From 2d305d9737d382cd3c837a003ab8bfdd2fa10310 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Tue, 25 Nov 2008 13:01:32 +0000 Subject: [PATCH] Add comments on new way to use widget BBxes --- packages/wx/src/bbwxColourSelectorButton.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/wx/src/bbwxColourSelectorButton.cxx b/packages/wx/src/bbwxColourSelectorButton.cxx index 9a4cafd..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/11/25 11:17:25 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/11/25 13:01:32 $ + Version: $Revision: 1.8 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -118,14 +118,18 @@ 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() { + // The widget may not be created : have to test it before using it wxColourPickerCtrlWidget* w = ( wxColourPickerCtrlWidget* )bbGetOutputWidget(); if (w) { @@ -133,6 +137,8 @@ void wxColourPickerCtrlWidget::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()); } } @@ -154,8 +160,8 @@ void wxColourPickerCtrlWidget::UpdateBox() cb = (unsigned char)(255.*b); wxColourPickerCtrlWidget* w = new wxColourPickerCtrlWidget(this, //bbGetWxParent() , - parent, - cr , cg , cb ); + parent, + cr , cg , cb ); bbSetOutputWidget( w ); } -- 2.45.1