def addControls(self): # Translators: the title of a group of radio buttons in the reading page # in the application settings related to how to read. self.readingMode = wx.RadioBox( self, -1, _("When Pressing Play:"), majorDimension=1, style=wx.RA_SPECIFY_COLS, choices=[ # Translators: the label of a radio button _("Read the entire book"), # Translators: the label of a radio button _("Read the current section"), # Translators: the label of a radio button _("Read the current page"), ], ) # Translators: the title of a group of radio buttons in the reading page # in the application settings related to where to start reading from. self.reading_pos = wx.RadioBox( self, -1, _("Start reading from:"), majorDimension=1, style=wx.RA_SPECIFY_COLS, # Translators: the label of a radio button choices=[_("Cursor position"), _("Beginning of page")], ) # Translators: the label of a group of controls in the reading page # of the settings related to behavior during reading aloud miscBox = sc.SizedStaticBox(self, -1, _("During Reading Aloud")) miscBox.SetSizerProps(expand=True) # Translators: the label of a checkbox wx.CheckBox(miscBox, -1, _("Speak page number"), name="reading.speak_page_number") # Translators: the label of a checkbox wx.CheckBox( miscBox, -1, _("Highlight spoken text"), name="reading.highlight_spoken_text", ) wx.CheckBox( # Translators: the label of a checkbox miscBox, -1, _("Select spoken text"), name="reading.select_spoken_text", ) wx.CheckBox( miscBox, -1, # Translators: the label of a checkbox _("Play end of section sound"), name="reading.play_end_of_section_sound", )
def __init__(self, parent, id): sc.SizedFrame.__init__(self, parent, id, "Static Box Demo Frame") pane = self.GetContentsPane() box = sc.SizedStaticBox(pane, -1, "I am a sized static box") box.SetSizerProps(expand=True, proportion=1) text = wx.StaticText( box, -1, "Now that controls can have wx.StaticBox as a parent, SizedControls supports static boxes via the SizedStaticBox class!" ) text.SetSizerProps(expand=True, proportion=1) self.CreateStatusBar( ) # should always do this when there's a resize border self.Fit() self.SetMinSize(self.GetSize())
def make_static_box(self, title, parent=None, ctrl_id=-1): stbx = sc.SizedStaticBox(parent or self, ctrl_id, title) stbx.SetSizerProp("expand", True) stbx.Sizer.AddSpacer(25) return stbx
def addControls(self): self.voices = SpeechEngine().get_voices() # Translators: the label of a group of controls in the # speech settings page related to voice selection voiceBox = sc.SizedStaticBox(self, -1, _("Voice")) voiceBox.SetSizerType("form") voiceBox.SetSizerProps(expand=True) # Translators: the label of a combobox containing a list of tts voices wx.StaticText(voiceBox, -1, _("Select Voice:")) self.voice = wx.Choice(voiceBox, -1, choices=[v.desc for v in self.voices]) # Translators: the label of the speech rate slider wx.StaticText(voiceBox, -1, _("Speech Rate:")) rt = wx.Slider(voiceBox, -1, minValue=0, maxValue=100, name="speech.rate") rt.SetPageSize(DEFAULT_STEP_SIZE) # Translators: the label of the speech volume slider wx.StaticText(voiceBox, -1, _("Speech Volume:")) vol = wx.Slider(voiceBox, -1, minValue=0, maxValue=100, name="speech.volume") vol.SetPageSize(DEFAULT_STEP_SIZE) # Translators: the label of a group of controls in the speech # settings page related to speech pauses pausesBox = sc.SizedStaticBox(self, -1, _("Pauses")) pausesBox.SetSizerType("form") pausesBox.SetSizerProps(expand=True) # Translators: the label of an edit field wx.StaticText(pausesBox, -1, _("Additional Pause At Sentence End (Ms)")) sp = EnhancedSpinCtrl(pausesBox, -1, min=0, max=PARAGRAPH_PAUSE_MAX, name="speech.sentence_pause") # Translators: the label of an edit field wx.StaticText(pausesBox, -1, _("Additional Pause At Paragraph End (Ms)")) pp = EnhancedSpinCtrl(pausesBox, -1, min=0, max=PARAGRAPH_PAUSE_MAX, name="speech.paragraph_pause") # Translators: the label of an edit field wx.StaticText(pausesBox, -1, _("End of Page Pause (ms)")) eop = EnhancedSpinCtrl( pausesBox, -1, min=0, max=END_OF_PAGE_PAUSE_MAX, name="speech.end_of_page_pause", ) # Translators: the label of an edit field wx.StaticText(pausesBox, -1, _("End of Section Pause (ms)")) eos = EnhancedSpinCtrl( pausesBox, -1, min=0, max=END_OF_SECTION_PAUSE_MAX, name="speech.end_of_section_pause", ) for ctrl in (sp, pp, eop, eos): ctrl.SetSizerProps(expand=True)
def addControls(self): # Translators: the title of a group of controls in the # general settings page related to the UI UIBox = sc.SizedStaticBox(self, -1, _("User Interface")) UIBox.SetSizerProps(expand=True) # Translators: the label of a combobox containing display languages. wx.StaticText(UIBox, -1, _("Display Language:")) self.languageChoice = wx.Choice(UIBox, -1, style=wx.CB_SORT) self.languageChoice.SetSizerProps(expand=True) wx.CheckBox( UIBox, -1, # Translators: the label of a checkbox _("Speak user interface messages"), name="general.announce_ui_messages", ) wx.CheckBox( UIBox, -1, # Translators: the label of a checkbox _("Open recently opened books from the last position"), name="general.open_with_last_position", ) wx.CheckBox( UIBox, -1, # Translators: the label of a checkbox _("Use file name instead of book title"), name="general.show_file_name_as_title", ) # Translators: the title of a group of controls shown in the # general settings page related to miscellaneous settings miscBox = sc.SizedStaticBox(self, -1, _("Miscellaneous")) miscBox.SetSizerProps(expand=True) wx.CheckBox( miscBox, -1, # Translators: the label of a checkbox _("Play pagination sound"), name="general.play_pagination_sound", ) wx.CheckBox( miscBox, -1, # Translators: the label of a checkbox _("Play a sound when the current page contains notes"), name="general.play_page_note_sound", ) wx.CheckBox( miscBox, -1, # Translators: the label of a checkbox _("Highlight bookmarked positions"), name="general.highlight_bookmarked_positions", ) wx.CheckBox( miscBox, -1, # Translators: the label of a checkbox _("Automatically check for updates"), name="general.auto_check_for_updates", ) # Translators: the title of a group of controls shown in the # general settings page related to file associations assocBox = sc.SizedStaticBox(self, -1, _("File Associations")) assocBox.SetSizerProps(expand=True) wx.Button( assocBox, wx.ID_SETUP, # Translators: the label of a button _("Manage File &Associations")) self.Bind(wx.EVT_BUTTON, self.onRequestFileAssoc, id=wx.ID_SETUP) self.langobjs = get_available_languages() languages = set((lang.language, lang.description) for lang in self.langobjs.values()) for ident, label in languages: self.languageChoice.Append(label, ident) self.languageChoice.SetStringSelection( app.current_language.description)
def make_sized_static_box(parent, title): stbx = sc.SizedStaticBox(parent, -1, title) stbx.SetSizerProp("expand", True) stbx.Sizer.AddSpacer(25) return stbx