bogus assert removed, optimized (and removed a bug in process of doing it)
[wxWidgets.git] / src / msw / frame.cpp
index 1a7f2bb7a600992e21f6c77dac20fe1c2d6c17c7..29e363328cec9d639566ab4043c7ea857896b339 100644 (file)
@@ -40,7 +40,7 @@
 #undef LoadAccelerators
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 #include <wx/msw/statbr95.h>
 #endif
 
@@ -62,7 +62,7 @@ END_EVENT_TABLE()
 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
 bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
 bool wxFrame::m_useNativeStatusBar = FALSE;
@@ -352,17 +352,12 @@ void wxFrame::SetIcon(const wxIcon& icon)
 #endif
 }
 
-void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel)
-{
-    m_acceleratorTable = accel;
-}
-
 wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
     const wxString& name)
 {
     wxStatusBar *statusBar = NULL;
 
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
     if (UsesNativeStatusBar())
     {
         statusBar = new wxStatusBar95(this, id, style);
@@ -426,7 +421,7 @@ void wxFrame::PositionStatusBar(void)
 {
   // native status bar positions itself
   if (m_frameStatusBar
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
    && !m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95))
 #endif
     )
@@ -595,7 +590,7 @@ void wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *
 
   // Keep this in wxFrame because it saves recoding this function
   // in wxTinyFrame
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
   if (style & wxTINY_CAPTION_VERT)
     msflags |= IBS_VERTCAPTION;
   if (style & wxTINY_CAPTION_HORIZ)
@@ -688,6 +683,12 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
   switch (id)
   {
     case SIZENORMAL:
+      // only do it it if we were iconized before, otherwise resizing the
+      // parent frame has a curious side effect of bringing it under it's
+      // children
+      if ( !m_iconized )
+        break;
+
       // restore all child frames too
       IconizeChildFrames(FALSE);
 
@@ -695,20 +696,20 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
 
     case SIZEFULLSCREEN:
       m_iconized = FALSE;
-    break;
+      break;
 
     case SIZEICONIC:
       // iconize all child frames too
       IconizeChildFrames(TRUE);
 
       m_iconized = TRUE;
-    break;
+      break;
   }
 
  if (!m_iconized)
  {
   // forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
   if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
   {
     wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
@@ -803,7 +804,7 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
 void wxFrame::OnSize(wxSizeEvent& event)
 {
   // if we're using constraints - do use them
-  #if USE_CONSTRAINTS
+  #if wxUSE_CONSTRAINTS
     if ( GetAutoLayout() ) {
       Layout();
       return;