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 // MT:Only do this if this frame is currently the active window, else weird
158 // things start to happen
159 if ( wxGetActiveWindow() == this )
160 if (GetParent() && GetParent()->GetHWND())
161 ::BringWindowToTop((HWND
) GetParent()->GetHWND());
164 // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
165 void wxFrame::DoGetClientSize(int *x
, int *y
) const
168 ::GetClientRect(GetHwnd(), &rect
);
170 if ( GetStatusBar() )
172 int statusX
, statusY
;
173 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
174 rect
.bottom
-= statusY
;
177 wxPoint
pt(GetClientAreaOrigin());
187 // Set the client size (i.e. leave the calculation of borders etc.
189 void wxFrame::DoSetClientSize(int width
, int height
)
191 HWND hWnd
= GetHwnd();
194 ::GetClientRect(hWnd
, &rect
);
197 GetWindowRect(hWnd
, &rect2
);
199 // Find the difference between the entire window (title bar and all)
200 // and the client area; add this to the new client size to move the
202 int actual_width
= rect2
.right
- rect2
.left
- rect
.right
+ width
;
203 int actual_height
= rect2
.bottom
- rect2
.top
- rect
.bottom
+ height
;
205 if ( GetStatusBar() )
207 int statusX
, statusY
;
208 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
209 actual_height
+= statusY
;
212 wxPoint
pt(GetClientAreaOrigin());
213 actual_width
+= pt
.y
;
214 actual_height
+= pt
.x
;
217 point
.x
= rect2
.left
;
220 MoveWindow(hWnd
, point
.x
, point
.y
, actual_width
, actual_height
, (BOOL
)TRUE
);
222 wxSizeEvent
event(wxSize(width
, height
), m_windowId
);
223 event
.SetEventObject( this );
224 GetEventHandler()->ProcessEvent(event
);
227 void wxFrame::DoGetSize(int *width
, int *height
) const
230 GetWindowRect(GetHwnd(), &rect
);
231 *width
= rect
.right
- rect
.left
;
232 *height
= rect
.bottom
- rect
.top
;
235 void wxFrame::DoGetPosition(int *x
, int *y
) const
238 GetWindowRect(GetHwnd(), &rect
);
247 bool wxFrame::Show(bool show
)
257 // Try to highlight the correct window (the parent)
261 hWndParent
= (HWND
) GetParent()->GetHWND();
263 ::BringWindowToTop(hWndParent
);
267 ShowWindow(GetHwnd(), (BOOL
)cshow
);
270 BringWindowToTop(GetHwnd());
272 wxActivateEvent
event(wxEVT_ACTIVATE
, TRUE
, m_windowId
);
273 event
.SetEventObject( this );
274 GetEventHandler()->ProcessEvent(event
);
279 void wxFrame::Iconize(bool iconize
)
289 ShowWindow(GetHwnd(), (BOOL
)cshow
);
290 m_iconized
= iconize
;
293 // Equivalent to maximize/restore in Windows
294 void wxFrame::Maximize(bool maximize
)
302 ShowWindow(GetHwnd(), cshow
);
306 bool wxFrame::IsIconized() const
308 ((wxFrame
*)this)->m_iconized
= (::IsIconic(GetHwnd()) != 0);
313 bool wxFrame::IsMaximized() const
315 return (::IsZoomed(GetHwnd()) != 0) ;
318 void wxFrame::SetIcon(const wxIcon
& icon
)
321 #if defined(__WIN95__)
323 SendMessage(GetHwnd(), WM_SETICON
,
324 (WPARAM
)TRUE
, (LPARAM
)(HICON
) m_icon
.GetHICON());
329 wxStatusBar
*wxFrame::OnCreateStatusBar(int number
, long style
, wxWindowID id
,
330 const wxString
& name
)
332 wxStatusBar
*statusBar
= NULL
;
334 #if wxUSE_NATIVE_STATUSBAR
335 if (UsesNativeStatusBar())
337 statusBar
= new wxStatusBar95(this, id
, style
);
342 statusBar
= new wxStatusBar(this, id
, wxPoint(0, 0), wxSize(100, 20),
345 // Set the height according to the font and the border size
346 wxClientDC
dc(statusBar
);
347 dc
.SetFont(statusBar
->GetFont());
350 dc
.GetTextExtent("X", &x
, &y
);
352 int height
= (int)( (y
* 1.1) + 2* statusBar
->GetBorderY());
354 statusBar
->SetSize(-1, -1, 100, height
);
357 statusBar
->SetFieldsCount(number
);
361 wxStatusBar
* wxFrame::CreateStatusBar(int number
, long style
, wxWindowID id
,
362 const wxString
& name
)
364 // VZ: calling CreateStatusBar twice is an error - why anyone would do it?
365 wxCHECK_MSG( m_frameStatusBar
== NULL
, FALSE
,
366 wxT("recreating status bar in wxFrame") );
368 m_frameStatusBar
= OnCreateStatusBar(number
, style
, id
,
370 if ( m_frameStatusBar
)
373 return m_frameStatusBar
;
379 void wxFrame::SetStatusText(const wxString
& text
, int number
)
381 wxCHECK_RET( m_frameStatusBar
!= NULL
, wxT("no statusbar to set text for") );
383 m_frameStatusBar
->SetStatusText(text
, number
);
386 void wxFrame::SetStatusWidths(int n
, const int widths_field
[])
388 wxCHECK_RET( m_frameStatusBar
!= NULL
, wxT("no statusbar to set widths for") );
390 m_frameStatusBar
->SetStatusWidths(n
, widths_field
);
394 void wxFrame::PositionStatusBar()
396 // native status bar positions itself
398 #if wxUSE_NATIVE_STATUSBAR
399 && !m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
))
404 GetClientSize(&w
, &h
);
406 m_frameStatusBar
->GetSize(&sw
, &sh
);
408 // Since we wish the status bar to be directly under the client area,
409 // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
410 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
413 #endif // wxUSE_STATUSBAR
415 void wxFrame::DetachMenuBar()
419 m_frameMenuBar
->Detach();
420 m_frameMenuBar
= NULL
;
424 void wxFrame::SetMenuBar(wxMenuBar
*menu_bar
)
432 wxCHECK_RET( !menu_bar
->GetFrame(), wxT("this menubar is already attached") );
435 delete m_frameMenuBar
;
437 m_hMenu
= menu_bar
->Create();
442 InternalSetMenuBar();
444 m_frameMenuBar
= menu_bar
;
445 menu_bar
->Attach(this);
448 void wxFrame::InternalSetMenuBar()
450 if ( !::SetMenu(GetHwnd(), (HMENU
)m_hMenu
) )
452 wxLogLastError("SetMenu");
456 // Responds to colour changes, and passes event on to children.
457 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent
& event
)
459 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
462 if ( m_frameStatusBar
)
464 wxSysColourChangedEvent event2
;
465 event2
.SetEventObject( m_frameStatusBar
);
466 m_frameStatusBar
->GetEventHandler()->ProcessEvent(event2
);
469 // Propagate the event to the non-top-level children
470 wxWindow::OnSysColourChanged(event
);
478 bool wxFrame::MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
, wxWindow
*wx_win
, const wxChar
*title
,
479 int x
, int y
, int width
, int height
, long style
)
482 m_defaultIcon
= (WXHICON
) (wxSTD_FRAME_ICON
? wxSTD_FRAME_ICON
: wxDEFAULT_FRAME_ICON
);
484 // If child windows aren't properly drawn initially, WS_CLIPCHILDREN
485 // could be the culprit. But without it, you can get a lot of flicker.
488 if ((style
& wxCAPTION
) == wxCAPTION
)
489 msflags
= WS_OVERLAPPED
;
493 if (style
& wxMINIMIZE_BOX
)
494 msflags
|= WS_MINIMIZEBOX
;
495 if (style
& wxMAXIMIZE_BOX
)
496 msflags
|= WS_MAXIMIZEBOX
;
497 if (style
& wxTHICK_FRAME
)
498 msflags
|= WS_THICKFRAME
;
499 if (style
& wxSYSTEM_MENU
)
500 msflags
|= WS_SYSMENU
;
501 if ((style
& wxMINIMIZE
) || (style
& wxICONIZE
))
502 msflags
|= WS_MINIMIZE
;
503 if (style
& wxMAXIMIZE
)
504 msflags
|= WS_MAXIMIZE
;
505 if (style
& wxCAPTION
)
506 msflags
|= WS_CAPTION
;
507 if (style
& wxCLIP_CHILDREN
)
508 msflags
|= WS_CLIPCHILDREN
;
510 // Keep this in wxFrame because it saves recoding this function
513 if (style
& wxTINY_CAPTION_VERT
)
514 msflags
|= IBS_VERTCAPTION
;
515 if (style
& wxTINY_CAPTION_HORIZ
)
516 msflags
|= IBS_HORZCAPTION
;
518 if (style
& wxTINY_CAPTION_VERT
)
519 msflags
|= WS_CAPTION
;
520 if (style
& wxTINY_CAPTION_HORIZ
)
521 msflags
|= WS_CAPTION
;
523 if ((style
& wxTHICK_FRAME
) == 0)
524 msflags
|= WS_BORDER
;
526 WXDWORD extendedStyle
= MakeExtendedStyle(style
);
528 #if !defined(__WIN16__) && !defined(__SC__)
529 if (style
& wxFRAME_TOOL_WINDOW
)
530 extendedStyle
|= WS_EX_TOOLWINDOW
;
533 if (style
& wxSTAY_ON_TOP
)
534 extendedStyle
|= WS_EX_TOPMOST
;
537 if ( !wxWindow::MSWCreate(id
, parent
, wclass
, wx_win
, title
, x
, y
, width
, height
,
538 msflags
, NULL
, extendedStyle
) )
541 // Seems to be necessary if we use WS_POPUP
542 // style instead of WS_OVERLAPPED
543 if (width
> -1 && height
> -1)
544 ::PostMessage(GetHwnd(), WM_SIZE
, SIZE_RESTORED
, MAKELPARAM(width
, height
));
549 // Default resizing behaviour - if only ONE subwindow, resize to client
551 void wxFrame::OnSize(wxSizeEvent
& event
)
553 // if we're using constraints - do use them
554 #if wxUSE_CONSTRAINTS
555 if ( GetAutoLayout() )
562 // do we have _exactly_ one child?
563 wxWindow
*child
= NULL
;
564 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
566 node
= node
->GetNext() )
568 wxWindow
*win
= node
->GetData();
569 if ( !win
->IsTopLevel()
571 && (win
!= GetStatusBar())
572 #endif // wxUSE_STATUSBAR
574 && (win
!= GetToolBar())
575 #endif // wxUSE_TOOLBAR
579 return; // it's our second subwindow - nothing to do
585 // we have exactly one child - set it's size to fill the whole frame
586 int clientW
, clientH
;
587 GetClientSize(&clientW
, &clientH
);
592 child
->SetSize(x
, y
, clientW
, clientH
);
596 // Default activation behaviour - set the focus for the first child
598 void wxFrame::OnActivate(wxActivateEvent
& event
)
600 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
602 node
= node
->GetNext() )
604 // FIXME all this is totally bogus - we need to do the same as wxPanel,
605 // but how to do it without duplicating the code?
608 wxWindow
*child
= node
->GetData();
610 if ( !child
->IsTopLevel()
612 && !wxDynamicCast(child
, wxToolBar
)
613 #endif // wxUSE_TOOLBAR
615 && !wxDynamicCast(child
, wxStatusBar
)
616 #endif // wxUSE_STATUSBAR
625 // The default implementation for the close window event.
626 void wxFrame::OnCloseWindow(wxCloseEvent
& event
)
631 // Destroy the window (delayed, if a managed window)
632 bool wxFrame::Destroy()
634 if (!wxPendingDelete
.Member(this))
635 wxPendingDelete
.Append(this);
639 // Default menu selection behaviour - display a help string
640 void wxFrame::OnMenuHighlight(wxMenuEvent
& event
)
645 int menuId
= event
.GetMenuId();
648 wxMenuBar
*menuBar
= GetMenuBar();
649 if (menuBar
&& menuBar
->FindItem(menuId
))
651 help
= menuBar
->GetHelpString(menuId
);
655 // set status text even if the string is empty - this will at
656 // least remove the string from the item which was previously
662 wxMenuBar
*wxFrame::GetMenuBar() const
664 return m_frameMenuBar
;
667 bool wxFrame::ProcessCommand(int id
)
669 wxMenuBar
*bar
= GetMenuBar() ;
673 wxMenuItem
*item
= bar
->FindItem(id
);
674 if ( item
&& item
->IsCheckable() )
679 wxCommandEvent
commandEvent(wxEVT_COMMAND_MENU_SELECTED
, id
);
680 commandEvent
.SetInt( id
);
681 commandEvent
.SetEventObject( this );
683 return GetEventHandler()->ProcessEvent(commandEvent
);
686 // Checks if there is a toolbar, and returns the first free client position
687 wxPoint
wxFrame::GetClientAreaOrigin() const
693 GetToolBar()->GetSize(& w
, & h
);
695 if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
707 void wxFrame::DoScreenToClient(int *x
, int *y
) const
709 wxWindow::DoScreenToClient(x
, y
);
711 // We may be faking the client origin.
712 // So a window that's really at (0, 30) may appear
713 // (to wxWin apps) to be at (0, 0).
714 wxPoint
pt(GetClientAreaOrigin());
719 void wxFrame::DoClientToScreen(int *x
, int *y
) const
721 // We may be faking the client origin.
722 // So a window that's really at (0, 30) may appear
723 // (to wxWin apps) to be at (0, 0).
724 wxPoint
pt1(GetClientAreaOrigin());
728 wxWindow::DoClientToScreen(x
, y
);
732 wxToolBar
* wxFrame::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
734 wxCHECK_MSG( m_frameToolBar
== NULL
, FALSE
,
735 wxT("recreating toolbar in wxFrame") );
737 wxToolBar
* toolBar
= OnCreateToolBar(style
, id
, name
);
750 wxToolBar
* wxFrame::OnCreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
752 return new wxToolBar(this, id
, wxDefaultPosition
, wxDefaultSize
, style
, name
);
755 void wxFrame::PositionToolBar()
758 ::GetClientRect(GetHwnd(), &rect
);
760 if ( GetStatusBar() )
762 int statusX
, statusY
;
763 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
764 rect
.bottom
-= statusY
;
770 GetToolBar()->GetSize(& tw
, & th
);
772 if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
774 // Use the 'real' MSW position
775 GetToolBar()->SetSize(0, 0, tw
, rect
.bottom
, wxSIZE_NO_ADJUSTMENTS
);
779 // Use the 'real' MSW position
780 GetToolBar()->SetSize(0, 0, rect
.right
, th
, wxSIZE_NO_ADJUSTMENTS
);
784 #endif // wxUSE_TOOLBAR
786 // propagate our state change to all child frames: this allows us to emulate X
787 // Windows behaviour where child frames float independently of the parent one
788 // on the desktop, but are iconized/restored with it
789 void wxFrame::IconizeChildFrames(bool bIconize
)
791 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
793 node
= node
->GetNext() )
795 wxWindow
*win
= node
->GetData();
797 if ( win
->IsKindOf(CLASSINFO(wxFrame
)) )
799 ((wxFrame
*)win
)->Iconize(bIconize
);
805 // make the window modal (all other windows unresponsive)
806 void wxFrame::MakeModal(bool modal
)
809 wxEnableTopLevelWindows(FALSE
);
810 Enable(TRUE
); // keep this window enabled
813 wxEnableTopLevelWindows(TRUE
);
818 // ===========================================================================
819 // message processing
820 // ===========================================================================
822 // ---------------------------------------------------------------------------
824 // ---------------------------------------------------------------------------
826 bool wxFrame::MSWTranslateMessage(WXMSG
* pMsg
)
828 if ( wxWindow::MSWTranslateMessage(pMsg
) )
831 // try the menu bar accels
832 wxMenuBar
*menuBar
= GetMenuBar();
836 const wxAcceleratorTable
& acceleratorTable
= menuBar
->GetAccelTable();
837 return acceleratorTable
.Translate(this, pMsg
);
840 // ---------------------------------------------------------------------------
841 // our private (non virtual) message handlers
842 // ---------------------------------------------------------------------------
844 bool wxFrame::HandlePaint()
847 if ( GetUpdateRect(GetHwnd(), &rect
, FALSE
) )
851 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
852 : (HICON
)m_defaultIcon
;
854 // Hold a pointer to the dc so long as the OnPaint() message
855 // is being processed
857 HDC hdc
= ::BeginPaint(GetHwnd(), &ps
);
859 // Erase background before painting or we get white background
860 MSWDefWindowProc(WM_ICONERASEBKGND
, (WORD
)(LONG
)ps
.hdc
, 0L);
865 ::GetClientRect(GetHwnd(), &rect
);
867 // FIXME: why hardcoded?
868 static const int icon_width
= 32;
869 static const int icon_height
= 32;
871 int icon_x
= (int)((rect
.right
- icon_width
)/2);
872 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
874 ::DrawIcon(hdc
, icon_x
, icon_y
, hIcon
);
877 ::EndPaint(GetHwnd(), &ps
);
883 return wxWindow::HandlePaint();
888 // nothing to paint - processed
893 bool wxFrame::HandleSize(int x
, int y
, WXUINT id
)
895 bool processed
= FALSE
;
900 // only do it it if we were iconized before, otherwise resizing the
901 // parent frame has a curious side effect of bringing it under it's
906 // restore all child frames too
907 IconizeChildFrames(FALSE
);
916 // iconize all child frames too
917 IconizeChildFrames(TRUE
);
925 // forward WM_SIZE to status bar control
926 #if wxUSE_NATIVE_STATUSBAR
927 if (m_frameStatusBar
&& m_frameStatusBar
->IsKindOf(CLASSINFO(wxStatusBar95
)))
929 wxSizeEvent
event(wxSize(x
, y
), m_frameStatusBar
->GetId());
930 event
.SetEventObject( m_frameStatusBar
);
932 ((wxStatusBar95
*)m_frameStatusBar
)->OnSize(event
);
934 #endif // wxUSE_NATIVE_STATUSBAR
939 wxSizeEvent
event(wxSize(x
, y
), m_windowId
);
940 event
.SetEventObject( this );
941 processed
= GetEventHandler()->ProcessEvent(event
);
947 bool wxFrame::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
951 // In case it's e.g. a toolbar.
952 wxWindow
*win
= wxFindWinFromHandle(control
);
954 return win
->MSWCommand(cmd
, id
);
957 // handle here commands from menus and accelerators
958 if ( cmd
== 0 || cmd
== 1 )
960 if ( wxCurrentPopupMenu
)
962 wxMenu
*popupMenu
= wxCurrentPopupMenu
;
963 wxCurrentPopupMenu
= NULL
;
965 return popupMenu
->MSWCommand(cmd
, id
);
968 if ( ProcessCommand(id
) )
977 bool wxFrame::HandleMenuSelect(WXWORD nItem
, WXWORD flags
, WXHMENU hMenu
)
980 if ( flags
== 0xFFFF && hMenu
== 0 )
982 // menu was removed from screen
985 else if ( !(flags
& MF_POPUP
) && !(flags
& MF_SEPARATOR
) )
991 // don't give hints for separators (doesn't make sense) nor for the
992 // items opening popup menus (they don't have them anyhow)
996 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, item
);
997 event
.SetEventObject( this );
999 return GetEventHandler()->ProcessEvent(event
);
1002 // ---------------------------------------------------------------------------
1003 // the window proc for wxFrame
1004 // ---------------------------------------------------------------------------
1006 long wxFrame::MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
1009 bool processed
= FALSE
;
1014 // if we can't close, tell the system that we processed the
1015 // message - otherwise it would close us
1016 processed
= !Close();
1023 UnpackCommand((WXWPARAM
)wParam
, (WXLPARAM
)lParam
,
1026 processed
= HandleCommand(id
, cmd
, (WXHWND
)hwnd
);
1034 UnpackMenuSelect(wParam
, lParam
, &item
, &flags
, &hmenu
);
1036 processed
= HandleMenuSelect(item
, flags
, hmenu
);
1041 processed
= HandlePaint();
1044 case WM_QUERYDRAGICON
:
1046 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
1047 : (HICON
)(m_defaultIcon
);
1049 processed
= rc
!= 0;
1054 processed
= HandleSize(LOWORD(lParam
), HIWORD(lParam
), wParam
);
1059 rc
= wxWindow::MSWWindowProc(message
, wParam
, lParam
);