Copyright © 2002-2009 MultiMedia Soft 
Return to index  
 
TEXT_DESC structure 
 
The TEXT_DESC structure contains all the information about the settings of a certain text over the button surface.  
Visual C++ definition 
typedef struct {  
       COLORREF  colorNormal
       COLORREF  colorMouseOver
       COLORREF  colorPressed
       short     xOffset
       short     yOffset
       short     iEffect
       short     nFactor
       short     nAngle
       COLORREF  colorSolidBack
       COLORREF  colorBorder
       short     nTransparentFactor
       BOOL      bAntialias
       BOOL      bSolidBack
       BOOL      bVisible
       BOOL      bBorder
       BOOL      bDoubleSpace
       BOOL      bSolidBackShadow
       COLORREF  colorHighlight
       COLORREF  colorShadow
       COLORREF  colorHalo
       COLORREF  colorSolidBackShadow
} TEXT_DESC;  
 
Visual Basic definition 
Public Type TEXT_DESC 
     colorNormal As OLE_COLOR 
     colorMouseOver As OLE_COLOR 
     colorPressed As OLE_COLOR 
     xOffset As Integer 
     yOffset As Integer 
     iEffect As Integer 
     nFactor As Integer 
     nAngle As Integer 
     colorSolidBack As OLE_COLOR 
     colorBorder As OLE_COLOR 
     nTransparentFactor As Integer 
     bAntialias As Integer 
     bSolidBack As Integer 
     bVisible As Integer 
     bBorder As Integer 
     bDoubleSpace As Integer 
     bSolidBackShadow As Integer 
     colorHighlight As OLE_COLOR 
     colorShadow As OLE_COLOR 
     colorHalo As OLE_COLOR 
     colorSolidBackShadow As OLE_COLOR 
End Type 
 
Member
Description
 
 
colorNormal
Text color expressed in RGB when the button is in normal (released) state.
colorMouseOver
Text color expressed in RGB when the mouse is over the button surface.
colorPressed
Text color expressed in RGB when the button is in pressed state.
xOffset
Offset from the default horizontal position (default is 0). The offsets range is between -99 and 99: if the offset value will exceed this range, 0 will be assumed.
yOffset
Offset from the default vertical position (default is 0).  The offsets range is between -99 and 99: if the offset value will exceed this range, 0 will be assumed.
iEffect
Effect applied over the text. Supported values are the following: 
Mnemonic constant
Value
Meaning
EFFECT_NONE
0
No effect applied to text 
EFFECT_RAISED
1
Text is displayed raised 
EFFECT_SUNKEN
2
Text is displayed sunken 
EFFECT_FLOATING
3
Text is displayed floating with an underlying shadow 
EFFECT_HALO
4
Text is displayed with an underlying halo 
EFFECT_RAISED_HALO
5
Text is displayed raised with an underlying halo 
EFFECT_SUNKEN_HALO
6
Text is displayed sunken with an underlying halo 
EFFECT_FLOATING_HALO
7
Text is displayed floating with an underlying halo 
 
nFactor
Factor of the effect over the text (valid only if iEffect is equal to EFFECT_FLOATING). The nFactor range is between 0 and 5: if the offset value will exceed this range, 1 will be assumed.
nAngle
Text rotation angle. 
This parameter value, whose default value is 0 degrees, can range from -180 to 180 degrees; entering an out of bounds value will cause the control to reset the value to the nearest in-bound value. 
Below you can see a sample of a button with a -30 degrees angle applied to the caption text. 
colorSolidBack
Color of the text solid background rectangle. The text solid background rectangle can be hidden/shown through the bSolidBack parameter. 
By default this color is set to Gray RGB (192, 192, 192).
colorBorder
Color of the text border line. The text border line can be hidden/shown through the bBorder parameter. 
By default this color is set to pure Black RGB (0, 0, 0).
nTransparentFactor
Applies alpha channel transparency to text. 
This parameter value can range from 0 (default) that means total opacity to 255 that means total transparency; entering an out of bounds value will cause the control to reset the value to the nearest in-bound value. 
Below you can see a sample of two identical buttons, the left one with the property set to 0 (total opacity) and the right one with the property set to 125. 
 
Further information about alpha channel transparency management can be found inside the How to manage alpha channel transparency section.
bAntiAlias
Boolean value that applies/removes antialiasing to text. Supported values are the following: 
Value
Meaning
FALSE (default)
Antialiasing is not applied.
TRUE
Antialiasing is applied.
Below you can see a sample of two identical buttons, but the one on the right doesn't have the Antialias flag set to TRUE: as you can see the text quality of the button on the left is really impressive. 
bSolidBack
Boolean value that applies/removes a solid background rectangle to text. Supported values are the following: 
Value
Meaning
FALSE (default)
The solid background is removed.
TRUE
The solid background is applied.
The color of the solid background rectangle can be set through the colorSolidBack parameter. 
Below you can see two samples of button with solid background applied: the left one has the bBorder property set to FALSE while the right one has the same property set to TRUE. 
bVisible
Boolean value that hides/shows the selected text. By default a text is always visible. Supported values are the following: 
Value
Meaning
FALSE
Text is hidden.
TRUE (default)
Text is visible.
bBorder
Boolean value that applies/removes a border line around the text. Supported values are the following: 
Value
Meaning
FALSE (default)
The border is removed.
TRUE
The border is applied.
The color of the border line can be set through the colorBorder property. 
Below you can see a button sample with a text bordered with a black line. 
bDoubleSpace
Boolean value that applies/removes double space to text. Supported values are the following: 
Value
Meaning
FALSE (default)
Text is spaced normally.
TRUE
Text is double spaced.
 
Below you can see a sample of two identical buttons, but the one on the right has the DoubleSpace flag set to TRUE. 
bSolidBackShadow
Boolean value that applies/removes a shadow to an eventual solid background rectangle applied to text. Supported values are the following: 
Value
Meaning
FALSE (default)
The shadow is removed.
TRUE
The shadow is applied.
The color of the shadow can be set through the colorSolidBackShadow parameter. 
This property value is ignored if the bSolidBack parameter is set to FALSE. 
Below you can see two samples of button with solid background applied: the left one doesn't have the shadow while the right one has the shadow applied. 
colorHighlight
Color of the highlighted text portion. 
This property is available only when the iEffect parameter has a value greater than EFFECT_NONE (0) 
If this color is left "undefined" the color will be calculated automatically: once the color has been defined, it can be reset back to the "undefined" state by setting its value to -1. 
Below you can see a zoomed button portion with the colorHighlight and colorShadow components shown under a raised text. 
colorShadow
Color of the shadowed text portion. 
This property is available only when the iEffect parameter has a value greater than EFFECT_NONE (0) 
If this color is left "undefined" the color will be calculated automatically: once the color has been defined, it can be reset back to the "undefined" state by setting its value to -1. 
Below you can see a zoomed button portion with the colorHighlight and colorShadow components shown under a raised text. 
colorHalo
Color of the Halo applied to the text when a Halo special effect has been set through the iEffect parameter. 
By default this color is set to pure White RGB (255, 255, 255). 
Below you can see a sample of button with the caption text surrounded by a pure Yellow RGB (255, 255, 0) Halo. 
colorSolidBackShadow
Color of the shadow applied under the text solid background rectangle. The shadow can be hidden/shown through the bSolidBackShadow parameter. 
By default this color is set to pure Black RGB (0, 0, 0).
 
 
 
 
 
 
 
Copyright © 2002-2009 MultiMedia Soft 
Return to index