]> Creatis software - bbtk.git/commitdiff
#3540 LstCtrl width column
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 20 Oct 2025 13:00:40 +0000 (15:00 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 20 Oct 2025 13:00:40 +0000 (15:00 +0200)
packages/wx/src/bbwxListCtrl.cxx
packages/wx/src/bbwxListCtrl.h

index 5dcef49147ff8df244530b36134a92c58bbd2836..b6382743a8db1a0606d8f5f50cc4475a273de4c5 100644 (file)
@@ -18,11 +18,19 @@ void ListCtrl::Process()
 {
        wxListCtrl *lstctrl= ((wxListCtrl*)bbGetOutputWidget());
        lstctrl->DeleteAllColumns();    
-
+    int columnsize;
+    
        unsigned int i,iSize=bbGetInputTitles().size();
        for (i=0;i<iSize;i++)
        {
-               lstctrl->AppendColumn( bbtk::std2wx( bbGetInputTitles()[i] ) , wxLIST_FORMAT_CENTRE );          
+//             lstctrl->AppendColumn( bbtk::std2wx( bbGetInputTitles()[i] ) , wxLIST_FORMAT_CENTRE );
+        if ( i<bbGetInputLstColumnSizes().size() )
+        {
+            columnsize = bbGetInputLstColumnSizes()[i];
+        } else {
+            columnsize = 400;
+        }
+        lstctrl->AppendColumn( bbtk::std2wx( bbGetInputTitles()[i] ), wxLIST_FORMAT_LEFT, columnsize );
        } // for i
 
     unsigned int j,jSize=bbGetInputColumn00().size();
@@ -30,7 +38,6 @@ void ListCtrl::Process()
        {
         lstctrl->InsertItem(j, bbtk::std2wx("0") );
         lstctrl->SetItem(j,0, bbtk::std2wx( bbGetInputColumn00()[j] ) );
-          
         if ((bbGetInputColumn01().size()==jSize ) && (1<iSize) ) { lstctrl->SetItem(j,1, bbtk::std2wx( bbGetInputColumn01()[j] ) ); }
         if ((bbGetInputColumn02().size()==jSize ) && (2<iSize) ) { lstctrl->SetItem(j,2, bbtk::std2wx( bbGetInputColumn02()[j] ) ); }
         if ((bbGetInputColumn03().size()==jSize ) && (3<iSize) ) { lstctrl->SetItem(j,3, bbtk::std2wx( bbGetInputColumn03()[j] ) ); }
@@ -46,42 +53,39 @@ void ListCtrl::Process()
         if ((bbGetInputColumn13().size()==jSize ) && (10<iSize)) { lstctrl->SetItem(j,13,bbtk::std2wx( bbGetInputColumn13()[j] ) ); }
         if ((bbGetInputColumn14().size()==jSize ) && (10<iSize)) { lstctrl->SetItem(j,14,bbtk::std2wx( bbGetInputColumn14()[j] ) ); }
         if ((bbGetInputColumn15().size()==jSize ) && (10<iSize)) { lstctrl->SetItem(j,15,bbtk::std2wx( bbGetInputColumn15()[j] ) ); }
-
        } // for j
-
-  
-  
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void ListCtrl::CreateWidget(wxWindow* parent)
 {
 //  |wxLC_NO_HEADER
    bbSetOutputWidget( new wxListCtrl ( parent , -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT  )  );
-  
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void ListCtrl::bbUserSetDefaultValues()
 {
-
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void ListCtrl::bbUserInitializeProcessing()
 {
-
 }
-//===== 
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void ListCtrl::bbUserFinalizeProcessing()
 {
-
 }
+
 }
 // EO namespace bbwx
 
index c812c7d91a30ac0f8347df568b3c9d7e16749bcd..622251508aa6597b869af02e8cde5c57a6a6998b 100644 (file)
@@ -20,6 +20,7 @@ class bbwx_EXPORT ListCtrl
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
     BBTK_DECLARE_INPUT(Titles,std::vector<std::string>);
+    BBTK_DECLARE_INPUT(LstColumnSizes,std::vector<int>);
     BBTK_DECLARE_INPUT(Column00,std::vector<std::string>);
     BBTK_DECLARE_INPUT(Column01,std::vector<std::string>);
     BBTK_DECLARE_INPUT(Column02,std::vector<std::string>);
@@ -51,23 +52,24 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ListCtrl,bbtk::WxBlackBox);
     BBTK_DESCRIPTION("No Description.");
     BBTK_CATEGORY("__CategoryBlackBox__");
 
-    BBTK_INPUT(ListCtrl,Titles,"Titres",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column00,"Column  0",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column01,"Column  1",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column02,"Column  2",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column03,"Column  3",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column04,"Column  4",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column05,"Column  5",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column06,"Column  6",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column07,"Column  7",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column08,"Column  8",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column09,"Column  9",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column10,"Column 10",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column11,"Column 11",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column12,"Column 12",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column13,"Column 13",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column14,"Column 14",std::vector<std::string>,"");
-    BBTK_INPUT(ListCtrl,Column15,"Column 15",std::vector<std::string>,"");
+    BBTK_INPUT(ListCtrl,Titles          , "Titres"          , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,LstColumnSizes  , "lst Column sizes", std::vector<int>,""           );
+    BBTK_INPUT(ListCtrl,Column00        , "Column  0"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column01        , "Column  1"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column02        , "Column  2"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column03        , "Column  3"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column04        , "Column  4"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column05        , "Column  5"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column06        , "Column  6"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column07        , "Column  7"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column08        , "Column  8"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column09        , "Column  9"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column10        , "Column 10"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column11        , "Column 11"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column12        , "Column 12"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column13        , "Column 13"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column14        , "Column 14"       , std::vector<std::string>,""   );
+    BBTK_INPUT(ListCtrl,Column15        , "Column 15"       , std::vector<std::string>,""   );
 
 BBTK_END_DESCRIBE_BLACK_BOX(ListCtrl);
 //=====