From d2f53a38136d0363078d32ea8712d77c63df8a0e Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Fri, 6 Oct 2023 11:30:06 +0200 Subject: [PATCH] #3256 wxSizer bug --- .../wxBlackBoxEditionDialog.cxx | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx index dc6ac4c..67a0351 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx @@ -108,9 +108,8 @@ namespace bbtk void wxBlackBoxEditionDialog::constructBlackBoxEditionDialog() { - wxBoxSizer *sizerDialog = new wxBoxSizer(wxVERTICAL); - - wxScrolledWindow *scrollWin = new wxScrolledWindow( this, -1, wxDefaultPosition, wxSize(200,200), wxVSCROLL); + wxBoxSizer *sizerDialog = new wxBoxSizer(wxVERTICAL); + wxScrolledWindow *scrollWin = new wxScrolledWindow( this, -1, wxDefaultPosition, wxSize(200,200), wxVSCROLL); wxString boxtype( crea::std2wx( _model->getBBTKType() ) ); @@ -133,9 +132,8 @@ namespace bbtk text->SetFont(font); textBoxName->SetFont(font); - - std::vector lstInputs = _model->getInputPorts(); - wxFlexGridSizer *sizer = new wxFlexGridSizer(lstInputs.size(),3,5,5); + std::vector lstInputs = _model->getInputPorts(); + wxFlexGridSizer *sizer = new wxFlexGridSizer(lstInputs.size(),3,5,5); sizer->AddGrowableCol(0); sizer->AddGrowableCol(1); sizer->AddGrowableCol(2); @@ -149,12 +147,9 @@ namespace bbtk wxStaticText *lblType = new wxStaticText(scrollWin, -1, std2wx(type),wxDefaultPosition,wxSize(250,25)); wxTextCtrl *txtValue = new wxTextCtrl(scrollWin, -1, _T(""),wxDefaultPosition,wxDefaultSize); - - lblName->SetToolTip( std2wx(port->getBBTKDescription()) ); txtValue->SetToolTip( std2wx(port->getBBTKDescription()) ); - - + if(port->getValue()!="") { std::string text = port->getValue(); @@ -182,12 +177,11 @@ namespace bbtk _lstValues.push_back(txtValue); _lstTypes.push_back(lblType); - sizer->Add(lblName,1,wxEXPAND,5); + sizer->Add(lblName,1,wxALIGN_RIGHT|wxEXPAND,5); sizer->Add(txtValue,1,wxEXPAND,5); - sizer->Add(lblType,1,wxCENTRE|wxEXPAND,5); + sizer->Add(lblType,1,wxEXPAND,5); } - wxBoxSizer *buts = new wxBoxSizer(wxHORIZONTAL); wxButton *okButton = new wxButton(scrollWin, -1, _T("Ok"),wxDefaultPosition, wxSize(70, 30)); wxButton *closeButton = new wxButton(scrollWin, -1, _T("Close"), wxDefaultPosition, wxSize(70, 30)); @@ -198,28 +192,34 @@ namespace bbtk buts->Add(okButton,0,wxCENTRE|wxEXPAND,5); buts->Add(closeButton,0,wxCENTRE|wxEXPAND,5); - sizerDialog->AddSpacer(10); - sizerDialog->Add(textBoxName,0,wxALIGN_TOP|wxALIGN_CENTER); + +// sizerDialog->Add(textBoxName,0,wxALIGN_TOP|wxALIGN_CENTER); + sizerDialog->Add(textBoxName,0,wxALIGN_CENTER); + sizerDialog->AddSpacer(10); sizerDialog->Add(boxnameSizer, wxSizerFlags(0).Align(0).Border(wxLEFT, 100)); sizerDialog->AddSpacer(10); - sizerDialog->Add(text,0,wxALIGN_TOP|wxALIGN_CENTER); - sizerDialog->AddSpacer(15); - sizerDialog->Add(sizer,0,wxALIGN_CENTER| wxEXPAND); + +// sizerDialog->Add(text,0,wxALIGN_TOP|wxALIGN_CENTER); + sizerDialog->Add(text,0,wxALIGN_CENTER); + + sizerDialog->AddSpacer(15); + +// sizerDialog->Add(sizer,0,wxALIGN_CENTER| wxEXPAND); + sizerDialog->Add(sizer,0, wxEXPAND); + sizerDialog->AddSpacer(15); - sizerDialog->Add(buts,0,wxALIGN_CENTER | wxTOP | wxBOTTOM); + sizerDialog->Add(buts,0,wxALIGN_CENTER | wxTOP ); scrollWin->SetSizer(sizerDialog); scrollWin->Centre(); - scrollWin->SetVirtualSize(400,400); scrollWin->SetSize(300,300); scrollWin->SetScrollbars(10, 10, 50, 50); // scrollWin->SetSizer(sizer); - ShowModal(); Destroy(); } -- 2.47.1