include('wintools') include("wincontrolworks") func _create(_data) var(ctrl) fvar(s) fvar(style_) beginStyle('wxCB_'+code(upper(Style))) addStyle(isndef(Sort), 'wxCB_SORT') style_ = endStyle() trace(style_) println(comboBox, ' = new wxComboBox(this, ID_' + upper(comboBox), ', "", wxPoint(', Left, ', ', Top, '), wxSize(', Width, ', ', Height, '), 0, NULL, ', style_, ');') ctrl = comboBox registerId(ctrl) s = isdef(DataType) ? ('event.GetSelection()')@int : (ctrl+'->GetStringSelection()')@str if(linked(onIndexChanged)) createEventArg1(ctrl, 'EVT_COMBOBOX', 'onIndexChanged', s) end if(linked(onTextChanged)) createEventArg1(ctrl, 'EVT_TEXT', 'onTextChanged', ctrl+'->GetValue()') end end func initFree() _create('') end func init() lng.decl_priv_var(comboBox, 'wxComboBox*') if(not linked(doCreate)) fvar(old) old = block.select(BLK_BODY) _create('') block.select(old) end end func doCreate(_data) _create(_data) end func doAdd(_data) println(comboBox, '->Append(', Text, ');') end func doClear() println(comboBox, '->Clear();') end func doText(_data) println(comboBox, '->SetValue(', e_str(_data), ');') end func doCurrentIndex (_data) println(comboBox, '->SetSelection(', e_int(_data), ');') end func CurrentIndex() return(comboBox + '->GetSelection()') end func Array(_data) // read write count add if(_data[0] = "@perm@") return(1 & 1 & 1 & 1) elseif(_data[0] = "@read@") return((comboBox + '->GetString(' + _data[1] + ')')@str) elseif(_data[0] = "@write@") return(comboBox + '->SetString(' + _data[1] + ',' + _data[2] + ')') elseif(_data[0] = "@count@") return((comboBox + '->GetCount()')@int) elseif(_data[0] = "@add@") return(comboBox + '->Append(' + _data[1] + ')') else return('') end end