]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxNB_FLAT for WinCE property sheet tabs
authorJulian Smart <julian@anthemion.co.uk>
Sun, 13 Mar 2005 17:31:23 +0000 (17:31 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 13 Mar 2005 17:31:23 +0000 (17:31 +0000)
Titlebar OK button on PocketPC now looks for OK, Cancel, Close buttons.
Dialog size now takes into account SIP or menubar.
Panels more naturally white on PocketPC.
wxDIALOG_EX_CONTEXTHELP ignored on WinCE since it interferes
with correct titlebar style.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/defs.h
src/generic/panelg.cpp
src/msw/dialog.cpp
src/msw/notebook.cpp
src/msw/toplevel.cpp

index 7a5cbb25f67ea32a65553a61747efefeb39bb553..e72b9d50a22a031e4dd097ebf4fb9afef6569cde 100644 (file)
@@ -8,8 +8,8 @@ wxWidgets 2.5 Change Log - For more verbose changes, see the manual
 All:
 
 - wxURI::GetUser() only returns the user name now, use GetUserInfo() to get
-  user and password as in 2.5.4; wxURI::GetPassword() added
-- added wxDebugReport class
+  user and password as in 2.5.4; wxURI::GetPassword() added.
+- Added wxDebugReport class.
 
 All (GUI):
 
@@ -21,19 +21,32 @@ All (GUI):
 
 Unix:
 
-- fixed build on Linux/AMD64
+- Fixed build on Linux/AMD64
 
 wxGTK:
 
 - Improved wxSystemSettings::GetMetric() to work better with X11. (Mart Raudsepp)
-- Corrected wxListBox selection handling
-- Corrected default button size handling for different themes
-- Corrected splitter sash size and look for different themes
-- Fixed keyboard input for dead-keys
+- Corrected wxListBox selection handling.
+- Corrected default button size handling for different themes.
+- Corrected splitter sash size and look for different themes.
+- Fixed keyboard input for dead-keys.
+
+wxMac:
+
+- Added wxFRAME_EX_METAL, wxDIALOG_EX_METAL for metallic-look windows.
 
 wxPalmOS:
 
-- native wxRadioBox implementation
+- native wxRadioBox implementation.
+
+wxWinCE:
+
+- Added wxNB_FLAT for flat-look notebooks on Windows CE.
+- Titlebar OK button on PocketPC now looks for OK, Cancel, Close buttons.
+- Dialog size now takes into account SIP or menubar.
+- Panels more naturally white on PocketPC.
+- wxDIALOG_EX_CONTEXTHELP ignored on WinCE since it interferes
+  with correct titlebar style.
 
 
 2.5.4
@@ -53,12 +66,12 @@ All:
 - added wxURI, a class for dealing with Uniform Resource Identifiers
 - changed wxURL to inherit from wxURI and provide assignment and comparison
 - implemented wxConvUTF7 (modified patch from Fredrik Roubert)
-- added versions of MB2WC and WC2MB for wxMBConv that for embedded null chars
+- added versions of MB2WC and WC2MB for wxMBConv that works for embedded null chars
 - Unicode support in wxODBC is now fully implemented
 - A new data type specific to wxWidgets called SQL_C_WXCHAR has been introduced.
   SQL_C_WXCHAR should be used rather than SQL_C_CHAR to ensure transparent
   behavior between Unicode and non-unicode builds
-- BLOB example added to samples/db (thanks to Casey ODonnell)
+- BLOB example added to samples/db (thanks to Casey O'Donnell)
 - use wxStream::GetLength() instead of deprecated GetSize()
 - wxGetOsDescription() is now more precise (Olly Betts)
 - XRC supports system fonts and colours (Ray Gilbert)
@@ -68,7 +81,7 @@ All:
   printing stuff in the GTK port.
 - Deprecated print setup dialog.
 - Added support to the wxODBC classes for Firebird 1.5 database
-- The samples\db sample program now includes an optional example of using a BLOB
+- The samples/db sample program now includes an optional example of using a BLOB
   datatype (if BLOB support is enabled and supported by the database)
 - added wxDynamicLibrary::ListLoaded()
 - wxGetPowerType() and wxGetBatteryState() addition
index 49949f1b5fd5f3e22ace7e6e65f097909d29783f..c06c812e445a1d10ea3f5d7eb6ec019d5abf3dfd 100644 (file)
@@ -1480,6 +1480,7 @@ enum wxBorder
 #define wxNB_BOTTOM           0x0080
 #define wxNB_MULTILINE        0x0100
 #define wxNB_NOPAGETHEME      0x0200
+#define wxNB_FLAT             0x0400
 #define wxNB_DEFAULT          wxNB_TOP
 
 /*
index 93bb178b2d70b3f7afc75f3193a00b38e5e1aad9..7a31bd9ab58f363afa14a3aa6d63d4700156908e 100644 (file)
@@ -126,8 +126,8 @@ bool wxPanel::Create(wxWindow *parent, wxWindowID id,
     SetThemeEnabled(true);
 
 #ifdef __WXWINCE__
-    // Required get solid control backgrounds under WinCE
-    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+    // Required to get solid control backgrounds under WinCE
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
 #endif
 
     return true;
index 8ecdaa9680ac37f2d08c2ed41b2e4ef1b70acba2..e11bff6afb5a46563ced136dfeb1dc40373469a0 100644 (file)
@@ -452,7 +452,15 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
             {
 #ifndef __SMARTPHONE__
                 case IDOK:
-                    wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL), wxButton);
+                    // First, try the OK button, since it's closest in meaning.
+                    wxButton *btn = wxDynamicCast(FindWindow(wxID_OK), wxButton);
+
+                    // Next, try Cancel or Close buttons
+                    if (!btn)
+                        btn = wxDynamicCast(FindWindow(wxID_CANCEL), wxButton);
+                    if (!btn)
+                        btn = wxDynamicCast(FindWindow(wxID_CLOSE), wxButton);
+
                     if ( btn && btn->IsEnabled() )
                     {
                         // if we do have a cancel button, do press it
@@ -460,6 +468,13 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
                         processed = true;
                         break;
                     }
+                    else
+                    {
+                        // Finally, if there aren't appropriate buttons,
+                        // act as if it were the normal close button.
+                        processed = !Close();
+                    }
+
 #else // ifdef __SMARTPHONE__
                 case IDM_LEFT:
                 case IDM_RIGHT:
index 5510e52fb7bc90fed2a66c78175b0d4c82838fe8..3c174fd922aaf3bdd3bba1f9798861c5323e21a8 100644 (file)
@@ -133,6 +133,8 @@ wxBEGIN_FLAGS( wxNotebookStyle )
     wxFLAGS_MEMBER(wxNB_LEFT)
     wxFLAGS_MEMBER(wxNB_RIGHT)
     wxFLAGS_MEMBER(wxNB_BOTTOM)
+    wxFLAGS_MEMBER(wxNB_NOPAGETHEME)
+    wxFLAGS_MEMBER(wxNB_FLAT)
 
 wxEND_FLAGS( wxNotebookStyle )
 
@@ -303,6 +305,19 @@ bool wxNotebook::Create(wxWindow *parent,
             SetBackgroundColour(col);
         }
     }
+
+    // Undocumented hack to get flat notebook style
+    // In fact, we should probably only do this in some
+    // curcumstances, i.e. if we know we will have a border
+    // at the bottom (the tab control doesn't draw it itself)
+#if defined(__POCKETPC__) || defined(__SMARTPHONE__)
+    if (HasFlag(wxNB_FLAT))
+    {
+        SendMessage(m_hwnd, CCM_SETVERSION, COMCTL32_VERSION, 0);
+        if (!m_hasBgCol)
+            SetBackgroundColour(*wxWHITE);
+    }
+#endif
     return true;
 }
 
@@ -322,7 +337,7 @@ WXDWORD wxNotebook::MSWGetStyle(long style, WXDWORD *exstyle) const
     else if ( style & wxNB_LEFT )
         tabStyle |= TCS_VERTICAL;
     else if ( style & wxNB_RIGHT )
-        tabStyle |= TCS_VERTICAL | TCS_RIGHT;
+        tabStyle |= TCS_VERTICAL | TCS_RIGHT; 
 
     // ex style
     if ( exstyle )
@@ -992,6 +1007,17 @@ wxColour wxNotebook::MSWGetBgColourForChild(wxWindow *win)
     if ( m_hasBgCol )
         return GetBackgroundColour();
 
+    // Experimental: don't do this since we're doing it in wxPanel
+#if 0 // defined(__POCKETPC__) || defined(__SMARTPHONE__)
+    // For some reason, the pages will be grey by default.
+    // Normally they should be white on these platforms.
+    // (However the static control backgrounds are painted
+    // in the correct colour, just not the rest of it.)
+    // So let's give WinCE a hint.
+    else if (!win->m_hasBgCol)
+        return *wxWHITE;
+#endif
+
     if ( !wxUxThemeEngine::GetIfActive() )
         return wxNullColour;
 
index 58438ba15f55108ba3b1e6cc825d439f15d0a354..526712ab873cfa1f82c76be1a621acde12e89657 100644 (file)
@@ -249,13 +249,13 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
             }
             //else: nothing to do [here]
         }
+
+        if ( GetExtraStyle() & wxFRAME_EX_CONTEXTHELP )
+            *exflags |= WS_EX_CONTEXTHELP;
 #endif // !__WXWINCE__
 
         if ( style & wxSTAY_ON_TOP )
             *exflags |= WS_EX_TOPMOST;
-
-        if ( GetExtraStyle() & wxFRAME_EX_CONTEXTHELP )
-            *exflags |= WS_EX_CONTEXTHELP;
     }
 
     return msflags;
@@ -360,7 +360,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
                        SWP_NOACTIVATE);
     }
 
-#if defined(__WIN95__)
+#if !defined(__WXWINCE__)
     // For some reason, the system menu is activated when we use the
     // WS_EX_CONTEXTHELP style, so let's set a reasonable icon
     if ( exflags & WS_EX_CONTEXTHELP )
@@ -377,7 +377,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
             }
         }
     }
-#endif // __WIN95__
+#endif
 
     // move the dialog to its initial position without forcing repainting
     int x, y, w, h;
@@ -1034,7 +1034,7 @@ wxDlgProc(HWND hDlg,
 #if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__) && !defined(__HANDHELDPC__)
         SHINITDLGINFO shidi;
         shidi.dwMask = SHIDIM_FLAGS;
-        shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN
+        shidi.dwFlags = SHIDIF_SIZEDLG // take account of the SIP or menubar
 #ifndef __SMARTPHONE__
                         | SHIDIF_DONEBUTTON
 #endif