X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/db101bd35296e100d490d3c033c0fdee32747e85..94500b32849a55cb4e07f3f4d6b095090522adac:/src/palmos/frame.cpp diff --git a/src/palmos/frame.cpp b/src/palmos/frame.cpp index b64d4da89b..631d1ae7d5 100644 --- a/src/palmos/frame.cpp +++ b/src/palmos/frame.cpp @@ -57,6 +57,9 @@ #include "wx/univ/colschem.h" #endif // __WXUNIVERSAL__ +#include +#include + // ---------------------------------------------------------------------------- // globals // ---------------------------------------------------------------------------- @@ -70,7 +73,6 @@ // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) EVT_PAINT(wxFrame::OnPaint) END_EVENT_TABLE() @@ -183,6 +185,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; } // ---------------------------------------------------------------------------- @@ -193,24 +199,8 @@ void wxFrame::Raise() { } -// generate an artificial resize event -void wxFrame::SendSizeEvent() -{ -} - #if wxUSE_MENUS_NATIVE -void wxFrame::AttachMenuBar(wxMenuBar *menubar) -{ - wxFrameBase::AttachMenuBar(menubar); - - if ( !menubar ) - { - // actually remove the menu from the frame - m_hMenu = (WXHMENU)0; - } -} - void wxFrame::InternalSetMenuBar() { } @@ -224,13 +214,16 @@ bool wxFrame::HandleMenuOpen() return true; } -bool wxFrame::HandleMenuSelect(int ItemID) +bool wxFrame::HandleMenuSelect(WXEVENTPTR event) { + 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); @@ -242,11 +235,6 @@ bool wxFrame::HandleMenuSelect(int ItemID) #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 @@ -289,53 +277,6 @@ void wxFrame::IconizeChildFrames(bool bIconize) { } -WXHICON wxFrame::GetDefaultIcon() const -{ - // we don't have any standard icons (any more) - return (WXHICON)0; -} - -// =========================================================================== -// message processing -// =========================================================================== - -// --------------------------------------------------------------------------- -// preprocessing -// --------------------------------------------------------------------------- - -bool wxFrame::MSWTranslateMessage(WXMSG* pMsg) -{ - return false; -} - -// --------------------------------------------------------------------------- -// our private (non virtual) message handlers -// --------------------------------------------------------------------------- - -bool wxFrame::HandlePaint() -{ - return false; -} - -bool wxFrame::HandleSize(int x, int y, WXUINT id) -{ - return false; -} - -bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) -{ - return false; -} - -// --------------------------------------------------------------------------- -// the window proc for wxFrame -// --------------------------------------------------------------------------- - -WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) -{ - 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 @@ -345,6 +286,17 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara // get the origin of the client area in the client coordinates wxPoint wxFrame::GetClientAreaOrigin() const { - wxPoint pt; - 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); }