X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fwx%2Fsrc%2FbbwxComboBox.cxx;h=8b2ea6479994078fb7d8d89022cd8f34382064ab;hb=19c9e9989a6be039aac2daac660e9133ee578ed7;hp=b11c55874b7ab4d32ebb5fb487020eb79812d5a0;hpb=f9574f4d8fb212474d38c304002a493051c7b579;p=bbtk.git diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx index b11c558..8b2ea64 100644 --- a/packages/wx/src/bbwxComboBox.cxx +++ b/packages/wx/src/bbwxComboBox.cxx @@ -29,6 +29,7 @@ namespace bbwx void OnComboBoxSelection(int iSelection); void OnComboBox(wxEvent& event); void FillItems( int iSelection, std::vector< std::string > lstIn); + void VerifyDeselect(int iSelection); private: int mTypeForm; @@ -53,7 +54,7 @@ namespace bbwx int sizeY ) : - wxPanel( parent, -1) , + wxPanel( parent, -1,wxDefaultPosition,wxSize(sizeX,sizeY) ) , mBox(box), mTypeForm(typeForm) { @@ -91,14 +92,25 @@ namespace bbwx { itemcontainer->Append( bbtk::std2wx( lstIn[i] ) ); } // for i - itemcontainer->SetSelection(iSelection); +// itemcontainer->SetSelection(iSelection); } - //------------------------------------------------------------------------- - + + //------------------------------------------------------------------------- ComboBoxWidget::~ComboBoxWidget() { } + //-------------------------------------------------------------------------- + void ComboBoxWidget::VerifyDeselect(int iSelection) + { + if ((iSelection>=0) && (mBox->bbGetInputDeselect()==true) ) + { + if (mTypeForm==1) + { + ((wxListBox*)itemcontainer)->Deselect( iSelection ); + } // if mTypeForm + } // if iSelection + } //-------------------------------------------------------------------------- void ComboBoxWidget::OnComboBoxSelection(int iSelection) @@ -108,8 +120,12 @@ namespace bbwx mBox->bbSetInputSelection( iSelection ); mBox->bbSetOutputOut( iSelection ); mBox->bbSetOutputOutString( bbtk::wx2std( itemcontainer->GetString(iSelection) ) ); - mBox->bbSignalOutputModification("Out"); - mBox->bbSignalOutputModification("OutString"); + mBox->bbSignalOutputModification(); + + VerifyDeselect(iSelection); + +// mBox->bbSignalOutputModification("Out"); +// mBox->bbSignalOutputModification("OutString"); } // if iSelection } @@ -127,7 +143,7 @@ namespace bbwx { itemcontainer->Append( bbtk::std2wx( lstIn[i] ) ); } // for i - itemcontainer->SetSelection(iSelection); + if (iSelection>=0) itemcontainer->SetSelection(iSelection); } BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox) @@ -143,14 +159,14 @@ void ComboBox::Process() w->FillItems( iSelection, bbGetInputIn() ); bbSetInputSelection( iSelection ); bbSetOutputOut( iSelection ); - int size = bbGetInputIn().size(); if ( (iSelection>0) && ( (size-1)<=iSelection) ) { bbSetOutputOutString( bbGetInputIn()[ iSelection ] ); - } -} + } // if iSelection + w->VerifyDeselect(iSelection); +} //===== // 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) //===== @@ -178,13 +194,13 @@ void ComboBox::bbUserSetDefaultValues() bbSetInputForm(0); bbSetInputWinWidth(100); bbSetInputWinHeight(200); + bbSetInputDeselect(false); } //===== // 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 ComboBox::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)