CButtonST |
09/09/99 |
Author:
davide_calabro@yahoo.com
ICQ: HOMEPAGE: http://members.tripod.com/~SoftechSoftware/cbtnst.html
Copyright (C) 1998-99 by SoftechSoftware OverView |
Overview |
#include <BtnST.h> Hierarchy Chart
How to integrate CButtonST in your application
With dialog editor create a standard button called, for
example, IDOK CButtonST m_btnOk;
// Call the base method
You may use two icons for the same button. First icon
will be displayed when
// Assign two icons
Please note that two icons must have the same size!
// Align icon vertically
// Draw the button as a standard
button
The following applies only with "flat" buttons:
by default when the mouse
// Don't draw border for this
button
// Set some color effect
Each button can have its own mouse pointer.
// Set a hand cursor
// Assign a tooltip to the button
// Make a transparent button
Your button is now a CButtonST! |
Class Members | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties Public:
Protected:
Private:
|
CButtonST::SetIcon | ||||||
void SetIcon(int nIconInId, int nIconOutId = NULL); Return Value:
Arguments:
Remarks: Set icon(s) for the button Example:
m_btnOk.SetIcon(IDI_OK256); |
CButtonST::SetAlign | ||||
void SetAlign(int nAlign) Return Value:
Arguments:
Remarks: Set icon position (if one is defined) Example: m_btnOk.SetAlign(CButtonST::ST_ALIGN_VERT); |
CButtonST::GetAlign | ||||
int GetAlign(); Return Value:
Arguments:
Remarks: Get current icon position Example: int nRetValue = m_btnOk.GetAlign(); |
CButtonST::SetFlat | ||||
void SetFlat(BOOL bState = TRUE) Return Value:
Arguments:
Remarks: Set button style ("flat" or standard) Example:
m_btnOk.SetFlat(); |
CButtonST::GetFlat | ||||
BOOL GetFlat() Return Value:
Arguments:
Remarks: Return current button style Example: int nRetValue = m_btnOk.GetFlat(); |
CButtonST::DrawBorder | ||||
void DrawBorder(BOOL bEnable = TRUE) Return Value:
Arguments:
Remarks: Set highlight ON/OFF (only for "flat" buttons) Example:
m_btnOk.DrawBorder(); |
CButtonST::SetShowText | ||||
void SetShowText(BOOL bShow = TRUE)
Return Value:
Arguments:
Remarks: Add or remove text (caption) from button at runtime Example:
m_btnOk.SetShowText(); |
CButtonST::GetShowText | ||||
BOOL GetShowText(); Return Value:
Arguments:
Remarks: Return current text status (displayed or not) Example: int nRetValue = m_btnOk.GetShowText(); |
CButtonST::SetDefaultActiveFgColor | ||||
void SetDefaultActiveFgColor() Return Value:
Arguments:
Remarks:
Sets to the system default the text's color (when the mouse is over the button) Example: m_btnOk.SetDefaultActiveFgColor(); |
CButtonST::SetDefaultActiveBgColor | ||||
void SetDefaultActiveBgColor() Return Value:
Arguments:
Remarks:
Sets to the system default the button's color (when the mouse is over it) Example: m_btnOk.SetDefaultActiveBgColor(); |
CButtonST::SetDefaultInactiveFgColor | ||||
void SetDefaultInactiveFgColor() Return Value:
Arguments:
Remarks:
Sets to the system default the text's color (when the mouse is outside the button) Example: m_btnOk.SetDefaultInactiveFgColor(); |
CButtonST::SetDefaultInactiveBgColor | ||||
void SetDefaultInactiveBgColor(); Return Value:
Arguments:
Remarks:
Sets to the system default the button's color (when the mouse is outside it) Example: m_btnOk.SetDefaultInactiveBgColor(); |
CButtonST::SetActiveFgColor | ||||||
void SetActiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE) Return Value:
Arguments:
Remarks: Sets the text's color (when the mouse is over the button) Example: m_btnOk.SetActiveFgColor(RGB(255, 255, 0)); |
CButtonST::SetActiveBgColor | ||||||
void SetActiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE); Return Value:
Arguments:
Remarks: Sets the button's color (when the mouse is over it) Example:
m_btnOk.SetActiveBgColor(RGB(128, 128, 128)); |
CButtonST::SetInactiveFgColor | ||||||
void SetInactiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE); Return Value:
Arguments:
Remarks: Sets the text's color (when the mouse is outside the button) Example: m_btnOk.SetInactiveFgColor(RGB(255, 255, 255)); |
CButtonST::SetInactiveBgColor | ||||||
void SetInactiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE) Return Value:
Arguments:
Remarks: Sets the button's color Example: m_btnOk.SetInactiveBgColor(RGB(128, 128, 128)); |
CButtonST::GetActiveFgColor | ||||
const COLORREF GetActiveFgColor() Return Value:
Arguments:
Remarks: Returns the current text's color (when the mouse is over the button) Example: COLORREF crCurrent = m_btnOk.GetActiveFgColor(); |
CButtonST::GetActiveBgColor | ||||
const COLORREF GetActiveBgColor() Return Value:
Arguments:
Remarks: Returns the current button's color (when the mouse is over it) Example: COLORREF crCurrent = m_btnOk.GetActiveBgColor(); |
CButtonST::GetInactiveFgColor | ||||
const COLORREF GetInactiveFgColor(); Return Value:
Arguments:
Remarks: Returns the current text's color (when the mouse is outside the button) Example: COLORREF crCurrent = m_btnOk.GetInactiveFgColor(); |
CButtonST::GetInactiveBgColor | ||||
const COLORREF GetInactiveBgColor(); Return Value:
Arguments:
Remarks: Returns the current button's color (when the mouse is outside it) Example: COLORREF crCurrent = m_btnOk.GetInactiveBgColor(); |
CButtonST:SetFlatFocus | ||||||
void SetFlatFocus(BOOL bDrawFlatFocus, BOOL bRepaint = FALSE); Return Value:
Arguments:
Remarks:
Enable/Disable the drawing of the focus rectangle Example:
m_btnOk.SetFlatFocus(TRUE); |
CButtonST::GetFlatFocus | ||||
BOOL GetFlatFocus(); Return Value:
Arguments:
Remarks:
Returns the state of the focus rectangle Example: BOOL bDrawFlatFocus = m_btnOk.GetFlatFocus(); |
CButtonST::SetBtnCursor | ||||
BOOL SetBtnCursor(int nCursorId = -1); Return Value:
Arguments:
Remarks:
Assign a cursor to the button Example:
BOOL bRetValue = m_btnOk.SetBtnCursor(IDC_HAND); |
CButtonST::SetTooltipText | ||||||||
void SetTooltipText(int nId, BOOL bActivate = TRUE) Return Value:
Arguments:
Remarks:
Assign a tooltip text to the button
Example:
m_btnOk.SetTooltipText(IDS_TT_OK); |
CButtonST::ActivateTooltip | ||||
void ActivateTooltip(BOOL bEnable = TRUE) Return Value:
Arguments:
Remarks: Enable/Disable the button's tooltip Example: m_btnOk.ActivateTooltip(FALSE); |
CButtonST::DrawTransparent | ||||
void DrawTransparent() Return Value:
Arguments:
Remarks:
Draws the button transparently
Example: m_btnOk.DrawTransparent(); |
CButtonST::GetDefault | ||||
BOOL GetDefault(); Return Value:
Arguments:
Remarks:
Returns if the button is the default-button
Example: BOOL bDefault = m_btnOk.GetDefault(); |