]> git.saurik.com Git - wxWidgets.git/commitdiff
wxWindow::GetClientAreaOrigin duplicated wxWindowBase method. Working wxFrame::GetCli...
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 10 Feb 2005 09:22:12 +0000 (09:22 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 10 Feb 2005 09:22:12 +0000 (09:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/palmos/window.h
src/palmos/frame.cpp
src/palmos/settings.cpp
src/palmos/window.cpp

index 8c1f1dd31ebcf2a615b525e384476d28544e5aca..460e2242e84707d6f6ce6461fbdb9604b65bb632 100644 (file)
@@ -147,10 +147,6 @@ public:
     void OnPaint(wxPaintEvent& event);
 
 public:
-    // For implementation purposes - sometimes decorations make the client area
-    // smaller
-    virtual wxPoint GetClientAreaOrigin() const;
-
     // Windows subclassing
     void SubclassWin(WXHWND hWnd);
     void UnsubclassWin();
index 2267eee58ef5d26c1b62dc0d904306a0b67ac39d..c81817af9299809c46f35c59c77839eb2eeef0b3 100644 (file)
@@ -302,8 +302,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(GetForm(),X,Y))
+            return wxPoint(X,Y+1);
+        Y++;
+    }
+
+    return wxPoint(X,0);
 }
index 4191175eb34c5011ee74ab891ca10a6248fb3f6b..25239aba83dea300eca5e6e1ddf6e77421cfcf5e 100644 (file)
@@ -2,10 +2,10 @@
 // Name:        src/palmos/settings.cpp
 // Purpose:     wxSystemSettingsNative implementation for Palm OS
 // Author:      William Osborne - minimal working wxPalmOS port
-// Modified by:
+// Modified by: Wlodzimierz ABX Skiba - native implementation
 // Created:     10/13/04
 // RCS-ID:      $Id$
-// Copyright:   (c) William Osborne
+// Copyright:   (c) William Osborne, Wlodzimierz Skiba
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -125,7 +125,23 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
 // Get a system metric, e.g. scrollbar size
 int wxSystemSettingsNative::GetMetric(wxSystemMetric index)
 {
-    return -1;
+    int metric = -1;
+    uint32_t attrP;
+
+    switch( index )
+    {
+        case wxSYS_SCREEN_X:
+            WinScreenGetAttribute(winScreenWidth, &attrP);
+            metric = attrP;
+            break;
+
+        case wxSYS_SCREEN_Y:
+            WinScreenGetAttribute(winScreenHeight, &attrP);
+            metric = attrP;
+            break;
+    }
+
+    return metric;
 }
 
 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
index 5eba9aed6a763f4af0909333d1770177b524d6d2..6ecb274dfa892473c3dc40d63f6466182cad0111 100644 (file)
@@ -558,13 +558,6 @@ void wxWindowPalm::DoSetClientSize(int width, int height)
 {
 }
 
-// For implementation purposes - sometimes decorations make the client area
-// smaller
-wxPoint wxWindowPalm::GetClientAreaOrigin() const
-{
-    return wxPoint(0, 0);
-}
-
 // ---------------------------------------------------------------------------
 // text metrics
 // ---------------------------------------------------------------------------