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 */
|
||||
|
||||
/* 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 */
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -745,6 +745,8 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
||||
0, NULL);
|
||||
|
||||
// copy it to our buffer and free memory
|
||||
// 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');
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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__)
|
||||
|
@ -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"
|
||||
|
@ -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 |
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user