Fixes for Standard WinCE SDK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-05-27 09:09:19 +00:00
parent f24764aa58
commit 45f272841c
7 changed files with 57 additions and 6 deletions

View File

@@ -178,6 +178,10 @@ public:
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))
WXHWND GetCommandBar() const { return m_commandBar; }
#endif
#if wxUSE_ACCEL #if wxUSE_ACCEL
// get the accel table for all the menus // get the accel table for all the menus
const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; } const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
@@ -220,7 +224,7 @@ 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(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))
WXHWND m_commandBar; WXHWND m_commandBar;
#endif #endif

View File

@@ -778,6 +778,15 @@
// Set to 0 to disable document/view architecture // Set to 0 to disable document/view architecture
#define wxUSE_DOC_VIEW_ARCHITECTURE 1 #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 // Set to 0 to disable MDI document/view architecture
#define wxUSE_MDI_ARCHITECTURE 0 #define wxUSE_MDI_ARCHITECTURE 0

View File

@@ -65,7 +65,7 @@ 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
#ifdef __WXWINCE__ #if defined(__WXWINCE__) && !defined(WCE_PLATFORM_STANDARDSDK)
#ifdef __SMARTPHONE__ #ifdef __SMARTPHONE__
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE) #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE)
#else #else

View File

@@ -174,6 +174,15 @@ 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;
} }

View File

@@ -545,6 +545,18 @@ void wxFrame::PositionToolBar()
} }
#endif // wxUSE_STATUSBAR #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 tx, ty;
int tw, th; int tw, th;
toolbar->GetPosition(&tx, &ty); toolbar->GetPosition(&tx, &ty);
@@ -600,7 +612,7 @@ void wxFrame::PositionToolBar()
} }
if (tx != 0 || ty != 0 || widthChanging || heightChanging) 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__ #endif // __WXWINCE__
} }
@@ -793,6 +805,23 @@ 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))
// 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); processed = wxWindow::HandleSize(x, y, id);
} }

View File

@@ -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(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP)))
#include "wx/toolbar.h" #include "wx/toolbar.h"
#include "wx/sysopt.h" #include "wx/sysopt.h"

View File

@@ -214,7 +214,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
if ( exflags ) if ( exflags )
{ {
// there is no taskbar under CE, so omit all this // there is no taskbar under CE, so omit all this
#ifndef __WXWINCE__ #if !defined(__WXWINCE__)
if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ) if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
{ {
if ( style & wxFRAME_TOOL_WINDOW ) if ( style & wxFRAME_TOOL_WINDOW )
@@ -388,7 +388,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
y = (sizeDpy.y - h) / 2; y = (sizeDpy.y - h) / 2;
} }
#ifndef __WXWINCE__ #if !defined(__WXWINCE__) || defined(WCE_PLATFORM_STANDARDSDK)
if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) ) if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
{ {
wxLogLastError(wxT("MoveWindow")); wxLogLastError(wxT("MoveWindow"));