Remove wxStaticBox custom drawing code entirely

Get rid of a big amount of non-trivial drawing code at the price of
having to switch to using a control label if the foreground colour is
changed, as we can't change the label colour otherwise now.

The only known drawback of this change is that the box will flicker now
if doubler buffering is disabled. But as long as we do use double
buffering, it shouldn't be a problem.
This commit is contained in:
Vadim Zeitlin 2022-11-08 20:20:50 +00:00
parent 60765babb6
commit 616586f301
6 changed files with 46 additions and 472 deletions

View file

@ -583,7 +583,9 @@ void StaticWidgetsPage::OnBoxCheckBox(wxCommandEvent& event)
void StaticWidgetsPage::OnButtonBoxText(wxCommandEvent& WXUNUSED(event))
{
m_sizerStatBox->GetStaticBox()->SetLabel(m_textBox->GetValue());
wxStaticBox* const box = m_sizerStatBox->GetStaticBox();
box->SetLabel(m_textBox->GetValue());
wxLogMessage("Box label changed, now is '%s'", box->GetLabel());
}
void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& WXUNUSED(event))