def __init__(self, parent, range=(0,100), visible=True, enabled=True, **kw): Frame.__init__(self, parent, visible=visible, enabled=enabled) self._buddy = Edit(self) self._ud = UpDown(self) self._ud.buddy = self._buddy self._buddy.bind(update=self._on_edit_update) sizer = HBox(spacing=-1) sizer.add(self._buddy) sizer.add(self._ud) self.sizer = sizer self.set(range=range, **kw) self._best_size = None
def __init__(self, parent, range=(0, 100), visible=True, enabled=True, **kw): Frame.__init__(self, parent, visible=visible, enabled=enabled) self._buddy = Edit(self) self._ud = UpDown(self) self._ud.buddy = self._buddy self._buddy.bind(update=self._on_edit_update) sizer = HBox(spacing=-1) sizer.add(self._buddy) sizer.add(self._ud) self.sizer = sizer self.set(range=range, **kw) self._best_size = None
def __init__(self, parent=None, title="PocketPyGui", action=None, menu=None, tab_traversal=True, visible=True, enabled=True, has_sip=True, has_toolbar=False): '''\ Arguments : - parent: the parent window of this CeFrame. - title: the title as appearing in the title bar. - action : a tuple ('Label', callback) . - menu : the title of the right menu as a string if not None, the menu can be filled via the cb_menu attribute after CeFrame initialization. ''' Frame.__init__(self, parent, title, tab_traversal=tab_traversal, visible=visible, enabled=enabled, pos=(-1,-1,240, 320)) self.title_label = Label(self, title=title) ## if has_ok: ## self.top_right_button = gui.Button(self, 'Ok', action=lambda ev: self.onok()) ## else: self._create_tr_button() if action is None: self.cb_action = Spacer(0, 0)#Button(self) else: name, callback = action self.cb_action = CommandBarAction(self, name, action=callback) self.cb_menu = PopupMenu() if menu is None: self._cb_menu = Spacer(0, 0) else: self._cb_menu = CommandBarMenuWrapper(self, menu, self.cb_menu) hbox = HBox() hbox.add(self.title_label, 1) hbox.add(self.top_right_button) hbox2 = HBox() hbox2.add(self.cb_action, 1) hbox2.add(self._cb_menu, 1) vbox = VBox() vbox.add(hbox) vbox.add(Spacer()) vbox.add(hbox2) self._sizer = vbox self.layout() InvalidateRect(self._w32_hWnd, 0, 0)
def set_sizer(self, sizer): hbox = HBox() hbox.add(self.title_label, 1) hbox.add(self.top_right_button) hbox2 = HBox() hbox2.add(self.cb_action, 1) hbox2.add(self._cb_menu, 1) vbox = VBox() vbox.add(hbox) vbox.add(sizer, 1) vbox.add(hbox2) self._sizer = vbox self.layout() InvalidateRect(self._w32_hWnd, 0, 0)