From a9928e9d1ab76fd26557e2cf8e6715402639e999 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 27 May 2004 11:31:12 +0000 Subject: [PATCH] WinCE Standard SDK improvements including adding close button git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/chkconf.h | 4 +-- include/wx/msw/frame.h | 1 + include/wx/msw/menu.h | 8 +++-- include/wx/msw/wince/libraries.h | 6 ++-- include/wx/msw/wince/missing.h | 2 +- include/wx/msw/wince/setup.h | 21 ------------ include/wx/platform.h | 14 ++++++++ include/wx/toolbar.h | 2 +- include/wx/toplevel.h | 6 ++-- src/common/framecmn.cpp | 12 +------ src/common/log.cpp | 8 +++-- src/msw/frame.cpp | 56 ++++++++++++++++++++++++++++---- src/msw/menu.cpp | 40 ++++++++++++++++------- src/msw/pen.cpp | 2 +- src/msw/tbar95.cpp | 2 +- src/msw/toplevel.cpp | 28 ++++++++++++---- src/msw/wince/tbarwce.cpp | 6 ++-- 17 files changed, 142 insertions(+), 76 deletions(-) diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index be518cf308..98e5bca5e3 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -1132,12 +1132,12 @@ #endif /* wxMGL */ /* Hopefully we can emulate these dialogs in due course */ -#if wxUSE_SMARTPHONE +#ifdef __SMARTPHONE__ # ifdef wxUSE_COLOURDLG # undef wxUSE_COLOURDLG # define wxUSE_COLOURDLG 0 # endif -#endif /* wxUSE_SMARTPHONE */ +#endif /* __SMARTPHONE__ */ /* generic controls dependencies */ diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 8cb8cb3432..d7faa10481 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -109,6 +109,7 @@ protected: // override base class virtuals virtual void DoGetClientSize(int *width, int *height) const; virtual void DoSetClientSize(int width, int height); + virtual wxPoint GetClientAreaOrigin() const; #if wxUSE_MENUS_NATIVE // perform MSW-specific action when menubar is changed diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 0dc031793e..f906ec392d 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -172,14 +172,15 @@ public: virtual void Detach(); virtual void Attach(wxFrame *frame); -#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) // Under WinCE, a menubar is owned by the frame's toolbar void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; } wxToolBar* GetToolBar() const { return m_toolBar; } #endif -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) WXHWND GetCommandBar() const { return m_commandBar; } + bool AddAdornments(long style); #endif #if wxUSE_ACCEL @@ -224,8 +225,9 @@ protected: // Not using a combined wxToolBar/wxMenuBar? then use // a commandbar in WinCE .NET to implement the // menubar, since there is no ::SetMenu function. -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) WXHWND m_commandBar; + bool m_adornmentsAdded; #endif private: diff --git a/include/wx/msw/wince/libraries.h b/include/wx/msw/wince/libraries.h index 81c5f23881..e597eb7694 100644 --- a/include/wx/msw/wince/libraries.h +++ b/include/wx/msw/wince/libraries.h @@ -27,16 +27,16 @@ #pragma comment(lib,"commdlg.lib") #endif -#if defined(WCE_PLATFORM_STANDARDSDK) +#if defined(__WINCE_STANDARDSDK__) // DoDragDrop: #pragma comment(lib,"olece400.lib") -#elif defined(WIN32_PLATFORM_PSPC) +#elif defined(__POCKETPC__) // PocketPC build: // DoDragDrop: #pragma comment(lib,"ceshell.lib") #pragma comment(lib,"aygshell.lib") -#elif defined(WIN32_PLATFORM_WFSP) +#elif defined(__SMARTPHONE__) // Smartphone build: #pragma comment(lib,"ceshell.lib") #pragma comment(lib,"aygshell.lib") diff --git a/include/wx/msw/wince/missing.h b/include/wx/msw/wince/missing.h index 99d6ce7583..50eff7a464 100644 --- a/include/wx/msw/wince/missing.h +++ b/include/wx/msw/wince/missing.h @@ -25,7 +25,7 @@ inline BOOL IsIconic( HWND WXUNUSED(hWnd) ) return FALSE; } -#ifdef WIN32_PLATFORM_PSPC +#ifdef __POCKETPC__ #define SM_CXCURSOR 13 #define SM_CYCURSOR 14 #endif diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 388371714a..41b861028e 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -1070,27 +1070,6 @@ // (notably, wxNotebook pages) #define wxUSE_UXTHEME_AUTO 0 -// Set to 1 if you want to maintain a PocketPC-style UI on -// Windows CE .NET. If 0, wxWidgets will use a commandbar -// for the menubar, and a normal separate toolbar as per the -// desktop implementation. If 1, wxWidgets will combine -// the toolbar and menubar as per the PocketPC implementation. -// -// Note that at present, the dynamic loading of PocketPC -// shell functions on WinCE .NET is not yet done, and a -// simple commandbar implementation is used instead of the -// PocketPC one. The intention is to use the PocketPC style -// when available (when wxUSE_POCKETPC_UI is 1). -// -// So if you're using WinCE .NET, and wxUSE_POCKETPC_UI is 0, -// you will be able to create separate toolbars and menubars, -// but _not_ the combined toolbar/menubar. - -// NOW OBSOLETE: we test WIN32_PLATFORM_PSPC and WIN32_PLATFORM_WFSP -// instead - -// #define wxUSE_POCKETPC_UI 1 - // ---------------------------------------------------------------------------- // obsolete settings // ---------------------------------------------------------------------------- diff --git a/include/wx/platform.h b/include/wx/platform.h index d67532a204..14707f6104 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -127,6 +127,20 @@ # endif #endif +/* detect PocketPC */ +#if defined( WIN32_PLATFORM_PSPC ) +# ifndef __POCKETPC__ +# define __POCKETPC__ +# endif +#endif + +/* detect Standard WinCE SDK */ +#if defined( WCE_PLATFORM_STANDARDSDK ) +# ifndef __WINCE_STANDARDSDK__ +# define __WINCE_STANDARDSDK__ +# endif +#endif + /* Include wx/setup.h for the Unix platform defines generated by configure and the library compilation options diff --git a/include/wx/toolbar.h b/include/wx/toolbar.h index ce47d61905..24db4885ee 100644 --- a/include/wx/toolbar.h +++ b/include/wx/toolbar.h @@ -123,7 +123,7 @@ enum #else // wxUSE_TOOLBAR_NATIVE #if defined(__WXUNIVERSAL__) #include "wx/univ/toolbar.h" - #elif defined(__WXMSW__) && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))) + #elif defined(__WXMSW__) && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))) #include "wx/msw/tbar95.h" #elif defined(__WXWINCE__) #include "wx/msw/wince/tbarwce.h" diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 24325e0afe..d7517e5cb3 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -65,9 +65,11 @@ class WXDLLEXPORT wxTopLevelWindowBase; // "correctly", i.e. as full screen windows with a "hide" button (same as // "close" but round instead of squared and just hides the applications // instead of closing it) in the title bar -#if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK) - #ifdef __SMARTPHONE__ +#if defined(__WXWINCE__) + #if defined(__SMARTPHONE__) #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE) + #elif defined(__WINCE_STANDARDSDK__) + #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX) #else #define wxDEFAULT_FRAME_STYLE (0) #endif diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 1b8448f0ad..b66e7a3f0d 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -155,8 +155,7 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const { wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin(); -#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && \ - (!defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))) +#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) wxToolBar *toolbar = GetToolBar(); if ( toolbar && toolbar->IsShown() ) { @@ -174,15 +173,6 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const } #endif // wxUSE_TOOLBAR -#if defined(__WXWINCE__) && defined(WCE_PLATFORM_STANDARDSDK) - if (GetMenuBar() && GetMenuBar()->GetCommandBar()) - { - RECT rect; - ::GetWindowRect((HWND) GetMenuBar()->GetCommandBar(), &rect); - pt.y += (rect.bottom - rect.top); - } -#endif - return pt; } diff --git a/src/common/log.cpp b/src/common/log.cpp index 6df2427e65..f4250830b4 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -745,7 +745,9 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) 0, NULL); // copy it to our buffer and free memory - if( lpMsgBuf != 0 ) { + // Crashes on SmartPhone +#if !defined(__SMARTPHONE__) + if( lpMsgBuf != 0 ) { wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0'); @@ -760,7 +762,9 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) s_szBuf[len - 2] = wxT('\0'); } } - else { + else +#endif + { s_szBuf[0] = wxT('\0'); } diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 32c1b2a9e3..6c412d00f0 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -318,7 +318,7 @@ void wxFrame::PositionStatusBar() void wxFrame::AttachMenuBar(wxMenuBar *menubar) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (!GetToolBar()) { wxToolBar* toolBar = new wxToolBar(this, -1, @@ -354,7 +354,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) } else // set new non NULL menu bar { -#if !defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if !defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) // Can set a menubar several times. if ( menubar->GetHMenu() ) { @@ -417,7 +417,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) if (show) { #if wxUSE_TOOLBAR -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) // TODO: hide commandbar #else wxToolBar *theToolBar = GetToolBar(); @@ -462,7 +462,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) else { #if wxUSE_TOOLBAR -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) // TODO: show commandbar #else wxToolBar *theToolBar = GetToolBar(); @@ -508,7 +508,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) // We may already have a toolbar from calling SetMenuBar. if (GetToolBar()) return GetToolBar(); @@ -526,7 +526,7 @@ void wxFrame::PositionToolBar() wxToolBar *toolbar = GetToolBar(); if ( toolbar && toolbar->IsShown() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) // We want to do something different in WinCE, because // the toolbar should be associated with the commandbar, // and not an independent window. @@ -805,7 +805,7 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) PositionToolBar(); #endif // wxUSE_TOOLBAR -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) // Position the menu command bar if (GetMenuBar() && GetMenuBar()->GetCommandBar()) { @@ -996,3 +996,45 @@ bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) return GetEventHandler()->ProcessEvent(event); } + +// ---------------------------------------------------------------------------- +// wxFrame size management: we exclude the areas taken by menu/status/toolbars +// from the client area, so the client area is what's really available for the +// frame contents +// ---------------------------------------------------------------------------- + +// get the origin of the client area in the client coordinates +wxPoint wxFrame::GetClientAreaOrigin() const +{ + wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin(); + +#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && \ + (!defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))) + wxToolBar *toolbar = GetToolBar(); + if ( toolbar && toolbar->IsShown() ) + { + int w, h; + toolbar->GetSize(&w, &h); + + if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) + { + pt.x += w; + } + else + { + pt.y += h; + } + } +#endif // wxUSE_TOOLBAR + +#if defined(__WXWINCE__) && defined(__WINCE_STANDARDSDK__) + if (GetMenuBar() && GetMenuBar()->GetCommandBar()) + { + RECT rect; + ::GetWindowRect((HWND) GetMenuBar()->GetCommandBar(), &rect); + pt.y += (rect.bottom - rect.top); + } +#endif + + return pt; +} diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 385c7fb320..a2162b9064 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -676,14 +676,15 @@ void wxMenuBar::Init() { m_eventHandler = this; m_hMenu = 0; -#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if wxUSE_TOOLBAR && defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) m_toolBar = NULL; #endif // Not using a combined wxToolBar/wxMenuBar? then use // a commandbar in WinCE .NET just to implement the // menubar. -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) m_commandBar = NULL; + m_adornmentsAdded = false; #endif } @@ -716,7 +717,7 @@ wxMenuBar::~wxMenuBar() { // In Windows CE (not .NET), the menubar is always associated // with a toolbar, which destroys the menu implicitly. -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) GetToolBar()->SetMenuBar(NULL); #else @@ -724,7 +725,7 @@ wxMenuBar::~wxMenuBar() // which happens if we're attached to a frame if (m_hMenu && !IsAttached()) { -#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) ::DestroyWindow((HWND) m_commandBar); m_commandBar = (WXHWND) NULL; #else @@ -743,12 +744,12 @@ void wxMenuBar::Refresh() { wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") ); -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) { CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0); } -#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) +#elif defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) if (m_commandBar) DrawMenuBar((HWND) m_commandBar); #else @@ -762,7 +763,7 @@ WXHMENU wxMenuBar::Create() // since you have to use resources. // We'll have to find another way to add a menu // by changing/adding menu items to an existing menu. -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if ( m_hMenu != 0 ) return m_hMenu; @@ -998,7 +999,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (!GetToolBar()) return FALSE; TBBUTTON tbButton; @@ -1052,7 +1053,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (!GetToolBar()) return FALSE; TBBUTTON tbButton; @@ -1103,7 +1104,7 @@ wxMenu *wxMenuBar::Remove(size_t pos) if ( IsAttached() ) { -#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if defined(__WXWINCE__) && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) if (GetToolBar()) { if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0)) @@ -1173,7 +1174,7 @@ void wxMenuBar::Attach(wxFrame *frame) #if defined(__WXWINCE__) if (!m_hMenu) this->Create(); -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__) // No idea why this was here, but it seems to be obsolete. // Remove after testing with other WinCE combinations - April 2004 @@ -1210,6 +1211,23 @@ void wxMenuBar::Attach(wxFrame *frame) #endif // wxUSE_ACCEL } +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) +bool wxMenuBar::AddAdornments(long style) +{ + if (m_adornmentsAdded || !m_commandBar) + return false; + + if (style & wxCLOSE_BOX) + { + if (!CommandBar_AddAdornments((HWND) m_commandBar, 0, 0)) + wxLogLastError(wxT("CommandBar_AddAdornments")); + else + return true; + } + return false; +} +#endif + void wxMenuBar::Detach() { wxMenuBarBase::Detach(); diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index dc52acc011..3196fc92c7 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -394,7 +394,7 @@ void wxPen::SetCap(int Cap) int wx2msPenStyle(int wx_style) { - int cstyle; + int cstyle = PS_SOLID; switch (wx_style) { #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 90ec836dbd..717e5ff7c9 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -39,7 +39,7 @@ #include "wx/control.h" #endif -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))) +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))) #include "wx/toolbar.h" #include "wx/sysopt.h" diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 27cc54f56e..3a0662db25 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -46,7 +46,7 @@ #include #include // Standard SDK doesn't have aygshell.dll: see include/wx/msw/wince/libraries.h - #if _WIN32_WCE < 400 || !defined(WCE_PLATFORM_STANDARDSDK) + #if _WIN32_WCE < 400 || !defined(__WINCE_STANDARDSDK__) #include #endif #include "wx/msw/wince/missing.h" @@ -388,7 +388,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, y = (sizeDpy.y - h) / 2; } -#if !defined(__WXWINCE__) || defined(WCE_PLATFORM_STANDARDSDK) +#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__) if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) { wxLogLastError(wxT("MoveWindow")); @@ -414,7 +414,7 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title, WXDWORD flags = MSWGetCreateWindowFlags(&exflags); #if (defined(_WIN32_WCE) && _WIN32_WCE < 400) || \ - defined(WIN32_PLATFORM_PSPC) || \ + defined(__POCKETPC__) || \ defined(__SMARTPHONE__) // Always expand to fit the screen in PocketPC or SmartPhone wxSize sz(wxDefaultSize); @@ -515,10 +515,12 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, ); } - // Native look is full screen window on Smartphones -#ifdef __SMARTPHONE__ + // Native look is full screen window on Smartphones and Standard SDK +#if defined(__WXWINCE__) if ( style & wxMAXIMIZE ) - Maximize(); + { + this->Maximize(); + } #endif return ret; @@ -565,6 +567,11 @@ bool wxTopLevelWindowMSW::Show(bool show) // show and maximize nShowCmd = SW_MAXIMIZE; + // This is necessary, or no window appears +#ifdef __WINCE_STANDARDSDK__ + DoShowWindow(SW_SHOW); +#endif + m_maximizeOnShow = FALSE; } else // just show @@ -582,6 +589,13 @@ bool wxTopLevelWindowMSW::Show(bool show) DoShowWindow(nShowCmd); +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) + // Addornments have to be added when the frame is the correct size + wxFrame* frame = wxDynamicCast(this, wxFrame); + if (frame && frame->GetMenuBar()) + frame->GetMenuBar()->AddAdornments(GetWindowStyleFlag()); +#endif + if ( show ) { ::BringWindowToTop(GetHwnd()); @@ -950,7 +964,7 @@ wxDlgProc(HWND hDlg, // Standard SDK doesn't have aygshell.dll: see // include/wx/msw/wince/libraries.h -#if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK) +#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__) SHINITDLGINFO shidi; shidi.dwMask = SHIDIM_FLAGS; shidi.dwFlags = SHIDIF_DONEBUTTON | diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 331a77dbe8..d69da49cb5 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -41,7 +41,7 @@ // Use the WinCE-specific toolbar only if we're either compiling // with a WinCE earlier than 4, or we wish to emulate a PocketPC-style UI -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)) +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) #include "wx/toolbar.h" @@ -56,7 +56,7 @@ #include #include #include -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__) #include #endif #include "wx/msw/wince/missing.h" @@ -249,7 +249,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB if (m_menuBar) m_menuBar->SetToolBar(this); -#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__) // Create the menubar. SHMENUBARINFO mbi; -- 2.45.2