X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=packages%2Fwx%2Fsrc%2FbbwxComboBox.cxx;h=f0c3cc5d23de828a180d3a8ed0fd9fafb7ac11d2;hb=9834268e7f5831df43fb680b25206b05b873c94c;hp=e1883ace8c15fd3d0402590d9c5002b1e1430604;hpb=f26b702afa376d56bd1c53c54b71f0ae1608e035;p=bbtk.git diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx index e1883ac..f0c3cc5 100644 --- a/packages/wx/src/bbwxComboBox.cxx +++ b/packages/wx/src/bbwxComboBox.cxx @@ -4,7 +4,6 @@ #include "bbwxComboBox.h" #include "bbwxPackage.h" - #include #include @@ -58,8 +57,7 @@ namespace bbwx int typeForm, int sizeX, int sizeY - ) - : + ) : wxPanel( parent, -1,wxDefaultPosition ) , mBox(box), mTypeForm(typeForm) @@ -83,6 +81,7 @@ namespace bbwx sizer->Add( new wxStaticText(panel,-1, _T("") ) ); } //--------------------------------------------------------------------- + if (mTypeForm==1) { wxListBox *wxlistbox = new wxListBox ( panel , -1 , wxDefaultPosition,wxSize(sizeX,sizeY),0, NULL, wxLB_SINGLE ); @@ -183,12 +182,13 @@ void ComboBoxWidget::OnSpinCtrlClick(wxCommandEvent& event) //-------------------------------------------------------------------------- void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn ) { - int i,size=lstIn.size(); + int i,size = lstIn.size(); #if defined(_WIN32) // Patch to put spaces at the beginin #else + /* // Patch to put spaces at the beginin int strLength=-1; // Looking for the longest string @@ -206,6 +206,7 @@ void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn lstIn[i]=" "+lstIn[i]; // spaces characters } // for ii } // for i + */ #endif // defined(_WIN32) itemcontainer->Clear(); @@ -240,18 +241,20 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox); void ComboBox::Process() { int iSelection = bbGetInputSelection(); - if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; } -// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=0; } +// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; } + if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=0; } ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget(); - w->FillItems( iSelection, bbGetInputIn() ); - bbSetInputSelection( iSelection ); - bbSetOutputOut( iSelection ); - int size = bbGetInputIn().size(); - if ( (iSelection>=0) && ( iSelectionVerifyDeselect(iSelection); + if (w!=NULL) { + w->FillItems( iSelection, bbGetInputIn() ); + bbSetInputSelection( iSelection ); + bbSetOutputOut( iSelection ); + int size = bbGetInputIn().size(); + if ( (iSelection>=0) && ( iSelectionVerifyDeselect(iSelection); + } // if w } //===== // 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) @@ -272,6 +275,7 @@ void ComboBox::CreateWidget(wxWindow* parent) bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] ); } // if InputIn size bbSetOutputWidget( w ); + } //===== // 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) @@ -297,9 +301,8 @@ void ComboBox::bbUserInitializeProcessing() //===== void ComboBox::bbUserFinalizeProcessing() { - } -} -// EO namespace bbwx + +}// EO namespace bbwx