(*( bbGetInputPVec() ))[ bbGetInputI() ] = bbGetInputValue();
}
bbSetOutputVec( *( bbGetInputPVec() ) );
- bbSignalOutputModification(std::string("Vec"));
+// bbSignalOutputModification(std::string("Vec"));
}
//=================================================================
std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
// Find first "non-delimiter".
std::string::size_type pos = str.find_first_of(delimiters, lastPos);
- bbmOutputOut.clear();
+// bbmOutputOut.clear();
+std::vector<T> out;
while (std::string::npos != pos || std::string::npos != lastPos)
{
// Found a token, add it to the vector.
- bbmOutputOut.push_back(
- this->decode_item( str.substr(lastPos, pos - lastPos) ) );
+// bbmOutputOut.push_back( this->decode_item( str.substr(lastPos, pos - lastPos) ) );
+ out.push_back( this->decode_item( str.substr(lastPos, pos - lastPos) ) );
// std::cout << this->bbGetOutputOut().back() << std::endl;
// Skip delimiters. Note the "not_of"
lastPos = str.find_first_not_of(delimiters, pos);
// Find next "non-delimiter"
pos = str.find_first_of(delimiters, lastPos);
}
+bbSetOutputOut (out);
+//bbSignalOutputModification();
// std::cout << "s=" << this->bbGetOutputOut().size() << std::endl;
}
//=================================================================
//std::vector<std::string> vect (bbGetInputIn() );
bbmOutputOut.clear();
-
// get a std::string, add it to the <std::vector< >>
int lgt=bbGetInputIn().size();
for (int i=0; i<lgt; i++)
bbmOutputOut.push_back( decode_item( bbGetInputIn()[i]) );
}
// bbmOutputOut.clear(); // ? JPR
-
+
// just to see // JPR
//EED int lgrOut=this->bbGetOutputOut().size();
//EED for (int j=0; j<lgrOut; j++)
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,wxSize(sizeX,sizeY) ) ,
mBox(box),
mTypeForm(typeForm)
{
{
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)
BBTK_DECLARE_INPUT(Selection, int );
BBTK_DECLARE_INPUT(In,std::vector< std::string >);
BBTK_DECLARE_INPUT(Form, int );
+ BBTK_DECLARE_INPUT(Deselect, bool );
BBTK_DECLARE_OUTPUT(Out, int );
BBTK_DECLARE_OUTPUT(OutString, std::string );
BBTK_PROCESS(Process);
BBTK_INPUT(ComboBox,Selection,"i element to be selected (default 0)",int,"");
BBTK_INPUT(ComboBox,In,"Vector of strings",std::vector< std::string >,"");
BBTK_INPUT(ComboBox,Form,"0 Combobox, 1 List (default 0)",int,"");
-
- BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
- BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");
-
+ BBTK_INPUT(ComboBox,Deselect,"(default false) Just for List form",bool,"");
+ BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
+ BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");
BBTK_END_DESCRIBE_BLACK_BOX(ComboBox);
//=====
// 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)