Página 1 de 1

set color a piscar

Enviado: 13 Dez 2009 18:35
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

Re: set color a piscar

Enviado: 13 Dez 2009 19:30
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.

Re: set color a piscar

Enviado: 17 Dez 2009 22:13
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

Re: set color a piscar

Enviado: 17 Dez 2009 23:29
por alaminojunior
Não sei os colegas, mas eu nunca conseguí fazer como no Clipper, usar a cor piscante.

Re: set color a piscar

Enviado: 18 Dez 2009 23:14
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