Use 'fit exactly' on button page in widgets sample to toggle wxBU_EXACTFIT
This commit is contained in:
@@ -111,9 +111,6 @@ protected:
|
|||||||
// (re)create the wxButton
|
// (re)create the wxButton
|
||||||
void CreateButton();
|
void CreateButton();
|
||||||
|
|
||||||
// add m_button to m_sizerButton using current value of m_chkFit
|
|
||||||
void AddButtonToSizer();
|
|
||||||
|
|
||||||
// helper function: create a bitmap for wxBitmapButton
|
// helper function: create a bitmap for wxBitmapButton
|
||||||
wxBitmap CreateBitmap(const wxString& label, const wxArtID& type);
|
wxBitmap CreateBitmap(const wxString& label, const wxArtID& type);
|
||||||
|
|
||||||
@@ -364,7 +361,7 @@ void ButtonWidgetsPage::CreateContent()
|
|||||||
void ButtonWidgetsPage::Reset()
|
void ButtonWidgetsPage::Reset()
|
||||||
{
|
{
|
||||||
m_chkBitmapOnly->SetValue(false);
|
m_chkBitmapOnly->SetValue(false);
|
||||||
m_chkFit->SetValue(true);
|
m_chkFit->SetValue(false);
|
||||||
m_chkAuthNeeded->SetValue(false);
|
m_chkAuthNeeded->SetValue(false);
|
||||||
m_chkTextAndBitmap->SetValue(false);
|
m_chkTextAndBitmap->SetValue(false);
|
||||||
m_chkDefault->SetValue(false);
|
m_chkDefault->SetValue(false);
|
||||||
@@ -453,6 +450,11 @@ void ButtonWidgetsPage::CreateButton()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_chkFit->GetValue() )
|
||||||
|
{
|
||||||
|
flags |= wxBU_EXACTFIT;
|
||||||
|
}
|
||||||
|
|
||||||
bool showsBitmap = false;
|
bool showsBitmap = false;
|
||||||
if ( m_chkBitmapOnly->GetValue() )
|
if ( m_chkBitmapOnly->GetValue() )
|
||||||
{
|
{
|
||||||
@@ -557,25 +559,13 @@ void ButtonWidgetsPage::CreateButton()
|
|||||||
|
|
||||||
m_button->Enable(!m_chkDisable->IsChecked());
|
m_button->Enable(!m_chkDisable->IsChecked());
|
||||||
|
|
||||||
AddButtonToSizer();
|
m_sizerButton->AddStretchSpacer();
|
||||||
|
m_sizerButton->Add(m_button, wxSizerFlags().Centre().Border());
|
||||||
|
m_sizerButton->AddStretchSpacer();
|
||||||
|
|
||||||
m_sizerButton->Layout();
|
m_sizerButton->Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ButtonWidgetsPage::AddButtonToSizer()
|
|
||||||
{
|
|
||||||
if ( m_chkFit->GetValue() )
|
|
||||||
{
|
|
||||||
m_sizerButton->AddStretchSpacer(1);
|
|
||||||
m_sizerButton->Add(m_button, wxSizerFlags(0).Centre().Border());
|
|
||||||
m_sizerButton->AddStretchSpacer(1);
|
|
||||||
}
|
|
||||||
else // take up the entire space
|
|
||||||
{
|
|
||||||
m_sizerButton->Add(m_button, wxSizerFlags(1).Expand().Border());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// event handlers
|
// event handlers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user