From b554cf63711f985030c5d5f338f9614d158a8718 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 13 Mar 2005 17:31:23 +0000 Subject: [PATCH] Added wxNB_FLAT for WinCE property sheet tabs 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 | 35 ++++++++++++++++++++++++----------- include/wx/defs.h | 1 + src/generic/panelg.cpp | 4 ++-- src/msw/dialog.cpp | 17 ++++++++++++++++- src/msw/notebook.cpp | 28 +++++++++++++++++++++++++++- src/msw/toplevel.cpp | 12 ++++++------ 6 files changed, 76 insertions(+), 21 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 7a5cbb25f6..e72b9d50a2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 diff --git a/include/wx/defs.h b/include/wx/defs.h index 49949f1b5f..c06c812e44 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -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 /* diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 93bb178b2d..7a31bd9ab5 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -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; diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 8ecdaa9680..e11bff6afb 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -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: diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 5510e52fb7..3c174fd922 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -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; diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 58438ba15f..526712ab87 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -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 -- 2.45.2