protected:
// regardless how deeply we are in wxWidgets hierarchy always get correct form
FormType* GetParentForm() const;
- uint16_t GetObjectIndex() const;
+ FormType* GetObjectFormIndex(uint16_t& index) const;
void* GetObjectPtr() const;
// choose the default border for this window
{
SetLabel(wxEmptyString);
m_isBeingDeleted = true;
+
+ DestroyChildren();
+
+ uint16_t index;
+ FormType* form = GetObjectFormIndex(index);
+ if(form!=NULL && index!=frmInvalidObjectId)
+ {
+ FrmRemoveObject((FormType **)&form,index);
+ }
}
// ----------------------------------------------------------------------------
( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y,
stdFont,
groupID,
- false
+ true
);
if(control==NULL)
return tlw->GetForm();
}
-uint16_t wxControl::GetObjectIndex() const
+FormType* wxControl::GetObjectFormIndex(uint16_t& index) const
{
FormType* form = GetParentForm();
- if(form==NULL)return frmInvalidObjectId;
- return FrmGetObjectIndex(form, GetId());
+ if(form!=NULL)
+ index = FrmGetObjectIndex(form, GetId());
+ else
+ index = frmInvalidObjectId;
+ return form;
}
void* wxControl::GetObjectPtr() const
{
- FormType* form = GetParentForm();
- if(form==NULL)return NULL;
- uint16_t index = FrmGetObjectIndex(form, GetId());
- if(index==frmInvalidObjectId)return NULL;
+ uint16_t index;
+ FormType* form = GetObjectFormIndex(index);
+ if(form==NULL || index==frmInvalidObjectId)return NULL;
return FrmGetObjectPtr(form,index);
}
if(!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
return false;
- return wxControl::PalmCreateField(label, pos, size, false, false, leftAlign);
+ // note that wxALIGN_LEFT is equal to 0 so we shouldn't
+ // test for it using & operator
+
+ JustificationType align = leftAlign;
+
+ if ( style & wxALIGN_CENTRE )
+ align = centerAlign ;
+ else if ( style & wxALIGN_RIGHT )
+ align = rightAlign;
+
+ return wxControl::PalmCreateField(label, pos, size, false, false, align);
}
wxBorder wxStaticText::GetDefaultBorder() const