1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "frame.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
37 #include "wx/dialog.h"
38 #include "wx/settings.h"
39 #include "wx/dcclient.h"
43 #include "wx/msw/private.h"
46 #include "wx/statusbr.h"
47 #include "wx/generic/statusbr.h"
48 #endif // wxUSE_STATUSBAR
51 #include "wx/toolbar.h"
52 #endif // wxUSE_TOOLBAR
54 #include "wx/menuitem.h"
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
61 extern wxWindowList wxModelessWindows
;
62 extern wxList WXDLLEXPORT wxPendingDelete
;
63 extern const wxChar
*wxFrameClassName
;
64 extern wxMenu
*wxCurrentPopupMenu
;
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 BEGIN_EVENT_TABLE(wxFrame
, wxFrameBase
)
71 EVT_ACTIVATE(wxFrame::OnActivate
)
72 EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged
)
75 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxWindow
)
77 // ============================================================================
79 // ============================================================================
81 // ----------------------------------------------------------------------------
82 // static class members
83 // ----------------------------------------------------------------------------
85 #if wxUSE_NATIVE_STATUSBAR
86 bool wxFrame::m_useNativeStatusBar
= TRUE
;
88 bool wxFrame::m_useNativeStatusBar
= FALSE
;
91 // ----------------------------------------------------------------------------
92 // creation/destruction
93 // ----------------------------------------------------------------------------
103 // Data to save/restore when calling ShowFullScreen
105 m_fsOldWindowStyle
= 0;
106 m_fsStatusBarFields
= 0;
107 m_fsStatusBarHeight
= 0;
108 m_fsToolBarHeight
= 0;
110 m_fsIsMaximized
= FALSE
;
111 m_fsIsShowing
= FALSE
;
114 bool wxFrame::Create(wxWindow
*parent
,
116 const wxString
& title
,
120 const wxString
& name
)
123 m_windowStyle
= style
;
124 m_frameMenuBar
= NULL
;
125 m_frameToolBar
= NULL
;
126 m_frameStatusBar
= NULL
;
128 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
133 m_windowId
= (int)NewControlId();
135 if (parent
) parent
->AddChild(this);
144 // we pass NULL as parent to MSWCreate because frames with parents behave
145 // very strangely under Win95 shell
146 // Alteration by JACS: keep normal Windows behaviour (float on top of parent)
148 if ((m_windowStyle
& wxFRAME_FLOAT_ON_PARENT
) == 0)
152 wxTopLevelWindows
.Append(this);
154 MSWCreate(m_windowId
, parent
, wxFrameClassName
, this, title
,
155 x
, y
, width
, height
, style
);
157 wxModelessWindows
.Append(this);
163 m_isBeingDeleted
= TRUE
;
164 wxTopLevelWindows
.DeleteObject(this);
168 if (wxTheApp
&& (wxTopLevelWindows
.Number() == 0))
170 wxTheApp
->SetTopWindow(NULL
);
172 if (wxTheApp
->GetExitOnFrameDelete())
178 wxModelessWindows
.DeleteObject(this);
180 // For some reason, wxWindows can activate another task altogether
181 // when a frame is destroyed after a modal dialog has been invoked.
182 // Try to bring the parent to the top.
183 // MT:Only do this if this frame is currently the active window, else weird
184 // things start to happen
185 if ( wxGetActiveWindow() == this )
186 if (GetParent() && GetParent()->GetHWND())
187 ::BringWindowToTop((HWND
) GetParent()->GetHWND());
190 // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
191 void wxFrame::DoGetClientSize(int *x
, int *y
) const
194 ::GetClientRect(GetHwnd(), &rect
);
197 if ( GetStatusBar() && GetStatusBar()->IsShown() )
199 int statusX
, statusY
;
200 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
201 rect
.bottom
-= statusY
;
203 #endif // wxUSE_STATUSBAR
205 wxPoint
pt(GetClientAreaOrigin());
215 // Set the client size (i.e. leave the calculation of borders etc.
217 void wxFrame::DoSetClientSize(int width
, int height
)
219 HWND hWnd
= GetHwnd();
222 ::GetClientRect(hWnd
, &rect
);
225 GetWindowRect(hWnd
, &rect2
);
227 // Find the difference between the entire window (title bar and all)
228 // and the client area; add this to the new client size to move the
230 int actual_width
= rect2
.right
- rect2
.left
- rect
.right
+ width
;
231 int actual_height
= rect2
.bottom
- rect2
.top
- rect
.bottom
+ height
;
234 if ( GetStatusBar() && GetStatusBar()->IsShown())
236 int statusX
, statusY
;
237 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
238 actual_height
+= statusY
;
240 #endif // wxUSE_STATUSBAR
242 wxPoint
pt(GetClientAreaOrigin());
243 actual_width
+= pt
.y
;
244 actual_height
+= pt
.x
;
247 point
.x
= rect2
.left
;
250 MoveWindow(hWnd
, point
.x
, point
.y
, actual_width
, actual_height
, (BOOL
)TRUE
);
252 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
253 event
.SetEventObject( this );
254 GetEventHandler()->ProcessEvent(event
);
257 void wxFrame::DoGetSize(int *width
, int *height
) const
260 GetWindowRect(GetHwnd(), &rect
);
261 *width
= rect
.right
- rect
.left
;
262 *height
= rect
.bottom
- rect
.top
;
265 void wxFrame::DoGetPosition(int *x
, int *y
) const
268 GetWindowRect(GetHwnd(), &rect
);
277 // ----------------------------------------------------------------------------
278 // variations around ::ShowWindow()
279 // ----------------------------------------------------------------------------
281 void wxFrame::DoShowWindow(int nShowCmd
)
283 ::ShowWindow(GetHwnd(), nShowCmd
);
285 m_iconized
= nShowCmd
== SW_MINIMIZE
;
288 bool wxFrame::Show(bool show
)
290 DoShowWindow(show
? SW_SHOW
: SW_HIDE
);
294 ::BringWindowToTop(GetHwnd());
296 wxActivateEvent
event(wxEVT_ACTIVATE
, TRUE
, m_windowId
);
297 event
.SetEventObject( this );
298 GetEventHandler()->ProcessEvent(event
);
302 // Try to highlight the correct window (the parent)
305 HWND hWndParent
= GetHwndOf(GetParent());
307 ::BringWindowToTop(hWndParent
);
314 void wxFrame::Iconize(bool iconize
)
316 DoShowWindow(iconize
? SW_MINIMIZE
: SW_RESTORE
);
319 void wxFrame::Maximize(bool maximize
)
321 DoShowWindow(maximize
? SW_MAXIMIZE
: SW_RESTORE
);
324 void wxFrame::Restore()
326 DoShowWindow(SW_RESTORE
);
329 bool wxFrame::IsIconized() const
331 ((wxFrame
*)this)->m_iconized
= (::IsIconic(GetHwnd()) != 0);
336 bool wxFrame::IsMaximized() const
338 return (::IsZoomed(GetHwnd()) != 0);
341 void wxFrame::SetIcon(const wxIcon
& icon
)
343 wxFrameBase::SetIcon(icon
);
345 #if defined(__WIN95__)
348 SendMessage(GetHwnd(), WM_SETICON
,
349 (WPARAM
)TRUE
, (LPARAM
)(HICON
) m_icon
.GetHICON());
355 wxStatusBar
*wxFrame::OnCreateStatusBar(int number
,
358 const wxString
& name
)
360 wxStatusBar
*statusBar
= NULL
;
362 #if wxUSE_NATIVE_STATUSBAR
363 if ( !UsesNativeStatusBar() )
365 statusBar
= (wxStatusBar
*)new wxStatusBarGeneric(this, id
, style
);
370 statusBar
= new wxStatusBar(this, id
, style
, name
);
373 // Set the height according to the font and the border size
374 wxClientDC
dc(statusBar
);
375 dc
.SetFont(statusBar
->GetFont());
378 dc
.GetTextExtent(_T("X"), NULL
, &y
);
380 int height
= (int)( (11*y
)/10 + 2*statusBar
->GetBorderY());
382 statusBar
->SetSize(-1, -1, -1, height
);
384 statusBar
->SetFieldsCount(number
);
389 void wxFrame::PositionStatusBar()
391 if ( !m_frameStatusBar
)
395 GetClientSize(&w
, &h
);
397 m_frameStatusBar
->GetSize(&sw
, &sh
);
399 // Since we wish the status bar to be directly under the client area,
400 // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
401 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
403 #endif // wxUSE_STATUSBAR
405 void wxFrame::DetachMenuBar()
409 m_frameMenuBar
->Detach();
410 m_frameMenuBar
= NULL
;
414 void wxFrame::SetMenuBar(wxMenuBar
*menu_bar
)
422 m_frameMenuBar
= NULL
;
424 // Can set a menubar several times.
425 // TODO: how to prevent a memory leak if you have a currently-unattached
426 // menubar? wxWindows assumes that the frame will delete the menu (otherwise
427 // there are problems for MDI).
428 if (menu_bar
->GetHMenu())
430 m_hMenu
= menu_bar
->GetHMenu();
436 m_hMenu
= menu_bar
->Create();
442 InternalSetMenuBar();
444 m_frameMenuBar
= menu_bar
;
445 menu_bar
->Attach(this);
447 #if 0 // Old code that assumes only one call of SetMenuBar per frame.
454 wxCHECK_RET( !menu_bar
->GetFrame(), wxT("this menubar is already attached") );
457 delete m_frameMenuBar
;
459 m_hMenu
= menu_bar
->Create();
464 InternalSetMenuBar();
466 m_frameMenuBar
= menu_bar
;
467 menu_bar
->Attach(this);
471 void wxFrame::InternalSetMenuBar()
473 if ( !::SetMenu(GetHwnd(), (HMENU
)m_hMenu
) )
475 wxLogLastError("SetMenu");
479 // Responds to colour changes, and passes event on to children.
480 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent
& event
)
482 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
485 if ( m_frameStatusBar
)
487 wxSysColourChangedEvent event2
;
488 event2
.SetEventObject( m_frameStatusBar
);
489 m_frameStatusBar
->GetEventHandler()->ProcessEvent(event2
);
492 // Propagate the event to the non-top-level children
493 wxWindow::OnSysColourChanged(event
);
496 // Pass TRUE to show full screen, FALSE to restore.
497 bool wxFrame::ShowFullScreen(bool show
, long style
)
504 m_fsIsShowing
= TRUE
;
507 wxToolBar
*theToolBar
= GetToolBar();
508 wxStatusBar
*theStatusBar
= GetStatusBar();
513 theToolBar
->GetSize(&dummyWidth
, &m_fsToolBarHeight
);
515 theStatusBar
->GetSize(&dummyWidth
, &m_fsStatusBarHeight
);
517 // zap the toolbar, menubar, and statusbar
519 if ((style
& wxFULLSCREEN_NOTOOLBAR
) && theToolBar
)
521 theToolBar
->SetSize(-1,0);
522 theToolBar
->Show(FALSE
);
525 if (style
& wxFULLSCREEN_NOMENUBAR
)
526 SetMenu((HWND
)GetHWND(), (HMENU
) NULL
);
528 // Save the number of fields in the statusbar
529 if ((style
& wxFULLSCREEN_NOSTATUSBAR
) && theStatusBar
)
531 m_fsStatusBarFields
= theStatusBar
->GetFieldsCount();
532 SetStatusBar((wxStatusBar
*) NULL
);
536 m_fsStatusBarFields
= 0;
538 // zap the frame borders
540 // save the 'normal' window style
541 m_fsOldWindowStyle
= GetWindowLong((HWND
)GetHWND(), GWL_STYLE
);
543 // save the old position, width & height, maximize state
544 m_fsOldSize
= GetRect();
545 m_fsIsMaximized
= IsMaximized();
547 // decide which window style flags to turn off
548 LONG newStyle
= m_fsOldWindowStyle
;
551 if (style
& wxFULLSCREEN_NOBORDER
)
552 offFlags
|= WS_BORDER
;
553 if (style
& wxFULLSCREEN_NOCAPTION
)
554 offFlags
|= (WS_CAPTION
| WS_SYSMENU
);
556 newStyle
&= (~offFlags
);
558 // change our window style to be compatible with full-screen mode
559 SetWindowLong((HWND
)GetHWND(), GWL_STYLE
, newStyle
);
561 // resize to the size of the desktop
565 ::GetWindowRect(GetDesktopWindow(), &rect
);
566 width
= rect
.right
- rect
.left
;
567 height
= rect
.bottom
- rect
.top
;
569 SetSize(width
, height
);
571 // now flush the window style cache and actually go full-screen
572 SetWindowPos((HWND
)GetHWND(), HWND_TOP
, 0, 0, width
, height
, SWP_FRAMECHANGED
);
574 wxSizeEvent
event(wxSize(width
, height
), GetId());
575 GetEventHandler()->ProcessEvent(event
);
584 m_fsIsShowing
= FALSE
;
586 wxToolBar
*theToolBar
= GetToolBar();
588 // restore the toolbar, menubar, and statusbar
589 if (theToolBar
&& (m_fsStyle
& wxFULLSCREEN_NOTOOLBAR
))
591 theToolBar
->SetSize(-1, m_fsToolBarHeight
);
592 theToolBar
->Show(TRUE
);
595 if ((m_fsStyle
& wxFULLSCREEN_NOSTATUSBAR
) && (m_fsStatusBarFields
> 0))
597 CreateStatusBar(m_fsStatusBarFields
);
601 if ((m_fsStyle
& wxFULLSCREEN_NOMENUBAR
) && (m_hMenu
!= 0))
602 SetMenu((HWND
)GetHWND(), (HMENU
)m_hMenu
);
604 Maximize(m_fsIsMaximized
);
605 SetWindowLong((HWND
)GetHWND(),GWL_STYLE
, m_fsOldWindowStyle
);
606 SetWindowPos((HWND
)GetHWND(),HWND_TOP
,m_fsOldSize
.x
, m_fsOldSize
.y
,
607 m_fsOldSize
.width
, m_fsOldSize
.height
, SWP_FRAMECHANGED
);
618 bool wxFrame::MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
, wxWindow
*wx_win
, const wxChar
*title
,
619 int x
, int y
, int width
, int height
, long style
)
622 m_defaultIcon
= (WXHICON
) (wxSTD_FRAME_ICON
? wxSTD_FRAME_ICON
: wxDEFAULT_FRAME_ICON
);
624 // If child windows aren't properly drawn initially, WS_CLIPCHILDREN
625 // could be the culprit. But without it, you can get a lot of flicker.
628 if ((style
& wxCAPTION
) == wxCAPTION
)
629 msflags
= WS_OVERLAPPED
;
633 if (style
& wxMINIMIZE_BOX
)
634 msflags
|= WS_MINIMIZEBOX
;
635 if (style
& wxMAXIMIZE_BOX
)
636 msflags
|= WS_MAXIMIZEBOX
;
637 if (style
& wxTHICK_FRAME
)
638 msflags
|= WS_THICKFRAME
;
639 if (style
& wxSYSTEM_MENU
)
640 msflags
|= WS_SYSMENU
;
641 if ((style
& wxMINIMIZE
) || (style
& wxICONIZE
))
642 msflags
|= WS_MINIMIZE
;
643 if (style
& wxMAXIMIZE
)
644 msflags
|= WS_MAXIMIZE
;
645 if (style
& wxCAPTION
)
646 msflags
|= WS_CAPTION
;
647 if (style
& wxCLIP_CHILDREN
)
648 msflags
|= WS_CLIPCHILDREN
;
650 // Keep this in wxFrame because it saves recoding this function
652 #if wxUSE_ITSY_BITSY && !defined(__WIN32__)
653 if (style
& wxTINY_CAPTION_VERT
)
654 msflags
|= IBS_VERTCAPTION
;
655 if (style
& wxTINY_CAPTION_HORIZ
)
656 msflags
|= IBS_HORZCAPTION
;
658 if (style
& wxTINY_CAPTION_VERT
)
659 msflags
|= WS_CAPTION
;
660 if (style
& wxTINY_CAPTION_HORIZ
)
661 msflags
|= WS_CAPTION
;
663 if ((style
& wxTHICK_FRAME
) == 0)
664 msflags
|= WS_BORDER
;
666 WXDWORD extendedStyle
= MakeExtendedStyle(style
);
668 #if !defined(__WIN16__) && !defined(__SC__)
669 if (style
& wxFRAME_TOOL_WINDOW
)
670 extendedStyle
|= WS_EX_TOOLWINDOW
;
673 if (style
& wxSTAY_ON_TOP
)
674 extendedStyle
|= WS_EX_TOPMOST
;
677 if ( !wxWindow::MSWCreate(id
, parent
, wclass
, wx_win
, title
, x
, y
, width
, height
,
678 msflags
, NULL
, extendedStyle
) )
681 // Seems to be necessary if we use WS_POPUP
682 // style instead of WS_OVERLAPPED
683 if (width
> -1 && height
> -1)
684 ::PostMessage(GetHwnd(), WM_SIZE
, SIZE_RESTORED
, MAKELPARAM(width
, height
));
689 // Default activation behaviour - set the focus for the first child
691 void wxFrame::OnActivate(wxActivateEvent
& event
)
693 if ( !event
.GetActive() )
700 wxLogTrace(_T("focus"), _T("wxFrame %08x activated."), m_hWnd
);
702 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
704 node
= node
->GetNext() )
706 // FIXME all this is totally bogus - we need to do the same as wxPanel,
707 // but how to do it without duplicating the code?
710 wxWindow
*child
= node
->GetData();
712 if ( !child
->IsTopLevel()
714 && !wxDynamicCast(child
, wxToolBar
)
715 #endif // wxUSE_TOOLBAR
717 && !wxDynamicCast(child
, wxStatusBar
)
718 #endif // wxUSE_STATUSBAR
727 // ----------------------------------------------------------------------------
728 // tool/status bar stuff
729 // ----------------------------------------------------------------------------
733 wxToolBar
* wxFrame::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
735 if ( wxFrameBase::CreateToolBar(style
, id
, name
) )
740 return m_frameToolBar
;
743 void wxFrame::PositionToolBar()
746 ::GetClientRect(GetHwnd(), &rect
);
749 if ( GetStatusBar() )
751 int statusX
, statusY
;
752 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
753 rect
.bottom
-= statusY
;
755 #endif // wxUSE_STATUSBAR
757 if ( GetToolBar() && GetToolBar()->IsShown() )
760 GetToolBar()->GetSize(&tw
, &th
);
762 if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
771 // Use the 'real' MSW position here
772 GetToolBar()->SetSize(0, 0, tw
, th
, wxSIZE_NO_ADJUSTMENTS
);
775 #endif // wxUSE_TOOLBAR
777 // ----------------------------------------------------------------------------
778 // frame state (iconized/maximized/...)
779 // ----------------------------------------------------------------------------
781 // propagate our state change to all child frames: this allows us to emulate X
782 // Windows behaviour where child frames float independently of the parent one
783 // on the desktop, but are iconized/restored with it
784 void wxFrame::IconizeChildFrames(bool bIconize
)
786 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
788 node
= node
->GetNext() )
790 wxWindow
*win
= node
->GetData();
792 // the child MDI frames are a special case and should not be touched by
793 // the parent frame - instead, they are managed by the user
794 wxFrame
*frame
= wxDynamicCast(win
, wxFrame
);
795 if ( frame
&& !wxDynamicCast(frame
, wxMDIChildFrame
) )
797 frame
->Iconize(bIconize
);
802 // ===========================================================================
803 // message processing
804 // ===========================================================================
806 // ---------------------------------------------------------------------------
808 // ---------------------------------------------------------------------------
810 bool wxFrame::MSWTranslateMessage(WXMSG
* pMsg
)
812 if ( wxWindow::MSWTranslateMessage(pMsg
) )
815 // try the menu bar accels
816 wxMenuBar
*menuBar
= GetMenuBar();
820 const wxAcceleratorTable
& acceleratorTable
= menuBar
->GetAccelTable();
821 return acceleratorTable
.Translate(this, pMsg
);
824 // ---------------------------------------------------------------------------
825 // our private (non virtual) message handlers
826 // ---------------------------------------------------------------------------
828 bool wxFrame::HandlePaint()
831 if ( GetUpdateRect(GetHwnd(), &rect
, FALSE
) )
835 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
836 : (HICON
)m_defaultIcon
;
838 // Hold a pointer to the dc so long as the OnPaint() message
839 // is being processed
841 HDC hdc
= ::BeginPaint(GetHwnd(), &ps
);
843 // Erase background before painting or we get white background
844 MSWDefWindowProc(WM_ICONERASEBKGND
, (WORD
)(LONG
)ps
.hdc
, 0L);
849 ::GetClientRect(GetHwnd(), &rect
);
851 // FIXME: why hardcoded?
852 static const int icon_width
= 32;
853 static const int icon_height
= 32;
855 int icon_x
= (int)((rect
.right
- icon_width
)/2);
856 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
858 ::DrawIcon(hdc
, icon_x
, icon_y
, hIcon
);
861 ::EndPaint(GetHwnd(), &ps
);
867 return wxWindow::HandlePaint();
872 // nothing to paint - processed
877 bool wxFrame::HandleSize(int x
, int y
, WXUINT id
)
879 bool processed
= FALSE
;
884 // only do it it if we were iconized before, otherwise resizing the
885 // parent frame has a curious side effect of bringing it under it's
890 // restore all child frames too
891 IconizeChildFrames(FALSE
);
900 // iconize all child frames too
901 IconizeChildFrames(TRUE
);
912 wxSizeEvent
event(wxSize(x
, y
), m_windowId
);
913 event
.SetEventObject( this );
914 processed
= GetEventHandler()->ProcessEvent(event
);
920 bool wxFrame::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
924 // In case it's e.g. a toolbar.
925 wxWindow
*win
= wxFindWinFromHandle(control
);
927 return win
->MSWCommand(cmd
, id
);
930 // handle here commands from menus and accelerators
931 if ( cmd
== 0 || cmd
== 1 )
933 if ( wxCurrentPopupMenu
)
935 wxMenu
*popupMenu
= wxCurrentPopupMenu
;
936 wxCurrentPopupMenu
= NULL
;
938 return popupMenu
->MSWCommand(cmd
, id
);
941 if ( ProcessCommand(id
) )
950 bool wxFrame::HandleMenuSelect(WXWORD nItem
, WXWORD flags
, WXHMENU hMenu
)
953 if ( flags
== 0xFFFF && hMenu
== 0 )
955 // menu was removed from screen
958 else if ( !(flags
& MF_POPUP
) && !(flags
& MF_SEPARATOR
) )
964 // don't give hints for separators (doesn't make sense) nor for the
965 // items opening popup menus (they don't have them anyhow)
969 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, item
);
970 event
.SetEventObject( this );
972 return GetEventHandler()->ProcessEvent(event
);
975 // ---------------------------------------------------------------------------
976 // the window proc for wxFrame
977 // ---------------------------------------------------------------------------
979 long wxFrame::MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
982 bool processed
= FALSE
;
987 // if we can't close, tell the system that we processed the
988 // message - otherwise it would close us
989 processed
= !Close();
996 UnpackCommand((WXWPARAM
)wParam
, (WXLPARAM
)lParam
,
999 processed
= HandleCommand(id
, cmd
, (WXHWND
)hwnd
);
1007 UnpackMenuSelect(wParam
, lParam
, &item
, &flags
, &hmenu
);
1009 processed
= HandleMenuSelect(item
, flags
, hmenu
);
1014 processed
= HandlePaint();
1017 case WM_QUERYDRAGICON
:
1019 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
1020 : (HICON
)(m_defaultIcon
);
1022 processed
= rc
!= 0;
1027 processed
= HandleSize(LOWORD(lParam
), HIWORD(lParam
), wParam
);
1032 rc
= wxWindow::MSWWindowProc(message
, wParam
, lParam
);