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
This commit is contained in:
parent
0cfc2a92dc
commit
a9928e9d1a
@ -1132,12 +1132,12 @@
|
|||||||
#endif /* wxMGL */
|
#endif /* wxMGL */
|
||||||
|
|
||||||
/* Hopefully we can emulate these dialogs in due course */
|
/* Hopefully we can emulate these dialogs in due course */
|
||||||
#if wxUSE_SMARTPHONE
|
#ifdef __SMARTPHONE__
|
||||||
# ifdef wxUSE_COLOURDLG
|
# ifdef wxUSE_COLOURDLG
|
||||||
# undef wxUSE_COLOURDLG
|
# undef wxUSE_COLOURDLG
|
||||||
# define wxUSE_COLOURDLG 0
|
# define wxUSE_COLOURDLG 0
|
||||||
# endif
|
# endif
|
||||||
#endif /* wxUSE_SMARTPHONE */
|
#endif /* __SMARTPHONE__ */
|
||||||
|
|
||||||
|
|
||||||
/* generic controls dependencies */
|
/* generic controls dependencies */
|
||||||
|
@ -109,6 +109,7 @@ protected:
|
|||||||
// override base class virtuals
|
// override base class virtuals
|
||||||
virtual void DoGetClientSize(int *width, int *height) const;
|
virtual void DoGetClientSize(int *width, int *height) const;
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
#if wxUSE_MENUS_NATIVE
|
#if wxUSE_MENUS_NATIVE
|
||||||
// perform MSW-specific action when menubar is changed
|
// perform MSW-specific action when menubar is changed
|
||||||
|
@ -172,14 +172,15 @@ public:
|
|||||||
virtual void Detach();
|
virtual void Detach();
|
||||||
virtual void Attach(wxFrame *frame);
|
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
|
// Under WinCE, a menubar is owned by the frame's toolbar
|
||||||
void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
|
void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
|
||||||
wxToolBar* GetToolBar() const { return m_toolBar; }
|
wxToolBar* GetToolBar() const { return m_toolBar; }
|
||||||
#endif
|
#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; }
|
WXHWND GetCommandBar() const { return m_commandBar; }
|
||||||
|
bool AddAdornments(long style);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
@ -224,8 +225,9 @@ protected:
|
|||||||
// Not using a combined wxToolBar/wxMenuBar? then use
|
// Not using a combined wxToolBar/wxMenuBar? then use
|
||||||
// a commandbar in WinCE .NET to implement the
|
// a commandbar in WinCE .NET to implement the
|
||||||
// menubar, since there is no ::SetMenu function.
|
// 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;
|
WXHWND m_commandBar;
|
||||||
|
bool m_adornmentsAdded;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -27,16 +27,16 @@
|
|||||||
#pragma comment(lib,"commdlg.lib")
|
#pragma comment(lib,"commdlg.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WCE_PLATFORM_STANDARDSDK)
|
#if defined(__WINCE_STANDARDSDK__)
|
||||||
// DoDragDrop:
|
// DoDragDrop:
|
||||||
#pragma comment(lib,"olece400.lib")
|
#pragma comment(lib,"olece400.lib")
|
||||||
#elif defined(WIN32_PLATFORM_PSPC)
|
#elif defined(__POCKETPC__)
|
||||||
// PocketPC build:
|
// PocketPC build:
|
||||||
// DoDragDrop:
|
// DoDragDrop:
|
||||||
#pragma comment(lib,"ceshell.lib")
|
#pragma comment(lib,"ceshell.lib")
|
||||||
|
|
||||||
#pragma comment(lib,"aygshell.lib")
|
#pragma comment(lib,"aygshell.lib")
|
||||||
#elif defined(WIN32_PLATFORM_WFSP)
|
#elif defined(__SMARTPHONE__)
|
||||||
// Smartphone build:
|
// Smartphone build:
|
||||||
#pragma comment(lib,"ceshell.lib")
|
#pragma comment(lib,"ceshell.lib")
|
||||||
#pragma comment(lib,"aygshell.lib")
|
#pragma comment(lib,"aygshell.lib")
|
||||||
|
@ -25,7 +25,7 @@ inline BOOL IsIconic( HWND WXUNUSED(hWnd) )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32_PLATFORM_PSPC
|
#ifdef __POCKETPC__
|
||||||
#define SM_CXCURSOR 13
|
#define SM_CXCURSOR 13
|
||||||
#define SM_CYCURSOR 14
|
#define SM_CYCURSOR 14
|
||||||
#endif
|
#endif
|
||||||
|
@ -1070,27 +1070,6 @@
|
|||||||
// (notably, wxNotebook pages)
|
// (notably, wxNotebook pages)
|
||||||
#define wxUSE_UXTHEME_AUTO 0
|
#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
|
// obsolete settings
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -127,6 +127,20 @@
|
|||||||
# endif
|
# endif
|
||||||
#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
|
Include wx/setup.h for the Unix platform defines generated by configure and
|
||||||
the library compilation options
|
the library compilation options
|
||||||
|
@ -123,7 +123,7 @@ enum
|
|||||||
#else // wxUSE_TOOLBAR_NATIVE
|
#else // wxUSE_TOOLBAR_NATIVE
|
||||||
#if defined(__WXUNIVERSAL__)
|
#if defined(__WXUNIVERSAL__)
|
||||||
#include "wx/univ/toolbar.h"
|
#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"
|
#include "wx/msw/tbar95.h"
|
||||||
#elif defined(__WXWINCE__)
|
#elif defined(__WXWINCE__)
|
||||||
#include "wx/msw/wince/tbarwce.h"
|
#include "wx/msw/wince/tbarwce.h"
|
||||||
|
@ -65,9 +65,11 @@ class WXDLLEXPORT wxTopLevelWindowBase;
|
|||||||
// "correctly", i.e. as full screen windows with a "hide" button (same as
|
// "correctly", i.e. as full screen windows with a "hide" button (same as
|
||||||
// "close" but round instead of squared and just hides the applications
|
// "close" but round instead of squared and just hides the applications
|
||||||
// instead of closing it) in the title bar
|
// instead of closing it) in the title bar
|
||||||
#if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK)
|
#if defined(__WXWINCE__)
|
||||||
#ifdef __SMARTPHONE__
|
#if defined(__SMARTPHONE__)
|
||||||
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE)
|
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE)
|
||||||
|
#elif defined(__WINCE_STANDARDSDK__)
|
||||||
|
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX)
|
||||||
#else
|
#else
|
||||||
#define wxDEFAULT_FRAME_STYLE (0)
|
#define wxDEFAULT_FRAME_STYLE (0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -155,8 +155,7 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const
|
|||||||
{
|
{
|
||||||
wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
|
wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin();
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && \
|
#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__)
|
||||||
(!defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)))
|
|
||||||
wxToolBar *toolbar = GetToolBar();
|
wxToolBar *toolbar = GetToolBar();
|
||||||
if ( toolbar && toolbar->IsShown() )
|
if ( toolbar && toolbar->IsShown() )
|
||||||
{
|
{
|
||||||
@ -174,15 +173,6 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_TOOLBAR
|
#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;
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,6 +745,8 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
|||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
// copy it to our buffer and free memory
|
// copy it to our buffer and free memory
|
||||||
|
// Crashes on SmartPhone
|
||||||
|
#if !defined(__SMARTPHONE__)
|
||||||
if( lpMsgBuf != 0 ) {
|
if( lpMsgBuf != 0 ) {
|
||||||
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
|
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
|
||||||
s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
|
s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');
|
||||||
@ -760,7 +762,9 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
|||||||
s_szBuf[len - 2] = wxT('\0');
|
s_szBuf[len - 2] = wxT('\0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
s_szBuf[0] = wxT('\0');
|
s_szBuf[0] = wxT('\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ void wxFrame::PositionStatusBar()
|
|||||||
|
|
||||||
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
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())
|
if (!GetToolBar())
|
||||||
{
|
{
|
||||||
wxToolBar* toolBar = new wxToolBar(this, -1,
|
wxToolBar* toolBar = new wxToolBar(this, -1,
|
||||||
@ -354,7 +354,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
|||||||
}
|
}
|
||||||
else // set new non NULL menu bar
|
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.
|
// Can set a menubar several times.
|
||||||
if ( menubar->GetHMenu() )
|
if ( menubar->GetHMenu() )
|
||||||
{
|
{
|
||||||
@ -417,7 +417,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
#if wxUSE_TOOLBAR
|
#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
|
// TODO: hide commandbar
|
||||||
#else
|
#else
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
@ -462,7 +462,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if wxUSE_TOOLBAR
|
#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
|
// TODO: show commandbar
|
||||||
#else
|
#else
|
||||||
wxToolBar *theToolBar = GetToolBar();
|
wxToolBar *theToolBar = GetToolBar();
|
||||||
@ -508,7 +508,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
|
|||||||
|
|
||||||
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
|
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.
|
// We may already have a toolbar from calling SetMenuBar.
|
||||||
if (GetToolBar())
|
if (GetToolBar())
|
||||||
return GetToolBar();
|
return GetToolBar();
|
||||||
@ -526,7 +526,7 @@ void wxFrame::PositionToolBar()
|
|||||||
wxToolBar *toolbar = GetToolBar();
|
wxToolBar *toolbar = GetToolBar();
|
||||||
if ( toolbar && toolbar->IsShown() )
|
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
|
// We want to do something different in WinCE, because
|
||||||
// the toolbar should be associated with the commandbar,
|
// the toolbar should be associated with the commandbar,
|
||||||
// and not an independent window.
|
// and not an independent window.
|
||||||
@ -805,7 +805,7 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
|||||||
PositionToolBar();
|
PositionToolBar();
|
||||||
#endif // wxUSE_TOOLBAR
|
#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
|
// Position the menu command bar
|
||||||
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
if (GetMenuBar() && GetMenuBar()->GetCommandBar())
|
||||||
{
|
{
|
||||||
@ -996,3 +996,45 @@ bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu)
|
|||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
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;
|
||||||
|
}
|
||||||
|
@ -676,14 +676,15 @@ void wxMenuBar::Init()
|
|||||||
{
|
{
|
||||||
m_eventHandler = this;
|
m_eventHandler = this;
|
||||||
m_hMenu = 0;
|
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;
|
m_toolBar = NULL;
|
||||||
#endif
|
#endif
|
||||||
// Not using a combined wxToolBar/wxMenuBar? then use
|
// Not using a combined wxToolBar/wxMenuBar? then use
|
||||||
// a commandbar in WinCE .NET just to implement the
|
// a commandbar in WinCE .NET just to implement the
|
||||||
// menubar.
|
// 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_commandBar = NULL;
|
||||||
|
m_adornmentsAdded = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,7 +717,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
{
|
{
|
||||||
// In Windows CE (not .NET), the menubar is always associated
|
// In Windows CE (not .NET), the menubar is always associated
|
||||||
// with a toolbar, which destroys the menu implicitly.
|
// 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())
|
if (GetToolBar())
|
||||||
GetToolBar()->SetMenuBar(NULL);
|
GetToolBar()->SetMenuBar(NULL);
|
||||||
#else
|
#else
|
||||||
@ -724,7 +725,7 @@ wxMenuBar::~wxMenuBar()
|
|||||||
// which happens if we're attached to a frame
|
// which happens if we're attached to a frame
|
||||||
if (m_hMenu && !IsAttached())
|
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);
|
::DestroyWindow((HWND) m_commandBar);
|
||||||
m_commandBar = (WXHWND) NULL;
|
m_commandBar = (WXHWND) NULL;
|
||||||
#else
|
#else
|
||||||
@ -743,12 +744,12 @@ void wxMenuBar::Refresh()
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );
|
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())
|
if (GetToolBar())
|
||||||
{
|
{
|
||||||
CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
|
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)
|
if (m_commandBar)
|
||||||
DrawMenuBar((HWND) m_commandBar);
|
DrawMenuBar((HWND) m_commandBar);
|
||||||
#else
|
#else
|
||||||
@ -762,7 +763,7 @@ WXHMENU wxMenuBar::Create()
|
|||||||
// since you have to use resources.
|
// since you have to use resources.
|
||||||
// We'll have to find another way to add a menu
|
// We'll have to find another way to add a menu
|
||||||
// by changing/adding menu items to an existing 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 )
|
if ( m_hMenu != 0 )
|
||||||
return m_hMenu;
|
return m_hMenu;
|
||||||
|
|
||||||
@ -998,7 +999,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
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 (!GetToolBar())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
TBBUTTON tbButton;
|
TBBUTTON tbButton;
|
||||||
@ -1052,7 +1053,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
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 (!GetToolBar())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
TBBUTTON tbButton;
|
TBBUTTON tbButton;
|
||||||
@ -1103,7 +1104,7 @@ wxMenu *wxMenuBar::Remove(size_t pos)
|
|||||||
|
|
||||||
if ( IsAttached() )
|
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 (GetToolBar())
|
||||||
{
|
{
|
||||||
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
|
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
|
||||||
@ -1173,7 +1174,7 @@ void wxMenuBar::Attach(wxFrame *frame)
|
|||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__)
|
||||||
if (!m_hMenu)
|
if (!m_hMenu)
|
||||||
this->Create();
|
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.
|
// No idea why this was here, but it seems to be obsolete.
|
||||||
// Remove after testing with other WinCE combinations - April 2004
|
// Remove after testing with other WinCE combinations - April 2004
|
||||||
@ -1210,6 +1211,23 @@ void wxMenuBar::Attach(wxFrame *frame)
|
|||||||
#endif // wxUSE_ACCEL
|
#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()
|
void wxMenuBar::Detach()
|
||||||
{
|
{
|
||||||
wxMenuBarBase::Detach();
|
wxMenuBarBase::Detach();
|
||||||
|
@ -394,7 +394,7 @@ void wxPen::SetCap(int Cap)
|
|||||||
|
|
||||||
int wx2msPenStyle(int wx_style)
|
int wx2msPenStyle(int wx_style)
|
||||||
{
|
{
|
||||||
int cstyle;
|
int cstyle = PS_SOLID;
|
||||||
switch (wx_style)
|
switch (wx_style)
|
||||||
{
|
{
|
||||||
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
#endif
|
#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/toolbar.h"
|
||||||
#include "wx/sysopt.h"
|
#include "wx/sysopt.h"
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include <ole2.h>
|
#include <ole2.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
// Standard SDK doesn't have aygshell.dll: see include/wx/msw/wince/libraries.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>
|
#include <aygshell.h>
|
||||||
#endif
|
#endif
|
||||||
#include "wx/msw/wince/missing.h"
|
#include "wx/msw/wince/missing.h"
|
||||||
@ -388,7 +388,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
|
|||||||
y = (sizeDpy.y - h) / 2;
|
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) )
|
if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("MoveWindow"));
|
wxLogLastError(wxT("MoveWindow"));
|
||||||
@ -414,7 +414,7 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title,
|
|||||||
WXDWORD flags = MSWGetCreateWindowFlags(&exflags);
|
WXDWORD flags = MSWGetCreateWindowFlags(&exflags);
|
||||||
|
|
||||||
#if (defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
#if (defined(_WIN32_WCE) && _WIN32_WCE < 400) || \
|
||||||
defined(WIN32_PLATFORM_PSPC) || \
|
defined(__POCKETPC__) || \
|
||||||
defined(__SMARTPHONE__)
|
defined(__SMARTPHONE__)
|
||||||
// Always expand to fit the screen in PocketPC or SmartPhone
|
// Always expand to fit the screen in PocketPC or SmartPhone
|
||||||
wxSize sz(wxDefaultSize);
|
wxSize sz(wxDefaultSize);
|
||||||
@ -515,10 +515,12 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Native look is full screen window on Smartphones
|
// Native look is full screen window on Smartphones and Standard SDK
|
||||||
#ifdef __SMARTPHONE__
|
#if defined(__WXWINCE__)
|
||||||
if ( style & wxMAXIMIZE )
|
if ( style & wxMAXIMIZE )
|
||||||
Maximize();
|
{
|
||||||
|
this->Maximize();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -565,6 +567,11 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
|||||||
// show and maximize
|
// show and maximize
|
||||||
nShowCmd = SW_MAXIMIZE;
|
nShowCmd = SW_MAXIMIZE;
|
||||||
|
|
||||||
|
// This is necessary, or no window appears
|
||||||
|
#ifdef __WINCE_STANDARDSDK__
|
||||||
|
DoShowWindow(SW_SHOW);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_maximizeOnShow = FALSE;
|
m_maximizeOnShow = FALSE;
|
||||||
}
|
}
|
||||||
else // just show
|
else // just show
|
||||||
@ -582,6 +589,13 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
|||||||
|
|
||||||
DoShowWindow(nShowCmd);
|
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 )
|
if ( show )
|
||||||
{
|
{
|
||||||
::BringWindowToTop(GetHwnd());
|
::BringWindowToTop(GetHwnd());
|
||||||
@ -950,7 +964,7 @@ wxDlgProc(HWND hDlg,
|
|||||||
|
|
||||||
// Standard SDK doesn't have aygshell.dll: see
|
// Standard SDK doesn't have aygshell.dll: see
|
||||||
// include/wx/msw/wince/libraries.h
|
// include/wx/msw/wince/libraries.h
|
||||||
#if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK)
|
#if defined(__WXWINCE__) && !defined(__WINCE_STANDARDSDK__)
|
||||||
SHINITDLGINFO shidi;
|
SHINITDLGINFO shidi;
|
||||||
shidi.dwMask = SHIDIM_FLAGS;
|
shidi.dwMask = SHIDIM_FLAGS;
|
||||||
shidi.dwFlags = SHIDIF_DONEBUTTON |
|
shidi.dwFlags = SHIDIF_DONEBUTTON |
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
// Use the WinCE-specific toolbar only if we're either compiling
|
// 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
|
// 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"
|
#include "wx/toolbar.h"
|
||||||
|
|
||||||
@ -56,7 +56,7 @@
|
|||||||
#include <ole2.h>
|
#include <ole2.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <commctrl.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>
|
#include <aygshell.h>
|
||||||
#endif
|
#endif
|
||||||
#include "wx/msw/wince/missing.h"
|
#include "wx/msw/wince/missing.h"
|
||||||
@ -249,7 +249,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB
|
|||||||
if (m_menuBar)
|
if (m_menuBar)
|
||||||
m_menuBar->SetToolBar(this);
|
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.
|
// Create the menubar.
|
||||||
SHMENUBARINFO mbi;
|
SHMENUBARINFO mbi;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user