w = size.x == wxDefaultCoord ? 1 : size.x,
h = size.y == wxDefaultCoord ? 1 : size.y;
- AdjustForParentClientOrigin(x, y);
+ wxWindow *win = this;
+ while(win->GetParent())
+ {
+ win = win->GetParent();
+ wxPoint pt(win->GetClientAreaOrigin());
+ x += pt.x;
+ y += pt.y;
+ }
ControlType *control = CtlNewControl(
(void **)&form,
void wxControl::DoGetPosition( int *x, int *y ) const
{
+ int ox = 0, oy = 0;
+ AdjustForParentClientOrigin(ox, oy);
+
RectangleType rect;
DoGetBounds(rect);
+
if(x)
- *x = rect.topLeft.x;
+ *x = rect.topLeft.x - ox;
if(y)
- *y = rect.topLeft.y;
+ *y = rect.topLeft.y - oy;
}
void wxControl::DoGetSize( int *width, int *height ) const
{
RectangleType rect;
DoGetBounds(rect);
+
if(width)
*width = rect.extent.x;
if(height)
{
wxRect oldRect = GetRect();
+ m_pos.x = x;
+ m_pos.y = y;
m_size.x = width;
m_size.y = height;
// get the origin of the client area in the client coordinates
wxPoint wxRadioBox::GetClientAreaOrigin() const
{
- return GetParent()->GetClientAreaOrigin() + GetPosition();
+ return GetPosition();
}
void wxRadioBox::SetString(int item, const wxString& label)
if(rect)
{
RectangleType dirtyRect;
- dirtyRect.topLeft.x = rect->GetX();
- dirtyRect.topLeft.y = rect->GetY();
- dirtyRect.extent.x = rect->GetWidth();
- dirtyRect.extent.y = rect->GetHeight();
+ dirtyRect.topLeft.x = rect->GetX() - 1;
+ dirtyRect.topLeft.y = rect->GetY() - 1;
+ dirtyRect.extent.x = rect->GetWidth() + 1;
+ dirtyRect.extent.y = rect->GetHeight() + 1;
WinInvalidateRect(handle, &dirtyRect);
}
else
void wxWindowPalm::DoGetPosition(int *x, int *y) const
{
+ if(x)
+ *x = 0;
+ if(y)
+ *y = 0;
}
void wxWindowPalm::DoScreenToClient(int *x, int *y) const