]> Creatis software - bbtkGEditor.git/commitdiff
#3256 wxSizer bug
authorEduardo Davila <davila@ei-ed-606.creatis.insa-lyon.fr>
Fri, 6 Oct 2023 09:30:06 +0000 (11:30 +0200)
committerEduardo Davila <davila@ei-ed-606.creatis.insa-lyon.fr>
Fri, 6 Oct 2023 09:30:06 +0000 (11:30 +0200)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx

index dc6ac4cfe167863ccfc60478032f49783878c144..67a0351bd167a9ed7bceb584e90fa5784cebde11 100644 (file)
@@ -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<GPortModel*> lstInputs = _model->getInputPorts();
-               wxFlexGridSizer *sizer = new wxFlexGridSizer(lstInputs.size(),3,5,5);
+               std::vector<GPortModel*>    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();
        }