} // Type Lsast_directories
numberOfFiles = numberOfFiles + tmpNumberOfFiles;
- } // if
+ } // if recursive
+ if ( fileName != "." && fileName != ".." && !recursive )
+ if ((bbGetInputType()==1) || (bbGetInputType()==2))
+ {
+ std::string temp = dirName+fileName;
+ Filenames.push_back(temp);
+ numberOfFiles++;
+ } // Type All_directories
+ }// fileName && !recursive
} else {
// std::string temp = "\"" +dirName+fileName + "\"";
std::string temp = dirName+fileName;
} // Type files
} // d_name
} else if ( S_ISDIR(buf.st_mode) ) { //directory?
- if ( d->d_name[0] != '.' && recursive ) //we also skip hidden files
+ if ( (d->d_name[0]!='.') && recursive ) //we also skip hidden files
{
if (bbGetInputType()==1)
{
numberOfFiles++;
} // Type Lsast_directories
numberOfFiles = numberOfFiles+tmpNumberOfFiles;
- } // d_name
+ }// d_name && recursive
+ if ( (d->d_name[0]!='.') && !recursive ) { //we also skip hidden files
+ if ((bbGetInputType()==1) || (bbGetInputType()==2))
+ {
+ Filenames.push_back(fileName);
+ numberOfFiles++;
+ } // Type All_directories
+
+ }// d_name && !recursive
+
} else {
//gdcmErrorMacro( "Unexpected error" );
return -1;
{
public:
ComboBoxWidget( ComboBox* box, wxWindow *parent,
- int iSelection,
- std::string title,
- std::vector< std::string > lstIn,
- int typeForm );
-
+ int iSelection,
+ std::string title,
+ std::vector< std::string > lstIn,
+ int typeForm );
~ComboBoxWidget();
-
+ void OnComboBox(int iSelection);
void OnComboBox(wxEvent& event);
void FillItems( int iSelection, std::vector< std::string > lstIn);
-
private:
- int mTypeForm;
+ int mTypeForm;
ComboBox *mBox;
- wxListBox *wxlistbox;
- wxChoice *wxchoice;
+ wxListBox *wxlistbox;
+ wxChoice *wxchoice;
};
mBox(box),
mTypeForm(typeForm)
{
- wxPanel *panel = this;
+ wxPanel *panel = this;
wxlistbox = NULL;
- wxchoice = NULL;
- int i;
-
-
+ wxchoice = NULL;
+ int i;
//---------------------------------------------------------------------
// 2) Insertion of the components in the window
}
sizer->AddGrowableCol(0);
panel->SetSizer(sizer);
-
-
+
//---------------------------------------------------------------------
// 1) Creation de wxChoise widget
wxchoice->SetSelection(iSelection);
sizer->Add( wxchoice,1,wxGROW );
}
-
-
// panel->SetAutoLayout(true);
// panel->Layout();
-
}
//-------------------------------------------------------------------------
{
}
+
+ //--------------------------------------------------------------------------
+ void ComboBoxWidget::OnComboBox(int iSelection)
+ {
+ mBox->bbSetInputSelection( iSelection );
+ mBox->bbSetOutputOut( iSelection );
+ mBox->bbSetOutputOutString( bbtk::wx2std( wxchoice->GetString(iSelection) ) );
+ mBox->bbSignalOutputModification("Out");
+ mBox->bbSignalOutputModification("OutString");
+ }
+
//--------------------------------------------------------------------------
void ComboBoxWidget::OnComboBox(wxEvent& event)
{
} else {
iSelection = wxchoice->GetSelection();
}
-
- mBox->bbSetInputSelection( iSelection );
- mBox->bbSetOutputOut( iSelection );
- mBox->bbSetOutputOutString( bbtk::wx2std( wxchoice->GetString(iSelection) ) );
- mBox->bbSignalOutputModification("Out");
- mBox->bbSignalOutputModification("OutString");
+ OnComboBox(iSelection);
}
-
//--------------------------------------------------------------------------
void ComboBoxWidget::FillItems(
int iSelection,
//=====
void ComboBox::Process()
{
- ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
- w->FillItems( bbGetInputSelection(),bbGetInputIn() );
+ int iSelection = bbGetInputSelection();
+ if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; }
+ ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
+ w->FillItems( iSelection, bbGetInputIn() );
+ bbSetInputSelection( iSelection );
+ bbSetOutputOut( iSelection );
+ bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
+// bbSignalOutputModification("Out");
+// bbSignalOutputModification("OutString");
+
}
//=====
ComboBoxWidget *w = new ComboBoxWidget(
this,
- parent,
+ parent,
bbGetInputSelection() ,
bbGetInputTitle(),
bbGetInputIn(),