std::string GetValue();
void SetValue(std::string value);
- void SetWindowStyle(int style);
void OnTextEnter(wxCommandEvent& event);
void OnTextUpdate(wxCommandEvent& event);
wxPanel *panel = this;
//wxTE_PROCESS_ENTER
-//wxTE_MULTILINE For multiple line you have to create an other box (EED).
-
+//wxTE_MULTILINE
+//wxTE_PASSWORD
mwxTextCtrl = new wxTextCtrl( panel, -1, In,wxDefaultPosition, wxSize(800,40) , wxTE_PROCESS_ENTER);
Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_ENTER,
(wxObjectEventFunction)
mwxTitle->SetLabel(s);
}
- void InputTextWidget::SetWindowStyle(int style)
- {
- long wxstyle = wxTE_PROCESS_ENTER;
- if (style==1) {wxstyle = wxTE_PASSWORD;}
- mwxTextCtrl->SetWindowStyle(wxstyle);
- }
-
-
//-------------------------------------------------------------------------
std::string InputTextWidget::GetValue()
{
firsttime=true;
bbSetInputTitle("");
bbSetInputIn("");
- bbSetOutputWidget(0);
+ bbSetOutputWidget(NULL);
bbSetInputReactiveOnKeystroke(2);
- bbSetInputStyle(0);
}
//-----------------------------------------------------------------
firsttime=false;
w->SetValue( bbGetInputIn().c_str() );
}
- w->SetWindowStyle( bbGetInputStyle() );
w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
bbSetOutputOut( w->GetValue() );
} else {
BBTK_BLACK_BOX_INTERFACE(InputText,bbtk::WxBlackBox);
BBTK_DECLARE_INPUT(In,std::string);
BBTK_DECLARE_INPUT(Title,std::string);
- BBTK_DECLARE_INPUT(Style,int);
BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(Process);
BBTK_AUTHOR("laurent guigues at creatis.insa-lyon.fr");
BBTK_DESCRIPTION("A zone in which the user can enter a text (wxTextCtrl)");
BBTK_INPUT(InputText,In,"Initial text (default '')",std::string,"");
-
BBTK_INPUT(InputText,Title,"Title of the input zone (default '') ", std::string,"");
- BBTK_INPUT(InputText,Style,"(default 0) 0:OneLine 1:Password ", int,"");
BBTK_INPUT(InputText,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,"");
-
BBTK_OUTPUT(InputText,Out,"Current text",std::string,"");
BBTK_END_DESCRIBE_BLACK_BOX(InputText);
--- /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 "bbwxInputTextMultiLine.h"
+#include "bbwxPackage.h"
+namespace bbwx
+{
+
+
+ //--------------------------------------------------------------------------
+ class InputTextMultiLineWidget : wxPanel
+ {
+ public:
+ InputTextMultiLineWidget(InputTextMultiLine* box, wxWindow *parent,
+ wxString In, wxString title );
+ ~InputTextMultiLineWidget();
+
+ std::string GetValue();
+ void SetValue(std::string value);
+
+ void OnTextEnter(wxCommandEvent& event);
+ void OnTextUpdate(wxCommandEvent& event);
+
+ void SetTitle(wxString);
+
+ private:
+ InputTextMultiLine *mBox;
+ wxTextCtrl *mwxTextCtrl;
+ wxStaticText *mwxTitle;
+ };
+
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+
+ InputTextMultiLineWidget::InputTextMultiLineWidget(InputTextMultiLine* box,
+ wxWindow *parent,
+ wxString In,
+ wxString title )
+ : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+ mBox(box)
+ {
+ wxPanel *panel = this;
+
+//wxTE_PROCESS_ENTER
+//wxTE_MULTILINE
+//wxTE_PASSWORD
+ mwxTextCtrl = new wxTextCtrl( panel, -1, In,wxDefaultPosition, wxSize(800,40) , wxTE_MULTILINE);
+ Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_ENTER,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCommandEventFunction)
+ (void (wxPanel::*)(wxCommandEvent&))
+ &InputTextMultiLineWidget::OnTextEnter );
+
+ Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCommandEventFunction)
+ (void (wxPanel::*)(wxCommandEvent&))
+ &InputTextMultiLineWidget::OnTextUpdate );
+
+
+ wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
+ mwxTitle = new wxStaticText(panel, -1, title );
+ sizer->Add( mwxTitle );
+ sizer->Add( mwxTextCtrl, 1, wxEXPAND );
+ sizer->AddGrowableCol(0);
+ sizer->AddGrowableRow(1);
+
+ panel-> SetSizer(sizer);
+ panel-> SetAutoLayout(true);
+ panel-> Layout();
+
+ }
+ //-------------------------------------------------------------------------
+
+ InputTextMultiLineWidget::~InputTextMultiLineWidget()
+ {
+ }
+
+ //-------------------------------------------------------------------------
+
+
+ void InputTextMultiLineWidget::SetTitle(wxString s)
+ {
+ mwxTitle->SetLabel(s);
+ }
+
+ //-------------------------------------------------------------------------
+ std::string InputTextMultiLineWidget::GetValue()
+ {
+ return bbtk::wx2std ( mwxTextCtrl->GetValue() );
+ }
+
+ void InputTextMultiLineWidget::SetValue(std::string value)
+ {
+ mwxTextCtrl->SetValue( bbtk::std2wx(value) ) ;
+ }
+
+ //--------------------------------------------------------------------------
+ void InputTextMultiLineWidget::OnTextUpdate(wxCommandEvent& event)
+ {
+ if (mBox->bbGetInputReactiveOnKeystroke()==2){
+ mBox->bbSetOutputOut( GetValue() );
+ mBox->bbSetInputIn( GetValue() );
+ mBox->bbSignalOutputModification("Out");
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ void InputTextMultiLineWidget::OnTextEnter(wxCommandEvent& event)
+ {
+ if (mBox->bbGetInputReactiveOnKeystroke()==1){
+ mBox->bbSetOutputOut( GetValue() );
+ mBox->bbSetInputIn( GetValue() );
+ mBox->bbSignalOutputModification("Out");
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,InputTextMultiLine)
+BBTK_BLACK_BOX_IMPLEMENTATION(InputTextMultiLine,bbtk::WxBlackBox);
+//=====
+// 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 InputTextMultiLine::Process()
+{
+ InputTextMultiLineWidget *w=(InputTextMultiLineWidget *)bbGetOutputWidget();
+ if (w)
+ {
+ if (firsttime==true)
+ {
+ firsttime=false;
+ w->SetValue( bbGetInputIn().c_str() );
+ }
+ w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
+ bbSetOutputOut( w->GetValue() );
+ } else {
+ bbSetOutputOut( "<VOID>" );
+ }
+}
+//=====
+// 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 InputTextMultiLine::CreateWidget(wxWindow* parent)
+{
+ bbSetOutputWidget
+ ( (wxWindow*) new InputTextMultiLineWidget( this, //bbGetWxParent(),
+ parent,
+ bbtk::std2wx ( bbGetInputIn() ) ,
+ bbtk::std2wx ( bbGetInputTitle() )
+ )
+ );
+}
+//=====
+// 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 InputTextMultiLine::bbUserSetDefaultValues()
+{
+ firsttime=true;
+ bbSetInputTitle("");
+ bbSetInputIn("");
+ bbSetOutputWidget(NULL);
+ bbSetInputReactiveOnKeystroke(2);
+}
+//=====
+// 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 InputTextMultiLine::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)
+//=====
+void InputTextMultiLine::bbUserFinalizeProcessing()
+{
+
+}
+}
+// 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)
+//=====
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbwxInputTextMultiLine_h_INCLUDED__
+#define __bbwxInputTextMultiLine_h_INCLUDED__
+
+#include "bbwx_EXPORT.h"
+#include "bbtkWxBlackBox.h"
+
+namespace bbwx
+{
+
+class bbwx_EXPORT InputTextMultiLine
+ :
+ public bbtk::WxBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(InputTextMultiLine,bbtk::WxBlackBox);
+//=====
+// 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,std::string);
+ BBTK_DECLARE_INPUT(Title,std::string);
+ BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
+
+ BBTK_PROCESS(Process);
+ void Process();
+ BBTK_CREATE_WIDGET(CreateWidget);
+ void CreateWidget(wxWindow*);
+
+ private:
+ bool firsttime;
+
+//=====
+// 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(InputTextMultiLine,bbtk::WxBlackBox);
+ BBTK_NAME("InputTextMultiLine");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("__CategoryBlackBox__");
+
+ BBTK_INPUT(InputTextMultiLine,In,"Initial text (default '')",std::string,"");
+ BBTK_INPUT(InputTextMultiLine,Title,"Title of the input zone (default '') ", std::string,"");
+ BBTK_INPUT(InputTextMultiLine,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,"");
+ BBTK_OUTPUT(InputTextMultiLine,Out,"Current text",std::string,"");
+
+
+BBTK_END_DESCRIBE_BLACK_BOX(InputTextMultiLine);
+//=====
+// 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 // __bbwxInputTextMultiLine_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+
--- /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 "bbwxInputTextPassword.h"
+#include "bbwxPackage.h"
+namespace bbwx
+{
+
+
+ //--------------------------------------------------------------------------
+ class InputTextPasswordWidget : wxPanel
+ {
+ public:
+ InputTextPasswordWidget(InputTextPassword* box, wxWindow *parent,
+ wxString In, wxString title );
+ ~InputTextPasswordWidget();
+
+ std::string GetValue();
+ void SetValue(std::string value);
+
+ void OnTextEnter(wxCommandEvent& event);
+ void OnTextUpdate(wxCommandEvent& event);
+
+ void SetTitle(wxString);
+
+ private:
+ InputTextPassword *mBox;
+ wxTextCtrl *mwxTextCtrl;
+ wxStaticText *mwxTitle;
+ };
+
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+ //------------------------------------------------------------------------
+
+ InputTextPasswordWidget::InputTextPasswordWidget(InputTextPassword* box,
+ wxWindow *parent,
+ wxString In,
+ wxString title )
+ : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+ mBox(box)
+ {
+ wxPanel *panel = this;
+
+//wxTE_PROCESS_ENTER
+//wxTE_MULTILINE
+//wxTE_PASSWORD
+
+ mwxTextCtrl = new wxTextCtrl( panel, -1, In,wxDefaultPosition, wxSize(800,40) , wxTE_PASSWORD);
+ Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_ENTER,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCommandEventFunction)
+ (void (wxPanel::*)(wxCommandEvent&))
+ &InputTextPasswordWidget::OnTextEnter );
+
+ Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+ (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxCommandEventFunction)
+ (void (wxPanel::*)(wxCommandEvent&))
+ &InputTextPasswordWidget::OnTextUpdate );
+
+ wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
+ mwxTitle = new wxStaticText(panel, -1, title );
+ sizer-> Add( mwxTitle );
+ sizer-> Add( mwxTextCtrl, 1, wxGROW );
+ sizer-> AddGrowableCol(0);
+
+ panel-> SetSizer(sizer);
+ panel-> SetAutoLayout(true);
+ panel-> Layout();
+
+ }
+ //-------------------------------------------------------------------------
+
+ InputTextPasswordWidget::~InputTextPasswordWidget()
+ {
+ }
+
+ //-------------------------------------------------------------------------
+
+
+ void InputTextPasswordWidget::SetTitle(wxString s)
+ {
+ mwxTitle->SetLabel(s);
+ }
+
+ //-------------------------------------------------------------------------
+ std::string InputTextPasswordWidget::GetValue()
+ {
+ return bbtk::wx2std ( mwxTextCtrl->GetValue() );
+ }
+
+ void InputTextPasswordWidget::SetValue(std::string value)
+ {
+ mwxTextCtrl->SetValue( bbtk::std2wx(value) ) ;
+ }
+
+ //--------------------------------------------------------------------------
+ void InputTextPasswordWidget::OnTextUpdate(wxCommandEvent& event)
+ {
+ if (mBox->bbGetInputReactiveOnKeystroke()==2){
+ mBox->bbSetOutputOut( GetValue() );
+ mBox->bbSetInputIn( GetValue() );
+ mBox->bbSignalOutputModification("Out");
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ void InputTextPasswordWidget::OnTextEnter(wxCommandEvent& event)
+ {
+ if (mBox->bbGetInputReactiveOnKeystroke()==1){
+ mBox->bbSetOutputOut( GetValue() );
+ mBox->bbSetInputIn( GetValue() );
+ mBox->bbSignalOutputModification("Out");
+ }
+ }
+
+
+ //--------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+
+
+
+
+
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,InputTextPassword)
+BBTK_BLACK_BOX_IMPLEMENTATION(InputTextPassword,bbtk::WxBlackBox);
+//=====
+// 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 InputTextPassword::Process()
+{
+ InputTextPasswordWidget *w=(InputTextPasswordWidget *)bbGetOutputWidget();
+ if (w)
+ {
+ if (firsttime==true)
+ {
+ firsttime=false;
+ w->SetValue( bbGetInputIn().c_str() );
+ }
+ w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
+ bbSetOutputOut( w->GetValue() );
+ } else {
+ bbSetOutputOut( "<VOID>" );
+ }
+
+}
+//=====
+// 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 InputTextPassword::CreateWidget(wxWindow* parent)
+{
+ bbSetOutputWidget
+ ( (wxWindow*) new InputTextPasswordWidget( this, //bbGetWxParent(),
+ parent,
+ bbtk::std2wx ( bbGetInputIn() ) ,
+ bbtk::std2wx ( bbGetInputTitle() )
+ )
+ );
+}
+//=====
+// 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 InputTextPassword::bbUserSetDefaultValues()
+{
+ firsttime=true;
+ bbSetInputTitle("");
+ bbSetInputIn("");
+ bbSetOutputWidget(NULL);
+ bbSetInputReactiveOnKeystroke(2);
+}
+//=====
+// 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 InputTextPassword::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)
+//=====
+void InputTextPassword::bbUserFinalizeProcessing()
+{
+
+}
+}
+// 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)
+//=====
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbwxInputTextPassword_h_INCLUDED__
+#define __bbwxInputTextPassword_h_INCLUDED__
+
+#include "bbwx_EXPORT.h"
+#include "bbtkWxBlackBox.h"
+
+namespace bbwx
+{
+
+class bbwx_EXPORT InputTextPassword
+ :
+ public bbtk::WxBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(InputTextPassword,bbtk::WxBlackBox);
+//=====
+// 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,std::string);
+ BBTK_DECLARE_INPUT(Title,std::string);
+ BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
+ BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(Process);
+ void Process();
+ BBTK_CREATE_WIDGET(CreateWidget);
+ void CreateWidget(wxWindow*);
+
+
+ private:
+ bool firsttime;
+
+
+
+//=====
+// 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(InputTextPassword,bbtk::WxBlackBox);
+ BBTK_NAME("InputTextPassword");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("A zone in which the user can enter a text (wxTextCtrl)");
+ BBTK_CATEGORY("__CategoryBlackBox__");
+
+ BBTK_INPUT(InputTextPassword,In,"Initial text (default '')",std::string,"");
+ BBTK_INPUT(InputTextPassword,Title,"Title of the input zone (default '') ", std::string,"");
+ BBTK_INPUT(InputTextPassword,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,"");
+ BBTK_OUTPUT(InputTextPassword,Out,"Current text",std::string,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(InputTextPassword);
+//=====
+// 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 // __bbwxInputTextPassword_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+