void OnComboBox(wxEvent& event);
void FillItems( int iSelection, std::vector< std::string > lstIn);
void VerifyDeselect(int iSelection);
-
void OnSpinCtrlClick(wxCommandEvent& event);
-
-
private:
int mTypeForm;
ComboBox *mBox;
// 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)
{
wxListBox *wxlistbox = new wxListBox ( panel , -1 , wxDefaultPosition,wxSize(sizeX,sizeY),0, NULL, wxLB_SINGLE );
Connect( wxchoice->GetId(),
wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
}
-
if (mBox->bbGetInputWithSpinButton()==true)
{
mwxspinbutton = new wxSpinButton( panel, -1 );
sizer->Add( mwxspinbutton,1,wxEXPAND );
}
sizer->AddGrowableCol(0);
-
panel->SetSizer(sizer);
FillItems( iSelection,lstIn );
}
{
mBox->bbSetInputSelection( iSelection );
mBox->bbSetOutputOut( iSelection );
-
// Patch to clean the spaces at the begining
std::string tmpStr = bbtk::wx2std( itemcontainer->GetString(iSelection) );
if (tmpStr.length()>0) { while(tmpStr[0]==' ') tmpStr.erase(0,1); }
mBox->bbSetOutputOutString( tmpStr );
// mBox->bbSetOutputOutString( bbtk::wx2std( itemcontainer->GetString(iSelection) ) );
-
mBox->bbSignalOutputModification();
VerifyDeselect(iSelection);
if (mTypeForm==0)
wxChoice *wxchoise=(wxChoice *)itemcontainer;
wxchoise->SetToolTip( itemcontainer->GetString(iSelection) );
} // if mTypeForm
-
-
// mBox->bbSignalOutputModification("Out");
// mBox->bbSignalOutputModification("OutString");
} // if iSelection
{
mwxspinbutton->SetValue( iSelection );
}
-
}
//--------------------------------------------------------------------------
void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
{
int i,size = lstIn.size();
-
-
#if defined(_WIN32)
// Patch to put spaces at the beginin
#else
} // for i
*/
#endif // defined(_WIN32)
-
itemcontainer->Clear();
for (i=0;i<size; i++)
{
}
} // iSelection
-
if (mTypeForm==0)
{
((wxChoice*)itemcontainer)->SetAutoLayout( true );
void ComboBox::Process()
{
int iSelection = bbGetInputSelection();
-// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; }
- if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=0; }
+// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection = bbGetInputIn().size()-1; }
+ if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection = 0; }
+ if (bbGetInputIn().size()==0) { iSelection = -1; }
ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
- if (w!=NULL) {
+ if (w!=NULL)
+ {
w->FillItems( iSelection, bbGetInputIn() );
bbSetInputSelection( iSelection );
bbSetOutputOut( iSelection );
bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
} // if InputIn size
bbSetOutputWidget( w );
-
}
//=====
// 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)
bbSetInputDeselect(false);
bbSetInputWithSpinButton(false);
}
-//=====
+
+//=====
// 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)
//=====
void ComboBox::bbUserInitializeProcessing()
{
}
+
//=====
// 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)
//=====