wxWindow::GetClientAreaOrigin duplicated wxWindowBase method. Working wxFrame::GetClientAreaOrigin. Screen size metric.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2005-02-10 09:22:12 +00:00
parent 1b24b2b48c
commit f241653c17
4 changed files with 32 additions and 18 deletions

View File

@ -147,10 +147,6 @@ public:
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
public: public:
// For implementation purposes - sometimes decorations make the client area
// smaller
virtual wxPoint GetClientAreaOrigin() const;
// Windows subclassing // Windows subclassing
void SubclassWin(WXHWND hWnd); void SubclassWin(WXHWND hWnd);
void UnsubclassWin(); void UnsubclassWin();

View 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 // get the origin of the client area in the client coordinates
wxPoint wxFrame::GetClientAreaOrigin() const wxPoint wxFrame::GetClientAreaOrigin() const
{ {
Coord x, y; // there is no API to get client area but we know
WinWindowToDisplayPt(&x,&y); // it starts after titlebar and 1 pixel of form border
wxPoint pt(x,y); Coord maxY = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y),
return pt; X = 1,
Y = 0;
while ( Y < maxY )
{
if(!FrmPointInTitle(GetForm(),X,Y))
return wxPoint(X,Y+1);
Y++;
}
return wxPoint(X,0);
} }

View File

@ -2,10 +2,10 @@
// Name: src/palmos/settings.cpp // Name: src/palmos/settings.cpp
// Purpose: wxSystemSettingsNative implementation for Palm OS // Purpose: wxSystemSettingsNative implementation for Palm OS
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -125,7 +125,23 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
// Get a system metric, e.g. scrollbar size // Get a system metric, e.g. scrollbar size
int wxSystemSettingsNative::GetMetric(wxSystemMetric index) 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) bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)

View 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 // text metrics
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------