func init // adds using namespace sys.add_use('System.Windows.Forms') // initialize instance sys.add_widget('ListBox') // initialize properties if(not isdef("Items")) arr = this.props("Items").value blk_init.println(this.codename, '.Items.AddRange(new string[] { ', arr.join(','), ' });') end sys.set_undef_field_const('BorderStyle', this.props('BorderStyle'), 'System.Windows.Forms.BorderStyle') sys.set_undef_field('ColumnWidth') sys.set_undef_field_const('DrawMode', this.props('DrawMode'), 'System.Windows.Forms.DrawMode') sys.set_undef_field('HorizontalExtent') sys.set_typed_field(104, 'HorizontalScrollbar') sys.set_typed_field(104, 'IntegralHeight') sys.set_undef_field('ItemHeight') sys.set_typed_field(104, 'MultiColumn') sys.set_undef_field_const('RightToLeft', this.props('RightToLeft'), 'System.Windows.Forms.RightToLeft') sys.set_typed_field(104, 'ScrollAlwaysVisible') sys.set_undef_field_const('SelectionMode', this.props('SelectionMode'), 'System.Windows.Forms.SelectionMode') sys.set_typed_field(104, 'Sorted') sys.set_typed_field(104, 'UseTabStops') // makes implementation methods for properties sys._prop_init('BorderStyle', 1, 1, 0) sys._prop_init('ColumnWidth', 1, 1, 1) sys._prop_init('CustomTabOffsets', 1, 0, 0) sys._prop_init('DrawMode', 1, 1, 0) sys._prop_init('HorizontalExtent', 1, 1, 1) sys._prop_init('HorizontalScrollbar', 1, 1, 104) sys._prop_init('IntegralHeight', 1, 1, 104) sys._prop_init('ItemHeight', 1, 1, 1) sys._prop_init('Items', 1, 0, 0) sys._prop_init('MultiColumn', 1, 1, 104) sys._prop_init('PreferredHeight', 1, 0, 1) sys._prop_init('RightToLeft', 1, 1, 0) sys._prop_init('ScrollAlwaysVisible', 1, 1, 104) sys._prop_init('SelectedIndex', 1, 1, 1) sys._prop_init('SelectedIndices', 1, 0, 0) sys._prop_init('SelectedItem', 1, 1, 0) sys._prop_init('SelectedItems', 1, 0, 0) sys._prop_init('SelectionMode', 1, 1, 0) sys._prop_init('Sorted', 1, 1, 104) sys._prop_init('Text', 1, 1, 2) sys._prop_init('TopIndex', 1, 1, 1) sys._prop_init('UseCustomTabOffsets', 1, 1, 104) sys._prop_init('UseTabStops', 1, 1, 104) // makes implementation of methods as properties sys._mtd_as_prop_init('ListBox') // makes implementation of simple methods sys._method_init('BeginUpdate') sys._method_init('ClearSelected') sys._method_init('EndUpdate') sys._method_init('Refresh') sys._method_init('ResetBackColor') sys._method_init('ResetForeColor') // initialize events sys.add_event_type('onDrawItem', 'DrawItem', 'DrawItemEvent', 'args') sys.add_event_type('onMeasureItem', 'MeasureItem', 'MeasureItemEvent', 'args') sys.add_event_type('onPaddingChanged', 'PaddingChanged', 'Event', 'args') sys.add_event('onSelectedIndexChanged', 'SelectedIndexChanged', this.codename + '.SelectedIndex') // initialize common events and properties include("ListControl-init") include("Control-init") end func DefaultItemHeight return('ListBox.DefaultItemHeight') end func NoMatches return('ListBox.NoMatches') end func doFindString(s) if(linked("onFindString")) event("onFindString", this.codename + '.FindString(' + d("s") + ')') else blk.println(this.codename, '.FindString(', d("s"), ');') end end func doFindString2(s, startIndex) if(linked("onFindString")) event("onFindString", this.codename + '.FindString(' + d("s") + ', ' + d("startIndex") + ')') else blk.println(this.codename, '.FindString(', d("s"), ', ', d("startIndex"), ');') end end func doFindStringExact(s) if(linked("onFindStringExact")) event("onFindStringExact", this.codename + '.FindStringExact(' + d("s") + ')') else blk.println(this.codename, '.FindStringExact(', d("s"), ');') end end func doFindStringExact2(s, startIndex) if(linked("onFindStringExact")) event("onFindStringExact", this.codename + '.FindStringExact(' + d("s") + ', ' + d("startIndex") + ')') else blk.println(this.codename, '.FindStringExact(', d("s"), ', ', d("startIndex"), ');') end end func doGetItemHeight(index) if(linked("onGetItemHeight")) event("onGetItemHeight", this.codename + '.GetItemHeight(' + d("index") + ')') else blk.println(this.codename, '.GetItemHeight(', d("index"), ');') end end func doGetItemRectangle(index) if(linked("onGetItemRectangle")) event("onGetItemRectangle", this.codename + '.GetItemRectangle(' + d("index") + ')') else blk.println(this.codename, '.GetItemRectangle(', d("index"), ');') end end func doGetSelected(index) if(linked("onGetSelected")) event("onGetSelected", this.codename + '.GetSelected(' + d("index") + ')') else blk.println(this.codename, '.GetSelected(', d("index"), ');') end end func doIndexFromPoint(p) if(linked("onIndexFromPoint")) event("onIndexFromPoint", this.codename + '.IndexFromPoint(' + d("p") + ')') else blk.println(this.codename, '.IndexFromPoint(', d("p"), ');') end end func doIndexFromPoint2(x, y) if(linked("onIndexFromPoint")) event("onIndexFromPoint", this.codename + '.IndexFromPoint(' + d("x") + ', ' + d("y") + ')') else blk.println(this.codename, '.IndexFromPoint(', d("x"), ', ', d("y"), ');') end end func doSetSelected(index, value) blk.println(this.codename, '.SetSelected(', d("index"), ', ', d("value"), ');') end include("ListControl") include("Control")