void OnComboBoxSelection(int iSelection);
void OnComboBox(wxEvent& event);
void FillItems( int iSelection, std::vector< std::string > lstIn);
+ void VerifyDeselect(int iSelection);
private:
int mTypeForm;
int sizeY
)
:
- wxPanel( parent, -1) ,
+ wxPanel( parent, -1,wxDefaultPosition ) ,
mBox(box),
mTypeForm(typeForm)
{
{
sizer->Add( new wxStaticText(panel,-1, bbtk::std2wx(title) ) );
}
- sizer->AddGrowableCol(0);
- panel->SetSizer(sizer);
//---------------------------------------------------------------------
if (mTypeForm==1)
{
Connect( wxlistbox->GetId(),
wxEVT_COMMAND_LISTBOX_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
} else if (mTypeForm==0) {
- wxChoice *wxchoice = new wxChoice ( panel , -1 );
+ wxChoice *wxchoice = new wxChoice ( panel , -1);
itemcontainer=wxchoice;
sizer->Add( wxchoice,1,wxGROW );
+
Connect( wxchoice->GetId(),
wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
}
+ sizer->AddGrowableCol(0);
+ panel->SetSizer(sizer);
+
for (i=0;i<lstIn.size(); i++)
{
itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
- itemcontainer->SetSelection(iSelection);
+// itemcontainer->SetSelection(iSelection);
}
- //-------------------------------------------------------------------------
-
+
+ //-------------------------------------------------------------------------
ComboBoxWidget::~ComboBoxWidget()
{
}
+ //--------------------------------------------------------------------------
+ void ComboBoxWidget::VerifyDeselect(int iSelection)
+ {
+ if ((iSelection>=0) && (mBox->bbGetInputDeselect()==true) )
+ {
+ if (mTypeForm==1)
+ {
+ ((wxListBox*)itemcontainer)->Deselect( iSelection );
+ } // if mTypeForm
+ } // if iSelection
+ }
//--------------------------------------------------------------------------
void ComboBoxWidget::OnComboBoxSelection(int iSelection)
mBox->bbSetInputSelection( iSelection );
mBox->bbSetOutputOut( iSelection );
mBox->bbSetOutputOutString( bbtk::wx2std( itemcontainer->GetString(iSelection) ) );
- mBox->bbSignalOutputModification("Out");
- mBox->bbSignalOutputModification("OutString");
+ mBox->bbSignalOutputModification();
+
+ VerifyDeselect(iSelection);
+
+// mBox->bbSignalOutputModification("Out");
+// mBox->bbSignalOutputModification("OutString");
} // if iSelection
}
{
itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
- itemcontainer->SetSelection(iSelection);
+ if (iSelection>=0) itemcontainer->SetSelection(iSelection);
}
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
w->FillItems( iSelection, bbGetInputIn() );
bbSetInputSelection( iSelection );
bbSetOutputOut( iSelection );
-
int size = bbGetInputIn().size();
if ( (iSelection>0) && ( (size-1)<=iSelection) )
{
bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
- }
-}
+ } // if iSelection
+ w->VerifyDeselect(iSelection);
+}
//=====
// 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)
//=====
bbSetInputForm(0);
bbSetInputWinWidth(100);
bbSetInputWinHeight(200);
+ bbSetInputDeselect(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)