def run(): setupTestTheme(800, 600) cd = Console(50, 50, 400, 200) pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) cd = ColorDialog(onDialogOk) pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) cd = FileDialog("C:", onDialogOk) pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Captionless Frame", [pyui2.widgets.Frame.NO_CAPTION]) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Simple Frame") w.pack() pyui2.run() pyui2.quit()
def run(self): self.init(800, 600) self.dc = getPresenter().getDeviceContext() self.gc = self.dc.createGraphicsContext((400, 400)) getPresenter().setBackgroundDrawing(self.callback) pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Simple Frame") w.addChild(pyui2.widgets.Label("Label 1", None, None, 1)) w.addChild(pyui2.widgets.Label("Label 2")) w.addChild(pyui2.widgets.Label("Label 3")) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "New Theme Test") w.addChild(pyui2.widgets.RadioButton("RadioButton 1", None)) w.addChild(pyui2.widgets.RadioButton("RadioButton 2", None)) w.addChild(pyui2.widgets.RadioButton("RadioButton 3", None, 1)) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Button Test") w.addChild(pyui2.widgets.Button("Button 1", onButton1)) w.addChild(pyui2.widgets.Button("Button 2", onButton2)) w.addChild(pyui2.widgets.Button("Button 3", onButton3)) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Simple Frame") w.addChild(pyui2.widgets.CheckBox("CheckBox 1", onCheckBox1)) w.addChild(pyui2.widgets.CheckBox("CheckBox 2", onCheckBox2)) w.addChild(pyui2.widgets.CheckBox("CheckBox 3", onCheckBox3, 1)) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) READWRITE = 0 READONLY = 1 w = pyui2.widgets.Frame(50, 50, 400, 400, "Edit Test") w.addChild(pyui2.widgets.Edit("Edit 1", 5, onEdit1, READONLY)) w.addChild(pyui2.widgets.Edit("some text for this edit", 10, onEdit2, READWRITE)) w.addChild(pyui2.widgets.Edit("Another lot of text", 7, onEdit3)) w.pack() pyui2.run() pyui2.quit()
def run(self): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "ImageButton test") self.btn1 = pyui2.widgets.ImageButton("cursor_drag.png", self.onButton1) self.btn2 = pyui2.widgets.ImageButton("cursor_hand.png", self.onButton2) self.btn3 = pyui2.widgets.ImageButton("cursor_resize.png", self.onButton3, "", "cursor_pointer.png") w.addChild(self.btn1) w.addChild(self.btn2) w.addChild(self.btn3) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) list1 = [("Item 1", None), ("Item 2", None), ("Item 3", None)] list2 = [("Apples", None), ("Oranges", None), ("Bananas", None), ("Plums", None)] list3 = [("Star Trek", "Good"), ("Stargate: SG1", "Great"), ("Babylon 5", "The Greatest")] w = pyui2.widgets.Frame(50, 50, 400, 400, "Dropdown Box Test") w.addChild(pyui2.widgets.DropDownBox(3, onList1, list1)) w.addChild(pyui2.widgets.DropDownBox(3, onList2, list2, 1)) w.addChild(pyui2.widgets.DropDownBox(3, onList3, list3, 2)) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Simple Frame") items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6"] lb = pyui2.widgets.ListBox() lb.populateList(items) w.addChild(lb) w.pack() pyui2.run() pyui2.quit()
def run(): setupTestTheme(800, 600) w = pyui2.widgets.Frame(50, 50, 400, 400, "Picture Test") w.addChild(pyui2.widgets.Picture("cursor_drag.png")) p2 = pyui2.widgets.Picture("cursor_drag.png") p2.setRotation(45) w.addChild(p2) w.pack() pyui2.run() pyui2.quit()
def run(self): parser = OptionParser() parser.add_option("-D", action="store", type="string", dest="deviceName", default="2d") (options, args) = parser.parse_args() #print options.deviceName self.init(800, 600, options.deviceName) menu1 = pyui2.widgets.Menu("Themes") for item in self.themes: menu1.addItem(item, self.onThemeChange) self.mbar = pyui2.widgets.MenuBar() self.mbar.addMenu(menu1) self.frame = pyui2.widgets.Frame(40, 40, 720, 520, self.themeTitle) self.frame.setLayout(pyui2.layouts.TableLayoutManager(21, 21)) btn = pyui2.widgets.Button("Open Tabs", self.onOpenTabs) lb_items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9"] lb = pyui2.widgets.ListBox() lb.populateList(lb_items) dd_items = [("Item 1", None), ("Item 2", None), ("Item 3", None), ("Item 4", None), ("Item 5", None)] dd = pyui2.widgets.DropDownBox(3, None, dd_items) pic = pyui2.widgets.Picture("../../images/cursor_drag.png") ib1 = pyui2.widgets.ImageButton("../../images/cursor_wait.png", None) ib2 = pyui2.widgets.ImageButton("../../images/cursor_hand.png", None) ib3 = pyui2.widgets.ImageButton("../../images/cursor_resize.png", None) lbl1 = pyui2.widgets.Label("Label 1", None, None, 0) lbl2 = pyui2.widgets.Label("Label 2", None, None, 1) cb1 = pyui2.widgets.CheckBox("CheckBox 1", self.onCheckbox) cb2 = pyui2.widgets.CheckBox("CheckBox 2", None) cb2.setID("Happy Fun Time") cb3 = pyui2.widgets.CheckBox("CheckBox 3", None, 1) READWRITE = 0 READONLY = 1 eb1 = pyui2.widgets.Edit("Edit 1", 5, None, READONLY) eb2 = pyui2.widgets.Edit("some text for this edit", 10, None, READWRITE) eb3 = pyui2.widgets.Edit("Another lot of text", 7, None) slb = pyui2.widgets.SliderBar(None, 6, 3) self.frame.addChild(btn, (10, 20, 3, 1)) self.frame.addChild(pic, (1, 1, 2, 2)) self.frame.addChild(ib1, (3, 1, 2, 2)) self.frame.addChild(ib2, (5, 1, 2, 2)) self.frame.addChild(ib3, (7, 1, 2, 2)) self.frame.addChild(lbl1, (1, 4, 3, 1)) self.frame.addChild(lbl2, (4, 4, 3, 1)) self.frame.addChild(cb1, (1, 6, 3, 1)) self.frame.addChild(cb2, (1, 7, 3, 1)) self.frame.addChild(cb3, (1, 8, 3, 1)) self.frame.addChild(eb1, (5, 6, 2, 1)) self.frame.addChild(eb2, (5, 7, 2, 1)) self.frame.addChild(eb3, (5, 8, 2, 1)) self.frame.addChild(dd, (11, 1, 4, 1)) self.frame.addChild(lb, (15, 1, 5, 5)) self.frame.addChild(slb, (1, 10, 6, 1)) self.frame.pack() pyui2.run() pyui2.quit()
def run(self): self.setupMenu() self.setupMainFrame() self.setupLogFrame() pyui2.run() pyui2.quit()
def onExit(self, menuitem): pyui2.quit()