include('wintools') include("wincontrolworks") func _create(_data) var(ctrl) fvar(style_) trace (edit) beginStyle('0') addStyle(isndef(Password), 'wxTE_PASSWORD') addStyle(isndef(ReadOnly), 'wxTE_READONLY') addStyle(isndef(Align), 'wxTE_'+code(upper(TextAlign))) style_ = endStyle() println(edit, ' = new wxTextCtrl(this, ID_', upper(edit), ', ', Text, ', wxPoint(', Left, ', ', Top, '), wxSize(', Width, ', ', Height, '), ', style_, ');') ctrl = edit registerId(edit) //include("wincontrol") if(linked(onChange)) createEventArg1(ctrl, 'EVT_TEXT', 'onChange', edit+'->GetValue()') end end func initFree() _create('') end func init() lng.decl_priv_var(edit, 'wxTextCtrl*') if(not linked(doCreate)) fvar(old) old = block.select(BLK_BODY) _create('') block.select(old) end end func doCreate(data) _create(data) end func CurrentText() return(edit + '->GetValue()') end func doText(_data) println(edit + '->SetValue(', e_str(_data), ');') end