Exemple #1
0
    def __init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Panel.__init__(self,
                          id=wxID_PANEL,
                          name=u'Panel',
                          parent=prnt,
                          style=wx.TAB_TRAVERSAL)

        self.searchFrom = search.Panel(self, main, _(u"Swap this:"),
                                       'searchFrom')
        self.searchTo = search.Panel(self, main, _(u"With this:"), 'searchTo')
    def __init__(self, parent, main_panel, params={}):
        Operation.__init__(self, params)
        global main
        main = main_panel
        self.__init_ctrls(parent)

        # place these here for boa compatibility
        self.case_operation_value.Bind(wx.EVT_CHOICE,
                                       self.create_operation,
                                       id=wxID_PANELCASE_OPERATION_VALUE)
        self.other_operation_value.Bind(wx.EVT_CHOICE,
                                        self.create_operation,
                                        id=wxID_PANELOTHER_OPERATION_VALUE)
        self.search = search.Panel(self, main,
                                   _(u"Search for what to modify, by:"))

        self.__init_sizer()
        self.on_config_load()
Exemple #3
0
    def __init_ctrls(self, prnt):
        wx.Panel.__init__(self,
                          id=wxID_PANEL,
                          name=u'replaceToolsPanel',
                          parent=prnt,
                          style=wx.TAB_TRAVERSAL)

        self.search = search.Panel(self, main,
                                   _(u"Search for what to replace, by:"))

        self.staticBox1 = wx.StaticBox(id=wxID_PANELSTATICBOX1,
                                       label=_("Replace with:"),
                                       name='staticBox1',
                                       parent=self,
                                       style=0)

        # sub operation buttons ------------------------------------------- #
        self.opButtonsPanel = opButtons.Panel(self, main)

        txt = _(u"Text (blank to delete):")
        self.staticText1 = wx.StaticText(id=wxID_PANELSTATICTEXT1,
                                         label=txt,
                                         name='staticText1',
                                         parent=self,
                                         style=0)
        Size = wx.Size(self.staticText1.GetTextExtent(txt)[0] + 3, -1)
        self.staticText1.SetMinSize(Size)

        self.repl_txt = wx.TextCtrl(id=wxID_PANELREPL_TXT,
                                    name=u'repl_txt',
                                    parent=self,
                                    style=wx.TE_PROCESS_ENTER,
                                    value=u'')
        self.repl_txt.SetToolTipString(_(u"Keep blank to delete."))
        self.repl_txt.Bind(wx.EVT_TEXT, main.show_preview)
        self.repl_txt.Bind(wx.EVT_TEXT_ENTER, main.show_preview)
Exemple #4
0
    def __init_ctrls(self, prnt):
        wx.Panel.__init__(self,
                          id=wxID_PANEL,
                          name=u'Panel',
                          parent=prnt,
                          style=0)

        # regular expressions --------------------------------------------- #
        self.regExpPanel = regExpr.Panel(self, main)

        self.search = search.Panel(self, main,
                                   _(u"Search for what to move, by:"))

        self.staticBox1 = wx.StaticBox(id=wxID_PANELSTATICBOX1,
                                       label=_(u"Move the match:"),
                                       name='staticBox1',
                                       parent=self,
                                       style=0)

        self.replMovePos = wx.RadioButton(id=wxID_PANELREPL_MOVE_POS,
                                          label=_(u"to position:"),
                                          name=u'replMovePos',
                                          parent=self,
                                          style=wx.RB_GROUP)
        self.replMovePos.SetValue(True)
        self.replMovePos.Bind(wx.EVT_RADIOBUTTON,
                              self.activate_options,
                              id=wxID_PANELREPL_MOVE_POS)

        self.replMovePosValue = wx.SpinCtrl(id=wxID_PANELREPL_MOVE_POS_VALUE,
                                            initial=0,
                                            max=255,
                                            min=-255,
                                            name=u'replMovePosValue',
                                            parent=self,
                                            size=wx.Size(60, -1),
                                            value='0',
                                            style=wx.SP_ARROW_KEYS
                                            | wx.TE_PROCESS_ENTER)
        self.replMovePosValue.SetValue(0)
        self.replMovePosValue.Bind(wx.EVT_TEXT_ENTER,
                                   main.show_preview,
                                   id=wxID_PANELREPL_MOVE_POS_VALUE)
        self.replMovePosValue.Bind(wx.EVT_SPINCTRL,
                                   main.show_preview,
                                   id=wxID_PANELREPL_MOVE_POS_VALUE)

        self.staticText5 = wx.StaticText(
            id=wxID_PANELSTATICTEXT6,
            label=_(u"Use negative values to start from end of name."),
            name=u'staticText5',
            parent=self,
            style=0)
        self.staticText5.Enable(True)

        self.replMoveText = wx.RadioButton(id=wxID_PANELREPL_MOVE_TXT,
                                           label=_(u"to"),
                                           name=u'replMoveText',
                                           parent=self,
                                           style=0)
        self.replMoveText.SetValue(False)
        self.replMoveText.Bind(wx.EVT_RADIOBUTTON,
                               self.activate_options,
                               id=wxID_PANELREPL_MOVE_TXT)

        self.replMoveTextValue = wx.TextCtrl(id=wxID_PANELREPL_MOVE_TXT_VALUE,
                                             name=u'replMoveTextValue',
                                             parent=self,
                                             style=0,
                                             value='')
        self.replMoveTextValue.Enable(False)
        self.replMoveTextValue.Bind(wx.EVT_TEXT,
                                    main.show_preview,
                                    id=wxID_PANELREPL_MOVE_TXT_VALUE)

        self.replMoveTextMod = wx.Choice(
            choices=[_(u"before"), _(u"after"),
                     _(u"replace")],
            id=wxID_PANELREPL_MOVE_TXT_MOD,
            name=u'replMoveTextMod',
            parent=self)
        self.replMoveTextMod.SetSelection(0)
        self.replMoveTextMod.Enable(False)
        self.replMoveTextMod.Bind(wx.EVT_CHOICE,
                                  main.show_preview,
                                  id=wxID_PANELREPL_MOVE_TXT_MOD)

        self.staticText6 = wx.StaticText(id=wxID_PANELSTATICTEXT6,
                                         label=_(u"text:"),
                                         name=u'staticText6',
                                         parent=self,
                                         style=0)
        self.staticText6.Enable(False)

        # grotesque hack for win2000
        if platform.system() == 'Windows':
            winver = sys.getwindowsversion()
            if winver[0] <= 5 and winver[1] < 1:
                self.hack = wx.RadioButton(id=-1,
                                           label='',
                                           name=u'hack',
                                           parent=self,
                                           style=wx.RB_GROUP)
                self.hack.Show(False)