]> Creatis software - bbtk.git/commitdiff
#3283 BBTK Bug New Normal - ComboBox update
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 25 Jul 2019 14:10:35 +0000 (16:10 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 25 Jul 2019 14:10:35 +0000 (16:10 +0200)
packages/wx/src/bbwxComboBox.cxx
packages/wx/src/bbwxComboBox.h

index 29d37820119456194171df7eb87655fd3da63475..c075b701deaacff1bc4fd0753ac4fed913966bab 100644 (file)
@@ -164,12 +164,13 @@ void ComboBox::Process()
 {
        int iSelection = bbGetInputSelection();
        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) && ( (size-1)<=iSelection) ) 
+    if         (  (iSelection>=0) && ( iSelection<size) ) 
     { 
        bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
     } // if iSelection
index 6b1e702b2675047f75585f70f5dc70cc90c4bccb..1f1578153d02c276e1994ebbd1a841ce0b3faaaf 100644 (file)
@@ -39,13 +39,16 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ComboBox,bbtk::WxBlackBox);
        BBTK_AUTHOR("Info-Dev");
        BBTK_DESCRIPTION("No Description.");
        BBTK_CATEGORY("__CategoryBlackBox__");
+
        BBTK_INPUT(ComboBox,Title,"Title prepended to the text",std::string,"");
        BBTK_INPUT(ComboBox,Selection,"i element to be selected (default 0)",int,"");
        BBTK_INPUT(ComboBox,In,"Vector of strings",std::vector< std::string >,"");
        BBTK_INPUT(ComboBox,Form,"0 Combobox, 1 List  (default 0)",int,"");
        BBTK_INPUT(ComboBox,Deselect,"(default false) Just for List form",bool,"");
+
     BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
     BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");
+
 BBTK_END_DESCRIBE_BLACK_BOX(ComboBox);
 //===== 
 // 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)