SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
- wxModelessWindows.Append(this);
-
return TRUE;
}
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.
}
#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);
}
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__
}
PositionToolBar();
#endif // wxUSE_TOOLBAR
+#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
+ // 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);
}
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;
+}