wxPoint palmPos(pos);
if((palmPos.x==wxDefaultCoord)||(palmPos.y==wxDefaultCoord))
{
- wxSize parentSize(parent->GetSize());
+ wxSize parentSize(parent->GetClientSize());
wxWindow* parentTLW = parent;
while ( parentTLW && !parentTLW->IsTopLevel() )
{
if(wxDynamicCast(parentTLW, wxFrame)!=NULL)
{
if(palmPos.x==wxDefaultCoord)
- palmPos.x = 1;
+ palmPos.x = 0;
if(palmPos.y==wxDefaultCoord)
palmPos.y = parentSize.y-palmSize.y;
}
else if(wxDynamicCast(parentTLW, wxDialog)!=NULL)
{
if(palmPos.x==wxDefaultCoord)
- palmPos.x = 5;
+ palmPos.x = 4;
if(palmPos.y==wxDefaultCoord)
palmPos.y = parentSize.y-palmSize.y-5;
}
if(form==NULL)
return false;
+
+ wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
+ y = pos.y == wxDefaultCoord ? 0 : pos.y,
+ w = size.x == wxDefaultCoord ? 1 : size.x,
+ h = size.y == wxDefaultCoord ? 1 : size.y;
+
+ AdjustForParentClientOrigin(x, y);
+
ControlType *control = CtlNewControl(
(void **)&form,
GetId(),
style,
wxEmptyString,
- ( pos.x == wxDefaultCoord ) ? winUndefConstraint : pos.x,
- ( pos.y == wxDefaultCoord ) ? winUndefConstraint : pos.y,
- ( size.x == wxDefaultCoord ) ? winUndefConstraint : size.x,
- ( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y,
+ x,
+ y,
+ w,
+ h,
stdFont,
groupID,
true
m_palmControl = true;
+ SetInitialBestSize(size);
SetLabel(label);
Show();
return true;
m_label = label;
+ wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
+ y = pos.y == wxDefaultCoord ? 0 : pos.y,
+ w = size.x == wxDefaultCoord ? 1 : size.x,
+ h = size.y == wxDefaultCoord ? 1 : size.y;
+
+ AdjustForParentClientOrigin(x, y);
+
FieldType *field = FldNewField(
(void **)&form,
GetId(),
- ( pos.x == wxDefaultCoord ) ? winUndefConstraint : pos.x,
- ( pos.y == wxDefaultCoord ) ? winUndefConstraint : pos.y,
- ( size.x == wxDefaultCoord ) ? winUndefConstraint : size.x,
- ( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y,
+ x,
+ y,
+ w,
+ h,
stdFont,
10,
editable,
m_palmField = true;
- Show();
+ SetInitialBestSize(size);
SetLabel(label);
+ Show();
return true;
}
// 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;
}
// ----------------------------------------------------------------------------
m_oldValue = m_oldPos = value;
+ wxCoord x = pos.x == wxDefaultCoord ? 0 : pos.x,
+ y = pos.y == wxDefaultCoord ? 0 : pos.y,
+ w = size.x == wxDefaultCoord ? 1 : size.x,
+ h = size.y == wxDefaultCoord ? 1 : size.y;
+
+ AdjustForParentClientOrigin(x, y);
+
SliderControlType *slider = CtlNewSliderControl (
(void **)&form,
GetId(),
NULL,
0,
0,
- pos.x,
- pos.y,
- size.x,
- size.y,
+ x,
+ y,
+ w,
+ h,
minValue,
maxValue,
1,
if(slider==NULL)
return false;
+ SetInitialBestSize(size);
Show();
return true;
}