Rave: mudar propriedade do DataText para negrito

09/05/2008

5

olá, estou tentando usar o event editor do rave para mudar a propriedade style de um determinado DataText para negrito (bold)...

para mudar a cor da fonte eu uso o seguinte codigo no OnBeforePrint do componente:
self.color := clRed;



e para mudar para negrito????

valeu!


Responder

Posts

09/05/2008

Joaoshi

Colega, não é só colocar [b:5d94b5e9e0]Bold := true[/b:5d94b5e9e0] ?


Responder

09/05/2008

Mahdak

nao deu certo... ja tinha tentado...

error #22 unknown identifier [bold].


Responder

12/05/2008

Mahdak

sobe por que nao consegui resolver ainda :lol:


Responder

14/05/2008

Mahdak

resolvido... na ajuda do rave digite bold que ira aparecer o seguinte topico:

Dynamically Changing Fonts
--------------------------------
2) Another choice is to use the FontMaster component and a Rave event . to control which FontMaster is used. First, drop several FontMaster components on a Global Page. Set one FontMaster name to ´FontArial10NormalBlack´ with the font attributes set as ´Arial´ ´10 points´ ´Normal´ ´Black´. Then set the other FontMaster name to ´FontArial10BoldRed´ with the font attributes set as ´Arial´ ´10 points´ ´Bold´ ´Red´. The following is an example of an event that will change the FontMirror property of a DataText component to point to the FontMaster you want based upon the contents of a DataField. This could be used in an OnBeforePrint or OnGetText event of your Text or DataText component(s).

{ Event for DataTextFishName.OnGetText }

function DataTextFishName_OnGetText(Self: TRaveDataText; var Value: string);

begin

  if UpperCase(BioLifeDVCategory.AsString) = ´SHARK´ then

     Self.FontMirror := FontArial10BoldRed;

  else

     Self.FontMirror := FontArial10NormalBlack;

  end if;

end OnGetText;




Responder