func MakeMenu(rootHandle, nodeHandle) arr = this.props('MenuItems').value if(arr.size()) l = 0 img = 0 this.setfield('root', this.codename) for(i = 0; i < arr.size(); i++) s = arr.get(i) if(s == "{") sys.stack_push(this.root) l++ this.setfield('root', this.slave) this.setfield('slave', 'tsmi' + l + i) elseif(s == "}") l-- this.setfield('root', sys.stack_pop()) elseif(l == 0) if(arr.get(i+1) == "{") this.setfield('slave', 'tsmi' + l + i) blk_init.println('ToolStripMenuItem ', this.slave, ' = new ToolStripMenuItem();') .println(this.root, '.Items.Add(', this.slave, ');') .println(this.root, '.Items[', this.root, '.Items.Count - 1', '].ImageIndex = ', img++, ';') .println(this.slave, '.Text = ', s, ';') else blk_init.println(this.root, '.Items.Add(', s, (linked("onSubItemCliked") or linked("onSubItemCliked2")) ? ', null, new EventHandler(' + rootHandle + ')' : '', ');') .println(this.root, '.Items[', this.root, '.Items.Count - 1', '].ImageIndex = ', img++, ';') end elseif(l > 0) if(arr.get(i+1) == "{") blk_init.println('ToolStripMenuItem ', this.slave, ' = new ToolStripMenuItem();') .println(this.root, '.DropDownItems.Add(', this.slave, ');') .println(this.slave, '.Text = ', s, ';') else blk_init.println(this.root, '.DropDownItems.Add(', s, (linked("onSubItemCliked") or linked("onSubItemCliked2")) ? ', null, new EventHandler(' + nodeHandle + ')' : '', ');') end end end end end