mBox(box),
mTypeForm(typeForm)
{
- wxPanel *panel = this;
itemcontainer = NULL;
- int i;
-
+ wxPanel *panel = this;
+ int i;
//---------------------------------------------------------------------
// 2) Insertion of the components in the window
wxChoice *wxchoice = new wxChoice ( panel , -1, wxDefaultPosition,wxSize(sizeX,sizeY));
itemcontainer=wxchoice;
sizer->Add( wxchoice,1,wxGROW );
-
Connect( wxchoice->GetId(),
wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
}
mBox->bbSetOutputOut( iSelection );
mBox->bbSetOutputOutString( bbtk::wx2std( itemcontainer->GetString(iSelection) ) );
mBox->bbSignalOutputModification();
-
VerifyDeselect(iSelection);
-
if (mTypeForm==0)
{
wxChoice *wxchoise=(wxChoice *)itemcontainer;
} // if iSelection
}
- //--------------------------------------------------------------------------
- void ComboBoxWidget::OnComboBox(wxEvent& event)
- {
+//--------------------------------------------------------------------------
+void ComboBoxWidget::OnComboBox(wxEvent& event)
+{
OnComboBoxSelection( itemcontainer->GetSelection() );
- }
+}
+
//--------------------------------------------------------------------------
- void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+{
+ int i;
+ itemcontainer->Clear();
+ for (i=0;i<lstIn.size(); i++)
{
- int i;
- itemcontainer->Clear();
- for (i=0;i<lstIn.size(); i++)
- {
- itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
- } // for i
- if (iSelection>=0) itemcontainer->SetSelection(iSelection);
- }
+ itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ if (iSelection>=0) itemcontainer->SetSelection(iSelection);
+}
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
+
//=====
// 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)
//=====
{
bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
} // if iSelection
-
w->VerifyDeselect(iSelection);
}
//=====
bbGetInputForm(),
bbGetInputWinWidth(), bbGetInputWinHeight() );
bbSetOutputOut( bbGetInputSelection() );
- bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+ if (bbGetInputIn().size()> bbGetInputSelection() )
+ {
+ bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+ } // if InputIn size
bbSetOutputWidget( w );
}
//=====