def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: TextPropertiesDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_15 = wx.StaticText(self, -1, _(u"Título:")) self.text_title = wx.TextCtrl(self, -1, "") self.label_16 = wx.StaticText(self, -1, _(u"Ano de produção:")) self.text_year = wx.TextCtrl(self, -1, "") self.label_17 = wx.StaticText(self, -1, _("Autor:")) self.text_author = wx.TextCtrl(self, -1, "") self.label_18 = wx.StaticText(self, -1, _("Ano de Nascimento:")) self.text_born = wx.TextCtrl(self, -1, "") self.label_19 = wx.StaticText(self, -1, _("Tipo:")) self.combo_type = wx.ComboBox(self, -1, choices=["", _("full"), _("partial")], style=wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) self.label_20 = wx.StaticText(self, -1, _("Palavras:")) self.text_words = wx.TextCtrl(self, -1, "") self.button_ok_copy = wx.Button(self, -1, _("Ok")) self.button_cancel_copy = wx.Button(self, -1, _("Cancelar")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.OnOkButtonClick, self.button_ok_copy) self.Bind(wx.EVT_BUTTON, self.OnCancelButtonClick, self.button_cancel_copy) # end wxGlade self.el = None self.text_title.SetFocus() self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown)
def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: InsertBreakDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.sizer_5_staticbox = wx.StaticBox(self, -1, _(u"Opções")) self.label_10 = wx.StaticText(self, -1, _("Posicione o sinal \"|\" para indicar o local da quebra:")) self.text_ctrl_1 = wx.TextCtrl(self, -1, "") self.radio_box_1 = wx.RadioBox(self, -1, _("Tipo de quebra"), choices=[_("Linha"), _("Coluna"), _(u"Página")], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.checkbox_3 = wx.CheckBox(self, -1, _(u"Número da linha")) self.text_ctrl_2 = wx.TextCtrl(self, -1, "") self.button_ok = wx.Button(self, -1, _("Ok")) self.button_cancel = wx.Button(self, -1, _("Cancelar")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT_ENTER, self.OnOkButtonClick, self.text_ctrl_1) self.Bind(wx.EVT_RADIOBOX, self.OnBreakTypeClick, self.radio_box_1) self.Bind(wx.EVT_CHECKBOX, self.OnLineNumberClick, self.checkbox_3) self.Bind(wx.EVT_BUTTON, self.OnOkButtonClick, self.button_ok) self.Bind(wx.EVT_BUTTON, self.OnCancelButtonClick, self.button_cancel) # end wxGlade self.break_type = '' self.options = [] self.original_word = '' self.text_ctrl_1.SetFocus() self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown)
def __init__(self, parent): # Set app language intl.setLanguage() wx.Dialog.__init__(self, parent, -1, "", wx.DefaultPosition, wx.Size(400, 100)) self.panel_1 = wx.Panel(self, -1) self.label_1 = wx.StaticText(self.panel_1, -1, _(u"Teste de mensagem."), style=wx.ALIGN_CENTRE) self.button_1 = wx.Button(self.panel_1, wx.ID_OK, "Ok") self.__set_properties() self.__do_layout()
def OnApplyButtonClick(self, event): # wxGlade: PreferencesDialog.<event_handler> # Save in configuration file self.prefsToConfigFile() self.main_frame.SavePreferences() # Update application UI intl.setLanguage() self.main_frame.LoadPreferences() # Disable Apply button self.btn_apply.Enable(False)
def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: ElementPropertiesDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.sizer_5_staticbox = wx.StaticBox(self, -1, _(u"Formatação")) self.label_1 = wx.StaticText(self, -1, _("Tipo:")) self.comboType = wx.ComboBox(self, -1, choices=[""], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) self.label_2 = wx.StaticText(self, -1, _(u"Língua:")) self.textLang = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_TAB) self.checkbox_1 = wx.CheckBox(self, -1, _("Negrito")) self.checkbox_2 = wx.CheckBox(self, -1, _(u"Itálico")) self.checkbox_3 = wx.CheckBox(self, -1, _("Sublinhado")) self.button_ok = wx.Button(self, -1, _("Ok")) self.button_cancel = wx.Button(self, -1, _("Cancelar")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.OnOkButtonClick, self.button_ok) self.Bind(wx.EVT_BUTTON, self.OnCancelButtonClick, self.button_cancel) # end wxGlade self.undo_info = None self.el = None self.el_types = {'sc':[], 'sce':[], 'p':[], 's':[]} for p in __builtin__.cfg.get(u'Preferences', u'ElementTypes').split(','): while p.count('|') <= 2: p += '|' el, desc, pos, css = p.split('|') if el == _(u'Seção'): self.el_types['sc'].append(desc) elif el == _(u'Elemento de Seção'): self.el_types['sce'].append(desc) elif el == _(u'Parágrafo'): self.el_types['p'].append(desc) elif el == _(u'Sentença'): self.el_types['s'].append(desc) self.comboType.SetFocus() self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown)
def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: MetadataDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.sizer_40_staticbox = wx.StaticBox(self, -1, _("Metadado")) self.label_12 = wx.StaticText(self, -1, _("Tipo:")) self.combo_box_1 = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) self.label_13 = wx.StaticText(self, -1, _("Nome:")) self.combo_box_2 = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY|wx.CB_SORT) self.label_14 = wx.StaticText(self, -1, _("Valor:")) self.text_ctrl_5 = wx.TextCtrl(self, -1, "") self.list_box_1 = wx.ListBox(self, -1, choices=[], style=wx.LB_SINGLE|wx.LB_HSCROLL|wx.LB_SORT) self.button_4 = wx.Button(self, -1, _("<<")) self.button_3 = wx.Button(self, -1, _("Remover")) self.button_ok = wx.Button(self, -1, _("Ok")) self.button_cancel = wx.Button(self, -1, _("Cancelar")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.OnGenerationClick, self.combo_box_1) self.Bind(wx.EVT_COMBOBOX, self.OnMetaNameClick, self.combo_box_2) self.Bind(wx.EVT_LISTBOX, self.OnListMetadataClick, self.list_box_1) self.Bind(wx.EVT_BUTTON, self.OnAddMeta, self.button_4) self.Bind(wx.EVT_BUTTON, self.OnRemoveMeta, self.button_3) self.Bind(wx.EVT_BUTTON, self.OnOkButtonClick, self.button_ok) self.Bind(wx.EVT_BUTTON, self.OnCancelButtonClick, self.button_cancel) # end wxGlade self.metadata = None self.meta_names = {} for meta_info in __builtin__.cfg.get(u'Preferences', u'Metadata').decode('utf-8').split(','): (type, name) = meta_info.split(' | ') if not type in self.meta_names: self.meta_names[type] = [] self.meta_names[type].append(name) self.combo_box_1.SetItems(self.meta_names.keys()) self.combo_box_1.SetFocus() self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown)
def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: InsertTextDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_11 = wx.StaticText(self, -1, _("Entre com o texto a ser inserido:")) self.text_ctrl_3 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_LINEWRAP) self.radio_box_2 = wx.RadioBox(self, -1, _(u"Em relação à palavra atual, inserir o texto:"), choices=[_("Antes"), _("Depois")], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.button_1 = wx.Button(self, -1, _("Inserir")) self.button_2 = wx.Button(self, -1, _("Cancelar")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_RADIOBOX, self.OnRadioClick, self.radio_box_2) self.Bind(wx.EVT_BUTTON, self.OnInsertBtnClick, self.button_1) self.Bind(wx.EVT_BUTTON, self.OnCancelBtnClick, self.button_2) # end wxGlade self.text_ctrl_3.SetFocus() self.rb_text = ['',''] self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown)
def __init__(self, *args, **kwds): # Set app language intl.setLanguage() # begin wxGlade: PreferencesDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.notebook_2 = wx.Notebook(self, -1, style=0) self.notebook_2_pane_6 = wx.Panel(self.notebook_2, -1) self.notebook_2_pane_5 = wx.Panel(self.notebook_2, -1) self.notebook_2_pane_4 = wx.Panel(self.notebook_2, -1) self.notebook_2_pane_3 = wx.Panel(self.notebook_2, -1) self.notebook_2_pane_2 = wx.Panel(self.notebook_2, -1) self.notebook_2_pane_1 = wx.Panel(self.notebook_2, -1) self.sizer_63_staticbox = wx.StaticBox(self.notebook_2_pane_1, -1, _(u"Segurança")) self.sizer_64_staticbox = wx.StaticBox(self.notebook_2_pane_1, -1, _(u"Aparência")) self.label_27 = wx.StaticText(self.notebook_2_pane_1, -1, _("Linguagem:")) self.cbo_app_language = wx.ComboBox(self.notebook_2_pane_1, -1, choices=[_(u"Português (brasileiro)"), _("English")], style=wx.CB_DROPDOWN|wx.CB_READONLY) self.label_lang = wx.StaticText(self.notebook_2_pane_1, -1, "") self.static_line_1 = wx.StaticLine(self.notebook_2_pane_1, -1) self.chk_linebk = wx.CheckBox(self.notebook_2_pane_1, -1, _(u"Realizar quebra de linha na edição")) self.chk_bkp_save = wx.CheckBox(self.notebook_2_pane_1, -1, _(u"Salvar cópia anterior (com extensão \"~\")")) self.chk_auto_save = wx.CheckBox(self.notebook_2_pane_1, -1, _(u"Gravações automáticas em cópia temporária oculta")) self.label_24 = wx.StaticText(self.notebook_2_pane_2, -1, _("Sigla:")) self.text_edtype_acr = wx.TextCtrl(self.notebook_2_pane_2, -1, "") self.label_25 = wx.StaticText(self.notebook_2_pane_2, -1, _(u"Descrição:")) self.text_edtype_name = wx.TextCtrl(self.notebook_2_pane_2, -1, "") self.btn_edtype_add = wx.Button(self.notebook_2_pane_2, -1, _("Adicionar >>")) self.btn_up = wx.BitmapButton(self.notebook_2_pane_2, -1, wx.Bitmap(__builtin__.application_path + "/res/up.png",wx.BITMAP_TYPE_ANY)) self.btn_down = wx.BitmapButton(self.notebook_2_pane_2, -1, wx.Bitmap(__builtin__.application_path + "/res/down.png",wx.BITMAP_TYPE_ANY)) self.btn_remove = wx.BitmapButton(self.notebook_2_pane_2, -1, wx.Bitmap(__builtin__.application_path + "/res/exclude.png",wx.BITMAP_TYPE_ANY)) self.list_edtype = wx.ListBox(self.notebook_2_pane_2, -1, choices=[_(u"jun|Junção"), _(u"seg|Ressegmentação")]) self.label_26 = wx.StaticText(self.notebook_2_pane_2, -1, _(u"ATENÇÃO: ordene os elementos da lista por ordem de aplicação"), style=wx.ALIGN_CENTRE) self.label_26_copy = wx.StaticText(self.notebook_2_pane_2, -1, _(u"(do primeiro para o último).")) self.label_29 = wx.StaticText(self.notebook_2_pane_3, -1, _("Elemento:")) self.cbo_element = wx.ComboBox(self.notebook_2_pane_3, -1, choices=["", _(u"Seção"), _(u"Parágrafo"), _(u"Sentença"), _("Palavra")], style=wx.CB_DROPDOWN|wx.CB_READONLY) self.label_28 = wx.StaticText(self.notebook_2_pane_3, -1, _("Tipo:")) self.text_el_type = wx.TextCtrl(self.notebook_2_pane_3, -1, "") self.chk_ignore_to_pos = wx.CheckBox(self.notebook_2_pane_3, -1, _(u"Ignorar para análise morfológica")) self.label_35 = wx.StaticText(self.notebook_2_pane_3, -1, _("Estilo CSS (opcional):")) self.text_css = wx.TextCtrl(self.notebook_2_pane_3, -1, "") self.btn_edtype_add_copy = wx.Button(self.notebook_2_pane_3, -1, _("Adicionar >>")) self.btn_el_type_remove = wx.BitmapButton(self.notebook_2_pane_3, -1, wx.Bitmap(__builtin__.application_path + "/res/exclude.png",wx.BITMAP_TYPE_ANY)) self.list_el_type = wx.ListBox(self.notebook_2_pane_3, -1, choices=[], style=wx.LB_MULTIPLE|wx.LB_SORT) self.label_37 = wx.StaticText(self.notebook_2_pane_4, -1, _(u"Nível de edição para o etiquetador:")) self.cbo_nivel_ed_tagger = wx.ComboBox(self.notebook_2_pane_4, -1, choices=[], style=wx.CB_DROPDOWN) self.label_6 = wx.StaticText(self.notebook_2_pane_4, -1, _(u"Etiquetas válidas (uma por linha):")) self.text_tag_list = wx.TextCtrl(self.notebook_2_pane_4, -1, "", style=wx.TE_MULTILINE) self.chk_allow_new_tag = wx.CheckBox(self.notebook_2_pane_4, -1, _(u"Permitir a criação de novas etiquetas durante a edição")) self.label_mtype = wx.StaticText(self.notebook_2_pane_5, -1, _("Tipo:")) self.cbo_mtype = wx.ComboBox(self.notebook_2_pane_5, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_SORT) self.label_mname = wx.StaticText(self.notebook_2_pane_5, -1, _("Nome:")) self.text_mname = wx.TextCtrl(self.notebook_2_pane_5, -1, "") self.btn_add_meta = wx.Button(self.notebook_2_pane_5, -1, _("Adicionar >>")) self.btn_rm_meta = wx.BitmapButton(self.notebook_2_pane_5, -1, wx.Bitmap(__builtin__.application_path + "/res/exclude.png",wx.BITMAP_TYPE_ANY)) self.list_metadata = wx.ListBox(self.notebook_2_pane_5, -1, choices=[], style=wx.LB_MULTIPLE|wx.LB_SORT) self.label_xml = wx.StaticText(self.notebook_2_pane_6, -1, _(u"Lista de contrações, siglas, etc. (expressões regulares):")) self.text_xml_list = wx.TextCtrl(self.notebook_2_pane_6, -1, "", style=wx.TE_MULTILINE) self.btn_save_pref = wx.Button(self, -1, _("Salvar...")) self.btn_load_pref = wx.Button(self, -1, _("Carregar...")) self.btn_ok = wx.Button(self, wx.ID_OK, "") self.btn_apply = wx.Button(self, wx.ID_APPLY, "") self.btn_cancel_copy = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.OnComboLanguageClick, self.cbo_app_language) self.Bind(wx.EVT_CHECKBOX, self.OnChkLinebkClick, self.chk_linebk) self.Bind(wx.EVT_BUTTON, self.OnEdTypeAddClick, self.btn_edtype_add) self.Bind(wx.EVT_BUTTON, self.OnEdTypeUpClick, self.btn_up) self.Bind(wx.EVT_BUTTON, self.OnEdTypeDownClick, self.btn_down) self.Bind(wx.EVT_BUTTON, self.OnEdTypeRemoveClick, self.btn_remove) self.Bind(wx.EVT_LISTBOX, self.OnListEdTypeClick, self.list_edtype) self.Bind(wx.EVT_COMBOBOX, self.OnCboElTypeClick, self.cbo_element) self.Bind(wx.EVT_BUTTON, self.OnElTypeAddClick, self.btn_edtype_add_copy) self.Bind(wx.EVT_BUTTON, self.OnElTypeRemoveClick, self.btn_el_type_remove) self.Bind(wx.EVT_LISTBOX, self.OnListElTypeClick, self.list_el_type) self.Bind(wx.EVT_COMBOBOX, self.OnCboNivelEdClick, self.cbo_nivel_ed_tagger) self.Bind(wx.EVT_TEXT, self.OnMorphoTagText, self.text_tag_list) self.Bind(wx.EVT_CHECKBOX, self.OnChkAllowTagClick, self.chk_allow_new_tag) self.Bind(wx.EVT_BUTTON, self.OnMetaAddClick, self.btn_add_meta) self.Bind(wx.EVT_BUTTON, self.OnMetaRemoveClick, self.btn_rm_meta) self.Bind(wx.EVT_LISTBOX, self.OnListMetaClick, self.list_metadata) self.Bind(wx.EVT_TEXT, self.OnXMLListText, self.text_xml_list) self.Bind(wx.EVT_BUTTON, self.OnOkButtonClick, self.btn_ok) self.Bind(wx.EVT_BUTTON, self.OnApplyButtonClick, self.btn_apply) self.Bind(wx.EVT_BUTTON, self.OnCancelButtonClick, self.btn_cancel_copy) # end wxGlade self.Bind(wx.EVT_BUTTON, self.OnLoadButtonClick, self.btn_load_pref) self.Bind(wx.EVT_BUTTON, self.OnSaveButtonClick, self.btn_save_pref) self.Bind(wx.EVT_CHAR_HOOK, self.OnKeyDown) self.chk_allow_new_tag.Bind(wx.EVT_CHECKBOX, self.OnCheckBoxClick) self.chk_auto_save.Bind(wx.EVT_CHECKBOX, self.OnCheckBoxClick) self.chk_bkp_save.Bind(wx.EVT_CHECKBOX, self.OnCheckBoxClick) self.notebook_2.ChangeSelection(0) self.cbo_app_language.SetFocus() self.main_frame = None