Further improvements in composite controls (wxRadioBox) on PalmOS.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -123,7 +123,14 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
|||||||
w = size.x == wxDefaultCoord ? 1 : size.x,
|
w = size.x == wxDefaultCoord ? 1 : size.x,
|
||||||
h = size.y == wxDefaultCoord ? 1 : size.y;
|
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(
|
ControlType *control = CtlNewControl(
|
||||||
(void **)&form,
|
(void **)&form,
|
||||||
@@ -299,18 +306,23 @@ void wxControl::DoSetBounds( RectangleType &rect )
|
|||||||
|
|
||||||
void wxControl::DoGetPosition( int *x, int *y ) const
|
void wxControl::DoGetPosition( int *x, int *y ) const
|
||||||
{
|
{
|
||||||
|
int ox = 0, oy = 0;
|
||||||
|
AdjustForParentClientOrigin(ox, oy);
|
||||||
|
|
||||||
RectangleType rect;
|
RectangleType rect;
|
||||||
DoGetBounds(rect);
|
DoGetBounds(rect);
|
||||||
|
|
||||||
if(x)
|
if(x)
|
||||||
*x = rect.topLeft.x;
|
*x = rect.topLeft.x - ox;
|
||||||
if(y)
|
if(y)
|
||||||
*y = rect.topLeft.y;
|
*y = rect.topLeft.y - oy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxControl::DoGetSize( int *width, int *height ) const
|
void wxControl::DoGetSize( int *width, int *height ) const
|
||||||
{
|
{
|
||||||
RectangleType rect;
|
RectangleType rect;
|
||||||
DoGetBounds(rect);
|
DoGetBounds(rect);
|
||||||
|
|
||||||
if(width)
|
if(width)
|
||||||
*width = rect.extent.x;
|
*width = rect.extent.x;
|
||||||
if(height)
|
if(height)
|
||||||
|
@@ -254,6 +254,8 @@ void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
{
|
{
|
||||||
wxRect oldRect = GetRect();
|
wxRect oldRect = GetRect();
|
||||||
|
|
||||||
|
m_pos.x = x;
|
||||||
|
m_pos.y = y;
|
||||||
m_size.x = width;
|
m_size.x = width;
|
||||||
m_size.y = height;
|
m_size.y = height;
|
||||||
|
|
||||||
@@ -292,7 +294,7 @@ void wxRadioBox::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
// get the origin of the client area in the client coordinates
|
// get the origin of the client area in the client coordinates
|
||||||
wxPoint wxRadioBox::GetClientAreaOrigin() const
|
wxPoint wxRadioBox::GetClientAreaOrigin() const
|
||||||
{
|
{
|
||||||
return GetParent()->GetClientAreaOrigin() + GetPosition();
|
return GetPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetString(int item, const wxString& label)
|
void wxRadioBox::SetString(int item, const wxString& label)
|
||||||
|
@@ -448,10 +448,10 @@ void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
|
|||||||
if(rect)
|
if(rect)
|
||||||
{
|
{
|
||||||
RectangleType dirtyRect;
|
RectangleType dirtyRect;
|
||||||
dirtyRect.topLeft.x = rect->GetX();
|
dirtyRect.topLeft.x = rect->GetX() - 1;
|
||||||
dirtyRect.topLeft.y = rect->GetY();
|
dirtyRect.topLeft.y = rect->GetY() - 1;
|
||||||
dirtyRect.extent.x = rect->GetWidth();
|
dirtyRect.extent.x = rect->GetWidth() + 1;
|
||||||
dirtyRect.extent.y = rect->GetHeight();
|
dirtyRect.extent.y = rect->GetHeight() + 1;
|
||||||
WinInvalidateRect(handle, &dirtyRect);
|
WinInvalidateRect(handle, &dirtyRect);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -510,6 +510,10 @@ void wxWindowPalm::DoGetClientSize(int *x, int *y) const
|
|||||||
|
|
||||||
void wxWindowPalm::DoGetPosition(int *x, int *y) const
|
void wxWindowPalm::DoGetPosition(int *x, int *y) const
|
||||||
{
|
{
|
||||||
|
if(x)
|
||||||
|
*x = 0;
|
||||||
|
if(y)
|
||||||
|
*y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowPalm::DoScreenToClient(int *x, int *y) const
|
void wxWindowPalm::DoScreenToClient(int *x, int *y) const
|
||||||
|
Reference in New Issue
Block a user