#include "bbtkUtilities.h"
namespace bbwx
-{
- //--------------------------------------------------------------------------
- // The widget created by the box
- class CheckBoxWidget : public wxPanel
- {
- public:
- /// Ctor with the two first params the parent window and the creator box
- /// which must be passed to the WxBlackBoxWidget constructor.
- /// The other params initialize the widget
- CheckBoxWidget(CheckBox* box, wxWindow *parent,
- wxString title,
- bool value, int reactiveOnKeyStroke
- );
- /// Dtor
- ~CheckBoxWidget();
- /// Events callbacks
- /// Called when the box is clicked
- void OnCheckBoxClick(wxCommandEvent& event);
-
- // Accessors
- bool GetValue() { return mwxCheckBox->GetValue(); }
- void SetValue(bool val);
- // Update the texts which display the min/max/current values of the slider
-
- private:
- CheckBox* mBox;
- wxCheckBox *mwxCheckBox;
- int _reactiveOnKeyStroke;
- bool val;
- };
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
-
-
+{
//-------------------------------------------------------------------------
CheckBoxWidget::CheckBoxWidget(CheckBox* box, wxWindow *parent,
//-------------------------------------------------------------------------
void CheckBoxWidget::OnCheckBoxClick(wxCommandEvent& event)
{
- // When user clicks the box
+ OnCheckBoxClick_();
+ }
+ //-------------------------------------------------------------------------
+ void CheckBoxWidget::OnCheckBoxClick_()
+ {
+ // When user clicks the box
// we update the output of the box
mBox->bbSetOutputOut( mwxCheckBox->GetValue() );
mBox->bbSetInputIn( mwxCheckBox->GetValue() );
//}
}
//-------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
//-------------------------------------------------------------------------
bbGetInputReactiveOnKeystroke()
);
bbSetOutputWidget( w );
-
}
protected:
};
+
+ //--------------------------------------------------------------------------
+ // The widget created by the box
+ class CheckBoxWidget : public wxPanel
+ {
+ public:
+ /// Ctor with the two first params the parent window and the creator box
+ /// which must be passed to the WxBlackBoxWidget constructor.
+ /// The other params initialize the widget
+ CheckBoxWidget(CheckBox* box, wxWindow *parent,
+ wxString title,
+ bool value, int reactiveOnKeyStroke
+ );
+ /// Dtor
+ ~CheckBoxWidget();
+ /// Events callbacks
+ /// Called when the box is clicked
+ void OnCheckBoxClick(wxCommandEvent& event);
+ void OnCheckBoxClick_();
+
+ // Accessors
+ bool GetValue() { return mwxCheckBox->GetValue(); }
+ void SetValue(bool val);
+ // Update the texts which display the min/max/current values of the slider
+
+ private:
+ CheckBox* mBox;
+ wxCheckBox *mwxCheckBox;
+ int _reactiveOnKeyStroke;
+ bool val;
+ };
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
//=================================================================
//=================================================================
--- /dev/null
+//=====
+// 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)
+//=====
+#include "bbwxCheckBox_tool.h"
+#include "bbwxPackage.h"
+namespace bbwx
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,CheckBox_tool)
+BBTK_BLACK_BOX_IMPLEMENTATION(CheckBox_tool,bbtk::AtomicBlackBox);
+//=====
+// 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 CheckBox_tool::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+ if(bbGetInputCheckBoxWidget() != NULL){
+ CheckBoxWidget* checkboxWidget = dynamic_cast<CheckBoxWidget*>(bbGetInputCheckBoxWidget());
+ checkboxWidget->SetValue(bbGetInputIn());
+ checkboxWidget->OnCheckBoxClick_();
+ }
+
+}
+//=====
+// 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 CheckBox_tool::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(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 CheckBox_tool::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// 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 CheckBox_tool::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbwx
+
+
--- /dev/null
+//=====
+// 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)
+//=====
+#ifndef __bbwxCheckBox_tool_h_INCLUDED__
+#define __bbwxCheckBox_tool_h_INCLUDED__
+
+#include "bbwx_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "bbwxCheckBox.h"
+
+namespace bbwx
+{
+
+class bbwx_EXPORT CheckBox_tool
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(CheckBox_tool,bbtk::AtomicBlackBox);
+//=====
+// 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(In,bool);
+ BBTK_DECLARE_INPUT(CheckBoxWidget, wxWindow*);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// 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_BEGIN_DESCRIBE_BLACK_BOX(CheckBox_tool,bbtk::AtomicBlackBox);
+BBTK_NAME("CheckBox_tool");
+BBTK_AUTHOR("InfoDev");
+BBTK_DESCRIPTION("No Description.");
+BBTK_CATEGORY("empty");
+BBTK_INPUT(CheckBox_tool,In,"new value",bool,"");
+BBTK_INPUT(CheckBox_tool,CheckBoxWidget,"Checkbox box to use",wxWindow*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(CheckBox_tool);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbwx
+
+#endif // __bbwxCheckBox_tool_h_INCLUDED__
+