]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
honour min/max size in wxMGL's wxWindow::DoSetSize
[wxWidgets.git] / src / univ / themes / win32.cpp
index 657417a08906a641ecc5d868a2a3632011dbef45..ea4dd2511ea3faf56f406b78ccc81b27ba1cb98d 100644 (file)
@@ -577,6 +577,16 @@ private:
     bool m_isOnGrip;
 };
 
+class wxWin32FrameInputHandler : public wxStdFrameInputHandler
+{
+public:
+    wxWin32FrameInputHandler(wxInputHandler *handler)
+        : wxStdFrameInputHandler(handler) { }
+
+    virtual bool HandleMouse(wxInputConsumer *control,
+                             const wxMouseEvent& event);
+};
+
 // ----------------------------------------------------------------------------
 // wxWin32ColourScheme: uses (default) Win32 colours
 // ----------------------------------------------------------------------------
@@ -1202,7 +1212,7 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
             handler = new wxWin32StatusBarInputHandler(GetDefaultInputHandler());
 #endif // wxUSE_STATUSBAR
         else if ( control == wxINP_HANDLER_TOPLEVEL )
-            handler = new wxStdFrameInputHandler(GetDefaultInputHandler());
+            handler = new wxWin32FrameInputHandler(GetDefaultInputHandler());
         else
             handler = GetDefaultInputHandler();
 
@@ -1261,7 +1271,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const
 
         // the colour set by the user should be used for the normal state
         // and for the states for which we don't have any specific colours
-        if ( !col.Ok() || (flags != 0) )
+        if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 )
         {
             if ( wxDynamicCast(win, wxScrollBar) )
                 col = Get(flags & wxCONTROL_PRESSED ? SCROLLBAR_PRESSED
@@ -1297,7 +1307,7 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const
 #if defined(COLOR_3DDKSHADOW)
         case SHADOW_DARK:       return wxColour(GetSysColor(COLOR_3DDKSHADOW));
 #else
-        case SHADOW_DARK:       return *wxBLACK;
+        case SHADOW_DARK:       return wxColour(GetSysColor(COLOR_3DHADOW));
 #endif
 
         case CONTROL_TEXT_DISABLED:
@@ -1348,6 +1358,8 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const
         case DESKTOP:           return wxColour(0x808000);
 #endif // __WXMSW__
 
+        case GAUGE:             return Get(HIGHLIGHT);
+
         case MAX:
         default:
             wxFAIL_MSG(_T("invalid standard colour"));
@@ -1380,7 +1392,7 @@ wxWin32Renderer::wxWin32Renderer(const wxColourScheme *scheme)
     m_colHighlight = wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT);
     m_penHighlight = wxPen(m_colHighlight, 0, wxSOLID);
 
-    m_titlebarFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
+    m_titlebarFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     m_titlebarFont.SetWeight(wxFONTWEIGHT_BOLD);
 
     // init the arrow bitmaps
@@ -2873,7 +2885,7 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
 {
     // prepare the dc: for now we draw all the items with the system font
     wxClientDC dc(win);
-    dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+    dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
 
     // the height of a normal item
     wxCoord heightText = dc.GetCharHeight();
@@ -4151,3 +4163,30 @@ bool wxWin32StatusBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
     return wxStdInputHandler::HandleMouseMove(consumer, event);
 }
 
+// ----------------------------------------------------------------------------
+// wxWin32FrameInputHandler
+// ----------------------------------------------------------------------------
+
+bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer,
+                                           const wxMouseEvent& event)
+{
+    if ( event.LeftDClick() )
+    {
+        wxTopLevelWindow *tlw = 
+            wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow);
+
+        long hit = tlw->HitTest(event.GetPosition());
+
+        if ( hit == wxHT_TOPLEVEL_TITLEBAR )
+        {
+            tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, 
+                               tlw->IsMaximized() ? 
+                                   wxTOPLEVEL_BUTTON_RESTORE : 
+                                   wxTOPLEVEL_BUTTON_MAXIMIZE);
+            return TRUE;
+        }
+    }
+
+    return wxStdFrameInputHandler::HandleMouse(consumer, event);
+}
+