set color a piscar

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

lapinhazzz
Usuário Nível 3
Usuário Nível 3
Mensagens: 130
Registrado em: 20 Abr 2009 10:52
Localização: LAGOA

set color a piscar

Mensagem por lapinhazzz »

Boa Noite Amigos do Forum

Alguém me poderia ajudar como se faz por exemplo setcolor(r+*/w,n/w)

Em que está tudo a piscar.

Cumprimentos a todos

lapinhazzz
Hasse
Usuário Nível 4
Usuário Nível 4
Mensagens: 820
Registrado em: 19 Out 2004 10:30
Localização: Jaraguá do Sul - SC

Re: set color a piscar

Mensagem por Hasse »

Veja a sintaxe correta...

SetColor(cStr) ou SetColor("r+*/w,n/w")

No teu exemplo estão faltando as aspas, visto que a função necessita de parâmetros em formato string.

Do xHarbour Documentation:
SetColor( [<cNewColorString>] ) --> cOldColorString
Arguments: <cNewColorString>
The parameter is a character string holding color settings. The first five colors are used for different pre-defined scopes. A color setting consists of a color pair that defines the foreground and background color in text mode applications. Single colors are specified with a letter (see description), foreground and background colors must be separated with a slash, and color pairs for different scopes must be comma separated.
Hasse
CP200 / CP500 / Basic / dBase III / dBase IV / Clipper Summer / RTlink / Exospace.
Clipper 5.3b / Blinker 7.0 / CDX com TAG
xHarbour 1.2.1-6604 / Borland C++ (5.5.1) 32 bit / HBmake.
Harbour 3.2.0dev (r1412121623) / MINGW / HBM2 / MiniGui HMG 3.1.4 / IDE (Roberto Lopez).
"Conheça todas as teorias, domine todas as técnicas, mas, quando tocares uma alma humana, seja apenas outra alma humana." (C.G.Jung)
lapinhazzz
Usuário Nível 3
Usuário Nível 3
Mensagens: 130
Registrado em: 20 Abr 2009 10:52
Localização: LAGOA

Re: set color a piscar

Mensagem por lapinhazzz »

Boa Noite,

Já experimentei e não resultou.
Eu Faço setcolor("r+*/gr+*,w/n")
Depois não funciona não pisca o vermelho sobre o fundo amarelo
O que se passa amigo Hasse

Obrigado

lapinhazzz
Avatar do usuário
alaminojunior
Colaborador
Colaborador
Mensagens: 1717
Registrado em: 16 Dez 2005 21:26
Localização: Ubatuba - SP

Re: set color a piscar

Mensagem por alaminojunior »

Não sei os colegas, mas eu nunca conseguí fazer como no Clipper, usar a cor piscante.
Compilador xHarbour 1.2.3 + Embarcadero C++ 7.30
MySQL c/ SQLRDD
HwGui + GTWVG
Hasse
Usuário Nível 4
Usuário Nível 4
Mensagens: 820
Registrado em: 19 Out 2004 10:30
Localização: Jaraguá do Sul - SC

Re: set color a piscar

Mensagem por Hasse »

Boa noite colegas.

Eu nunca usei no xHarbour com texto colorido piscante, mas pesquisando no Documentation encontrei a função do SetBlink(), que interpreta o asterisco da função SetColor(). Veja abaixo:
SetBlink()
Determines how to treat the asterisk in a SetColor() string.
Syntax
SetBlink( [<lOnOff>] ) --> lOldSetting

Arguments
<lOnOff>
This is a logical value. If .T. (true) is passed, the asterisk (*) in the background color of a SetColor() string causes the foreground color (text) to blink. If .F. (false) is passed, the background color is set to high intensity. Return
The function returns the setting which is active before SetBlink() is called.
Description
SetBlink() is a compatibility function which toggles interpretation of the blink attribute (*) if it is specified for the backgroud color of a SetColor() string. The blink attribute is only relevant when an application runs in full screen text mode. In addition, its availability is operating system dependent.
If the blink attribute is not supported by the operating system, the asterisk (*) is treated like the high intensity color attribute (+).
Info
See also: ColorSelect(), SetColor()
Category: Screen functions
Source: rtl\setcolor.c
LIB: xhb.lib
DLL: xhbdll.dll

Example
// The example displays text with the SetBlink() setting on and off.
Observe que, aparentemente, o seu uso nem sempre é possível ou recomendado, algo a ver com o SO e tela cheia (não janela).

Código: Selecionar todos

   PROCEDURE Main
      CLS
      SetColor( "N/GR*" )

      @ 0, 0 CLEAR TO 2, MaxCol()
      ? "Blink attribute is:", SetBlink()

      WAIT "Press a key to toggle blink attribute"

      SetBlink( .NOT. SetBlink() )

      @ 0, 0 CLEAR TO 2, MaxCol()
      ? "Blink attribute is:", SetBlink()

      WAIT "Press a key to end"
   RETURN
Hasse
CP200 / CP500 / Basic / dBase III / dBase IV / Clipper Summer / RTlink / Exospace.
Clipper 5.3b / Blinker 7.0 / CDX com TAG
xHarbour 1.2.1-6604 / Borland C++ (5.5.1) 32 bit / HBmake.
Harbour 3.2.0dev (r1412121623) / MINGW / HBM2 / MiniGui HMG 3.1.4 / IDE (Roberto Lopez).
"Conheça todas as teorias, domine todas as técnicas, mas, quando tocares uma alma humana, seja apenas outra alma humana." (C.G.Jung)
Responder