~ComboBoxWidget();
void OnComboBox(wxEvent& event);
+ void FillItems( int iSelection, std::vector< std::string > lstIn);
+
private:
int mTypeForm;
Connect( wxlistbox->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
for (i=0;i<lstIn.size(); i++)
{
- wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
+ wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
wxlistbox->SetSelection(iSelection);
sizer->Add( wxlistbox,1,wxGROW );
Connect( wxchoice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
for (i=0;i<lstIn.size(); i++)
{
- wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
+ wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
wxchoice->SetSelection(iSelection);
sizer->Add( wxchoice,1,wxGROW );
mBox->bbSignalOutputModification("OutString");
}
+//--------------------------------------------------------------------------
+ void ComboBoxWidget::FillItems(
+ int iSelection,
+ std::vector< std::string > lstIn
+ )
+ {
+ int i;
+ if (mTypeForm==1)
+ {
+ wxlistbox->Clear();
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxlistbox->SetSelection(iSelection);
+ } else {
+ wxchoice->Clear();
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxchoice->SetSelection(iSelection);
+ } // if
+ }
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
//=====
void ComboBox::Process()
{
+ ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
+ w->FillItems( bbGetInputSelection(),bbGetInputIn() );
}
+
//=====
// 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)
//=====