SECControlBar Class
class SECControlBar: public CControlBar
SECControlBar replaces CControlBar as the base class for all your control bars.
Defined in: sbarcore.h
Comments
SECControlBar adds support for sizing while docked, automatic stretching when resized and a default context menu with facilities for adding and removing menu items. (NOTE: All control bars formally derived from CControlBar must be rederived from SECControlBar. No CControlBars are allowed when using Objective Toolkit’s docking window enhancements, as they lack the member variables required to perform the sizing calculations.)
See the sample VIZ in the \SAMPLES\TOOLKIT\STANDARD\DOCKING\VIZ directory for a demonstration of this class.
See Also
Class Members
Construction
Constructs an SECControlBar object.
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, UINT nID, DWORD dwStyle, DWORD dwExStyle, const RECT& rect, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL)
Creates a control bar and attaches it to an SECControlBar object.
virtual BOOL Create(CWnd* pParentWnd, LPCTSTR lpszWindowName, DWORD dwStyle, DWORD dwExStyle, UINT nID, CCreateContext* pContext = NULL)
Creates a control bar and attaches it to an SECControlBar object.
virtual void GetInsideRect(CRect& rectInside) const
Retrieves attributes associated with control bar’s inside rectangle.
BOOL IsMDIChild() const
Determines whether control bar has been re-parented by an MDI child window.
Attributes
static BOOL m_bOptimizedRedrawEnabled
TRUE if optimized redraw is in effect.
static BOOL GetOptimizeRedrawEnabled()
Cross-dll accessor to get m_bOptimizedRedrawEnabled state.
static void SetOptimizedRedrawEnabled(BOOL bOptimize)
Cross-dll accessor to set m_bOptimizedRedrawEnabled state.
BOOL GetBarSizePos(int& nRow,int& nCol)
Access function to get the position of a bar.
BOOL GetBarSizePos(int& nRow,int& nCol,int& nDockbarID)
Access function to get the position of a bar with the ID.
BOOL GetBarSizePos(int& nRow,int& nCol,int& nDockbarID,float& fPctWidth,int& nHeight)
Access function to get the position of a bar with the ID, height, and percentage width.
Public data members
CSize m_szDockHorz
Dimensions when docked horizontally.
CPoint m_ptDockHorz
Location when docked horizontally.
CSize m_szDockVert
Dimensions when docked vertically.
CSize m_szFloat
Dimensions when floating.
DWORD m_dwMRUDockingState
Remember docking state when “Allow Docking” unchecked.
float m_fPctWidth
The percentage of the dock bar’s width this control bar occupies.
float m_fDockedPctWidth
The percentage of the dock bar’s width this control bar occupies.
DWORD m_dwExStyle
Extended style bits.
Protected data members
CRect m_rcBorderSpace
White space around bar used for dragging.
SECControlBarManager* m_pManager
Control bar manager.
SECGripperInfo m_GripperInfo
Gripper information.
CRect m_rcGripperCloseButton
Gripper close button.
CRect m_rcGripperExpandButton
Expand button
Operations
void EnableDocking(DWORD dwDockStyle)
Enables control bar docking.
virtual SECDockContext * NewDockContext(void)
This member is called by EnableDocking() to instantiate a derivative of SECDockContext
virtual void SetExBarStyle(DWORD dwExStyle,BOOL bAutoUpdate=FALSE)
Set the extended bar style.
virtual void ModifyBarStyleEx(DWORD dwRemove,DWORD dwAdd,BOOL bAutoUpdate=FALSE)
Called to give control bars derived from SECControlBar a chance to modify
static UINT GetUniqueBarID(CFrameWnd* pMainWnd,UINT nBaseID=0x100)
Static utility function to derive a unique controlbar id
static BOOL VerifyUniqueBarIds(CFrameWnd* pFrameWnd)
Static utility function to verify all existing controlbars have unique ids.
static BOOL VerifyUniqueSpecificBarID(CFrameWnd* pFrameWnd,UINT nBarID)
Static utility function to verify a specific controlbar id is unique
Overridable
virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode)
Return the size of a dockable bar
virtual void OnBarBeginDock()
Virtual function that can be overridden to handle special requirements before a bar is docked.
virtual void OnBarEndDock()
Virtual function that can be overridden to handle special requirements after a bar is docked.
virtual void OnBarBeginFloat()
Virtual function that can be overridden to handle special requirements before a bar is floated.
virtual void OnBarEndFloat()
Virtual function that can be overridden to handle special requirements after a bar is floated.
virtual void OnBarBeginMDIFloat()
Virtual function that can be overridden to handle special requirements before a bar is floated as a MDI child window.
virtual void OnBarEndMDIFloat()
Virtual function that can be overridden to handle special requirements after a bar is floated as a MDI child window.
Implementation
virtual BOOL OnGripperClose()
Gripper button callback. Return FALSE to abort closing.
virtual BOOL OnGripperExpand()
Gripper button callbacks. Return FALSE to abort expansion.