Flags for wxStaticText alignment. Destroying of the control. Internal minor reorganization.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// regardless how deeply we are in wxWidgets hierarchy always get correct form
|
// regardless how deeply we are in wxWidgets hierarchy always get correct form
|
||||||
FormType* GetParentForm() const;
|
FormType* GetParentForm() const;
|
||||||
uint16_t GetObjectIndex() const;
|
FormType* GetObjectFormIndex(uint16_t& index) const;
|
||||||
void* GetObjectPtr() const;
|
void* GetObjectPtr() const;
|
||||||
|
|
||||||
// choose the default border for this window
|
// choose the default border for this window
|
||||||
|
@@ -74,6 +74,15 @@ wxControl::~wxControl()
|
|||||||
{
|
{
|
||||||
SetLabel(wxEmptyString);
|
SetLabel(wxEmptyString);
|
||||||
m_isBeingDeleted = true;
|
m_isBeingDeleted = true;
|
||||||
|
|
||||||
|
DestroyChildren();
|
||||||
|
|
||||||
|
uint16_t index;
|
||||||
|
FormType* form = GetObjectFormIndex(index);
|
||||||
|
if(form!=NULL && index!=frmInvalidObjectId)
|
||||||
|
{
|
||||||
|
FrmRemoveObject((FormType **)&form,index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -119,7 +128,7 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
|||||||
( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y,
|
( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y,
|
||||||
stdFont,
|
stdFont,
|
||||||
groupID,
|
groupID,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
if(control==NULL)
|
if(control==NULL)
|
||||||
@@ -191,19 +200,21 @@ FormType* wxControl::GetParentForm() const
|
|||||||
return tlw->GetForm();
|
return tlw->GetForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t wxControl::GetObjectIndex() const
|
FormType* wxControl::GetObjectFormIndex(uint16_t& index) const
|
||||||
{
|
{
|
||||||
FormType* form = GetParentForm();
|
FormType* form = GetParentForm();
|
||||||
if(form==NULL)return frmInvalidObjectId;
|
if(form!=NULL)
|
||||||
return FrmGetObjectIndex(form, GetId());
|
index = FrmGetObjectIndex(form, GetId());
|
||||||
|
else
|
||||||
|
index = frmInvalidObjectId;
|
||||||
|
return form;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* wxControl::GetObjectPtr() const
|
void* wxControl::GetObjectPtr() const
|
||||||
{
|
{
|
||||||
FormType* form = GetParentForm();
|
uint16_t index;
|
||||||
if(form==NULL)return NULL;
|
FormType* form = GetObjectFormIndex(index);
|
||||||
uint16_t index = FrmGetObjectIndex(form, GetId());
|
if(form==NULL || index==frmInvalidObjectId)return NULL;
|
||||||
if(index==frmInvalidObjectId)return NULL;
|
|
||||||
return FrmGetObjectPtr(form,index);
|
return FrmGetObjectPtr(form,index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,7 +94,17 @@ bool wxStaticText::Create(wxWindow *parent,
|
|||||||
if(!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
|
if(!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
|
||||||
return false;
|
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
|
wxBorder wxStaticText::GetDefaultBorder() const
|
||||||
|
Reference in New Issue
Block a user