def __build_comicvinetab(self): ''' builds and returns the "ComicVine" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormComicVineTab") tabpage.Name = "comicvine" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = False label.Location = Point(34, 80) label.Size = Size(315, 54) label.Text = i18n.get("ConfigFormComicVineText") # 2. --- the API key text box fired_update_gui = self.__fired_update_gui class ApiKeyTextBox(TextBox): def OnTextChanged(self, args): fired_update_gui() self.__api_key_tbox = ApiKeyTextBox() tbox = self.__api_key_tbox tbox.Location = Point(34, 135) tbox.Size = Size(315, 1) menu = ContextMenu() items = menu.MenuItems items.Add(MenuItem(i18n.get("TextCut"), lambda s, ea: tbox.Cut())) items.Add(MenuItem(i18n.get("TextCopy"), lambda s, ea: tbox.Copy())) items.Add(MenuItem(i18n.get("TextPaste"), lambda s, ea: tbox.Paste())) tbox.ContextMenu = menu # 3. --- add a clickable link to send the user to ComicVine linklabel = LinkLabel() linklabel.UseMnemonic = False linklabel.AutoSize = False linklabel.Location = Point(34, 170) linklabel.Size = Size(315, 34) linklabel.Text = i18n.get("ConfigFormComicVineClickHere") linklabel.LinkClicked += self.__fired_linkclicked # 4. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(tbox) tabpage.Controls.Add(linklabel) return tabpage
def __build_comicvinetab(self): ''' builds and returns the "ComicVine" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormComicVineTab") tabpage.Name = "comicvine" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = False label.Location = Point(34, 80) label.Size = Size(315, 54) label.Text = i18n.get("ConfigFormComicVineText") # 2. --- the API key text box fired_update_gui = self.__fired_update_gui class ApiKeyTextBox(TextBox): def OnTextChanged(self, args): fired_update_gui() self.__api_key_tbox = ApiKeyTextBox() tbox = self.__api_key_tbox tbox.Location = Point(34, 135) tbox.Size = Size(315, 1) menu = ContextMenu() items = menu.MenuItems items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) ) items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) ) items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) ) tbox.ContextMenu = menu # 3. --- add a clickable link to send the user to ComicVine linklabel = LinkLabel() linklabel.UseMnemonic = False linklabel.AutoSize = False linklabel.Location = Point(34, 170) linklabel.Size = Size(315, 34) linklabel.Text = i18n.get("ConfigFormComicVineClickHere") linklabel.LinkClicked += self.__fired_linkclicked # 4. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(tbox) tabpage.Controls.Add(linklabel) return tabpage
def __build_detailstab(self): ''' builds and returns the "Details" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormDetailsTab") tabpage.Name = "details" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 35) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormDetailsText") # 2. --- the 'select all' button checkall_button = Button() checkall_button.Click += self.__fired_checkall checkall_button.Location = Point(280, 107) checkall_button.Size = Size(100, 23) checkall_button.Text = i18n.get("ConfigFormDetailsAll") # 3. --- the 'deselect all' button uncheckall_button = Button() uncheckall_button.Click += self.__fired_uncheckall uncheckall_button.Location = Point(280, 138) uncheckall_button.Size = Size(100, 23) uncheckall_button.Text = i18n.get("ConfigFormDetailsNone") # 4. --- build the update checklist (contains all the 'data' checkboxes) self.__update_checklist = CheckedListBox() self.__update_checklist.CheckOnClick = True self.__update_checklist.ColumnWidth = 125 self.__update_checklist.ThreeDCheckBoxes = True self.__update_checklist.Location = Point(15, 65) self.__update_checklist.MultiColumn = True self.__update_checklist.SelectionMode = SelectionMode.One self.__update_checklist.Size = Size(260, 170) self.__update_checklist.ItemCheck += self.__fired_update_gui self.__update_checklist.Items.Add(ConfigForm.__SERIES_CB) self.__update_checklist.Items.Add(ConfigForm.__VOLUME_CB) self.__update_checklist.Items.Add(ConfigForm.__NUMBER_CB) self.__update_checklist.Items.Add(ConfigForm.__TITLE_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHED_CB) self.__update_checklist.Items.Add(ConfigForm.__RELEASED_CB) self.__update_checklist.Items.Add(ConfigForm.__CROSSOVERS_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHER_CB) self.__update_checklist.Items.Add(ConfigForm.__IMPRINT_CB) self.__update_checklist.Items.Add(ConfigForm.__WRITER_CB) self.__update_checklist.Items.Add(ConfigForm.__PENCILLER_CB) self.__update_checklist.Items.Add(ConfigForm.__INKER_CB) self.__update_checklist.Items.Add(ConfigForm.__COLORIST_CB) self.__update_checklist.Items.Add(ConfigForm.__LETTERER_CB) self.__update_checklist.Items.Add(ConfigForm.__COVER_ARTIST_CB) self.__update_checklist.Items.Add(ConfigForm.__EDITOR_CB) self.__update_checklist.Items.Add(ConfigForm.__SUMMARY_CB) self.__update_checklist.Items.Add(ConfigForm.__CHARACTERS_CB) self.__update_checklist.Items.Add(ConfigForm.__TEAMS_CB) self.__update_checklist.Items.Add(ConfigForm.__LOCATIONS_CB) self.__update_checklist.Items.Add(ConfigForm.__WEBPAGE_CB) # 5. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(checkall_button) tabpage.Controls.Add(uncheckall_button) tabpage.Controls.Add(self.__update_checklist) return tabpage