]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
added font encoding support
[wxWidgets.git] / src / msw / frame.cpp
index 252fc36d9a20effe10572c1d5d0a52a29bab3bc2..9e41888e34877848fc9408e2d525f9a0cfd0d50f 100644 (file)
@@ -154,6 +154,9 @@ wxFrame::~wxFrame()
   // For some reason, wxWindows can activate another task altogether
   // when a frame is destroyed after a modal dialog has been invoked.
   // Try to bring the parent to the top.
+  // MT:Only do this if this frame is currently the active window, else weird
+  // things start to happen
+  if ( wxGetActiveWindow() == this )
   if (GetParent() && GetParent()->GetHWND())
     ::BringWindowToTop((HWND) GetParent()->GetHWND());
 }
@@ -360,7 +363,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,
-               _T("recreating status bar in wxFrame") );
+               T("recreating status bar in wxFrame") );
 
   m_frameStatusBar = OnCreateStatusBar(number, style, id,
     name);
@@ -375,14 +378,14 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id,
 
 void wxFrame::SetStatusText(const wxString& text, int number)
 {
-  wxCHECK_RET( m_frameStatusBar != NULL, _T("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, _T("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();
@@ -426,7 +429,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menu_bar)
         return;
     }
 
-    wxCHECK_RET( !menu_bar->GetFrame(), _T("this menubar is already attached") );
+    wxCHECK_RET( !menu_bar->GetFrame(), T("this menubar is already attached") );
 
     if (m_frameMenuBar)
         delete m_frameMenuBar;
@@ -668,10 +671,8 @@ bool wxFrame::ProcessCommand(int id)
         return FALSE;
 
     wxMenuItem *item = bar->FindItemForId(id);
-    if ( !item )
-        return FALSE;
 
-    if ( item->IsCheckable() )
+    if ( item &&  item->IsCheckable() )
     {
         bar->Check(id, !bar->IsChecked(id)) ;
     }
@@ -732,7 +733,7 @@ void wxFrame::ClientToScreen(int *x, int *y) const
 wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
 {
     wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
-                 _T("recreating toolbar in wxFrame") );
+                 T("recreating toolbar in wxFrame") );
 
     wxToolBar* toolBar = OnCreateToolBar(style, id, name);
     if (toolBar)