Пример #1
0
    def set_dialog_buttons(self):
        if self.add_line:
            self.box.pack(HLine(self.box), fill=True, padding=5)
        else:
            self.box.pack((3, 3))

        self.button_box = HPanel(self.box)
        self.box.pack(self.button_box, fill=True)

        self.ok_btn = Button(
            self.button_box, '', onclick=self.on_ok,
            default=True, pid=self.action_button)
        self.cancel_btn = Button(
            self.button_box, '', onclick=self.on_cancel,
            pid=const.BUTTON_CANCEL)

        self.left_button_box = HPanel(self.button_box)
        self.button_box.pack(self.left_button_box, expand=True, fill=True)

        if const.IS_MAC:
            self.button_box.pack(self.ok_btn, padding=5)
            self.button_box.pack(self.cancel_btn, padding=5)
        elif const.IS_MSW:
            self.button_box.pack(self.ok_btn, padding=2)
            self.button_box.pack(self.cancel_btn)
        else:
            self.button_box.pack(self.cancel_btn, padding=2)
            self.button_box.pack(self.ok_btn)
Пример #2
0
    def set_dialog_buttons(self):
        if self.add_line:
            self.box.pack(HLine(self.box), fill=True, padding=5)
        else:
            self.box.pack((3, 3))

        self.button_box = HPanel(self.box)
        self.box.pack(self.button_box, fill=True)

        self.close_btn = Button(self.button_box, '', onclick=self.on_close,
            default=True, pid=const.BUTTON_CLOSE)

        self.left_button_box = HPanel(self.button_box)
        self.button_box.pack(self.left_button_box, expand=True, fill=True)
        self.button_box.pack(self.close_btn, padding=5)