def onOkButton(self, event: wx._core.PyEvent) -> None: """Sending edited text to a remote service. @param event: event binder object that handles the activation of the button @type event: wx._core.PyEvent """ event.Skip() self.text = self.textCtrl.GetValue()
def onSelectService(self, event: wx._core.PyEvent) -> None: """Activation of the selected online service. @param event: event binder object that handles the activation of the button or ListItem element @type event: wx._core.PyEvent """ event.Skip() config.conf[addonName]['active'] = self.servicesList.GetFocusedItem() self.Close()
def onOkButton(self, event: wx._core.PyEvent) -> None: """Executed when the <OK> button in the dialog box is pressed. @param event: event that occurs when a wx.Button is pressed @type event: wx._core.PyEvent """ slot = int(self.slotChoice.GetStringSelection()) event.Skip() ChangeProfileDialog(self, slot).ShowModal() self.Destroy()
def onKeyPress(self, event: wx._core.PyEvent) -> None: """Performed when pressing keys. @param event: event binder object that handles keystrokes @type event: wx._core.PyEvent """ key: int = event.GetKeyCode() - ord('1') event.Skip() if key in range(min(len(services), 12)): config.conf[addonName]['active'] = key self.Close()
def onSwitchSynth(self, event: wx._core.PyEvent) -> None: """Executed when enable or disable the check box for switching voice synthesizers to selected languages. @param event: event binder object that specifies the check or uncheck the wx.CheckBox @type event: wx._core.PyEvent """ event.Skip() self._sizer.Show(self._blankSizer, show=not self._switchSynthChk.GetValue()) self._sizer.Show(self._synthPanel, show=self._switchSynthChk.GetValue()) self._sizer.Fit(self) self._sizer.Layout()
def onSelectService(self, event: wx._core.PyEvent) -> None: """Executed when switching between services. @param event: event binder object that specifies the selection of an item in the wx.Choice object @type event: wx._core.PyEvent """ serv = self._servChoice.GetClientData(self._servChoice.GetSelection()) self._active = serv.id event.Skip() self._panel.Destroy() self._panel = ServicePanel(self._active, parent=self._container) self._sizer.Fit(self)
def onActivateProfile(self, event: wx._core.PyEvent) -> None: """Activation of the selected voice synthesizer profile. The profile slot number is passed to the external handler. @param event: event binder object that handles the activation of the button or ListItem element @type event: wx._core.PyEvent """ event.Skip() item = int(self.synthsList.GetItem(itemIdx=self.synthsList.GetFocusedItem(), col=0).GetText()) profiles.rememberCurrent() profiles[item].set() self.EndModal(item)
def onKeyPress(self, event: wx._core.PyEvent) -> None: """Performed when pressing keys. @param event: event binder object that handles keystrokes @type event: wx._core.PyEvent """ key: int = event.GetKeyCode() if event.CmdDown(): { ord('A'): self.textCtrl.SelectAll, ord('R'): self.textCtrl.Clear, ord('E'): self.clearText, ord('U'): self.updateText }.get(key, lambda: None)() event.Skip()