include('wintools') include('wincontrolworks') include('includes') func _create(_data) var(ctrl) fvar(old, style_) addInclude('LinearMeter.h',1) addIncludePath('../extras/kwxIC') addSource('../extras/kwxIC/LinearMeter', 'cpp') beginStyle('wxBORDER_NONE') addStyle(isndef(Orientation), 'wxLM_'+code(upper(Orientation))) style_ = endStyle() println(lmeter, ' = new kwxLinearMeter(this, ID_', upper(lmeter), ', _T("Focus me"), wxPoint(', Left, ', ', Top, '), wxSize(', Width, ', ', Height, '), ', style_, ');') ctrl = lmeter registerId(ctrl) if (isndef(ActiveBarColor)) println(lmeter, '->SetActiveBarColour(', lng.to_color(ActiveBarColor, '255'), ');') end if (isndef(PassiveBarColor)) println(lmeter, '->SetPassiveBarColour(', lng.to_color(PassiveBarColor, '255'), ');') end if (isndef(BorderColor)) println(lmeter, '->SetBorderColour(', lng.to_color(BorderColor, '255'), ');') end if (isndef(TxtLimitColor)) println(lmeter, '->SetTxtLimitColour(', lng.to_color(TxtLimitColor, '255'), ');') end if (isndef(TxtValueColor)) println(lmeter, '->SetTxtValueColour(', lng.to_color(TxtValueColor, '255'), ');') end if (isndef(TagsColor)) println(lmeter, '->SetTagsColour(', lng.to_color(TagsColor, '255'), ');') end println(lmeter, '->SetRangeVal(', Minimum, ', ', Maximum, ');') println(lmeter, '->SetNumTick(', NumTicks, ');') println(lmeter, '->SetValue(', Value, ');') end func doMaximum(_data) println(ctrl, '->SetRangeVal(', ctrl, '->GetMinimum(), ', _data@int, ');') end func doMinimum(_data) println(ctrl, '->SetRangeVal(', _data@int, ', ', ctrl, '->GetMaximum());') end func doValue(_data) println(ctrl, '->SetValue(', _data@int, ');') end func CurrentValue() return(ctrl + '->GetValue();') end func initFree() _create('') end func init() lng.decl_priv_var(lmeter, 'kwxLinearMeter*') if(not linked(doCreate)) fvar(old) old = block.select(BLK_BODY) _create('') block.select(old) end end func doCreate(_data) _create(_data) end