HOWTO display Label text with different text styles

Moderator: Rathinagiri

Post Reply
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

HOWTO display Label text with different text styles

Post by Ricci » Sun Nov 27, 2011 7:14 am

You like to diplay one LABEL with different text styles (normal, bold, italic, diff. colors, etc.) ?
This is very simle in HMG4.

LABEL is based on QLabel() and this widget understand XHTML. The only thing you need to know are CSS commands.

Code: Select all

DEFINE LABEL oLabel
		 ROW 10; COL  10
		 WIDTH 100; HEIGHT 20
		 VALUE "Normal <em>italic</em> <span style='color:red;'>Red</span> Normal"
END LABEL
Will display: Normal italic Red Normal


Ricci

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Sun Nov 27, 2011 1:57 pm

Very very interesting ! Thanks for your info.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Rossine
Posts: 87
Joined: Thu Jun 30, 2011 10:04 pm

Post by Rossine » Sun Nov 27, 2011 11:53 pm

Ricci wrote:You like to diplay one LABEL with different text styles (normal, bold, italic, diff. colors, etc.) ?
This is very simle in HMG4.

LABEL is based on QLabel() and this widget understand XHTML. The only thing you need to know are CSS commands.

Code: Select all

DEFINE LABEL oLabel
		 ROW 10; COL  10
		 WIDTH 100; HEIGHT 20
		 VALUE "Normal <em>italic</em> <span style='color:red;'>Red</span> Normal"
END LABEL
Will display: Normal italic Red Normal


Ricci
Hi Ricci,

I'm really amazed with the possibilities HMG.4 + QT is giving us.

Thanks to all who are making this possible :shock:

Rossine

Post Reply