|
OWLNext 6.32
|
#include <decframe.h>
Public Types | |
| enum | TLocation { None = alNone, Top = alTop, Bottom = alBottom, Left = alLeft, Right = alRight } |
Public Member Functions | |
| TDecoratedFrame (TWindow *parent, LPCTSTR title, TWindow *clientWnd, bool trackMenuSelection=false, TModule *module=0) | |
| TDecoratedFrame (TWindow *parent, const tstring &title, TWindow *client, bool trackMenuSelection=false, TModule *=0) | |
| virtual void | Insert (TWindow &decoration, TLocation location=Top) |
| virtual tstring | GetHintText (uint id, THintText hintType) const |
| bool | PreProcessMsg (MSG &msg) |
| TWindow * | SetClientWindow (TWindow *clientWnd) |
| virtual TGadgetWindow * | GetControlBar () |
| void | SetBarCreator (const TGadgetWndFunctor &funct) |
| void | SetBarInserter (const TBarInsertFunctor &funct) |
| TGadgetWndFunctor * | GetBarCreator () |
| TBarInsertFunctor * | GetBarInserter () |
Protected Member Functions | |
| void | Init (TWindow *parent, LPCTSTR title, TWindow *client, bool trackMenuSelection, TModule *) |
| virtual bool | MergeBar (const TBarDescr &childBarDescr) |
| virtual bool | RestoreBar () |
| virtual bool | CreateBar () |
| bool | GetTrackMenuSelection () const |
| void | SetTrackMenuSelection (bool tr=true) |
| uint | GetMenuItemId () const |
| void | SetMenuItemId (uint menuitemid) |
| void | SetupWindow () |
| void | CleanupWindow () |
| void | RemoveChild (TWindow *child) |
| TResult | EvCommand (uint id, HWND hWndCtl, uint notifyCode) |
| void | EvCommandEnable (TCommandEnabler &ce) |
| void | EvMenuSelect (uint menuItemId, uint flags, HMENU hMenu) |
| void | EvEnterIdle (uint source, HWND hWndDlg) |
| void | EvSize (uint sizeType, TSize &size) |
TDecoratedFrame automatically positions its client window (you must supply a client window) so that it is the same size as the client rectangle. You can add additional decorations like toolbars and status lines to a window.You can create a TDecoratedFrame without a caption bar by clearing all of the bits in the style data member of the TWindowAttr structure. TDecoratedFrame is a streamable class. It is virtually derived from TFrameWindow and from TLayoutWindow.
For OLE-enabled applications, use TOleFrame, which creates a decorated frame and manages decorations such as toolbars for the main window of an SDI (Single Document Interface) OLE application.
Enumeration describing the possible locations of a Gadgetwindow [Used mainly for location of Toolbar and Statusbar standalone and in the context of docking windows]
| owl::TDecoratedFrame::TDecoratedFrame | ( | TWindow * | parent, |
| LPCTSTR | title, | ||
| TWindow * | clientWnd, | ||
| bool | trackMenuSelection = false, |
||
| TModule * | module = 0 |
||
| ) |
Constructs a TDecoratedFrame object with the specified parent window (parent), window caption (title), and module ID. Sets TWindow::Attr.Title to the new title. Passes a pointer to the client window if one is specified. By default set to false, trackMenuSelection controls whether hint text appears at the bottom of the window when a menu item is highlighted.
References Init().
| owl::TDecoratedFrame::TDecoratedFrame | ( | TWindow * | parent, |
| const tstring & | title, | ||
| TWindow * | client, | ||
| bool | trackMenuSelection = false, |
||
| TModule * | module = 0 |
||
| ) |
String-aware overload.
References Init().
| void owl::TDecoratedFrame::CleanupWindow | ( | ) | [protected, virtual] |
Cleans up any associated icons.
Reimplemented from owl::TFrameWindow.
Reimplemented in ocf::TOleFrame.
References owl::TFrameWindow::GetBarDescr(), and GetControlBar().
| bool owl::TDecoratedFrame::CreateBar | ( | ) | [protected, virtual] |
SetupWindow() call this function to create control bar, if it is MainWindow and if BarDescriptor exist.
References owl::alTop, owl::TWindow::Create(), owl::TFrameWindow::GetBarDescr(), GetControlBar(), owl::TWindow::GetWindowAttr(), and owl::TWindowAttr::Id.
| TResult owl::TDecoratedFrame::EvCommand | ( | uint | id, |
| HWND | hWndCtl, | ||
| uint | notifyCode | ||
| ) | [protected, virtual] |
Automates hiding and showing of decorations.
Reimplemented from owl::TFrameWindow.
References Bottom, owl::TWindow::ChildWithId(), owl::TWindow::FirstThat(), owl::TWindow::IsFlagSet(), owl::TWindow::IsWindowVisible(), owl::TLayoutWindow::Layout(), Left, None, owl::TLayoutWindow::RemoveChildLayoutMetrics(), Right, owl::TWindow::ShowWindow(), Top, and owl::wfInsertAtEdge.
| void owl::TDecoratedFrame::EvCommandEnable | ( | TCommandEnabler & | commandEnabler | ) | [protected, virtual] |
Handles checking and unchecking of menu items that are associated with decorations.
Reimplemented from owl::TFrameWindow.
References owl::TCommandEnabler::Checked, owl::TWindow::ChildWithId(), owl::TCommandEnabler::Enable(), GetHintText(), owl::TCommandEnabler::GetId(), owl::htTooltip, owl::TCommandEnabler::SetCheck(), owl::TCommandEnabler::SetText(), and owl::TCommandEnabler::Unchecked.
| void owl::TDecoratedFrame::EvEnterIdle | ( | uint | source, |
| HWND | hDlg | ||
| ) | [protected] |
Responds to a window message that tells an application's main window that a dialog box or a menu is entering an idle state. EvEnterIdle also handles updating the status bar with the appropriate help message. Handle WM_ENTERIDLE in order to display help hints on the messsage bar if there is a hint pending & this frame has a message bar.
Reimplemented from owl::TWindow.
References owl::TWindow::ChildWithId(), GetHintText(), owl::htStatus, and owl::TMessageBar::SetHintText().
| void owl::TDecoratedFrame::EvMenuSelect | ( | uint | menuItemId, |
| uint | flags, | ||
| HMENU | hMenu | ||
| ) | [protected] |
Responds to user menu selection. If MenuItemId is blank, displays an empty help message; otherwise, it displays a help message with the specified string ID. See EvEnterIdle for a description of how the help message is loaded. Handle WM_MENUSELECT to provide hint text in the status bar based on the menu item id. Treat popup items seperatly and ask them for their ids.
Reimplemented from owl::TWindow.
References owl::TWindow::ChildWithId(), owl::TMessageBar::ClearHintText(), and owl::TMenu::GetMenuItemID().
| void owl::TDecoratedFrame::EvSize | ( | uint | sizeType, |
| TSize & | size | ||
| ) | [protected] |
Forward our size event to the layout window base, and not the frame base.
Reimplemented from owl::TFrameWindow.
Reimplemented in ocf::TOleFrame.
References owl::TFrameWindow::BroadcastResizeToChildren().
| TGadgetWindow * owl::TDecoratedFrame::GetControlBar | ( | ) | [virtual] |
Search for child with ID = IDW_TOOLBAR, and if found check that it is GadgetWindow and return it;
References owl::TWindow::ChildWithId(), and owl::TWindow::FirstThat().
| tstring owl::TDecoratedFrame::GetHintText | ( | uint | id, |
| THintText | hintType | ||
| ) | const [virtual] |
Retrieves the text specified by the resource id. If hintType equals htToolTip, GetHintText first searches for id in the menu strings. If the id cannot be found in the menu strings, GetHintText looks for the id in the resource strings. If hintType equal htStatus, GetHintText looks for the id in the module's resource strings.
References owl::TWindow::GetMenu(), owl::TWindow::GetModule(), owl::htStatus, owl::htTooltip, and owl::TModule::LoadString().
| uint owl::TDecoratedFrame::GetMenuItemId | ( | ) | const [inline, protected] |
Return cached id of the current menu item.
| bool owl::TDecoratedFrame::GetTrackMenuSelection | ( | ) | const [inline, protected] |
Returns true if the decorated frame is tracking the menu selections. Sends a message to the status bar to display the hint text.
| void owl::TDecoratedFrame::Init | ( | TWindow * | parent, |
| LPCTSTR | title, | ||
| TWindow * | client, | ||
| bool | trackMenuSelection, | ||
| TModule * | module | ||
| ) | [protected] |
Initialization shared by the constructors.
References owl::TLayoutMetrics::Height, owl::lmBottom, owl::lmLeft, lmParent, owl::lmRight, owl::lmTop, owl::TEdgeOrHeightConstraint::SameAs(), owl::TEdgeOrWidthConstraint::SameAs(), owl::TEdgeConstraint::SameAs(), owl::TEdgeConstraint::Set(), owl::TLayoutWindow::SetChildLayoutMetrics(), owl::TWindow::TWindow(), owl::TLayoutMetrics::Width, owl::TLayoutMetrics::X, and owl::TLayoutMetrics::Y.
Insert a decoration window into position at one of the four edges.
After you specify where the decoration should be placed, Insert adds it just above, below, left, or right of the client window. This process is especially important when there are multiple decorations. Insert looks at the decoration's Attr.Style member and checks the WS_VISIBLE flag to tell whether the decoration should initially be visible or hidden. To position the decoration, Insert uses TLocation enum, which describes Top, Left, Bottom, and Right positions where the decoration can be placed.
References Bottom, owl::TWindow::GetWindowAttr(), Left, owl::TWindow::ModifyStyle(), None, owl::TLayoutWindow::RemoveChildLayoutMetrics(), Right, owl::TWindow::SetParent(), owl::TWindowAttr::Style, and Top.
| bool owl::TDecoratedFrame::MergeBar | ( | const TBarDescr & | childBarDescr | ) | [protected, virtual] |
Merges the given bar descriptor with this frame's own bar descriptor and displays the resulting control bar in this frame. See TBarDescr for a description of control bar types that can be merged.
Reimplemented from owl::TFrameWindow.
References owl::TFrameWindow::GetBarDescr(), GetControlBar(), and owl::TWindow::GetHandle().
| bool owl::TDecoratedFrame::PreProcessMsg | ( | MSG & | msg | ) | [virtual] |
Override TFrameWindow member function to give decorations an opportunity to do pre-processing (e.g. mnemonic access)
Give the decorations an opportunity to do pre-processing. Don't bother checking the client window since it is typically in the focus chain and will be given an opportunity to do pre-processing
Reimplemented from owl::TFrameWindow.
References owl::TWindow::GetFirstChild(), owl::TWindow::GetHandle(), owl::TWindow::GetWindowLong(), owl::TWindow::Next(), and owl::TWindow::PreProcessMsg().
| void owl::TDecoratedFrame::RemoveChild | ( | TWindow * | child | ) | [protected, virtual] |
Makes sure that both bases get a chance to see the child removed. TWindow's will be called twice, but the second call will be ignored. If the client is being removed and the client is not currently being set, then this function calls SetClientWindow to put in a placeholder.
Reimplemented from owl::TFrameWindow.
References SetClientWindow().
| bool owl::TDecoratedFrame::RestoreBar | ( | ) | [protected, virtual] |
Restores the default control bar of the frame window.
Reimplemented from owl::TFrameWindow.
References owl::TFrameWindow::GetBarDescr(), GetControlBar(), and owl::TWindow::GetHandle().
Overrides TFrameWindows virtual function. Sets the client window to the specified window. Users are responsible for destroying the old client window if they want to remove it. Handle SetClientWindow() here to manage fixing up the layout metrics of all the children before & after the client is changed.
Reimplemented from owl::TFrameWindow.
References owl::TWindow::Destroy(), owl::TWindow::GetCaption(), owl::TLayoutWindow::GetChildLayoutMetrics(), owl::TFrameWindow::GetClientWindow(), owl::TWindow::GetFirstChild(), owl::TLayoutMetrics::Height, owl::TLayoutWindow::Layout(), owl::TWindow::Next(), owl::TLayoutConstraint::RelWin, owl::TLayoutWindow::SetChildLayoutMetrics(), owl::TWindow::SetParent(), owl::TWindow::TWindow(), owl::TLayoutMetrics::Width, owl::TLayoutMetrics::X, and owl::TLayoutMetrics::Y.
| void owl::TDecoratedFrame::SetMenuItemId | ( | uint | menuitemid | ) | [inline, protected] |
Set the cached id of the current menu item.
| void owl::TDecoratedFrame::SetTrackMenuSelection | ( | bool | tr = true | ) | [inline, protected] |
Set the flag for tracking menu selection.
| void owl::TDecoratedFrame::SetupWindow | ( | ) | [protected, virtual] |
Override SetupWindow in order to layout & position decorations Calls TLayoutWindow::Layout to size and position the decoration.
Reimplemented from owl::TFrameWindow.
Reimplemented in owl::TPreviewWin, and ocf::TOleFrame.
References CreateBar(), owl::TFrameWindow::GetBarDescr(), owl::TWindow::GetClientRect(), owl::TWindow::IsFlagSet(), owl::TLayoutWindow::Layout(), and owl::wfMainWindow.
1.7.4