CNewLabel : Advanced CStatic-Derived Class

This class (CNewLabel) is derived from CStatic and performs a lot of things that the CStatic class can not do.

provided by: 
Originally published at Internet.com


New Label Class Demo Dialog New Label Class Demo Dialog This class (CNewLabel) is derived from CStatic and performs a lot of things that the CStatic class can not do: * Text colour * Background colour * Text background colour * Fonts * Multi line support with text justification * Link text (with or without cursor) * Text highlighting when mouse moves over static control * Centred background image (stretched or not with or without text) * Text rotation (00 - 900 - 1800 - 2700) (separated CTextRotator class) * Bevel lines support * Text flashing * Background flashing * Control tool tips (separated CControlToolTip class)

CNewLabel API

// Colour functions //Set the background colour of the control. CNewLabel& SetBkColor(COLORREF clr) //Set the text colour of the control. CNewLabel& SetTextColor(COLORREF clr) //Set the background colour of the text background. CNewLabel& SetTextBackColor(COLORREF clr) //Set the highlighting colour. CNewLabel& SetHighLightColor(COLORREF clr) //Set the control to use the default background colour (COLOR_3DFACE). CNewLabel& SetDefaultBkColor() //Set the control to use the default text colour (COLOR_WINDOWTEXT). CNewLabel& SetDefaultTextColor() //Set the control to use the default text background colour (COLOR_3DFACE). CNewLabel& SetDefaultTextBackColor() // Font functions //Toggles the state of the bold attribute of the text in the control. CNewLabel& SetFontBold(BOOL bSet) //Toggles the state of the italic font attribute of the control. CNewLabel& SetFontItalic(BOOL bSet) //Toggles the state of the underline font attribute of the control. CNewLabel& SetFontUnderline(BOOL bSet) //Sets the fonts face name. CNewLabel& SetFontName(LPCTSTR lpszFaceName) //Sets the fonts size in points. CNewLabel& SetFontSize(int iSize) // Other functions //Toggles the state of the background flashing attribute. CNewLabel& FlashBackground(BOOL bActivate, UINT uiTime) //Toggles the state of the text flashing attribute. CNewLabel& FlashText(BOOL bActivate, UINT uiTime) //Set the text justification (see under for defines). CNewLabel& SetAlignment(UINT uiAlign) //Set the text rotation angle (0, 90 , 180 or 270). CNewLabel& SetAngle(UINT uiAngle) //Set (or remove) the background image. CNewLabel& SetBackImage(UINT nID) //Toggles the state of the borders attribute. CNewLabel& SetBorder(BOOL bSet) //Set the control cursor. CNewLabel& SetCursor(HCURSOR hCursor) //Set the control cursor. CNewLabel& SetCursor(UINT uiCursorID) //Toggles the state of the disabled attribute. CNewLabel& SetDisabled(BOOL bSet) //Toggles the state of the link attribute. CNewLabel& SetLink(BOOL bSet) //Sets the cursor for the link. CNewLabel& SetLinkCursor(HCURSOR hCursor) //Sets the cursor for the link. CNewLabel& SetLinkCursor(UINT uiCursorID) //Toggles the state of the lower case attribute. CNewLabel& SetLowerCase(BOOL bSet) //Set the text of the control. CNewLabel& SetText(LPCTSTR lpszText) //Set the tool tip position (0 = Over, 1 = Under, 2 = Above). CNewLabel& SetToolTipPosition(int iPos) //Set the tool tip text. CNewLabel& SetToolTipText(LPCTSTR lpszText) //Toggles the state of the sunken attribue of the control. CNewLabel& SetSunken(BOOL bSet) //Toggles the state of thhe upper case attribute. CNewLabel& SetUpperCase(BOOL bSet) //Toggles the state of the vertical text attribute. CNewLabel& SetVerticalText(BOOL bSet) //Toggles the state how the tool tip must appear. CNewLabel& ShowToolTipOnlyOnMouseClick(BOOL b) //Stretch or not the centred bitmap. CNewLabel& StretchBitmap(BOOL bStrecth) //Display or not the bevel line. CNewLabel& UseBevelLine(BOOL bUse) //Toggles the state of the highlighting mode. CNewLabel& UseHighLighting(BOOL bUse) //Use tool tip or not. CNewLabel& UseToolTip(BOOL bUse) //Use highlighting only with a filled tool tip. CNewLabel& UseHighLightingOnlyWithMouseToolTip(BOOL b) //Use left mouse button for tool tip. CNewLabel& UseLeftMouseButtonForToolTip(BOOL bUse) For GET functions, see source code! ...

Read article at Internet.com site
Regional Articles
- CNewLabel : Advanced CStatic-Derived Class Alabama
- CNewLabel : Advanced CStatic-Derived Class Alaska
- CNewLabel : Advanced CStatic-Derived Class Arizona
- CNewLabel : Advanced CStatic-Derived Class Arkansas
- CNewLabel : Advanced CStatic-Derived Class California
- CNewLabel : Advanced CStatic-Derived Class Colorado
- CNewLabel : Advanced CStatic-Derived Class Connecticut
- CNewLabel : Advanced CStatic-Derived Class DC
- CNewLabel : Advanced CStatic-Derived Class Delaware
- CNewLabel : Advanced CStatic-Derived Class Florida
- CNewLabel : Advanced CStatic-Derived Class Georgia
- CNewLabel : Advanced CStatic-Derived Class Hawaii
- CNewLabel : Advanced CStatic-Derived Class Idaho
- CNewLabel : Advanced CStatic-Derived Class Illinois
- CNewLabel : Advanced CStatic-Derived Class Indiana
- CNewLabel : Advanced CStatic-Derived Class Iowa
- CNewLabel : Advanced CStatic-Derived Class Kansas
- CNewLabel : Advanced CStatic-Derived Class Kentucky
- CNewLabel : Advanced CStatic-Derived Class Louisiana
- CNewLabel : Advanced CStatic-Derived Class Maine
- CNewLabel : Advanced CStatic-Derived Class Maryland
- CNewLabel : Advanced CStatic-Derived Class Massachusetts
- CNewLabel : Advanced CStatic-Derived Class Michigan
- CNewLabel : Advanced CStatic-Derived Class Minnesota
- CNewLabel : Advanced CStatic-Derived Class Mississippi
- CNewLabel : Advanced CStatic-Derived Class Missouri
- CNewLabel : Advanced CStatic-Derived Class Montana
- CNewLabel : Advanced CStatic-Derived Class Nebraska
- CNewLabel : Advanced CStatic-Derived Class Nevada
- CNewLabel : Advanced CStatic-Derived Class New Hampshire
- CNewLabel : Advanced CStatic-Derived Class New Jersey
- CNewLabel : Advanced CStatic-Derived Class New Mexico
- CNewLabel : Advanced CStatic-Derived Class New York
- CNewLabel : Advanced CStatic-Derived Class North Carolina
- CNewLabel : Advanced CStatic-Derived Class North Dakota
- CNewLabel : Advanced CStatic-Derived Class Ohio
- CNewLabel : Advanced CStatic-Derived Class Oklahoma
- CNewLabel : Advanced CStatic-Derived Class Oregon
- CNewLabel : Advanced CStatic-Derived Class Pennsylvania
- CNewLabel : Advanced CStatic-Derived Class Rhode Island
- CNewLabel : Advanced CStatic-Derived Class South Carolina
- CNewLabel : Advanced CStatic-Derived Class South Dakota
- CNewLabel : Advanced CStatic-Derived Class Tennessee
- CNewLabel : Advanced CStatic-Derived Class Texas
- CNewLabel : Advanced CStatic-Derived Class Utah
- CNewLabel : Advanced CStatic-Derived Class Vermont
- CNewLabel : Advanced CStatic-Derived Class Virginia
- CNewLabel : Advanced CStatic-Derived Class Washington
- CNewLabel : Advanced CStatic-Derived Class West Virginia
- CNewLabel : Advanced CStatic-Derived Class Wisconsin
- CNewLabel : Advanced CStatic-Derived Class Wyoming

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML