SECShortcutBarComp Class
class SECShortcutBarComp: public IQueryGuid
The SECShortcutBarComp class is the framework independent implementation for the Shorcutbar component. This class ties up the underlying MVC arhitecture and provides a convenient API for using the control. SECShortcutBarComp is an internal implementation detail and is documented primarily for the common API that it exposes through the framework specific controls. You should never directly use the SECShortcutBarComp class. Instead, your application, depending on the framework, should use one of the MFC/ATL specialized control classes.
Defined in: ShortcutBar.h
Comments
SECShortcutBarComp supports the following styles:
SEC_TABBAR_VERT - Displays the shortcutbar in the vertical mode. This is the default orientation.
SEC_TABBAR_BARCURSOR - Uses a hand cursor for the bar objects. The default is to use the arrow cursor.
SEC_TABBAR_NOANIMATE - Disables animated switching of bars.
SEC_TABBAR_NOHILIGHT - Disables highlighting of bars.
SEC_TABBAR_CNTXTMENU - Sends the WM_TABBAR_CNTXTMENU message to the shortcutbar's owner window.
See Also
CATLShortcutBarWnd
CATLShortcutBarHosted
CMFCShortcutBarWnd
CMFCShortcutBarHosted
Class Members
Public Members
void SetHostImpl(IVisualWindow* pHost)
Sets the host implementation for the shortcutbar. A host can be any class that has a valid HWND tied to it and implements the IVisualWindow interface.
IVisualWindow* GetHostImpl()
Returns a pointer to the host implementation.
int AddBarVisual(TVisual* pClient, LPCTSTR lpszLabel, BOOL bUpdate = FALSE)
Adds the visual client, pClient, to the shortcutbar and sets the bar label to be lpszLabel.
int AddBarWnd(HWND& hWndClient, LPCTSTR lpszLabel, BOOL bUpdate = FALSE)
Adds the client window to the shortcutbar.
int InsertBarVisual(int nIndex, TVisual* pClient, LPCTSTR lpszLabel)
Inserts the visual client at the specified location.
int InsertBarWnd(int nIndex, HWND& hWndClient, LPCTSTR lpszLabel)
Inserts the client window at the specified location.
void RemoveBar(int nIndex)
Removes the bar corresponding to the index.
void ActivateBar(int nIndex, BOOL bUpdate = FALSE)
Activates the bar at the particular index. Setting bUpdate to TRUE will force the control to update itself.
int GetActiveIndex()
Returns the zero-based index of the active bar.
void SetNotifyWnd(HWND hWnd)
Sets the notification target for the control.
HWND GetNotifyWnd()
Returns a handle to the notification target
int GetBarCount()
Gets the number of bars contained in the shorcutbar.
DWORD SetBarStyle(DWORD dwStyle)
Sets the shortcutbar style.
DWORD GetBarStyle()
Returns a DWORD containing the shortcutbar styles.
void SetBarIcon(int nIndex, HICON hIcon)
Sets an icon for the bar at the particular index.
void SetBarIcon(int nIndex, UINT nIDIcon)
Sets an icon for the bar at the particular index.
HICON GetBarIcon(int nIndex)
Returns a handle to the icon associated with the particular bar.
void SetBarLabel(int nIndex, LPCTSTR lpszLabel)
Sets the display text for the bar at this index.
LPCTSTR GetBarLabel(int nIndex)
Returns a pointer to a string containing the bar's label.
HCURSOR SetBarCursor(HCURSOR hBarCursor)
Sets a new cursor for the shortcutbar. The function returns a handle to the previous cursor.
HCURSOR GetBarCursor()
Returns a handle to the current cursor.
void SetBarFont(HFONT hFont, int nBarIndex = -1)
Sets the font for the bar at nBarIndex. If the index is -1, then the font will be used for all bars.
HFONT GetBarFont(int nBarIndex)
Returns the font used for the bar lying at this index.
void SetBarBrush(HBRUSH hBrush, int nBarIndex = -1)
Sets the brush used for painting the particular bar. If nBarIndex is -1,the brush is used for all bars.
HBRUSH GetBarBrush(int nBarIndex)
Returns the brush used by this bar.
void SetBarBkColor(COLORREF clrBk, int nBarIndex = -1)
Sets the background color for the bar at the specified index. If nBarIndex is -1, the back color is set for all the bars.
COLORREF GetBarBkColor(int nBarIndex)
Gets the background color of the specified bar.
void SetBarTextColor(COLORREF clrText, int nBarIndex = -1)
Sets the text color for the bar at nBarIndex. If the index value is -1, then the text color will be assigned for all bars.
COLORREF GetBarTextColor(int nBarIndex)
Gets the text color used for this bar.
void SetLabelAlignment(UINT nAlign)
Sets the label alignment for the Shortcutbar.
UINT GetLabelAlignment()
Returns the label alignment.
void EditLabel(int nIndex)
Invokes an in-place edit of the specified bar's label.
void DisableBar(int nIndex, BOOL bDisable = TRUE)
If bDisable is TRUE, then the specified bar is disabled. If not, it is enabled.
BOOL IsBarEnabled(int nIndex)
Returns the enabled state for the particular bar.