X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b54238992fada5b370ff7ac7f0f62913622c5c5f..a4f964122df05b83a7753ea50fb0831b9781822d:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 2c459e4c3a..48d39d7495 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -43,7 +43,7 @@ extern wxWindowList wxModelessWindows; extern wxList WXDLLEXPORT wxPendingDelete; -extern char wxFrameClassName[]; +extern wxChar wxFrameClassName[]; extern wxMenu *wxCurrentPopupMenu; #if !USE_SHARED_LIBRARY @@ -346,6 +346,7 @@ void wxFrame::SetIcon(const wxIcon& icon) #endif } +#if wxUSE_STATUSBAR wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) { @@ -383,7 +384,7 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, { // VZ: calling CreateStatusBar twice is an error - why anyone would do it? wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, - "recreating status bar in wxFrame" ); + _T("recreating status bar in wxFrame") ); m_frameStatusBar = OnCreateStatusBar(number, style, id, name); @@ -398,14 +399,14 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, void wxFrame::SetStatusText(const wxString& text, int number) { - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" ); + wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") ); m_frameStatusBar->SetStatusText(text, number); } void wxFrame::SetStatusWidths(int n, const int widths_field[]) { - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" ); + wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") ); m_frameStatusBar->SetStatusWidths(n, widths_field); PositionStatusBar(); @@ -430,6 +431,7 @@ void wxFrame::PositionStatusBar() m_frameStatusBar->SetSize(0, h, w, sh); } } +#endif // wxUSE_STATUSBAR void wxFrame::SetMenuBar(wxMenuBar *menu_bar) { @@ -439,7 +441,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menu_bar) return; } - wxCHECK_RET( !menu_bar->GetFrame(), "this menubar is already attached" ); + wxCHECK_RET( !menu_bar->GetFrame(), _T("this menubar is already attached") ); if (m_frameMenuBar) delete m_frameMenuBar; @@ -485,7 +487,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) * */ -bool wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title, +bool wxFrame::MSWCreate(int id, wxWindow *parent, const wxChar *wclass, wxWindow *wx_win, const wxChar *title, int x, int y, int width, int height, long style) { @@ -571,13 +573,19 @@ void wxFrame::OnSize(wxSizeEvent& event) // do we have _exactly_ one child? wxWindow *child = NULL; - for ( wxNode *node = GetChildren().First(); node; node = node->Next() ) + for ( wxWindowList::Node *node = GetChildren().GetFirst(); + node; + node = node->GetNext() ) { - wxWindow *win = (wxWindow *)node->Data(); - if ( !win->IsKindOf(CLASSINFO(wxFrame)) && - !win->IsKindOf(CLASSINFO(wxDialog)) && - (win != GetStatusBar()) && - (win != GetToolBar()) ) + wxWindow *win = node->GetData(); + if ( !win->IsTopLevel() +#if wxUSE_STATUSBAR + && (win != GetStatusBar()) +#endif // wxUSE_STATUSBAR +#if wxUSE_TOOLBAR + && (win != GetToolBar()) +#endif // wxUSE_TOOLBAR + ) { if ( child ) return; // it's our second subwindow - nothing to do @@ -720,10 +728,11 @@ void wxFrame::ClientToScreen(int *x, int *y) const wxWindow::ClientToScreen(x, y); } +#if wxUSE_TOOLBAR wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE, - "recreating toolbar in wxFrame" ); + _T("recreating toolbar in wxFrame") ); wxToolBar* toolBar = OnCreateToolBar(style, id, name); if (toolBar) @@ -772,6 +781,7 @@ void wxFrame::PositionToolBar() } } } +#endif // wxUSE_TOOLBAR // propagate our state change to all child frames: this allows us to emulate X // Windows behaviour where child frames float independently of the parent one