]> git.saurik.com Git - wxWidgets.git/commitdiff
changed wxSystemSettings::HasFrameDecorations to more general GetCapability(index)
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 30 Oct 2001 23:30:04 +0000 (23:30 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 30 Oct 2001 23:30:04 +0000 (23:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

17 files changed:
include/wx/gtk/settings.h
include/wx/gtk1/settings.h
include/wx/mac/settings.h
include/wx/mgl/settings.h
include/wx/motif/settings.h
include/wx/msw/settings.h
include/wx/os2/settings.h
include/wx/settings.h
src/gtk/settings.cpp
src/gtk1/settings.cpp
src/mac/carbon/settings.cpp
src/mac/settings.cpp
src/mgl/settings.cpp
src/motif/settings.cpp
src/msw/settings.cpp
src/os2/settings.cpp
src/univ/topluniv.cpp

index 901678da4145a47823e72966749c5aa40a04b385..0292adb6f0fde2dc1ae0c3850e4bf08f43c3fc8d 100644 (file)
@@ -36,8 +36,8 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int         GetSystemMetric(int index);
 
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool        HasFrameDecorations() { return TRUE; }
+    // Return true if the port has certain feature
+    static bool        GetCapability(int index);
 };
 
 #endif
index 901678da4145a47823e72966749c5aa40a04b385..0292adb6f0fde2dc1ae0c3850e4bf08f43c3fc8d 100644 (file)
@@ -36,8 +36,8 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int         GetSystemMetric(int index);
 
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool        HasFrameDecorations() { return TRUE; }
+    // Return true if the port has certain feature
+    static bool        GetCapability(int index);
 };
 
 #endif
index d274901abbbba607839f7fe54fb7c133f40b39e8..90aa26f7947b9909f309fcc4e88128f76b4e7152 100644 (file)
@@ -128,8 +128,9 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int         GetSystemMetric(int index);
 
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool        HasFrameDecorations() { return TRUE; }
+    // Return true if the port has certain feature
+    static bool        GetCapability(int index);
+
 };
 
 #endif
index ac1d27041302ab3425a9c6dd0404e9e11af41121..49ca2427b15e63a23cd53f7ec55b8458d4de7321 100644 (file)
@@ -37,8 +37,8 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int GetSystemMetric(int index);
     
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool HasFrameDecorations() { return FALSE; }
+    // Return true if the port has certain feature
+    static bool GetCapability(int index);
 };
 
 #endif
index 2dd0d459534967ca8db8c7fbe2ac65585bb52e7b..03c367e816eea0ed3a80ca57aedfa746d7ee0131 100644 (file)
@@ -37,8 +37,9 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int         GetSystemMetric(int index);
 
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool        HasFrameDecorations() { return TRUE; }
+    // Return true if the port has certain feature
+    static bool        GetCapability(int index);
+
 };
 
 #endif
index 4c7c1c3561cd4c251f4f9c66f84628dec383faf5..bf24eb5bc68a7524b3aebef96c89a64ab210f63f 100644 (file)
@@ -33,9 +33,8 @@ public:
     // Get a system metric, e.g. scrollbar size
     static int GetSystemMetric(int index);
 
-    // Return true if the port can draw frame titlebar (i.e. doesn't need wxUniv for it)
-    static bool HasFrameDecorations() { return TRUE; }
-
+    // Return true if the port has certain feature
+    static bool GetCapability(int index);
 };
 
 #endif
index d3f75e040408b42ae138bb3d0e947f97eb2e1aa3..c9dfaabd02ce5f08f9fd501658dd1a7e3711a045 100644 (file)
@@ -24,7 +24,7 @@ public:
     static wxColour    GetSystemColour(int index);
     static wxFont      GetSystemFont(int index);
     static int         GetSystemMetric(int index);
-    static bool        HasFrameDecorations() { return TRUE; }
+    static bool        GetCapability(int index);
 }; // end of CLASS wxSystemSettings
 
 #endif
index 14b487a92a437ae10a5891a336f9c5d3fb670fe9..901801991896e1cfec642dcff35359cc30e6a256 100644 (file)
 #define wxSYS_SHOW_SOUNDS             36
 #define wxSYS_SWAP_BUTTONS            37
 
+// Platform capabilities
+#define wxSYS_CAN_DRAW_FRAME_DECORATIONS  1
+#define wxSYS_CAN_ICONIZE_FRAME           2
+
 #if defined(__WXMSW__)
 #include "wx/msw/settings.h"
 #elif defined(__WXMOTIF__)
index 36662eb0a5c6d67f3f4526141bf742606fdf57a2..85b2c7c312c6b45c3cb97a212dbb1ac60b9c0abb 100644 (file)
@@ -369,3 +369,16 @@ int wxSystemSettings::GetSystemMetric( int index )
 
     return 0;
 }
+
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+            return FALSE; break;
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index 36662eb0a5c6d67f3f4526141bf742606fdf57a2..85b2c7c312c6b45c3cb97a212dbb1ac60b9c0abb 100644 (file)
@@ -369,3 +369,16 @@ int wxSystemSettings::GetSystemMetric( int index )
 
     return 0;
 }
+
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+            return FALSE; break;
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index df2800a97becb59ff9f5fe4e6e1960a7f8d87aff..dcfe3657534a12fda9d3958763a70368579a666b 100644 (file)
@@ -220,3 +220,14 @@ int wxSystemSettings::GetSystemMetric(int index)
        return 0;
 }
 
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index df2800a97becb59ff9f5fe4e6e1960a7f8d87aff..dcfe3657534a12fda9d3958763a70368579a666b 100644 (file)
@@ -220,3 +220,14 @@ int wxSystemSettings::GetSystemMetric(int index)
        return 0;
 }
 
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index 735674f2491e5f72e5a5bb97463ae0d3d87b004e..4e6b6d28f8f162974b3b622c102d60bb81c06f7b 100644 (file)
@@ -32,3 +32,16 @@ int wxSystemSettings::GetSystemMetric(int WXUNUSED(index))
     // FIXME_MGL
     return 1;
 }
+
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+            return FALSE; break;
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return FALSE; break;
+        default:
+            return FALSE;
+    }
+}
index 62e04d0be8e28a7c0299b178630829b13b97da38..b75b68efc92fbc451f76d1b094bdf59688695eb1 100644 (file)
@@ -231,3 +231,14 @@ int wxSystemSettings::GetSystemMetric(int index)
        }
 }
 
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index 360e8a2fc3c618f9404453a47f05e578dcde3d05..e5e54f501706d3c0708882b644f98cba45a87d9e 100644 (file)
@@ -267,3 +267,14 @@ int wxSystemSettings::GetSystemMetric(int index)
     // __WXMICROWIN__
 }
 
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index 05ba3aaf808e493eb7ad038fe50703d06af32437..c60806596275d78507816d31cbdc285b9045b7b7 100644 (file)
@@ -357,3 +357,14 @@ int wxSystemSettings::GetSystemMetric(int index)
     return 0;
 }
 
+bool wxSystemSettings::GetCapability(int index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+            return TRUE; break;
+        default:
+            return FALSE;
+    }
+}
index c68373a528515b28a170379c3945a76cbbd1f7d4..27a2633365e09d7dd35c63a5240c98b7a4a8e2f7 100644 (file)
@@ -55,6 +55,7 @@ WX_FORWARD_TO_INPUT_CONSUMER(wxTopLevelWindow)
 // ============================================================================
 
 int wxTopLevelWindow::ms_drawDecorations = -1;
+int wxTopLevelWindow::ms_canIconize = -1;
 
 void wxTopLevelWindow::Init()
 {
@@ -76,10 +77,18 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
          exstyleOrig = 0;
 
     if ( ms_drawDecorations == -1 )
-        ms_drawDecorations = !wxSystemSettings::HasFrameDecorations() ||
-                             wxGetEnv(wxT("WXDECOR"), NULL);
+    {
+        ms_drawDecorations = 
+            !wxSystemSettings::GetCapability(wxSYS_CAN_DRAW_FRAME_DECORATIONS) 
+            || wxGetEnv(wxT("WXDECOR"), NULL);
         // FIXME -- wxUniv should provide a way to force non-native decorations!
         //          $WXDECOR is just a hack in absence of better wxUniv solution
+    }
+
+    if ( ms_canIconize == -1 )
+    {
+        ms_canIconize = wxSystemSettings::GetCapability(wxSYS_CAN_ICONIZE_FRAME);
+    }
 
     if ( ms_drawDecorations )
     {
@@ -138,7 +147,7 @@ long wxTopLevelWindow::GetDecorationsStyle() const
     if ( m_windowStyle & wxCAPTION )
     {
         style |= wxTOPLEVEL_TITLEBAR | wxTOPLEVEL_BUTTON_CLOSE;
-        if ( m_windowStyle & wxMINIMIZE_BOX )
+        if ( (m_windowStyle & wxMINIMIZE_BOX) && ms_canIconize )
             style |= wxTOPLEVEL_BUTTON_ICONIZE;
         if ( m_windowStyle & wxMAXIMIZE_BOX )
         {