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,
}
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() )
{
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();
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();
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();
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.
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())
{
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;
+}