SECMDIFrameWnd Class

class SECMDIFrameWnd: public CMDIFrameWnd

The SECMDIFrameWnd class is an interface equivalent for CMDIFrameWnd that adds support for a variety of new features. SECMDIFrameWnd supports enhanced docking window capabilities and a gradient caption (similar to the Microsoft Word caption). Future releases will add more features to this class.

Defined in: swinmdi.h

Comments

The enhanced docking window capabilities enable control bars to be resized while docked, converted to MDI child windows, diagonally resized while floating and more. These enhancments give your application docking window capabilities comparable to those seen in the Microsoft Developer Studio. The SECMDIFrameWnd class derives from CMDIFrameWnd and adds the implementation details and public operations required to support the above mentioned enhancements to MDI. Since SECMDIFrameWnd inherits the CMDIFrameWnd interface, all occurrences of CMDIFrameWnd in your application code can simply be replaced with SECMDIFrameWnd. Refer to the Objective Toolkit User’s Guide for more information about using the enhanced docking window and gradient caption features.

To create a useful SECMDIFrameWnd frame window for your application, derive a class (typically, your CMainFrame class) from SECMDIFrameWnd. Add member variables to the derived class to store data specific to your application. Implement message-handler member functions and a message map in the derived class to specify what happens when messages are directed to the window. Note, if you are converting an existing MDI application to Objective Toolkit’s SECMDIFrameWnd, simply change the base class of your main frame (i.e., CMainFrame), from CMDIFrameWnd to SECMDIFrameWnd.

You can construct an SECMDIFrameWnd by calling the Create or LoadFrame member function of CFrameWnd.

Before you call Create or LoadFrame, you must construct the frame window object on the heap using the C++ new operator. Before calling Create you can also register a window class with the AfxRegisterWndClass global function to set the icon and class styles for the frame.

Use the Create member function to pass the frame’s creation parameters as immediate arguments.

LoadFrame requires fewer arguments than Create, and instead retrieves most of its default values from resources, including the frame’s caption, icon, accelerator table, and menu. To be accessed by LoadFrame, all these resources must have the same resource ID (for example, IDR_MAINFRAME).

Though SECMDIFrameWnd is derived from CMDIFrameWnd, a frame window class derived from SECMDIFrameWnd need not be declared with DECLARE_DYNCREATE.

The SECMDIFrameWnd class inherits much of its default implementation from CMDIFrameWnd. For a detailed list of these features, refer to the CMDIFrameWnd class description. The SECMDIFrameWnd class has the following additional features:

·When docked inside an SECMDIFrameWnd window, a control bar can be resized via splitter bars positioned along the control bar’s edge.
·A control bar can be converted to an MDI child window and floated inside the MDI client area.
·The context menu associated with any control bar can be edited by the SECMDIFrameWnd object prior to the menu’s display.

Do not use the C++ delete operator to destroy a frame window. Use CWnd::DestroyWindow instead. The CFrameWnd implementation of PostNcDestroy will delete the C++ object when the window is destroyed. When the user closes the frame window, the default OnClose handler will call DestroyWindow.

For more information on SECMDIFrameWnd, see The Extended Control Bar Architecture section of the Objective Toolkit User’s Guide.

See the \SAMPLES\TOOLKIT\STANDARD\DOCKING\VIZ and \SAMPLES\TOOLKIT\STANDARD\UIEXT\GRADFRM samples, which demonstrate the capabilities of this class.

Class Members

void  EnableContextListMode(BOOL bEnable = TRUE)

Enables or disables the control bar context list mode.

virtual void  DockControlBarEx(CControlBar* pBar, UINT nDockBarID = 0,int nCol = 0, int nRow = 0, float fPctWidth = (float)1.0, int nHeight = 150)

Similar to DockControlBar but gives greater control over how and where the control bar will

void  ReDockControlBar(CControlBar* pBar, CDockBar* pDockBar, LPCRECT lpRect = NULL)

Converts the control bar back to a normal docking or floating control bar.

virtual void  FloatControlBarInMDIChild(CControlBar* pBar, CPoint point, DWORD dwStyle = CBRS_ALIGN_TOP)

Converts the control bar to an MDI child window.

BOOL  EnableCustomCaption(BOOL bEnable, BOOL bRedraw = TRUE)

Enables or disables gradient caption rendering.

void  ForceCaptionRedraw()

Forces a redraw of the caption bar.

virtual void  CreateCaptionAppFont(CFont& font)

Creates the caption text font for the application name

virtual void  CreateCaptionDocFont(CFont& font)

Creates the caption text font for the document name

virtual void  DrawCaptionText()

Draws the text on the caption bar

void  SetCaptionTextAlign(AlignCaption ac, BOOL bRedraw = TRUE)

Modifies the alignment of the caption text relative to the caption bar.

void  SwapMenu(UINT nID)

Switches the menu on the menubar when running with a cool look menubar.

BOOL  LoadAdditionalMenus(UINT nCount, UINT nIDMenu, ...)

Loads additional menus that are not created by the document templates.

void  EnableOleContainmentMode()

Sets CBRS_HIDE_INPLACE for all control bars. Call when used with Ole Containers.

afx_msg LRESULT  OnExtendContextMenu(WPARAM wParam, LPARAM lParam)

Traps WM_EXTENDCONTEXTMENU message sent by the SECControlBar class after it creates a context menu. Trap this message if you wish to customize the default context menu.

virtual SECWorkspaceManagerEx*  InitWorkspaceMgrEx(const CString& strAppKey, BOOL bRegistryMode=FALSE, CRuntimeClass* pWSClass= RUNTIME_CLASS(SECWorkspaceManagerEx), BOOL bSectionKey=FALSE)

Initialize the extended workspace manager.