If you create a wxAuiToolBar containing an element with a proportion of 1, then maximize the main frame and then change the Scale from, say, 100% to 175%, you'll see that the elements with a proportion of 1 collapse.
In my example below, this can be seen in the wxAuiToolBar::AddStretchSpacer and wxTextCtrl elements.
wxAuiToolBar elements should not collapse, but should take up the full available width.
wxAuiToolBar collapsed, if we restore the previous size, the display will be correctedHere is code for test
#include <wx/wx.h> #include <wx/aui/auibar.h> class MyFrame : public wxFrame { public: MyFrame() : wxFrame( nullptr, wxID_ANY, "wxAuiToolBar example", wxDefaultPosition, wxSize(700, 200)) { auto* mainSizer = new wxBoxSizer(wxVERTICAL); auto* toolbar1 = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND); auto* label1 = new wxStaticText(toolbar1, wxID_ANY, "Name:"); auto* textCtrl = new wxTextCtrl(toolbar1, wxID_ANY); toolbar1->AddControl(label1); auto* textItem = toolbar1->AddControl(textCtrl); textItem->SetProportion(1); toolbar1->Realize(); auto* toolbar2 = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORIZONTAL); auto* label2 = new wxStaticText(toolbar2, wxID_ANY, "Left"); auto* label3 = new wxStaticText(toolbar2, wxID_ANY, "Right"); toolbar2->AddControl(label2); toolbar2->AddStretchSpacer(1); toolbar2->AddControl(label3); toolbar2->Realize(); mainSizer->Add(toolbar1, 0, wxEXPAND); mainSizer->Add(toolbar2, 0, wxEXPAND); SetSizer(mainSizer); Layout(); } }; class MyApp : public wxApp { public: bool OnInit() override { auto* frame = new MyFrame(); frame->Show(); return true; } }; wxIMPLEMENT_APP(MyApp);
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()