1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "frame.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
36 #include "wx/dialog.h"
37 #include "wx/settings.h"
38 #include "wx/dcclient.h"
43 #include "wx/msw/private.h"
50 #include "wx/statusbr.h"
51 #include "wx/generic/statusbr.h"
52 #endif // wxUSE_STATUSBAR
55 #include "wx/toolbar.h"
56 #endif // wxUSE_TOOLBAR
58 #include "wx/menuitem.h"
61 #ifdef __WXUNIVERSAL__
62 #include "wx/univ/theme.h"
63 #include "wx/univ/colschem.h"
64 #endif // __WXUNIVERSAL__
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 #if wxUSE_MENUS_NATIVE
71 extern wxMenu
*wxCurrentPopupMenu
;
72 #endif // wxUSE_MENUS_NATIVE
74 // ----------------------------------------------------------------------------
76 // ----------------------------------------------------------------------------
78 BEGIN_EVENT_TABLE(wxFrame
, wxFrameBase
)
79 EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged
)
82 #if wxUSE_EXTENDED_RTTI
83 WX_DEFINE_FLAGS( wxFrameStyle
)
85 WX_BEGIN_FLAGS( wxFrameStyle
)
86 // new style border flags, we put them first to
87 // use them for streaming out
88 WX_FLAGS_MEMBER(wxBORDER_SIMPLE
)
89 WX_FLAGS_MEMBER(wxBORDER_SUNKEN
)
90 WX_FLAGS_MEMBER(wxBORDER_DOUBLE
)
91 WX_FLAGS_MEMBER(wxBORDER_RAISED
)
92 WX_FLAGS_MEMBER(wxBORDER_STATIC
)
93 WX_FLAGS_MEMBER(wxBORDER_NONE
)
95 // old style border flags
96 WX_FLAGS_MEMBER(wxSIMPLE_BORDER
)
97 WX_FLAGS_MEMBER(wxSUNKEN_BORDER
)
98 WX_FLAGS_MEMBER(wxDOUBLE_BORDER
)
99 WX_FLAGS_MEMBER(wxRAISED_BORDER
)
100 WX_FLAGS_MEMBER(wxSTATIC_BORDER
)
101 WX_FLAGS_MEMBER(wxNO_BORDER
)
103 // standard window styles
104 WX_FLAGS_MEMBER(wxTAB_TRAVERSAL
)
105 WX_FLAGS_MEMBER(wxCLIP_CHILDREN
)
106 WX_FLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
107 WX_FLAGS_MEMBER(wxWANTS_CHARS
)
108 WX_FLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE
)
109 WX_FLAGS_MEMBER(wxALWAYS_SHOW_SB
)
110 WX_FLAGS_MEMBER(wxVSCROLL
)
111 WX_FLAGS_MEMBER(wxHSCROLL
)
114 WX_FLAGS_MEMBER(wxSTAY_ON_TOP
)
115 WX_FLAGS_MEMBER(wxCAPTION
)
116 WX_FLAGS_MEMBER(wxTHICK_FRAME
)
117 WX_FLAGS_MEMBER(wxSYSTEM_MENU
)
118 WX_FLAGS_MEMBER(wxRESIZE_BORDER
)
119 WX_FLAGS_MEMBER(wxRESIZE_BOX
)
120 WX_FLAGS_MEMBER(wxCLOSE_BOX
)
121 WX_FLAGS_MEMBER(wxMAXIMIZE_BOX
)
122 WX_FLAGS_MEMBER(wxMINIMIZE_BOX
)
124 WX_FLAGS_MEMBER(wxFRAME_TOOL_WINDOW
)
125 WX_FLAGS_MEMBER(wxFRAME_FLOAT_ON_PARENT
)
127 WX_FLAGS_MEMBER(wxFRAME_SHAPED
)
129 WX_END_FLAGS( wxFrameStyle
)
131 IMPLEMENT_DYNAMIC_CLASS_XTI(wxFrame
, wxTopLevelWindow
,"wx/frame.h")
133 WX_BEGIN_PROPERTIES_TABLE(wxFrame
)
134 WX_PROPERTY( Title
,wxString
, SetTitle
, GetTitle
, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
135 WX_PROPERTY_FLAGS( WindowStyle
, wxFrameStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
136 WX_PROPERTY( MenuBar
, wxMenuBar
* , SetMenuBar
, GetMenuBar
, , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
140 style (wxDEFAULT_FRAME_STYLE)
141 centered (bool, false )
143 WX_END_PROPERTIES_TABLE()
145 WX_BEGIN_HANDLERS_TABLE(wxFrame
)
146 WX_END_HANDLERS_TABLE()
148 WX_CONSTRUCTOR_6( wxFrame
, wxWindow
* , Parent
, wxWindowID
, Id
, wxString
, Title
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
151 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxTopLevelWindow
)
154 // ============================================================================
156 // ============================================================================
158 // ----------------------------------------------------------------------------
159 // static class members
160 // ----------------------------------------------------------------------------
163 #if wxUSE_NATIVE_STATUSBAR
164 bool wxFrame::m_useNativeStatusBar
= TRUE
;
166 bool wxFrame::m_useNativeStatusBar
= FALSE
;
168 #endif // wxUSE_NATIVE_STATUSBAR
170 // ----------------------------------------------------------------------------
171 // creation/destruction
172 // ----------------------------------------------------------------------------
180 // Data to save/restore when calling ShowFullScreen
181 m_fsStatusBarFields
= 0;
182 m_fsStatusBarHeight
= 0;
183 m_fsToolBarHeight
= 0;
185 m_wasMinimized
= FALSE
;
188 bool wxFrame::Create(wxWindow
*parent
,
190 const wxString
& title
,
194 const wxString
& name
)
196 if ( !wxTopLevelWindow::Create(parent
, id
, title
, pos
, size
, style
, name
) )
199 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE
));
201 wxModelessWindows
.Append(this);
208 m_isBeingDeleted
= TRUE
;
212 // ----------------------------------------------------------------------------
213 // wxFrame client size calculations
214 // ----------------------------------------------------------------------------
216 void wxFrame::DoSetClientSize(int width
, int height
)
218 // leave enough space for the status bar if we have (and show) it
220 wxStatusBar
*statbar
= GetStatusBar();
221 if ( statbar
&& statbar
->IsShown() )
223 height
+= statbar
->GetSize().y
;
225 #endif // wxUSE_STATUSBAR
227 // call GetClientAreaOrigin() to take the toolbar into account
228 wxPoint pt
= GetClientAreaOrigin();
232 wxTopLevelWindow::DoSetClientSize(width
, height
);
235 // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
236 void wxFrame::DoGetClientSize(int *x
, int *y
) const
238 wxTopLevelWindow::DoGetClientSize(x
, y
);
240 // account for the possible toolbar
241 wxPoint pt
= GetClientAreaOrigin();
249 // adjust client area height to take the status bar into account
252 wxStatusBar
*statbar
= GetStatusBar();
253 if ( statbar
&& statbar
->IsShown() )
255 *y
-= statbar
->GetClientSize().y
;
258 #endif // wxUSE_STATUSBAR
261 // ----------------------------------------------------------------------------
262 // wxFrame: various geometry-related functions
263 // ----------------------------------------------------------------------------
265 void wxFrame::Raise()
267 ::SetForegroundWindow(GetHwnd());
270 // generate an artificial resize event
271 void wxFrame::SendSizeEvent()
275 RECT r
= wxGetWindowRect(GetHwnd());
277 (void)::PostMessage(GetHwnd(), WM_SIZE
,
278 IsMaximized() ? SIZE_MAXIMIZED
: SIZE_RESTORED
,
279 MAKELPARAM(r
.right
- r
.left
, r
.bottom
- r
.top
));
284 wxStatusBar
*wxFrame::OnCreateStatusBar(int number
,
287 const wxString
& name
)
289 wxStatusBar
*statusBar
= NULL
;
291 #if wxUSE_NATIVE_STATUSBAR
292 if ( !UsesNativeStatusBar() )
294 statusBar
= (wxStatusBar
*)new wxStatusBarGeneric(this, id
, style
);
299 statusBar
= new wxStatusBar(this, id
, style
, name
);
302 statusBar
->SetFieldsCount(number
);
307 void wxFrame::PositionStatusBar()
309 if ( !m_frameStatusBar
|| !m_frameStatusBar
->IsShown() )
313 GetClientSize(&w
, &h
);
315 m_frameStatusBar
->GetSize(&sw
, &sh
);
317 // Since we wish the status bar to be directly under the client area,
318 // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
319 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
321 #endif // wxUSE_STATUSBAR
323 #if wxUSE_MENUS_NATIVE
325 void wxFrame::AttachMenuBar(wxMenuBar
*menubar
)
327 wxFrameBase::AttachMenuBar(menubar
);
331 // actually remove the menu from the frame
332 m_hMenu
= (WXHMENU
)0;
333 InternalSetMenuBar();
335 else // set new non NULL menu bar
338 // Can set a menubar several times.
339 if ( menubar
->GetHMenu() )
341 m_hMenu
= menubar
->GetHMenu();
345 m_hMenu
= menubar
->Create();
349 wxFAIL_MSG( _T("failed to create menu bar") );
354 InternalSetMenuBar();
358 void wxFrame::InternalSetMenuBar()
360 #ifdef __WXMICROWIN__
362 #elif defined(__WXWINCE__)
366 wxToolBar
* toolBar
= new wxToolBar(this, -1,
367 wxDefaultPosition
, wxDefaultSize
,
368 wxBORDER_NONE
| wxTB_HORIZONTAL
,
369 wxToolBarNameStr
, GetMenuBar());
373 if ( !::SetMenu(GetHwnd(), (HMENU
)m_hMenu
) )
375 wxLogLastError(wxT("SetMenu"));
380 #endif // wxUSE_MENUS_NATIVE
382 // Responds to colour changes, and passes event on to children.
383 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent
& event
)
385 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE
));
389 if ( m_frameStatusBar
)
391 wxSysColourChangedEvent event2
;
392 event2
.SetEventObject( m_frameStatusBar
);
393 m_frameStatusBar
->GetEventHandler()->ProcessEvent(event2
);
395 #endif // wxUSE_STATUSBAR
397 // Propagate the event to the non-top-level children
398 wxWindow::OnSysColourChanged(event
);
401 // Pass TRUE to show full screen, FALSE to restore.
402 bool wxFrame::ShowFullScreen(bool show
, long style
)
404 if ( IsFullScreen() == show
)
411 // TODO: hide commandbar
413 wxToolBar
*theToolBar
= GetToolBar();
415 theToolBar
->GetSize(NULL
, &m_fsToolBarHeight
);
417 // zap the toolbar, menubar, and statusbar
419 if ((style
& wxFULLSCREEN_NOTOOLBAR
) && theToolBar
)
421 theToolBar
->SetSize(-1,0);
422 theToolBar
->Show(FALSE
);
424 #endif // __WXWINCE__
425 #endif // wxUSE_TOOLBAR
427 // TODO: make it work for WinCE
428 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
429 if (style
& wxFULLSCREEN_NOMENUBAR
)
430 SetMenu((HWND
)GetHWND(), (HMENU
) NULL
);
434 wxStatusBar
*theStatusBar
= GetStatusBar();
436 theStatusBar
->GetSize(NULL
, &m_fsStatusBarHeight
);
438 // Save the number of fields in the statusbar
439 if ((style
& wxFULLSCREEN_NOSTATUSBAR
) && theStatusBar
)
441 //m_fsStatusBarFields = theStatusBar->GetFieldsCount();
442 //SetStatusBar((wxStatusBar*) NULL);
443 //delete theStatusBar;
444 theStatusBar
->Show(FALSE
);
447 m_fsStatusBarFields
= 0;
448 #endif // wxUSE_STATUSBAR
454 // TODO: show commandbar
456 wxToolBar
*theToolBar
= GetToolBar();
458 // restore the toolbar, menubar, and statusbar
459 if (theToolBar
&& (m_fsStyle
& wxFULLSCREEN_NOTOOLBAR
))
461 theToolBar
->SetSize(-1, m_fsToolBarHeight
);
462 theToolBar
->Show(TRUE
);
464 #endif // __WXWINCE__
465 #endif // wxUSE_TOOLBAR
468 if ( m_fsStyle
& wxFULLSCREEN_NOSTATUSBAR
)
470 //CreateStatusBar(m_fsStatusBarFields);
473 GetStatusBar()->Show(TRUE
);
477 #endif // wxUSE_STATUSBAR
479 // TODO: make it work for WinCE
480 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
481 if ((m_fsStyle
& wxFULLSCREEN_NOMENUBAR
) && (m_hMenu
!= 0))
482 SetMenu((HWND
)GetHWND(), (HMENU
)m_hMenu
);
486 return wxFrameBase::ShowFullScreen(show
, style
);
489 // ----------------------------------------------------------------------------
490 // tool/status bar stuff
491 // ----------------------------------------------------------------------------
495 wxToolBar
* wxFrame::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
498 // We may already have a toolbar from calling SetMenuBar.
502 if ( wxFrameBase::CreateToolBar(style
, id
, name
) )
507 return m_frameToolBar
;
510 void wxFrame::PositionToolBar()
512 wxToolBar
*toolbar
= GetToolBar();
513 if ( toolbar
&& toolbar
->IsShown() )
516 // We want to do something different in WinCE, because
517 // the toolbar should be associated with the commandbar,
518 // and not an independent window.
521 // don't call our (or even wxTopLevelWindow) version because we want
522 // the real (full) client area size, not excluding the tool/status bar
524 wxWindow::DoGetClientSize(&width
, &height
);
527 wxStatusBar
*statbar
= GetStatusBar();
528 if ( statbar
&& statbar
->IsShown() )
530 height
-= statbar
->GetClientSize().y
;
532 #endif // wxUSE_STATUSBAR
536 toolbar
->GetPosition(&tx
, &ty
);
537 toolbar
->GetSize(&tw
, &th
);
540 if (ty
< 0 && (-ty
== th
))
542 if (tx
< 0 && (-tx
== tw
))
548 if ( toolbar
->GetWindowStyleFlag() & wxTB_VERTICAL
)
555 // if ( toolbar->GetWindowStyleFlag() & wxTB_FLAT )
559 // use the 'real' MSW position here, don't offset relativly to the
560 // client area origin
562 // Optimise such that we don't have to always resize the toolbar
563 // when the frame changes, otherwise we'll get a lot of flicker.
564 bool heightChanging
= TRUE
;
565 bool widthChanging
= TRUE
;
567 if ( toolbar
->GetWindowStyleFlag() & wxTB_VERTICAL
)
569 // It's OK if the current height is greater than what can be shown.
570 heightChanging
= (desiredH
> th
) ;
571 widthChanging
= (desiredW
!= tw
) ;
573 // The next time around, we may not have to set the size
575 desiredH
= desiredH
+ 200;
579 // It's OK if the current width is greater than what can be shown.
580 widthChanging
= (desiredW
> tw
) ;
581 heightChanging
= (desiredH
!= th
) ;
583 // The next time around, we may not have to set the size
585 desiredW
= desiredW
+ 200;
588 if (tx
!= 0 || ty
!= 0 || widthChanging
|| heightChanging
)
589 toolbar
->SetSize(0, 0, desiredW
, desiredH
, wxSIZE_NO_ADJUSTMENTS
);
591 #endif // __WXWINCE__
595 #endif // wxUSE_TOOLBAR
597 // ----------------------------------------------------------------------------
598 // frame state (iconized/maximized/...)
599 // ----------------------------------------------------------------------------
601 // propagate our state change to all child frames: this allows us to emulate X
602 // Windows behaviour where child frames float independently of the parent one
603 // on the desktop, but are iconized/restored with it
604 void wxFrame::IconizeChildFrames(bool bIconize
)
606 for ( wxWindowList::compatibility_iterator node
= GetChildren().GetFirst();
608 node
= node
->GetNext() )
610 wxWindow
*win
= node
->GetData();
612 // iconizing the frames with this style under Win95 shell puts them at
613 // the bottom of the screen (as the MDI children) instead of making
614 // them appear in the taskbar because they are, by virtue of this
615 // style, not managed by the taskbar - instead leave Windows take care
618 if ( win
->GetWindowStyle() & wxFRAME_TOOL_WINDOW
)
622 // the child MDI frames are a special case and should not be touched by
623 // the parent frame - instead, they are managed by the user
624 wxFrame
*frame
= wxDynamicCast(win
, wxFrame
);
626 #if wxUSE_MDI_ARCHITECTURE
627 && !wxDynamicCast(frame
, wxMDIChildFrame
)
628 #endif // wxUSE_MDI_ARCHITECTURE
631 // we don't want to restore the child frames which had been
632 // iconized even before we were iconized, so save the child frame
633 // status when iconizing the parent frame and check it when
637 // note that we shouldn't touch the hidden frames neither
638 // because iconizing/restoring them would show them as a side
640 frame
->m_wasMinimized
= frame
->IsIconized() || !frame
->IsShown();
643 // this test works for both iconizing and restoring
644 if ( !frame
->m_wasMinimized
)
645 frame
->Iconize(bIconize
);
650 WXHICON
wxFrame::GetDefaultIcon() const
652 // we don't have any standard icons (any more)
656 // ===========================================================================
657 // message processing
658 // ===========================================================================
660 // ---------------------------------------------------------------------------
662 // ---------------------------------------------------------------------------
664 bool wxFrame::MSWTranslateMessage(WXMSG
* pMsg
)
666 if ( wxWindow::MSWTranslateMessage(pMsg
) )
669 #if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
670 // try the menu bar accels
671 wxMenuBar
*menuBar
= GetMenuBar();
675 const wxAcceleratorTable
& acceleratorTable
= menuBar
->GetAccelTable();
676 return acceleratorTable
.Translate(this, pMsg
);
679 #endif // wxUSE_MENUS && wxUSE_ACCEL
682 // ---------------------------------------------------------------------------
683 // our private (non virtual) message handlers
684 // ---------------------------------------------------------------------------
686 bool wxFrame::HandlePaint()
689 if ( GetUpdateRect(GetHwnd(), &rect
, FALSE
) )
691 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
694 const wxIcon
& icon
= GetIcon();
695 HICON hIcon
= icon
.Ok() ? GetHiconOf(icon
)
696 : (HICON
)GetDefaultIcon();
698 // Hold a pointer to the dc so long as the OnPaint() message
699 // is being processed
701 HDC hdc
= ::BeginPaint(GetHwnd(), &ps
);
703 // Erase background before painting or we get white background
704 MSWDefWindowProc(WM_ICONERASEBKGND
, (WORD
)(LONG
)ps
.hdc
, 0L);
709 ::GetClientRect(GetHwnd(), &rect
);
711 // FIXME: why hardcoded?
712 static const int icon_width
= 32;
713 static const int icon_height
= 32;
715 int icon_x
= (int)((rect
.right
- icon_width
)/2);
716 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
718 ::DrawIcon(hdc
, icon_x
, icon_y
, hIcon
);
721 ::EndPaint(GetHwnd(), &ps
);
728 return wxWindow::HandlePaint();
733 // nothing to paint - processed
738 bool wxFrame::HandleSize(int x
, int y
, WXUINT id
)
740 bool processed
= FALSE
;
741 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
746 // only do it it if we were iconized before, otherwise resizing the
747 // parent frame has a curious side effect of bringing it under it's
752 // restore all child frames too
753 IconizeChildFrames(FALSE
);
755 (void)SendIconizeEvent(FALSE
);
764 // iconize all child frames too
765 IconizeChildFrames(TRUE
);
767 (void)SendIconizeEvent();
778 #endif // wxUSE_STATUSBAR
782 #endif // wxUSE_TOOLBAR
784 processed
= wxWindow::HandleSize(x
, y
, id
);
790 bool wxFrame::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
794 // In case it's e.g. a toolbar.
795 wxWindow
*win
= wxFindWinFromHandle(control
);
797 return win
->MSWCommand(cmd
, id
);
800 // handle here commands from menus and accelerators
801 if ( cmd
== 0 || cmd
== 1 )
803 #if wxUSE_MENUS_NATIVE
804 if ( wxCurrentPopupMenu
)
806 wxMenu
*popupMenu
= wxCurrentPopupMenu
;
807 wxCurrentPopupMenu
= NULL
;
809 return popupMenu
->MSWCommand(cmd
, id
);
811 #endif // wxUSE_MENUS_NATIVE
813 if ( ProcessCommand(id
) )
822 bool wxFrame::HandleMenuSelect(WXWORD nItem
, WXWORD flags
, WXHMENU hMenu
)
825 if ( flags
== 0xFFFF && hMenu
== 0 )
827 // menu was removed from screen
830 #ifndef __WXMICROWIN__
831 else if ( !(flags
& MF_POPUP
) && !(flags
& MF_SEPARATOR
) )
838 // don't give hints for separators (doesn't make sense) nor for the
839 // items opening popup menus (they don't have them anyhow) but do clear
840 // the status line - otherwise, we would be left with the help message
841 // for the previous item which doesn't apply any more
842 DoGiveHelp(wxEmptyString
, FALSE
);
847 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, item
);
848 event
.SetEventObject(this);
850 return GetEventHandler()->ProcessEvent(event
);
853 bool wxFrame::HandleMenuLoop(const wxEventType
& evtType
, WXWORD isPopup
)
855 // we don't have the menu id here, so we use the id to specify if the event
856 // was from a popup menu or a normal one
857 wxMenuEvent
event(evtType
, isPopup
? -1 : 0);
858 event
.SetEventObject(this);
860 return GetEventHandler()->ProcessEvent(event
);
863 // ---------------------------------------------------------------------------
864 // the window proc for wxFrame
865 // ---------------------------------------------------------------------------
867 long wxFrame::MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
870 bool processed
= FALSE
;
875 // if we can't close, tell the system that we processed the
876 // message - otherwise it would close us
877 processed
= !Close();
881 processed
= HandleSize(LOWORD(lParam
), HIWORD(lParam
), wParam
);
888 UnpackCommand((WXWPARAM
)wParam
, (WXLPARAM
)lParam
,
891 processed
= HandleCommand(id
, cmd
, (WXHWND
)hwnd
);
896 processed
= HandlePaint();
899 case WM_INITMENUPOPUP
:
900 processed
= HandleInitMenuPopup((WXHMENU
) wParam
);
903 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
908 UnpackMenuSelect(wParam
, lParam
, &item
, &flags
, &hmenu
);
910 processed
= HandleMenuSelect(item
, flags
, hmenu
);
914 case WM_EXITMENULOOP
:
915 processed
= HandleMenuLoop(wxEVT_MENU_CLOSE
, wParam
);
918 case WM_QUERYDRAGICON
:
920 const wxIcon
& icon
= GetIcon();
921 HICON hIcon
= icon
.Ok() ? GetHiconOf(icon
)
922 : (HICON
)GetDefaultIcon();
927 #endif // !__WXMICROWIN__
931 rc
= wxFrameBase::MSWWindowProc(message
, wParam
, lParam
);
936 // handle WM_INITMENUPOPUP message
937 bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu
)
942 int nCount
= GetMenuBar()->GetMenuCount();
943 for (int n
= 0; n
< nCount
; n
++)
945 if (GetMenuBar()->GetMenu(n
)->GetHMenu() == hMenu
)
947 menu
= GetMenuBar()->GetMenu(n
);
953 wxMenuEvent
event(wxEVT_MENU_OPEN
, 0, menu
);
954 event
.SetEventObject(this);
956 return GetEventHandler()->ProcessEvent(event
);