Program: bbtk
Module: $RCSfile: bbwxColourSelectorButton.cxx,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:25 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/11/25 13:01:32 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
void ColourSelectorButton::bbUserConstructor()
{
+ // Default input value
bbSetInputIn("1 1 1");
+ // Initial output value = the same than input
bbSetOutputOut("1 1 1");
+ // IMPORTANT : Initialize output widget to null pointer to test it after
bbSetOutputWidget(0);
}
void ColourSelectorButton::Process()
{
+ // The widget may not be created : have to test it before using it
wxColourPickerCtrlWidget* w = ( wxColourPickerCtrlWidget* )bbGetOutputWidget();
if (w)
{
}
else
{
+ // If widget does not exist yet you have to update the output value according
+ // to the input (which may have changed if the user set it)
bbSetOutputOut(bbGetInputIn());
}
}
cb = (unsigned char)(255.*b);
wxColourPickerCtrlWidget* w = new wxColourPickerCtrlWidget(this, //bbGetWxParent() ,
- parent,
- cr , cg , cb );
+ parent,
+ cr , cg , cb );
bbSetOutputWidget( w );
}