OWLNext 6.32
Public Member Functions | Static Public Member Functions | Protected Member Functions
owl::TMDIFrame Class Reference

#include <mdi.h>

Inheritance diagram for owl::TMDIFrame:
owl::TFrameWindow owl::TWindow owl::TEventHandler owl::TStreamableBase ocf::TOleMDIFrame owl::TDecoratedMDIFrame

List of all members.

Public Member Functions

 TMDIFrame (LPCTSTR title, TResId menuResId, TMDIClient &clientWnd=*new TMDIClient, TModule *module=0)
 TMDIFrame (const tstring &title, TResId menuResId, TMDIClient &client=*new TMDIClient, TModule *=0)
 TMDIFrame (THandle frameHandle, HWND clientHandle, TModule *module=0)
bool SetMenu (HMENU)
TMDIClientGetClientWindow ()
virtual HWND GetCommandTarget ()

Static Public Member Functions

static HMENU FindChildMenu (HMENU)

Protected Member Functions

virtual TResult DefWindowProc (uint msg, TParam1 p1, TParam2 p2)
virtual TPerformCreateReturnType PerformCreate (int deprecated_argument=0)

Detailed Description

Multiple Document Interface (MDI) frame windows, represented by TMDIFrame, are overlapped windows that serve as main windows of MDI-compliant applications. TMDIFrame objects automatically handle creating and initializing an MDI client window (represented by a TMDIClient object) required by Windows. TMDIFrame sets window style WS_CLIPCHILDREN by default so that minimal flicker occurs when the MDI frame erases its background and the backgrounds of its children. TMDIFrame is a streamable class. Because TMDIFrame is derived from TFrameWindow, it inherits keyboard navigation. As a result, all children of the MDI frame acquire keyboard navigation. However, it's best to enable keyboard navigation only for those children who require it.

To create an OLE-enabled MDI frame window, use TOleMDIFrame, which inherits functionality from both TMDIFrame and TOleFrame.


Constructor & Destructor Documentation

owl::TMDIFrame::TMDIFrame ( LPCTSTR  title,
TResId  menuResId,
TMDIClient clientWnd = *new TMDIClient,
TModule module = 0 
)

Constructs an MDI frame window object using the caption (title) and resource ID (menuResId). If no client window is specified (clientWnd), then an instance of TMDIClient is created automatically and used as the client window of the frame. The supplied library ID (module) is passed to the TFrameWindow constructor along with a null parent window pointer, caption, client window, and a flag indicating that the client window is not to be resized to fit. The TWindow constructor is also invoked; it passes the supplied caption and library ID, as well as a null parent window pointer. Then the child menu position is initialized to be the leftmost menu item, and the supplied menu resource ID is used in a call to TFrameWindow::AssignMenu.

References owl::TFrameWindow::Init(), and owl::TWindow::Init().

owl::TMDIFrame::TMDIFrame ( const tstring &  title,
TResId  menuResId,
TMDIClient client = *new TMDIClient,
TModule module = 0 
)

String-aware overload.

References owl::TFrameWindow::AssignMenu(), and owl::TFrameWindow::Init().

owl::TMDIFrame::TMDIFrame ( THandle  handle,
HWND  clientHandle,
TModule module = 0 
)

Constructs an MDI frame window using an already created non-ObjectWindows window. Invokes the TFrameWindow and TWindow constructors, passing in the window handle (hWindow) and library ID (module). Initializes the child menu position to the leftmost menu item and constructs a TMDIClient object that corresponds to the supplied clientHWnd.

References owl::TWindow::GetParent().


Member Function Documentation

TResult owl::TMDIFrame::DefWindowProc ( uint  message,
TParam1  param1,
TParam2  param2 
) [protected, virtual]

Overrides TWindow::DefWindowProc and provides default processing for any incoming message the MDI frame window does not process.

Reimplemented from owl::TWindow.

Reimplemented in owl::TDecoratedMDIFrame, and ocf::TOleMDIFrame.

References owl::TWindow::GetHandle().

HMENU owl::TMDIFrame::FindChildMenu ( HMENU  menu) [static]

Find & return the child menu of an MDI frame's (or anyone's) menu bar.

FindChildMenu searches, from right to left, the pop-up child menus contained in the newMenu menu resource for a child menu containing command items with one of the following identifiers: CM_CASCADECHILDREN, CM_TITLECHILDREN, or CM_ARRANGEICONS. The return value of FindChildMenu is the HMENU of the first child menu containing one of these identifiers. If one of these identifiers is not found, FindChildMenu returns 0. FindChildMenu is used to locate the menu to which the MDI child window list will be appended. This call to FindChildMenu is made from within the TMDIClient class.

TMDIClient * owl::TMDIFrame::GetClientWindow ( ) [virtual]

Returns a pointer to the MDI client window.

Reimplemented from owl::TFrameWindow.

TWindow::THandle owl::TMDIFrame::GetCommandTarget ( ) [virtual]

Locates and returns the child window that is the target of the command and the command enabling messages. If the current application does not have focus or if the focus is within a toolbar in the application, GetCommandTarget returns the most recently active child window. If an alternative form of command processing is desired, a user's main window class can override this function.

Reimplemented from owl::TFrameWindow.

References owl::TMDIClient::GetActiveMDIChild(), GetClientWindow(), and owl::TFrameWindow::GetCommandTarget().

TWindow::TPerformCreateReturnType owl::TMdiFrame::PerformCreate ( int  arg = 0) [protected, virtual]

Overrides TWindow's virtual PerformCreate function. Creates the interface element associated with the MDI frame window.

Reimplemented from owl::TWindow.

References owl::TWindow::GetClassName(), and owl::TWindow::GetModule().

bool owl::TMDIFrame::SetMenu ( HMENU  newMenu) [virtual]

Searches for the MDI child menu in the new menu bar and updates the child menu position with the specified menu index. Then sends the client window an WM_MDISETMENU message to set the new menu and invokes TWindow::DrawMenuBar to redraw the menu. Returns false if the MDI client indicates that there was no previous menu; otherwise returns true.

Reimplemented from owl::TFrameWindow.

References owl::TWindow::DrawMenuBar(), FindChildMenu(), owl::TWindow::GetApplication(), owl::TWindow::GetHandle(), owl::TWindow::IsFlagSet(), owl::TApplication::PreProcessMenu(), and owl::wfMainWindow.


The documentation for this class was generated from the following files: