]> git.saurik.com Git - wxWidgets.git/commitdiff
WinCE Standard SDK improvements including adding close button
authorJulian Smart <julian@anthemion.co.uk>
Thu, 27 May 2004 11:31:12 +0000 (11:31 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 27 May 2004 11:31:12 +0000 (11:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

17 files changed:
include/wx/chkconf.h
include/wx/msw/frame.h
include/wx/msw/menu.h
include/wx/msw/wince/libraries.h
include/wx/msw/wince/missing.h
include/wx/msw/wince/setup.h
include/wx/platform.h
include/wx/toolbar.h
include/wx/toplevel.h
src/common/framecmn.cpp
src/common/log.cpp
src/msw/frame.cpp
src/msw/menu.cpp
src/msw/pen.cpp
src/msw/tbar95.cpp
src/msw/toplevel.cpp
src/msw/wince/tbarwce.cpp

index be518cf308b33c33999af35f6fcb50389a786d93..98e5bca5e33dfcbf7cf8a30d5d19c4dd3edae918 100644 (file)
 #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 */
index 8cb8cb3432cd60cd9895b003f9b39827257dbb89..d7faa10481eebf13a0bf6fb4005d52f9f4e0c87b 100644 (file)
@@ -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
index 0dc031793e946a8b306b63f46303aa4c6d131e10..f906ec392d48c5878ba247d3b274145dc48025e9 100644 (file)
@@ -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:
index 81c5f23881c48b04757d548fa4aeb25ae04f98e6..e597eb7694df689dcdac7c8c71ba690112385df2 100644 (file)
     #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")
index 99d6ce7583f7950e190843b99f55522e974d6fa3..50eff7a464b4263ebfff55316e3105ce5c421308 100644 (file)
@@ -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
index 388371714a6bf0fa5d0d579c22c4b87fccd24a99..41b861028e2dd7cc1eeb3147bb21c8b75294289c 100644 (file)
 // (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
 // ----------------------------------------------------------------------------
index d67532a20459e27ef04212b38e93c823aa3c8142..14707f610498743747d0121fabd42687fc485c91 100644 (file)
 #    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
index ce47d619054bd3e2306db7f7bd5d60c67e130740..24db4885eefab1231ae5a0a41707b995b7989c85 100644 (file)
@@ -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"
index 24325e0afe574c7daf434d06ba15623e114c0149..d7517e5cb3fa03488cbddf81edb097a0ab2b6f96 100644 (file)
@@ -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
index 1b8448f0adf27772a2e35dd7320563c0de5ba531..b66e7a3f0de52fde94baa7b8e5b1f18d8fa2452c 100644 (file)
@@ -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;
 }
 
index 6df2427e65efeb8e162d46218550f5669e2ca016..f4250830b41f36e539058f1e4353319587f7164e 100644 (file)
@@ -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');
     }
 
index 32c1b2a9e3675e4dca1a4d30d2db332763b7c726..6c412d00f09ee962a14fa1b2ff176d0e8fa87c54 100644 (file)
@@ -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;
+}
index 385c7fb32043f762aba4c83f03532802b2497565..a2162b9064b9378ba1ea2803146e61132303c314 100644 (file)
@@ -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();
index dc52acc011feda35dc78dabfc112862c1b3e9d64..3196fc92c72761ad3cea8ee627856e1b27275e55 100644 (file)
@@ -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__)
index 90ec836dbd23e4f18eedc0f866a81994baf70176..717e5ff7c9216eff89e8d53fa8e6ed9e908b7a63 100644 (file)
@@ -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"
index 27cc54f56eb1d3be2b57e09c815aa4d32a0198f9..3a0662db252bccdd969639bbe5d7dc8f72cfd4ab 100644 (file)
@@ -46,7 +46,7 @@
   #include <ole2.h>
   #include <shellapi.h>
   // 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 <aygshell.h>
   #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 |
index 331a77dbe84b2f13d91f6bc70064ef3f99826165..d69da49cb504ad26db6a8c56d325f82248b77372 100644 (file)
@@ -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 <ole2.h>
 #include <shellapi.h>
 #include <commctrl.h>
-#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
+#if _WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)
   #include <aygshell.h>
 #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;