extern wxWindowList wxModelessWindows;
extern wxList WXDLLEXPORT wxPendingDelete;
-extern char wxFrameClassName[];
+extern wxChar wxFrameClassName[];
extern wxMenu *wxCurrentPopupMenu;
#if !USE_SHARED_LIBRARY
m_hwndToolTip = 0;
#endif
- if (!parent)
- wxTopLevelWindows.Append(this);
-
SetName(name);
m_windowStyle = style;
m_frameMenuBar = NULL;
if ((m_windowStyle & wxFRAME_FLOAT_ON_PARENT) == 0)
parent = NULL;
+ if (!parent)
+ wxTopLevelWindows.Append(this);
+
MSWCreate(m_windowId, parent, wxFrameClassName, this, title,
x, y, width, height, style);
{
// 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);
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();
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;
*
*/
-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)
{
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
- for(wxNode *node = GetChildren().First(); node; node = node->Next())
- {
- // Find a child that's a subwindow, but not a dialog box.
- wxWindow *child = (wxWindow *)node->Data();
- if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
- !child->IsKindOf(CLASSINFO(wxDialog)))
+ for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
{
- child->SetFocus();
- return;
+ // FIXME all this is totally bogus - we need to do the same as wxPanel,
+ // but how to do it without duplicating the code?
+
+ // restore focus
+ wxWindow *child = node->GetData();
+
+ if ( !child->IsTopLevel()
+#if wxUSE_TOOLBAR
+ && !wxDynamicCast(child, wxToolBar)
+#endif // wxUSE_TOOLBAR
+#if wxUSE_STATUSBAR
+ && !wxDynamicCast(child, wxStatusBar)
+#endif // wxUSE_STATUSBAR
+ )
+ {
+ child->SetFocus();
+ return;
+ }
}
- }
}
// The default implementation for the close window event.
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)