1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "frame.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
29 #include "wx/dialog.h"
30 #include "wx/settings.h"
31 #include "wx/dcclient.h"
34 #include "wx/msw/private.h"
35 #include "wx/statusbr.h"
36 #include "wx/toolbar.h"
37 #include "wx/menuitem.h"
40 #if wxUSE_NATIVE_STATUSBAR
41 #include <wx/msw/statbr95.h>
44 extern wxWindowList wxModelessWindows
;
45 extern wxList WXDLLEXPORT wxPendingDelete
;
46 extern wxChar wxFrameClassName
[];
47 extern wxMenu
*wxCurrentPopupMenu
;
49 #if !USE_SHARED_LIBRARY
50 BEGIN_EVENT_TABLE(wxFrame
, wxWindow
)
51 EVT_SIZE(wxFrame::OnSize
)
52 EVT_ACTIVATE(wxFrame::OnActivate
)
53 EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight
)
54 EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged
)
55 EVT_IDLE(wxFrame::OnIdle
)
56 EVT_CLOSE(wxFrame::OnCloseWindow
)
59 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxWindow
)
62 #if wxUSE_NATIVE_STATUSBAR
63 bool wxFrame::m_useNativeStatusBar
= TRUE
;
65 bool wxFrame::m_useNativeStatusBar
= FALSE
;
70 m_frameToolBar
= NULL
;
71 m_frameMenuBar
= NULL
;
72 m_frameStatusBar
= NULL
;
77 bool wxFrame::Create(wxWindow
*parent
,
79 const wxString
& title
,
90 m_windowStyle
= style
;
91 m_frameMenuBar
= NULL
;
92 m_frameToolBar
= NULL
;
93 m_frameStatusBar
= NULL
;
95 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
101 m_windowId
= (int)NewControlId();
103 if (parent
) parent
->AddChild(this);
112 // we pass NULL as parent to MSWCreate because frames with parents behave
113 // very strangely under Win95 shell
114 // Alteration by JACS: keep normal Windows behaviour (float on top of parent)
116 if ((m_windowStyle
& wxFRAME_FLOAT_ON_PARENT
) == 0)
120 wxTopLevelWindows
.Append(this);
122 MSWCreate(m_windowId
, parent
, wxFrameClassName
, this, title
,
123 x
, y
, width
, height
, style
);
125 wxModelessWindows
.Append(this);
131 m_isBeingDeleted
= TRUE
;
132 wxTopLevelWindows
.DeleteObject(this);
134 if (m_frameStatusBar
)
135 delete m_frameStatusBar
;
137 delete m_frameMenuBar
;
139 /* New behaviour March 1998: check if it's the last top-level window */
140 // if (wxTheApp && (this == wxTheApp->GetTopWindow()))
142 if (wxTheApp
&& (wxTopLevelWindows
.Number() == 0))
144 wxTheApp
->SetTopWindow(NULL
);
146 if (wxTheApp
->GetExitOnFrameDelete())
152 wxModelessWindows
.DeleteObject(this);
154 // For some reason, wxWindows can activate another task altogether
155 // when a frame is destroyed after a modal dialog has been invoked.
156 // Try to bring the parent to the top.
157 if (GetParent() && GetParent()->GetHWND())
158 ::BringWindowToTop((HWND
) GetParent()->GetHWND());
161 // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
162 void wxFrame::DoGetClientSize(int *x
, int *y
) const
165 ::GetClientRect(GetHwnd(), &rect
);
167 if ( GetStatusBar() )
169 int statusX
, statusY
;
170 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
171 rect
.bottom
-= statusY
;
174 wxPoint
pt(GetClientAreaOrigin());
184 // Set the client size (i.e. leave the calculation of borders etc.
186 void wxFrame::DoSetClientSize(int width
, int height
)
188 HWND hWnd
= GetHwnd();
191 ::GetClientRect(hWnd
, &rect
);
194 GetWindowRect(hWnd
, &rect2
);
196 // Find the difference between the entire window (title bar and all)
197 // and the client area; add this to the new client size to move the
199 int actual_width
= rect2
.right
- rect2
.left
- rect
.right
+ width
;
200 int actual_height
= rect2
.bottom
- rect2
.top
- rect
.bottom
+ height
;
202 if ( GetStatusBar() )
204 int statusX
, statusY
;
205 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
206 actual_height
+= statusY
;
209 wxPoint
pt(GetClientAreaOrigin());
210 actual_width
+= pt
.y
;
211 actual_height
+= pt
.x
;
214 point
.x
= rect2
.left
;
217 MoveWindow(hWnd
, point
.x
, point
.y
, actual_width
, actual_height
, (BOOL
)TRUE
);
219 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
220 event
.SetEventObject( this );
221 GetEventHandler()->ProcessEvent(event
);
224 void wxFrame::DoGetSize(int *width
, int *height
) const
227 GetWindowRect(GetHwnd(), &rect
);
228 *width
= rect
.right
- rect
.left
;
229 *height
= rect
.bottom
- rect
.top
;
232 void wxFrame::DoGetPosition(int *x
, int *y
) const
235 GetWindowRect(GetHwnd(), &rect
);
244 void wxFrame::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
246 wxWindow::DoSetSize(x
, y
, width
, height
, sizeFlags
);
248 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
249 event
.SetEventObject( this );
250 GetEventHandler()->ProcessEvent(event
);
253 bool wxFrame::Show(bool show
)
263 // Try to highlight the correct window (the parent)
267 hWndParent
= (HWND
) GetParent()->GetHWND();
269 ::BringWindowToTop(hWndParent
);
273 ShowWindow(GetHwnd(), (BOOL
)cshow
);
276 BringWindowToTop(GetHwnd());
278 wxActivateEvent
event(wxEVT_ACTIVATE
, TRUE
, m_windowId
);
279 event
.SetEventObject( this );
280 GetEventHandler()->ProcessEvent(event
);
285 void wxFrame::Iconize(bool iconize
)
295 ShowWindow(GetHwnd(), (BOOL
)cshow
);
296 m_iconized
= iconize
;
299 // Equivalent to maximize/restore in Windows
300 void wxFrame::Maximize(bool maximize
)
308 ShowWindow(GetHwnd(), cshow
);
312 bool wxFrame::IsIconized() const
314 ((wxFrame
*)this)->m_iconized
= (::IsIconic(GetHwnd()) != 0);
319 bool wxFrame::IsMaximized() const
321 return (::IsZoomed(GetHwnd()) != 0) ;
324 void wxFrame::SetIcon(const wxIcon
& icon
)
327 #if defined(__WIN95__)
329 SendMessage(GetHwnd(), WM_SETICON
,
330 (WPARAM
)TRUE
, (LPARAM
)(HICON
) m_icon
.GetHICON());
335 wxStatusBar
*wxFrame::OnCreateStatusBar(int number
, long style
, wxWindowID id
,
336 const wxString
& name
)
338 wxStatusBar
*statusBar
= NULL
;
340 #if wxUSE_NATIVE_STATUSBAR
341 if (UsesNativeStatusBar())
343 statusBar
= new wxStatusBar95(this, id
, style
);
348 statusBar
= new wxStatusBar(this, id
, wxPoint(0, 0), wxSize(100, 20),
351 // Set the height according to the font and the border size
352 wxClientDC
dc(statusBar
);
353 dc
.SetFont(statusBar
->GetFont());
356 dc
.GetTextExtent("X", &x
, &y
);
358 int height
= (int)( (y
* 1.1) + 2* statusBar
->GetBorderY());
360 statusBar
->SetSize(-1, -1, 100, height
);
363 statusBar
->SetFieldsCount(number
);
367 wxStatusBar
* wxFrame::CreateStatusBar(int number
, long style
, wxWindowID id
,
368 const wxString
& name
)
370 // VZ: calling CreateStatusBar twice is an error - why anyone would do it?
371 wxCHECK_MSG( m_frameStatusBar
== NULL
, FALSE
,
372 _T("recreating status bar in wxFrame") );
374 m_frameStatusBar
= OnCreateStatusBar(number
, style
, id
,
376 if ( m_frameStatusBar
)
379 return m_frameStatusBar
;
385 void wxFrame::SetStatusText(const wxString
& text
, int number
)
387 wxCHECK_RET( m_frameStatusBar
!= NULL
, _T("no statusbar to set text for") );
389 m_frameStatusBar
->SetStatusText(text
, number
);
392 void wxFrame::SetStatusWidths(int n
, const int widths_field
[])
394 wxCHECK_RET( m_frameStatusBar
!= NULL
, _T("no statusbar to set widths for") );
396 m_frameStatusBar
->SetStatusWidths(n
, widths_field
);
400 void wxFrame::PositionStatusBar()
402 // native status bar positions itself
404 #if wxUSE_NATIVE_STATUSBAR
405 && !m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
))
410 GetClientSize(&w
, &h
);
412 m_frameStatusBar
->GetSize(&sw
, &sh
);
414 // Since we wish the status bar to be directly under the client area,
415 // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
416 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
419 #endif // wxUSE_STATUSBAR
421 void wxFrame::DetachMenuBar()
425 m_frameMenuBar
->Detach();
426 m_frameMenuBar
= NULL
;
430 void wxFrame::SetMenuBar(wxMenuBar
*menu_bar
)
438 wxCHECK_RET( !menu_bar
->GetFrame(), _T("this menubar is already attached") );
441 delete m_frameMenuBar
;
443 m_hMenu
= menu_bar
->Create();
448 InternalSetMenuBar();
450 m_frameMenuBar
= menu_bar
;
451 menu_bar
->Attach(this);
454 void wxFrame::InternalSetMenuBar()
456 if ( !::SetMenu(GetHwnd(), (HMENU
)m_hMenu
) )
458 wxLogLastError("SetMenu");
462 // Responds to colour changes, and passes event on to children.
463 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent
& event
)
465 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
468 if ( m_frameStatusBar
)
470 wxSysColourChangedEvent event2
;
471 event2
.SetEventObject( m_frameStatusBar
);
472 m_frameStatusBar
->GetEventHandler()->ProcessEvent(event2
);
475 // Propagate the event to the non-top-level children
476 wxWindow::OnSysColourChanged(event
);
484 bool wxFrame::MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
, wxWindow
*wx_win
, const wxChar
*title
,
485 int x
, int y
, int width
, int height
, long style
)
488 m_defaultIcon
= (WXHICON
) (wxSTD_FRAME_ICON
? wxSTD_FRAME_ICON
: wxDEFAULT_FRAME_ICON
);
490 // If child windows aren't properly drawn initially, WS_CLIPCHILDREN
491 // could be the culprit. But without it, you can get a lot of flicker.
494 if ((style
& wxCAPTION
) == wxCAPTION
)
495 msflags
= WS_OVERLAPPED
;
499 if (style
& wxMINIMIZE_BOX
)
500 msflags
|= WS_MINIMIZEBOX
;
501 if (style
& wxMAXIMIZE_BOX
)
502 msflags
|= WS_MAXIMIZEBOX
;
503 if (style
& wxTHICK_FRAME
)
504 msflags
|= WS_THICKFRAME
;
505 if (style
& wxSYSTEM_MENU
)
506 msflags
|= WS_SYSMENU
;
507 if ((style
& wxMINIMIZE
) || (style
& wxICONIZE
))
508 msflags
|= WS_MINIMIZE
;
509 if (style
& wxMAXIMIZE
)
510 msflags
|= WS_MAXIMIZE
;
511 if (style
& wxCAPTION
)
512 msflags
|= WS_CAPTION
;
513 if (style
& wxCLIP_CHILDREN
)
514 msflags
|= WS_CLIPCHILDREN
;
516 // Keep this in wxFrame because it saves recoding this function
519 if (style
& wxTINY_CAPTION_VERT
)
520 msflags
|= IBS_VERTCAPTION
;
521 if (style
& wxTINY_CAPTION_HORIZ
)
522 msflags
|= IBS_HORZCAPTION
;
524 if (style
& wxTINY_CAPTION_VERT
)
525 msflags
|= WS_CAPTION
;
526 if (style
& wxTINY_CAPTION_HORIZ
)
527 msflags
|= WS_CAPTION
;
529 if ((style
& wxTHICK_FRAME
) == 0)
530 msflags
|= WS_BORDER
;
532 WXDWORD extendedStyle
= MakeExtendedStyle(style
);
534 #if !defined(__WIN16__) && !defined(__SC__)
535 if (style
& wxFRAME_TOOL_WINDOW
)
536 extendedStyle
|= WS_EX_TOOLWINDOW
;
539 if (style
& wxSTAY_ON_TOP
)
540 extendedStyle
|= WS_EX_TOPMOST
;
543 if ( !wxWindow::MSWCreate(id
, parent
, wclass
, wx_win
, title
, x
, y
, width
, height
,
544 msflags
, NULL
, extendedStyle
) )
547 // Seems to be necessary if we use WS_POPUP
548 // style instead of WS_OVERLAPPED
549 if (width
> -1 && height
> -1)
550 ::PostMessage(GetHwnd(), WM_SIZE
, SIZE_RESTORED
, MAKELPARAM(width
, height
));
555 // Default resizing behaviour - if only ONE subwindow, resize to client
557 void wxFrame::OnSize(wxSizeEvent
& event
)
559 // if we're using constraints - do use them
560 #if wxUSE_CONSTRAINTS
561 if ( GetAutoLayout() )
568 // do we have _exactly_ one child?
569 wxWindow
*child
= NULL
;
570 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
572 node
= node
->GetNext() )
574 wxWindow
*win
= node
->GetData();
575 if ( !win
->IsTopLevel()
577 && (win
!= GetStatusBar())
578 #endif // wxUSE_STATUSBAR
580 && (win
!= GetToolBar())
581 #endif // wxUSE_TOOLBAR
585 return; // it's our second subwindow - nothing to do
591 // we have exactly one child - set it's size to fill the whole frame
592 int clientW
, clientH
;
593 GetClientSize(&clientW
, &clientH
);
598 child
->SetSize(x
, y
, clientW
, clientH
);
602 // Default activation behaviour - set the focus for the first child
604 void wxFrame::OnActivate(wxActivateEvent
& event
)
606 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
608 node
= node
->GetNext() )
610 // FIXME all this is totally bogus - we need to do the same as wxPanel,
611 // but how to do it without duplicating the code?
614 wxWindow
*child
= node
->GetData();
616 if ( !child
->IsTopLevel()
618 && !wxDynamicCast(child
, wxToolBar
)
619 #endif // wxUSE_TOOLBAR
621 && !wxDynamicCast(child
, wxStatusBar
)
622 #endif // wxUSE_STATUSBAR
631 // The default implementation for the close window event.
632 void wxFrame::OnCloseWindow(wxCloseEvent
& event
)
637 // Destroy the window (delayed, if a managed window)
638 bool wxFrame::Destroy()
640 if (!wxPendingDelete
.Member(this))
641 wxPendingDelete
.Append(this);
645 // Default menu selection behaviour - display a help string
646 void wxFrame::OnMenuHighlight(wxMenuEvent
& event
)
651 int menuId
= event
.GetMenuId();
654 wxMenuBar
*menuBar
= GetMenuBar();
655 if (menuBar
&& menuBar
->FindItem(menuId
))
657 help
= menuBar
->GetHelpString(menuId
);
661 // set status text even if the string is empty - this will at
662 // least remove the string from the item which was previously
668 wxMenuBar
*wxFrame::GetMenuBar() const
670 return m_frameMenuBar
;
673 bool wxFrame::ProcessCommand(int id
)
675 wxMenuBar
*bar
= GetMenuBar() ;
679 wxMenuItem
*item
= bar
->FindItemForId(id
);
683 if ( item
->IsCheckable() )
685 bar
->Check(id
, !bar
->IsChecked(id
)) ;
688 wxCommandEvent
commandEvent(wxEVT_COMMAND_MENU_SELECTED
, id
);
689 commandEvent
.SetInt( id
);
690 commandEvent
.SetEventObject( this );
692 return GetEventHandler()->ProcessEvent(commandEvent
);
695 // Checks if there is a toolbar, and returns the first free client position
696 wxPoint
wxFrame::GetClientAreaOrigin() const
702 GetToolBar()->GetSize(& w
, & h
);
704 if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
716 void wxFrame::ScreenToClient(int *x
, int *y
) const
718 wxWindow::ScreenToClient(x
, y
);
720 // We may be faking the client origin.
721 // So a window that's really at (0, 30) may appear
722 // (to wxWin apps) to be at (0, 0).
723 wxPoint
pt(GetClientAreaOrigin());
728 void wxFrame::ClientToScreen(int *x
, int *y
) const
730 // We may be faking the client origin.
731 // So a window that's really at (0, 30) may appear
732 // (to wxWin apps) to be at (0, 0).
733 wxPoint
pt1(GetClientAreaOrigin());
737 wxWindow::ClientToScreen(x
, y
);
741 wxToolBar
* wxFrame::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
743 wxCHECK_MSG( m_frameToolBar
== NULL
, FALSE
,
744 _T("recreating toolbar in wxFrame") );
746 wxToolBar
* toolBar
= OnCreateToolBar(style
, id
, name
);
759 wxToolBar
* wxFrame::OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
761 return new wxToolBar(this, id
, wxDefaultPosition
, wxDefaultSize
, style
, name
);
764 void wxFrame::PositionToolBar()
767 ::GetClientRect(GetHwnd(), &rect
);
769 if ( GetStatusBar() )
771 int statusX
, statusY
;
772 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
773 rect
.bottom
-= statusY
;
779 GetToolBar()->GetSize(& tw
, & th
);
781 if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
783 // Use the 'real' MSW position
784 GetToolBar()->SetSize(0, 0, tw
, rect
.bottom
, wxSIZE_NO_ADJUSTMENTS
);
788 // Use the 'real' MSW position
789 GetToolBar()->SetSize(0, 0, rect
.right
, th
, wxSIZE_NO_ADJUSTMENTS
);
793 #endif // wxUSE_TOOLBAR
795 // propagate our state change to all child frames: this allows us to emulate X
796 // Windows behaviour where child frames float independently of the parent one
797 // on the desktop, but are iconized/restored with it
798 void wxFrame::IconizeChildFrames(bool bIconize
)
800 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
802 node
= node
->GetNext() )
804 wxWindow
*win
= node
->GetData();
806 if ( win
->IsKindOf(CLASSINFO(wxFrame
)) )
808 ((wxFrame
*)win
)->Iconize(bIconize
);
814 // make the window modal (all other windows unresponsive)
815 void wxFrame::MakeModal(bool modal
)
818 wxEnableTopLevelWindows(FALSE
);
819 Enable(TRUE
); // keep this window enabled
822 wxEnableTopLevelWindows(TRUE
);
827 // ===========================================================================
828 // message processing
829 // ===========================================================================
831 // ---------------------------------------------------------------------------
833 // ---------------------------------------------------------------------------
835 bool wxFrame::MSWTranslateMessage(WXMSG
* pMsg
)
837 if ( wxWindow::MSWTranslateMessage(pMsg
) )
840 // try the menu bar accels
841 wxMenuBar
*menuBar
= GetMenuBar();
845 const wxAcceleratorTable
& acceleratorTable
= menuBar
->GetAccelTable();
846 return acceleratorTable
.Translate(this, pMsg
);
849 // ---------------------------------------------------------------------------
850 // our private (non virtual) message handlers
851 // ---------------------------------------------------------------------------
853 bool wxFrame::HandlePaint()
856 if ( GetUpdateRect(GetHwnd(), &rect
, FALSE
) )
860 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
861 : (HICON
)m_defaultIcon
;
863 // Hold a pointer to the dc so long as the OnPaint() message
864 // is being processed
866 HDC hdc
= ::BeginPaint(GetHwnd(), &ps
);
868 // Erase background before painting or we get white background
869 MSWDefWindowProc(WM_ICONERASEBKGND
, (WORD
)(LONG
)ps
.hdc
, 0L);
874 ::GetClientRect(GetHwnd(), &rect
);
876 // FIXME: why hardcoded?
877 static const int icon_width
= 32;
878 static const int icon_height
= 32;
880 int icon_x
= (int)((rect
.right
- icon_width
)/2);
881 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
883 ::DrawIcon(hdc
, icon_x
, icon_y
, hIcon
);
886 ::EndPaint(GetHwnd(), &ps
);
892 return wxWindow::HandlePaint();
897 // nothing to paint - processed
902 bool wxFrame::HandleSize(int x
, int y
, WXUINT id
)
904 bool processed
= FALSE
;
909 // only do it it if we were iconized before, otherwise resizing the
910 // parent frame has a curious side effect of bringing it under it's
915 // restore all child frames too
916 IconizeChildFrames(FALSE
);
925 // iconize all child frames too
926 IconizeChildFrames(TRUE
);
934 // forward WM_SIZE to status bar control
935 #if wxUSE_NATIVE_STATUSBAR
936 if (m_frameStatusBar
&& m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
)))
938 wxSizeEvent
event(wxSize(x
, y
), m_frameStatusBar
->GetId());
939 event
.SetEventObject( m_frameStatusBar
);
941 ((wxStatusBar95
*)m_frameStatusBar
)->OnSize(event
);
943 #endif // wxUSE_NATIVE_STATUSBAR
948 wxSizeEvent
event(wxSize(x
, y
), m_windowId
);
949 event
.SetEventObject( this );
950 processed
= GetEventHandler()->ProcessEvent(event
);
956 bool wxFrame::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
960 // In case it's e.g. a toolbar.
961 wxWindow
*win
= wxFindWinFromHandle(control
);
963 return win
->MSWCommand(cmd
, id
);
966 // handle here commands from menus and accelerators
967 if ( cmd
== 0 || cmd
== 1 )
969 if ( wxCurrentPopupMenu
)
971 wxMenu
*popupMenu
= wxCurrentPopupMenu
;
972 wxCurrentPopupMenu
= NULL
;
974 return popupMenu
->MSWCommand(cmd
, id
);
977 if ( ProcessCommand(id
) )
986 bool wxFrame::HandleMenuSelect(WXWORD nItem
, WXWORD flags
, WXHMENU hMenu
)
989 if ( flags
== 0xFFFF && hMenu
== 0 )
991 // menu was removed from screen
994 else if ( !(flags
& MF_POPUP
) && !(flags
& MF_SEPARATOR
) )
1000 // don't give hints for separators (doesn't make sense) nor for the
1001 // items opening popup menus (they don't have them anyhow)
1005 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, item
);
1006 event
.SetEventObject( this );
1008 return GetEventHandler()->ProcessEvent(event
);
1011 // ---------------------------------------------------------------------------
1012 // the window proc for wxFrame
1013 // ---------------------------------------------------------------------------
1015 long wxFrame::MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
1018 bool processed
= FALSE
;
1023 // if we can't close, tell the system that we processed the
1024 // message - otherwise it would close us
1025 processed
= !Close();
1032 UnpackCommand((WXWPARAM
)wParam
, (WXLPARAM
)lParam
,
1035 processed
= HandleCommand(id
, cmd
, (WXHWND
)hwnd
);
1043 UnpackMenuSelect(wParam
, lParam
, &item
, &flags
, &hmenu
);
1045 processed
= HandleMenuSelect(item
, flags
, hmenu
);
1050 processed
= HandlePaint();
1053 case WM_QUERYDRAGICON
:
1055 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
1056 : (HICON
)(m_defaultIcon
);
1058 processed
= rc
!= 0;
1063 processed
= HandleSize(LOWORD(lParam
), HIWORD(lParam
), wParam
);
1068 rc
= wxWindow::MSWWindowProc(message
, wParam
, lParam
);