]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
added FreeBSD
[wxWidgets.git] / src / msw / frame.cpp
index 70feafee9398637fcca994fb916987d45b715d1e..368784f45910db2fb31d416f11b60f0a37f33312 100644 (file)
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+    #pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx/setup.h"
-#include "wx/frame.h"
-#include "wx/menu.h"
-#include "wx/app.h"
-#include "wx/utils.h"
-#include "wx/dialog.h"
-#include "wx/settings.h"
-#include "wx/dcclient.h"
-#endif
+    #include "wx/setup.h"
+    #include "wx/frame.h"
+    #include "wx/menu.h"
+    #include "wx/app.h"
+    #include "wx/utils.h"
+    #include "wx/dialog.h"
+    #include "wx/settings.h"
+    #include "wx/dcclient.h"
+#endif // WX_PRECOMP
 
 #include "wx/msw/private.h"
 #include "wx/statusbr.h"
 #endif
 
 #if wxUSE_NATIVE_STATUSBAR
-#include <wx/msw/statbr95.h>
+    #include <wx/msw/statbr95.h>
 #endif
 
 extern wxList wxModelessWindows;
-extern wxList wxPendingDelete;
+extern wxList WXDLLEXPORT wxPendingDelete;
 extern char wxFrameClassName[];
 extern wxMenu *wxCurrentPopupMenu;
 
@@ -63,9 +63,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
 #endif
 
 #if wxUSE_NATIVE_STATUSBAR
-bool wxFrame::m_useNativeStatusBar = TRUE;
+    bool wxFrame::m_useNativeStatusBar = TRUE;
 #else
-bool wxFrame::m_useNativeStatusBar = FALSE;
+    bool wxFrame::m_useNativeStatusBar = FALSE;
 #endif
 
 wxFrame::wxFrame(void)
@@ -86,6 +86,10 @@ bool wxFrame::Create(wxWindow *parent,
            long style,
            const wxString& name)
 {
+#if wxUSE_TOOLTIPS
+    m_hwndToolTip = 0;
+#endif
+
   if (!parent)
     wxTopLevelWindows.Append(this);
 
@@ -331,6 +335,12 @@ bool wxFrame::IsIconized(void) const
   return m_iconized;
 }
 
+// Is it maximized?
+bool wxFrame::IsMaximized(void) const
+{
+    return (::IsZoomed((HWND) GetHWND()) != 0) ;
+}
+
 void wxFrame::SetTitle(const wxString& title)
 {
   SetWindowText((HWND) GetHWND(), (const char *)title);
@@ -606,8 +616,10 @@ void wxFrame::MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *
 
   WXDWORD extendedStyle = MakeExtendedStyle(style);
 
+#if !defined(__WIN16__) && !defined(__SC__)
   if (style & wxFRAME_TOOL_WINDOW)
     extendedStyle |= WS_EX_TOOLWINDOW;
+#endif
 
   if (style & wxSTAY_ON_TOP)
     extendedStyle |= WS_EX_TOPMOST;
@@ -640,7 +652,7 @@ bool wxFrame::MSWOnPaint(void)
       HDC cdc = BeginPaint((HWND) GetHWND(), &ps);
       
       // Erase background before painting or we get white background
-      this->MSWDefWindowProc(WM_ICONERASEBKGND,(WORD)ps.hdc,0L);
+      this->MSWDefWindowProc(WM_ICONERASEBKGND,(WORD)(LONG) ps.hdc,0L);
       
       if (the_icon)
       {
@@ -847,23 +859,10 @@ void wxFrame::OnActivate(wxActivateEvent& event)
   }
 }
 
-// The default implementation for the close window event - calls
-// OnClose for backward compatibility.
-
+// The default implementation for the close window event.
 void wxFrame::OnCloseWindow(wxCloseEvent& event)
 {
-    // Compatibility
-    if ( GetEventHandler()->OnClose() || event.GetForce())
-    {
-        this->Destroy();
-    }
-    else
-        event.Veto(TRUE);
-}
-
-bool wxFrame::OnClose(void)
-{
-    return TRUE;
+    this->Destroy();
 }
 
 // Destroy the window (delayed, if a managed window)
@@ -886,9 +885,14 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event)
       wxMenuBar *menuBar = GetMenuBar();
       if (menuBar)
       {
-        wxString helpString(menuBar->GetHelpString(event.GetMenuId()));
+// #ifndef __SALFORDC__
+        int menuId = event.GetMenuId();
+        wxString helpString;
+        // This causes a spurious access violation with Salford C++
+        helpString = menuBar->GetHelpString(menuId);
         if (helpString != "")
-          SetStatusText(helpString);
+            SetStatusText(helpString);
+// #endif
       }
     }
   }