From 45f272841cd2faca5fd3ad2560cbf06eb81465bc Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 27 May 2004 09:09:19 +0000 Subject: [PATCH] Fixes for Standard WinCE SDK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/menu.h | 6 +++++- include/wx/msw/wince/setup.h | 9 +++++++++ include/wx/toplevel.h | 2 +- src/common/framecmn.cpp | 9 +++++++++ src/msw/frame.cpp | 31 ++++++++++++++++++++++++++++++- src/msw/tbar95.cpp | 2 +- src/msw/toplevel.cpp | 4 ++-- 7 files changed, 57 insertions(+), 6 deletions(-) diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index be8a023694..0dc031793e 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -178,6 +178,10 @@ public: wxToolBar* GetToolBar() const { return m_toolBar; } #endif +#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) + WXHWND GetCommandBar() const { return m_commandBar; } +#endif + #if wxUSE_ACCEL // get the accel table for all the menus const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; } @@ -220,7 +224,7 @@ 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(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)) WXHWND m_commandBar; #endif diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 33151539f3..388371714a 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -778,6 +778,15 @@ // Set to 0 to disable document/view architecture #define wxUSE_DOC_VIEW_ARCHITECTURE 1 +// Set to 0 to disable MDI support. +// +// Requires wxUSE_NOTEBOOK under platforms other than MSW. +// +// Default is 1. +// +// Recommended setting: 1, can be safely set to 0. +#define wxUSE_MDI 0 + // Set to 0 to disable MDI document/view architecture #define wxUSE_MDI_ARCHITECTURE 0 diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 8ad1a568d0..24325e0afe 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -65,7 +65,7 @@ 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 -#ifdef __WXWINCE__ +#if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK) #ifdef __SMARTPHONE__ #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE) #else diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index f451627440..1b8448f0ad 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -174,6 +174,15 @@ 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/msw/frame.cpp b/src/msw/frame.cpp index 4b7181dd03..32c1b2a9e3 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -545,6 +545,18 @@ void wxFrame::PositionToolBar() } #endif // wxUSE_STATUSBAR + int x = 0; + int y = 0; +#if defined(__WXWINCE__) + // We're using a commandbar - so we have to allow for it. + if (GetMenuBar() && GetMenuBar()->GetCommandBar()) + { + RECT rect; + ::GetWindowRect((HWND) GetMenuBar()->GetCommandBar(), &rect); + y = rect.bottom - rect.top; + } +#endif + int tx, ty; int tw, th; toolbar->GetPosition(&tx, &ty); @@ -600,7 +612,7 @@ void wxFrame::PositionToolBar() } if (tx != 0 || ty != 0 || widthChanging || heightChanging) - toolbar->SetSize(0, 0, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS); + toolbar->SetSize(x, y, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS); #endif // __WXWINCE__ } @@ -793,6 +805,23 @@ 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)) + // Position the menu command bar + if (GetMenuBar() && GetMenuBar()->GetCommandBar()) + { + RECT rect; + ::GetWindowRect((HWND) GetMenuBar()->GetCommandBar(), &rect); + wxSize clientSz = GetClientSize(); + + if ( !::MoveWindow((HWND) GetMenuBar()->GetCommandBar(), 0, 0, clientSz.x, rect.bottom - rect.top, true ) ) + { + wxLogLastError(wxT("MoveWindow")); + } + + } +#endif + + processed = wxWindow::HandleSize(x, y, id); } diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 8d8c01735c..90ec836dbd 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(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))) #include "wx/toolbar.h" #include "wx/sysopt.h" diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 683c6c3e16..27cc54f56e 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -214,7 +214,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const if ( exflags ) { // there is no taskbar under CE, so omit all this -#ifndef __WXWINCE__ +#if !defined(__WXWINCE__) if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ) { if ( style & wxFRAME_TOOL_WINDOW ) @@ -388,7 +388,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, y = (sizeDpy.y - h) / 2; } -#ifndef __WXWINCE__ +#if !defined(__WXWINCE__) || defined(WCE_PLATFORM_STANDARDSDK) if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) { wxLogLastError(wxT("MoveWindow")); -- 2.47.2