{
public:
InputTextWidget(InputText* box, wxWindow *parent,
- wxString In, wxString title);
+ wxString In, wxString title );
~InputTextWidget();
std::string GetValue();
void SetValue(std::string value);
+ void SetWindowStyle(int style);
void OnTextEnter(wxCommandEvent& event);
void OnTextUpdate(wxCommandEvent& event);
InputTextWidget::InputTextWidget(InputText* box,
wxWindow *parent,
wxString In,
- wxString title)
+ wxString title )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
mBox(box)
{
wxPanel *panel = this;
-
- mwxTextCtrl = new wxTextCtrl( panel, -1, In,wxDefaultPosition, wxSize(800,20),wxTE_PROCESS_ENTER);
+
+//wxTE_PROCESS_ENTER
+//wxTE_MULTILINE For multiple line you have to create an other box (EED).
+
+ mwxTextCtrl = new wxTextCtrl( panel, -1, In,wxDefaultPosition, wxSize(800,40) , wxTE_PROCESS_ENTER);
Connect( mwxTextCtrl->GetId(), wxEVT_COMMAND_TEXT_ENTER,
(wxObjectEventFunction)
(wxEventFunction)
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()
{
bbSetInputIn("");
bbSetOutputWidget(0);
bbSetInputReactiveOnKeystroke(2);
+ bbSetInputStyle(0);
}
//-----------------------------------------------------------------
firsttime=false;
w->SetValue( bbGetInputIn().c_str() );
}
+ w->SetWindowStyle( bbGetInputStyle() );
w->SetTitle( bbtk::std2wx ( bbGetInputTitle() ) );
bbSetOutputOut( w->GetValue() );
} else {
void InputText::CreateWidget(wxWindow* parent)
{
bbSetOutputWidget
- ( (wxWindow*) new InputTextWidget(this, //bbGetWxParent(),
- parent,
- bbtk::std2wx ( bbGetInputIn() ) ,
- bbtk::std2wx ( bbGetInputTitle() ) ) );
+ ( (wxWindow*) new InputTextWidget( this, //bbGetWxParent(),
+ parent,
+ bbtk::std2wx ( bbGetInputIn() ) ,
+ bbtk::std2wx ( bbGetInputTitle() )
+ )
+ );
}
}//namespace bbtk
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_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,"");