def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) radGroup = pyui2.widgets.RadioGroup(self.onRadioChange) self.widgetGroup.addChild(pyui2.widgets.RadioButton("Radio 1", radGroup), (7, 4, 2, 1)) self.widgetGroup.addChild(pyui2.widgets.RadioButton("Radio 2", radGroup), (10, 4, 3, 1)) self.widgetGroup.addChild(pyui2.widgets.RadioButton("Radio 3", radGroup), (13, 4, 2, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) items = ("Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10") lb = pyui2.widgets.ListBox() lb.populateList(items) self.widgetGroup.addChild(lb, (6, 2, 6, 6)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) gp = pyui2.widgets.GridPanel(8, 6) for i in range(0,5): gp.putCellAt( pyui2.widgets.Button("button #%d" % i, None), random.randrange(0,8), random.randrange(0,6) ) gp.putCellAt( pyui2.widgets.Label("label #%d" % i), random.randrange(0,8), random.randrange(0,6) ) gp.putCellAt( pyui2.widgets.Edit("edit #%d" % i, 12, None), random.randrange(0,8), random.randrange(0,6) ) gp.putCellAt( pyui2.widgets.SliderBar(self.onSlider, 50, 30), random.randrange(0,8), random.randrange(0,6) ) self.widgetGroup.addChild(gp, (0, 0, 21, 9)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) items = ( ("Item 1", None), ("Item 2", None), ("Item 3", None), ("Item 4", None), ("Item 5", None), ("Item 6", None), ("Item 7", None), ("Item 8", None), ("Item 9", None), ("Item 10", None), ) dd = pyui2.widgets.DropDownBox() dd.addItems(items) self.widgetGroup.addChild(dd, (6, 2, 6, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) tree = pyui2.widgets.Tree() node1 = pyui2.widgets.TreeNode("Node 1") node1A = pyui2.widgets.TreeNode("Node 1A") node1B = pyui2.widgets.TreeNode("Node 1B") node1C = pyui2.widgets.TreeNode("Node 1C") node1Ca = pyui2.widgets.TreeNode("Node 1Ca") node1Cb = pyui2.widgets.TreeNode("Node 1Cb") node1Cc = pyui2.widgets.TreeNode("Node 1Cc") node1C.addNode(node1Ca) node1C.addNode(node1Cb) node1C.addNode(node1Cc) node1D = pyui2.widgets.TreeNode("Node 1D") node1E = pyui2.widgets.TreeNode("Node 1E") node1.addNode(node1A) node1.addNode(node1B) node1.addNode(node1C) node1.addNode(node1D) node1.addNode(node1E) node2 = pyui2.widgets.TreeNode("Node 2") node3 = pyui2.widgets.TreeNode("Node 3") node3A = pyui2.widgets.TreeNode("Node 3A") node3B = pyui2.widgets.TreeNode("Node 3B") node3C = pyui2.widgets.TreeNode("Node 3C") node3D = pyui2.widgets.TreeNode("Node 3D") node3E = pyui2.widgets.TreeNode("Node 3E") node3.addNode(node3A) node3.addNode(node3B) node3.addNode(node3C) node3.addNode(node3D) node3.addNode(node3E) node4 = pyui2.widgets.TreeNode("Node 4") node5 = pyui2.widgets.TreeNode("Node 5") tree.addNode(node1) tree.addNode(node2) tree.addNode(node3) tree.addNode(node4) tree.addNode(node5) self.widgetGroup.addChild(tree, (7, 0, 7, 9)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) self.controlGroup.addChild(pyui2.widgets.CheckBox("Shadowed", self.onLabelShadowed), (0, 1, 3, 1)) self.controlGroup.addChild(pyui2.widgets.CheckBox("Bordered", self.onLabelBordered), (0, 2, 3, 1)) self.controlGroup.addChild(pyui2.widgets.Label("Justification:"), (0, 4, 3, 1)) justGroup = pyui2.widgets.RadioGroup(self.onJustification) self.controlGroup.addChild(pyui2.widgets.RadioButton("Left", justGroup), (3, 4, 2, 1)) self.controlGroup.addChild(pyui2.widgets.RadioButton("Centered", justGroup), (6, 4, 3, 1)) self.controlGroup.addChild(pyui2.widgets.RadioButton("Right", justGroup), (9, 4, 2, 1)) self.controlGroup.addChild(pyui2.widgets.Label("Set Text:"), (0, 6, 3, 1)) self.controlGroup.addChild(pyui2.widgets.Edit("Label 1", 15), (3, 6, 3, 1)) self.controlGroup.addChild(pyui2.widgets.Button("Set Label", self.onSetLabel), (6, 6, 2, 1)) label = pyui2.widgets.Label("Label 1", None, None, 0) self.widgetGroup.addChild(label, (9, 4, 3, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) scrl = pyui2.widgets.HScroll() scrl.setNumItems(100, 10) self.widgetGroup.addChild(scrl, (7, 4, 7, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) sht = pyui2.widgets.Sheet(self.onChanged, self.onInserted) self.widgetGroup.addChild(sht, (0, 0, 21, 9)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) self.widgetGroup.addChild(pyui2.widgets.Edit("some text for this edit", 10, None, READWRITE), (9, 4, 3, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) self.widgetGroup.addChild(pyui2.widgets.CheckBox("CheckBox", self.onCheckboxTest), (9, 4, 3, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) slde = pyui2.widgets.SliderBar() slde.setRange(10) self.widgetGroup.addChild(slde, (7, 4, 7, 1)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) self.widgetGroup.addChild(pyui2.widgets.Picture("cat.png"), (9, 3, 3, 4)) self.completeInit()
def __init__(self, owner): WidgetDemoPanel.__init__(self, owner) self.widgetGroup.addChild(pyui2.widgets.Button("Button", self.onButtonTest), (9, 4, 3, 2)) self.completeInit()