// /// Intercepts the WM_MDICREATE message sent when MDI child windows are created, /// and, if the client's style includes MDIS_ALLCHILDSTYLES, and the child window's /// specified style is 0, then changes the child window style attributes to /// WS_VISIBLE, WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_SYSMENU, WS_CAPTION, /// WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX. // TResult TMDIClient::EvMDICreate(MDICREATESTRUCT & createStruct) { // Fill in default child window styles if they request style 0 since this // client by default has set allchildstyles // if ((Attr.Style&MDIS_ALLCHILDSTYLES) && !createStruct.style) createStruct.style = WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; // Work around a Windows MDI bug w/ bad menus if MDI child is created // maximized, by hiding child now & maximizing later // uint32 origStyle = createStruct.style; if (createStruct.style & WS_MAXIMIZE) createStruct.style &= ~(WS_MAXIMIZE | WS_VISIBLE); TResult result = DefaultProcessing(); // Finish up maximized MDI child workaround // if (THandle(result) && (origStyle & WS_MAXIMIZE)) { HandleMessage(WM_MDIMAXIMIZE, TParam1(result)); HandleMessage(WM_MDIREFRESHMENU); } return result; }
// /// Responds to an incoming BN_CLICKED message // /// Responds to notification message BN_CLICKED, indicating that the user clicked /// the check box. If Group isn't 0, BNClicked() calls the group box's /// SelectionChanged() member function to notify the group box that the state has /// changed. // void TCheckBox::BNClicked() { if (Group) Group->SelectionChanged(Attr.Id); DefaultProcessing(); // give parent an opportunity to handle... }
// /// Intercepts the WM_MDIDESTROY message. /// /// Destroy an MDI child window. Must temporarily unhide any hidden children, /// and then rehide them after the destruction. Otherwise Window's MDI client /// gets confused // void TMDIClient::EvMDIDestroy(THandle THandle) { ForEach(sUnHide, (void*)THandle); DefaultProcessing(); ForEach(sReHide); HandleMessage(WM_MDIREFRESHMENU); }
///////////////////////////////////////////////////////////////////// // TInfoControl // ------------ // BOOL TInfoControl::EvSetCursor (HWND hWndCursor, UINT hitTest, UINT /* mouseMsg */) { if (hWndCursor == HWindow && hitTest == HTCAPTION && HCursor) { ::SetCursor(HCursor); return TRUE; } return (BOOL)DefaultProcessing(); }
// /// Because a button can't have both owner-drawn and push button styles, BMSetStyle /// keeps track of the style if the button is owner-drawn and the system tries to /// set the style to BS_DEFPUSHBUTTON. BMSetStyle sets IsCurrentDefPB to true if the /// button style is BS_DEFPUSHBUTTON. // TResult TButton::BMSetStyle(TParam1 param1, TParam2) { if ((Attr.Style & BS_OWNERDRAW) != BS_OWNERDRAW) DefaultProcessing(); else if (param1 == BS_DEFPUSHBUTTON) { IsCurrentDefPB = true; Invalidate(); } else if (param1 == BS_PUSHBUTTON) { IsCurrentDefPB = false; Invalidate(); } else { DefaultProcessing(); } return 0; }
// /// Default processing. /// Responds to the click of the setup button with an EV_COMMAND message. // void TPrintDialog::CmSetup() { DefaultProcessing(); }
// /// Responds to a request to change a title bar or icon. Paints the indicated device /// context or display screen and does any special painting required for the caption. /// /// We only need to paint the caption. Someone else will paint the borders // void TTinyCaption::EvNCPaint(HRGN /*region*/) { DefaultProcessing(); // Default border painting DoNCPaint(); // Then our special caption painting }
// /// Keeps TWindow from rerouting this message.It must be left as is for the tab /// control, as it may originate from the control's spin. // void TTabControl::EvHScroll(uint, uint, THandle) { DefaultProcessing(); }