X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fwx%2Fsrc%2FbbwxColourSelectorButton.cxx;h=60ff6fd18228e13868238394660d38d7efb68501;hb=8cbad3dc345346d0473d93cdc06dc9eb5cbdbf23;hp=03a52286075cf8bff47c09105448a10ffbb7af73;hpb=6575a389b71b1b85c79e4444885becb76ecf16e4;p=bbtk.git diff --git a/packages/wx/src/bbwxColourSelectorButton.cxx b/packages/wx/src/bbwxColourSelectorButton.cxx index 03a5228..60ff6fd 100644 --- a/packages/wx/src/bbwxColourSelectorButton.cxx +++ b/packages/wx/src/bbwxColourSelectorButton.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbwxColourSelectorButton.cxx,v $ Language: C++ - Date: $Date: 2008/10/17 08:18:32 $ - Version: $Revision: 1.5 $ + Date: $Date: 2008/11/25 13:01:32 $ + Version: $Revision: 1.8 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -118,15 +118,29 @@ void wxColourPickerCtrlWidget::UpdateBox() 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() { - bbtkDebugMessageInc("Process",9,"ColourSelectorButton::Process()"<UpdateBox(); - bbtkDebugDecTab("Process",9); + // The widget may not be created : have to test it before using it + wxColourPickerCtrlWidget* w = ( wxColourPickerCtrlWidget* )bbGetOutputWidget(); + if (w) + { + w->UpdateBox(); + } + 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()); + } } @@ -135,9 +149,8 @@ void wxColourPickerCtrlWidget::UpdateBox() * * */ - void ColourSelectorButton::CreateWidget() + void ColourSelectorButton::CreateWidget(wxWindow* parent) { - bbtkDebugMessage("Process",9,"=> ColourSelectorButton::CreateWidget()"<