]> Creatis software - bbtk.git/commitdiff
#3466 Combobox with Spin
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 16 Jun 2021 13:47:42 +0000 (15:47 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 16 Jun 2021 13:47:42 +0000 (15:47 +0200)
packages/std/src/bbstdFilesFromDirectory.cxx
packages/std/src/bbstdFilesFromDirectory.h
packages/wx/src/bbwxComboBox.cxx
packages/wx/src/bbwxComboBox.h

index 387b5ad77aacfd7a2043b9048daed5491c20cdec..4caeae3c6cc4a96500ade9515abaeade4250e929 100644 (file)
@@ -49,18 +49,23 @@ void FilesFromDirectory::Process()
 {
        Filenames.clear();
        SimpleFilenames.clear();
-       if (bbGetInputIn()!="")
+       
+       if (bbGetInputActive()==true)
        {
-               DirName         = bbGetInputIn();
-               /*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() );
-               CleanFilenames( DirName );
-       } // if In
+               if (bbGetInputIn()!="")
+               {
+                       DirName         = bbGetInputIn();
+                       /*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() );
+                       CleanFilenames( DirName );
+               } // if In
+       } // Active
        bbSetOutputOut(Filenames);   
        bbSetOutputOutSimple(SimpleFilenames);   
 }
 
 void FilesFromDirectory::bbUserSetDefaultValues()
 {
+    bbSetInputActive(true);
     bbSetInputIn(".");
     bbSetInputRecursive(false);  
     bbSetInputType(0);  
index 841df20a83f8bf8ecc9fb570282d883975bf7c1d..f3b8671e3cc67a15ffeaebc4f4af2d14b68b75f7 100644 (file)
@@ -39,6 +39,7 @@ namespace bbstd
     public bbtk::AtomicBlackBox
   {
     BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox);
+    BBTK_DECLARE_INPUT(Active,bool);
     BBTK_DECLARE_INPUT(In,std::string);
     BBTK_DECLARE_INPUT(Recursive,bool);  
     BBTK_DECLARE_INPUT(RecursiveLevel,int);  
@@ -69,6 +70,7 @@ namespace bbstd
    BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory");
    BBTK_CATEGORY("");
 
+   BBTK_INPUT(FilesFromDirectory,Active,"(default true) Active true/false ",bool,"");
    BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,"");
    BBTK_INPUT(FilesFromDirectory,Recursive,"(default false) Recursive directory exploration",bool,"");
    BBTK_INPUT(FilesFromDirectory,Type,"(0 default) 0=files 1=All_directories 2=last_directories  ",int,"");
index 086708b92fa2fa554b0f160fc006ff2418a16960..e1883ace8c15fd3d0402590d9c5002b1e1430604 100644 (file)
@@ -72,10 +72,15 @@ namespace bbwx
     // 2) Insertion of the components in the window
     
     // We use a FlexGridSizer
+//    wxFlexGridSizer *sizerV          = new wxFlexGridSizer(1);
+//    wxFlexGridSizer *sizerH1 = new wxFlexGridSizer(0);
+//    wxFlexGridSizer *sizerH2 = new wxFlexGridSizer(2);
     wxFlexGridSizer *sizer     = new wxFlexGridSizer(2);
+       
     if (title!="")
     {
           sizer->Add( new wxStaticText(panel,-1,  bbtk::std2wx(title) ) ); 
+          sizer->Add( new wxStaticText(panel,-1,  _T("") ) ); 
     }
     //---------------------------------------------------------------------
        if (mTypeForm==1)
@@ -101,19 +106,12 @@ namespace bbwx
                         (wxObjectEventFunction) 
                         (void (wxPanel::*)(wxScrollEvent&))
                         &ComboBoxWidget::OnSpinCtrlClick);
-  
                sizer->Add( mwxspinbutton,1,wxEXPAND ); 
        }
-
     sizer->AddGrowableCol(0);
+
     panel->SetSizer(sizer);
-       FillItems( iSelection,lstIn );
-       
-//     for (i=0;i<lstIn.size(); i++)
-//     {
-//             itemcontainer->Append(  bbtk::std2wx( lstIn[i] )  ); 
-//     } // for i
-//     itemcontainer->SetSelection(iSelection);
+       FillItems( iSelection,lstIn );  
   }
 
   //-------------------------------------------------------------------------  
@@ -177,23 +175,8 @@ void ComboBoxWidget::OnComboBox(wxEvent& event)
 void ComboBoxWidget::OnSpinCtrlClick(wxCommandEvent& event)
 {
        int iSelection = mwxspinbutton->GetValue();
-       printf("EED ComboBoxWidget::OnSpinCtrlClick %d\n", iSelection );
        itemcontainer->SetSelection(iSelection);
        OnComboBoxSelection( iSelection );
-
-/*
-       if (mBox->bbGetInputType()==0)
-       {
-         mBox->bbSetOutputOut( mwxSpinCtrl->GetValue() );
-       } else {
-         mBox->bbSetOutputOut( mwxSpinButton->GetValue() );
-       }// if Type
-
-         // and signal that the output has changed
-         //if(_reactiveOnKeyStroke==1){
-         mBox->bbSignalOutputModification(std::string("Out"));
-         //}
-*/       
 }
 
 
index de0b439ca8d61014b182ad7f259fe1a972c71158..3a02e0539bbd04bf83352eb5d5f512816479264d 100644 (file)
@@ -48,7 +48,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ComboBox,bbtk::WxBlackBox);
        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_INPUT(ComboBox,WithSpinButton,"(default false) With spin button",bool,"");
+       BBTK_INPUT(ComboBox,WithSpinButton,"(default false) With spin button true/false",bool,"");
 
     BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
     BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");