From 2f90bbb89134c7de31a986a2d53519d4c2be221e Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Mon, 20 Oct 2025 15:00:40 +0200 Subject: [PATCH] #3540 LstCtrl width column --- packages/wx/src/bbwxListCtrl.cxx | 34 +++++++++++++++++------------- packages/wx/src/bbwxListCtrl.h | 36 +++++++++++++++++--------------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/packages/wx/src/bbwxListCtrl.cxx b/packages/wx/src/bbwxListCtrl.cxx index 5dcef49..b638274 100644 --- a/packages/wx/src/bbwxListCtrl.cxx +++ b/packages/wx/src/bbwxListCtrl.cxx @@ -18,11 +18,19 @@ void ListCtrl::Process() { wxListCtrl *lstctrl= ((wxListCtrl*)bbGetOutputWidget()); lstctrl->DeleteAllColumns(); - + int columnsize; + unsigned int i,iSize=bbGetInputTitles().size(); for (i=0;iAppendColumn( bbtk::std2wx( bbGetInputTitles()[i] ) , wxLIST_FORMAT_CENTRE ); +// lstctrl->AppendColumn( bbtk::std2wx( bbGetInputTitles()[i] ) , wxLIST_FORMAT_CENTRE ); + if ( iAppendColumn( 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 ) && (1SetItem(j,1, bbtk::std2wx( bbGetInputColumn01()[j] ) ); } if ((bbGetInputColumn02().size()==jSize ) && (2SetItem(j,2, bbtk::std2wx( bbGetInputColumn02()[j] ) ); } if ((bbGetInputColumn03().size()==jSize ) && (3SetItem(j,3, bbtk::std2wx( bbGetInputColumn03()[j] ) ); } @@ -46,42 +53,39 @@ void ListCtrl::Process() if ((bbGetInputColumn13().size()==jSize ) && (10SetItem(j,13,bbtk::std2wx( bbGetInputColumn13()[j] ) ); } if ((bbGetInputColumn14().size()==jSize ) && (10SetItem(j,14,bbtk::std2wx( bbGetInputColumn14()[j] ) ); } if ((bbGetInputColumn15().size()==jSize ) && (10SetItem(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 diff --git a/packages/wx/src/bbwxListCtrl.h b/packages/wx/src/bbwxListCtrl.h index c812c7d..6222515 100644 --- a/packages/wx/src/bbwxListCtrl.h +++ b/packages/wx/src/bbwxListCtrl.h @@ -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); + BBTK_DECLARE_INPUT(LstColumnSizes,std::vector); BBTK_DECLARE_INPUT(Column00,std::vector); BBTK_DECLARE_INPUT(Column01,std::vector); BBTK_DECLARE_INPUT(Column02,std::vector); @@ -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,""); - BBTK_INPUT(ListCtrl,Column00,"Column 0",std::vector,""); - BBTK_INPUT(ListCtrl,Column01,"Column 1",std::vector,""); - BBTK_INPUT(ListCtrl,Column02,"Column 2",std::vector,""); - BBTK_INPUT(ListCtrl,Column03,"Column 3",std::vector,""); - BBTK_INPUT(ListCtrl,Column04,"Column 4",std::vector,""); - BBTK_INPUT(ListCtrl,Column05,"Column 5",std::vector,""); - BBTK_INPUT(ListCtrl,Column06,"Column 6",std::vector,""); - BBTK_INPUT(ListCtrl,Column07,"Column 7",std::vector,""); - BBTK_INPUT(ListCtrl,Column08,"Column 8",std::vector,""); - BBTK_INPUT(ListCtrl,Column09,"Column 9",std::vector,""); - BBTK_INPUT(ListCtrl,Column10,"Column 10",std::vector,""); - BBTK_INPUT(ListCtrl,Column11,"Column 11",std::vector,""); - BBTK_INPUT(ListCtrl,Column12,"Column 12",std::vector,""); - BBTK_INPUT(ListCtrl,Column13,"Column 13",std::vector,""); - BBTK_INPUT(ListCtrl,Column14,"Column 14",std::vector,""); - BBTK_INPUT(ListCtrl,Column15,"Column 15",std::vector,""); + BBTK_INPUT(ListCtrl,Titles , "Titres" , std::vector,"" ); + BBTK_INPUT(ListCtrl,LstColumnSizes , "lst Column sizes", std::vector,"" ); + BBTK_INPUT(ListCtrl,Column00 , "Column 0" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column01 , "Column 1" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column02 , "Column 2" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column03 , "Column 3" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column04 , "Column 4" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column05 , "Column 5" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column06 , "Column 6" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column07 , "Column 7" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column08 , "Column 8" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column09 , "Column 9" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column10 , "Column 10" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column11 , "Column 11" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column12 , "Column 12" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column13 , "Column 13" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column14 , "Column 14" , std::vector,"" ); + BBTK_INPUT(ListCtrl,Column15 , "Column 15" , std::vector,"" ); BBTK_END_DESCRIBE_BLACK_BOX(ListCtrl); //===== -- 2.52.0