X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be7c2a2033f57f92c23f0db8220cb53ad47eabde..63a3cd7a8c737eb4571f27e5f2af37eda0f1c5cc:/src/palmos/frame.cpp?ds=sidebyside diff --git a/src/palmos/frame.cpp b/src/palmos/frame.cpp index 2267eee58e..efdaf784f2 100644 --- a/src/palmos/frame.cpp +++ b/src/palmos/frame.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "frame.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -57,6 +53,9 @@ #include "wx/univ/colschem.h" #endif // __WXUNIVERSAL__ +#include +#include + // ---------------------------------------------------------------------------- // globals // ---------------------------------------------------------------------------- @@ -70,7 +69,6 @@ // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) EVT_PAINT(wxFrame::OnPaint) END_EVENT_TABLE() @@ -183,6 +181,10 @@ void wxFrame::DoSetClientSize(int width, int height) // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc. void wxFrame::DoGetClientSize(int *x, int *y) const { + wxSize size = GetSize(); + wxPoint pos = GetClientAreaOrigin(); + *x = size.x - pos.x - 1; + *y = size.y - pos.y - 1; } // ---------------------------------------------------------------------------- @@ -208,15 +210,16 @@ bool wxFrame::HandleMenuOpen() return true; } -bool wxFrame::HandleMenuSelect(EventType* event) +bool wxFrame::HandleMenuSelect(WXEVENTPTR event) { - int ItemID = event->data.menu.itemID; + const EventType *palmEvent = (EventType *)event; + const int ItemID = palmEvent->data.menu.itemID; if (!m_frameMenuBar) return false; - int item=m_frameMenuBar->ProcessCommand(ItemID); - if(item==-1) + const int item = m_frameMenuBar->ProcessCommand(ItemID); + if (item==-1) return false; wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item); @@ -228,11 +231,6 @@ bool wxFrame::HandleMenuSelect(EventType* event) #endif // wxUSE_MENUS_NATIVE -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ -} - void wxFrame::OnPaint(wxPaintEvent& event) { #if wxUSE_STATUSBAR @@ -275,24 +273,6 @@ void wxFrame::IconizeChildFrames(bool bIconize) { } -// =========================================================================== -// message processing -// =========================================================================== - -// --------------------------------------------------------------------------- -// our private (non virtual) message handlers -// --------------------------------------------------------------------------- - -bool wxFrame::HandlePaint() -{ - return false; -} - -bool wxFrame::HandleSize(int x, int y, WXUINT id) -{ - return false; -} - // ---------------------------------------------------------------------------- // 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 @@ -302,8 +282,17 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) // get the origin of the client area in the client coordinates wxPoint wxFrame::GetClientAreaOrigin() const { - Coord x, y; - WinWindowToDisplayPt(&x,&y); - wxPoint pt(x,y); - return pt; + // there is no API to get client area but we know + // it starts after titlebar and 1 pixel of form border + Coord maxY = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y), + X = 1, + Y = 0; + while ( Y < maxY ) + { + if(!FrmPointInTitle((FormType*)GetForm(),X,Y)) + return wxPoint(X,Y+1); + Y++; + } + + return wxPoint(X,0); }