def create_dialog(self): super().create_dialog() self.earliest_date_entry = AlexDateEntry(self.interior, label=_("Earliest Date")) self.earliest_date_entry.grid(row=3, column=0, sticky=W, pady=5, columnspan=2) self.latest_date_entry = AlexDateEntry(self.interior, label=_("Latest Date")) self.latest_date_entry.grid(row=4, column=0, sticky=W, pady=5, columnspan=2) AlexLabel(self.interior, text=_("Only local events")).grid(row=5, column=0, sticky=W, pady=5) self.local_only_checkbox = AlexCheckBox(self.interior) self.local_only_checkbox.grid(row=5, column=1, sticky=W, pady=5) AlexLabel(self.interior, text=_("Only unverified events")).grid(row=6, column=0, sticky=W, pady=5) self.unverified_only_checkbox = AlexCheckBox(self.interior) self.unverified_only_checkbox.grid(row=6, column=1, sticky=W, pady=5)
def create_signature_entry(self): AlexLabel(self.interior, text=_("Signature:")).grid(row=3, column=0, sticky=W) self.signature_widget = AlexEntry(self.interior) self.signature_widget.grid(row=3, column=1, sticky=W, pady=5)
def create_dialog(self): super().create_dialog() self.label = AlexLabel(self.interior) self.label.pack(side=TOP, padx=5, pady=5) filter_frame = Frame(self.interior) AlexLabel(filter_frame, text=_('Search tree:')).pack(side=LEFT, pady=5) self.filter_entry = AlexEntry(filter_frame) self.filter_entry.bind("<KeyRelease>", lambda event: self._apply_filter(event)) self.filter_entry.pack(side=LEFT, fill=X, expand=YES) filter_frame.pack(side=TOP, expand=YES, fill=X) self.set_default_buttons()
def config_dialog(self, event_list=[], date=None): self.label.set( _("Events exist on %s. Please select the event you want or create a new one" ) % date) if self.event_frame is not None: self.event_frame.destroy() self.event_frame = Frame(self.interior) self.event_frame.pack() row_counter = 0 for event in event_list: description = AlexLabel(self.event_frame, wraplength=500, justify=LEFT, text=event.description) description.grid(row=row_counter, column=0, sticky=W) def closure(event): return lambda: self._set_return_value(event) button = AlexButton(self.event_frame, text=_("Goto event"), command=closure(event)) button.grid(row=row_counter, column=1) row_counter += 1
def create_dialog(self): ''' Extend this method in your child class. It already provides three frames: interior, buttons_frame and errormessage. The errormessage frame already has a label that may be read and set by the errormessage property. To set default buttons in the button_frame, use the set default buttons. Other buttons may be set through the add_button method. ''' self.window = self.window_manager.create_new_window() self.window.protocol("WM_DELETE_WINDOW", lambda: self._set_return_value(None)) self.window.transient() self.window.attributes('-topmost', True) self.window.withdraw() self.interior = Frame(self.window) self.interior.pack() self.buttons_frame = Frame(self.window) self.buttons_frame.pack() self.message_frame = Frame(self.window) self.message_frame.pack() self._errormessage = AlexLabel(self.message_frame) self._errormessage.pack(side=TOP)
def _populate_entity_frame(self): # pylint: disable=no-member self._document_label = AlexLabel(self.entity_frame, text=_("No document available")) self._document_label.pack(padx=7, pady=7) self.notebook = Notebook(self.entity_frame, width=600) self.notebook.pack(fill=X) description = Frame(self.notebook) self.notebook.add(description, text=_('Description')) self._description_widget = AlexText(description, font="Helvetica 12 bold", wrap=WORD, height=6) self._description_widget.pack(fill=X) condition = Frame(self.notebook) self.notebook.add(condition, text=_('Condition')) self._condition_widget = AlexText(condition, font="Helvetica 12 bold", wrap=WORD, height=6) self._condition_widget.pack(fill=X) keywords = Frame(self.notebook) self.notebook.add(keywords, text=_('Keywords')) self._keywords_widget = AlexText(keywords, font="Helvetica 12 bold", wrap=WORD, height=6) self._keywords_widget.pack(fill=X)
def __init__(self, test_classes): self.message_broker = MessageBroker() self.window_manager = WindowManager(self.message_broker) self.create_test_instances(test_classes) self.root = self.window_manager.create_new_window() geometry = '800x450' self.root.geometry(geometry) self.test_frame = None top_frame = Frame(self.root) top_frame.pack(side=TOP, fill=BOTH, expand=TRUE) message_frame = Frame(self.root) message_frame.pack(side=TOP) button_frame = Frame(self.root) button_frame.pack(side=TOP) self.message_label = AlexLabel(message_frame) self.message_label.pack(side=LEFT) self.menu_frame = Frame(top_frame) self.menu_frame.pack(side=LEFT, anchor=NW, padx=5) label = AlexLabel(self.menu_frame) label.set("Select a test") label.pack() self.tests = AlexListBox( self.menu_frame, # @UndefinedVariable height=len(self.test_instances), selectioncommand=self.run_selected_test, ) self.tests.set_items(self.test_instances) self.tests.pack(anchor=NW) self.widget_frame = Frame(top_frame, borderwidth=1, relief=SOLID) self.widget_frame.pack(side=LEFT, fill=BOTH, expand=TRUE) quit_button = Button(button_frame, command=self.root.quit, text="Quit") quit_button.pack(side=LEFT)
def create_signature_entry(self): AlexLabel(self.interior, text=_("Signature:")).grid(row=3, column=0, sticky=W) self.signature_widget = AlexButton(self.interior, command=self._select_signature) self.signature_widget.set(self.NO_SYSTEMATIC_POINT_SELECTED) self.signature_widget.grid(row=3, column=1, sticky=W)
def _add_page1_content(self): event_selection_frame = Frame(self.page(1)) self.add_page_body(event_selection_frame) AlexLabel(event_selection_frame, text=_("Please select an event:")).pack(side=TOP) self.event_list_box = AlexListBox(event_selection_frame, width=50, height=5) # @UndefinedVariable self.event_list_box.pack(fill=BOTH)
def create_dialog(self): super().create_dialog() self.set_default_buttons() self.label = AlexLabel(self.interior) self.label.pack() self.entry = AlexEntry(self.interior) self.entry.pack()
def create_dialog(self): super().create_dialog() self.create_signature_entry() AlexLabel(self.interior, text=_("No event link:")).grid(row=4, column=0, sticky=W) self.missing_event_checkbox = AlexCheckBox(self.interior) self.missing_event_checkbox.grid(row=4, column=1, sticky=W, pady=5)
def create_dialog(self): super().create_dialog() self.add_button(_('Create new event'), self.presenter.cancel_action) self.label = AlexLabel(self.interior, wraplength=550, font=("Helvetica", 14, "bold")) self.label.pack() self.event_frame = None
def create_dialog(self): super().create_dialog() label = AlexLabel(self.interior) label.set("%s:" % _('Please select year')) label.pack() self.year_combo_box = AlexComboBox(self.interior) self.year_combo_box.pack(padx=5, pady=5) self.set_default_buttons()
def test_component(self, master, message_label): self.message_label = message_label self.master = master label1 = AlexLabel(master) label1.set('Entry 1:') label1.grid(row=0, column=0) self.entry1 = AlexEntry(master) self.entry1.set("Entry 1 text") self.entry1.grid(row=0, column=1) label2 = AlexLabel(master) label2.set('Entry 2:') label2.grid(row=1, column=0) self.entry2 = AlexEntry(master) self.entry2.set("Entry 2 text") self.entry2.grid(row=1, column=1) AlexButton(master, text='Switch input', command=self._switch_input).grid(row=2, column=1)
def create_dialog(self): super().create_dialog() self.add_button(_("Set filter"), self.presenter.ok_action) self.add_button(_("Clear form"), self._clear_filter_form) self.add_button(_("Cancel"), self.presenter.cancel_action) self.search_term_entries = [] for i in range(1, 4): AlexLabel(self.interior, text=_("%d. search expression:") % i).grid(row=i - 1, column=0, sticky=W) entry = AlexEntry(self.interior) entry.grid(row=i - 1, column=1, sticky=W, pady=5) self.search_term_entries.append(entry)
def test_component(self, master, message_label): self.message_label = message_label self.master = master self.label1 = AlexLabel(master) self.label1.set('Label text:') self.label1.grid(row=0, column=0) self.entry1 = AlexEntry(master) self.entry1.set("Enter label text") self.entry1.grid(row=0, column=1) AlexButton(master, text='Set label text', command=self._set_label_text).grid(row=1, column=0) AlexButton(master, text='Set entry from label', command=self._set_entry_from_label).grid(row=1, column=1)
def create_dialog(self): super().create_dialog() for input_field in range(0, self.number_of_entries): date_entry = DateEntryFrame(self.interior) date_entry.day_entry.bind('<KeyRelease>', lambda event, i=input_field, f='day': self._on_change(event, i, f)) date_entry.month_entry.bind('<KeyRelease>', lambda event, i=input_field, f='month': self._on_change(event, i, f)) date_entry.year_entry.bind('<KeyRelease>', lambda event, i=input_field, f='year': self._on_change(event, i, f)) date_entry.pack(padx=10) self.date_entry.append(date_entry) empty_label = AlexLabel(self.interior) empty_label.pack() self.set_default_buttons()
def create_dialog(self): super().create_dialog() AlexButton(self.buttons_frame, text=_("Create chronology"), command=self.presenter.ok_action).pack(side=LEFT) AlexButton(self.buttons_frame, text=_("Cancel"), command=self.presenter.cancel_action).pack(side=LEFT) self.quarter_select = AlexRadioGroup(self.interior, title=_('Quarter'), choices=self.quarters) self.quarter_select.pack() AlexLabel(self.interior, text=_(_("Year"))).pack(side=LEFT, padx=10, pady=10) self.year_entry = AlexEntry(self.interior) self.year_entry.pack(side=LEFT, padx=10, pady=10)
def create_dialog(self): self.window = self.window_manager.create_new_window() self.window.withdraw() super().__init__(self.window) self.pack() label = AlexLabel(self) label.set(_("Please select user:")) label.pack(padx=5, pady=5) self.combobox = AlexComboBox(self) self.combobox.pack(padx=5, pady=5) buttonframe = Frame(self) buttonframe.pack(padx=5, pady=5) AlexButton(buttonframe, text=_('OK'), command=self.presenter.ok_action).pack(side=LEFT) AlexButton(buttonframe, text=_('Cancel'), command=self.presenter.cancel_action).pack(side=LEFT)
def create_dialog(self): super().create_dialog() self.add_button(_('Yes'), self.presenter.yes_action) self.add_button(_('No'), self.presenter.no_action) self.label = AlexLabel(self.interior) self.label.pack(padx=20, pady=20)
def _add_filter_warning(self, parent): self.filter_warning = AlexLabel(parent, text="", foreground='red') self.filter_warning.pack(side=TOP)
def _add_label(self, label): self.label = AlexLabel(self.labelframe) self.label.pack() self.label.set(label)