示例#1
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           size=(400, 340),
                           style=wx.DEFAULT_DIALOG_STYLE,
                           title=tr('About'))

        #        self.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL, False))
        #
        box = ui.VBox(padding=6,
                      namebinding='widget').create(self).auto_layout()
        box.add(ui.Label(tr('UliPad %s') % Version.version),
                name='version',
                flag=wx.ALIGN_CENTER | wx.ALL)
        font = self.version.GetFont()
        font.SetPointSize(20)
        self.version.SetFont(font)
        box.add(ui.Label(tr('Author: %s (%s)') % (author, email)))
        box.add(ui.Label(tr('If you have any questions, please contact me.')))

        self.ID_HOMEPAGE = wx.NewId()
        self.homepage = HyperLinkCtrl(self,
                                      self.ID_HOMEPAGE,
                                      "The UliPad project homepage",
                                      URL=homepage)
        box.add(self.homepage).bind(EVT_HYPERLINK_LEFT, self.OnLink)

        self.ID_MAILLIST = wx.NewId()
        self.maillist = HyperLinkCtrl(self,
                                      self.ID_MAILLIST,
                                      "The UliPad maillist",
                                      URL=maillist)
        box.add(self.maillist).bind(EVT_HYPERLINK_LEFT, self.OnLink)

        self.ID_ULISPOT = wx.NewId()
        self.ulispot = HyperLinkCtrl(self,
                                     self.ID_ULISPOT,
                                     "The UliPad Snippets Site",
                                     URL=ulispot)
        box.add(self.ulispot).bind(EVT_HYPERLINK_LEFT, self.OnLink)

        self.ID_BLOG = wx.NewId()
        self.blog = HyperLinkCtrl(self, self.ID_BLOG, "My Blog", URL=blog)
        box.add(self.blog)

        self.ID_EMAIL = wx.NewId()
        self.email = HyperLinkCtrl(self,
                                   self.ID_EMAIL,
                                   "Contact me",
                                   URL='mailto:' + email)
        box.add(self.email)

        box.add(ui.Button(tr("OK"), id=wx.ID_OK),
                name='btnOk',
                flag=wx.ALIGN_RIGHT | wx.ALL,
                border=10)
        self.btnOk.SetDefault()

        box.auto_fit(2)
示例#2
0
    def __init__(self, parent):
        self.parent = parent
        wx.Panel.__init__(self, parent, -1)
        
        self.pref = Globals.pref

        self.sizer = sizer = ui.VBox(padding=0, namebinding='widget').create(self).auto_layout()
        h = sizer.add(ui.HBox)
        h.add(ui.Label(tr("Replace with") + ':'))
        h.add(ui.Text('', size=(150, -1)), name='text')
        h.add(ui.Button(tr('Start')), name='btnRun').bind('click', self.OnRun)
        h.add(ui.Button(tr('Replace')), name='btnReplace').bind('click', self.OnReplace)
        h.add(ui.Button(tr('Replace All')), name='btnReplaceAll').bind('click', self.OnReplaceAll)
        h.add(ui.Button(tr('Ignore')), name='btnIgnore').bind('click', self.OnIgnore)
        h.add(ui.Button(tr('Ignore All')), name='btnIgnoreAll').bind('click', self.OnIgnoreAll)
        h.add(ui.Button(tr('Add')), name='btnAdd').bind('click', self.OnAdd)

        h = sizer.add(ui.HBox, proportion=1)
        h.add(ui.Label(tr("Suggest") + ':'))
        h.add(ui.ListBox(size=(250, -1)), name='list').binds(
                (wx.EVT_LISTBOX, self._OnReplSelect),
                (wx.EVT_LISTBOX_DCLICK, self.OnReplace),
            )
        h.add(ui.Label(tr("Available Dict") + ':'))
        h.add(ui.ListBox(size=(100, -1), choices=enchant.list_languages()), name='dict_list').bind(
            wx.EVT_LISTBOX, self.OnDictSelect
            )

        sizer.auto_fit(0)

        self.init()

        self._DisableButtons()
    def __init__(self, parent, version):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           size=(400, 340),
                           style=wx.DEFAULT_DIALOG_STYLE,
                           title=tr('Check Update'))

        box = ui.VBox(padding=6,
                      namebinding='widget').create(self).auto_layout()
        h = box.add(ui.HBox)
        h.add(ui.Label(tr('There is new version %s of UliPad.') % version))

        self.ID_HOMEPAGE = wx.NewId()
        self.homepage = HyperLinkCtrl(self,
                                      self.ID_HOMEPAGE,
                                      tr("Goto Download page"),
                                      URL=self.homepage)
        h.add(self.homepage).bind(EVT_HYPERLINK_LEFT, self.OnDownload)

        box.add(ui.Check(Globals.pref.check_update,
                         tr("Check for updates at startup")),
                name='chkCheck').bind('check', self.OnCheck)

        box.add(ui.Button(tr("OK"), id=wx.ID_OK),
                name='btnOk',
                flag=wx.ALIGN_CENTER | wx.ALL,
                border=10)
        self.btnOk.SetDefault()

        box.auto_fit(2)
示例#4
0
    def __init__(self, title=tr('Wrap Text'), values=None):
        wx.Dialog.__init__(self,
                           Globals.mainframe,
                           -1,
                           style=wx.DEFAULT_DIALOG_STYLE,
                           title=title,
                           size=(600, 300))

        self.sizer = box = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        grid = box.add(ui.SimpleGrid)
        grid.add(tr('Width'), ui.Int(75), name='width')
        grid.add(tr('Indent'), ui.Text(''), name='indent')
        grid.add(tr('First Line Indent'), ui.Text(''), name='firstindent')
        grid.add(tr('Skip Beginning Characters'), ui.Text(''), name='skipchar')
        grid.add(tr('Remove Tailing Characters'),
                 ui.Text(''),
                 name='remove_tailingchar')
        grid.add(tr('Add Tailing Characters'),
                 ui.Text(''),
                 name='add_tailingchar')
        box.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER | wx.BOTTOM)

        box.auto_fit(2)

        if values:
            box.SetValue(values)
示例#5
0
    def __init__(self, parent, mainframe):
        wx.Panel.__init__(self, parent, -1)

        self.mainframe = mainframe
        self.pref = Globals.pref

        self.sizer = sizer = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.HBox)
        box.add(ui.Check(self.pref.pylint_convention, tr('Convention')),
                name='convention').bind('check', self.OnCheckConvention)
        box.add(ui.Check(self.pref.pylint_refactor, tr('Refactor')),
                name='refactor').bind('check', self.OnCheckRefactor)
        box.add(ui.Check(self.pref.pylint_warning, tr('Warning')),
                name='warning').bind('check', self.OnCheckWarning)
        box.add(ui.Check(self.pref.pylint_error, tr('Error')),
                name='error').bind('check', self.OnCheckError)
        box.add(ui.Check(self.pref.pylint_fatal, tr('Fatal')),
                name='fatal').bind('check', self.OnCheckFatal)
        self.list = CheckList.List(self,
                                   columns=[
                                       (tr("Filename"), 400, 'left'),
                                       (tr("Type"), 100, 'left'),
                                       (tr("LineNo"), 60, 'left'),
                                       (tr("Description"), 200, 'left'),
                                   ],
                                   style=wx.LC_REPORT | wx.SUNKEN_BORDER
                                   | wx.LC_SINGLE_SEL)

        sizer.add(self.list, proportion=1, flag=wx.EXPAND)

        wx.EVT_LIST_ITEM_ACTIVATED(self.list, self.list.GetId(), self.OnEnter)

        sizer.auto_fit(0)
示例#6
0
    def __init__(self, parent, pref, dirs=''):
        self.parent = parent
        wx.Panel.__init__(self, parent, -1)

        self.pref = Globals.pref
        self.mainframe = Globals.mainframe
        self.running = 0
        self.stopping = 0
        self.starting = 0

        self.box = box = ui.VBox()
        box.add(
            ui.Label(
                tr("Multiple directories or extensions should be separated by semicolons ';'"
                   )))
        h = ui.HBox()
        h.add(ui.Label(tr("Search for:")))
        h.add(ui.ComboBox(Globals.mainframe.document.GetSelectedText(), choices=self.pref.searchinfile_searchlist), name='search')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Label(tr("Directories:")))
        h.add(ui.ComboBox(dirs, choices=self.pref.searchinfile_dirlist), name='sdirs')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Button('...', size=(22, -1)),
              name='btnBrow').bind('click', self.OnDirButtonClick)
        box.add(h, flag=wx.EXPAND)
        h = ui.HBox()
        h.add(ui.Label(tr("Extensions:")))
        if not self.pref.searchinfile_extlist:
            v = '*.*'
        else:
            v = self.pref.searchinfile_extlist[0]
        h.add(ui.ComboBox(v, choices=self.pref.searchinfile_extlist), name='extns')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Check(self.pref.searchinfile_case, tr("Case sensitive")),
              name='cs')
        h.add(ui.Check(self.pref.searchinfile_subdir,
                       tr("Search subdirectories")),
              name='ss')
        h.add(ui.Check(self.pref.searchinfile_regular,
                       tr("Regular expression")),
              name='re')
        h.add(ui.Check(self.pref.searchinfile_onlyfilename,
                       tr("Only show filename")),
              name='onlyfilename')
        box.add(h, flag=wx.EXPAND)
        box.add(ui.ListBox, name='results').bind(wx.EVT_LISTBOX_DCLICK,
                                                 self.OpenFound)
        h = ui.HBox()
        h.add(ui.Label(tr('Status:')))
        h.add(ui.Text(tr("Ready.")), name='status')
        h.add(ui.Button(tr("Start Search")),
              name='btnRun').bind('click', self.OnFindButtonClick)
        h.add(ui.Button(tr("CopyClipboard"))).bind('click',
                                                   self.OnCopyButtonClick)
        box.add(h, flag=wx.EXPAND)

        ui.create(self, box, namebinding='widget')

        self.status.Enable(False)
示例#7
0
    def __init__(self, parent):
        self.initmixin()

        wx.Panel.__init__(self, parent, -1)

        self.sizer = ui.VBox(0).create(self).auto_layout()
        obj = self.execplugin('init', self)
        self.sizer.add(obj, proportion=1, flag=wx.EXPAND)
示例#8
0
 def __init__(self, parent):
     wx.Dialog.__init__(self, parent, -1, title=tr('Input Log Message'), size=(300, 200))
     self.sizer = sizer = ui.VBox(namebinding='widget').create(self).auto_layout()
     sizer.add(ui.MultiText, name='text')
     
     sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
     sizer.auto_fit(0)
     
     self.CentreOnParent()
示例#9
0
    def __init__(self, parent, value, interpreters):
        box = ui.VBox(namebinding='element')
        box.add(ui.Label(tr('Which Lua interpreter do you want to use?')))
        box.add(ui.ComboBox(value, choices=interpreters, style=wx.CB_READONLY),
                name='interpreter')
        super(SelectInterpreter,
              self).__init__(parent,
                             box,
                             title=tr('Lua Interpreters List'),
                             fit=2)

        self.layout.SetFocus()
示例#10
0
    def __init__(self,
                 parent,
                 size=(850, 500),
                 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
        self.initmixin()

        #config.ini
        self.ini = common.get_config_file_obj()

        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           title=tr("Preferences"),
                           size=size,
                           style=style)

        self.value_set = []
        self.pages = {}
        self.pagenames = {}
        self.values = {}

        self.parent = parent
        self.pref = self.parent.pref
        self.default_pref = Preference.Preference()

        self.box = box = ui.VBox(namebinding='widget')
        self.treebook = TreeBookPanel(self, -1)
        self.addPages(self.treebook)

        box.add(self.treebook, proportion=1, flag=wx.EXPAND | wx.ALL)

        box.add(wx.StaticLine(self), flag=wx.EXPAND | wx.ALL)

        buttons = [(tr('OK'), wx.ID_OK, 'btnOk'),
                   (tr('Cancel'), wx.ID_CANCEL, 'btnCancel'),
                   (tr('Apply'), wx.ID_APPLY, 'btnApply')]
        box.add(ui.simple_buttons(buttons), flag=wx.ALIGN_CENTER | wx.BOTTOM)
        box.bind('btnOk', 'click', self.OnOk)
        box.bind('btnApply', 'click', self.OnApply)

        self.create_pages()

        self.callplugin('initpreference', self)
        ui.create(self, box, 0)
        self.btnOk.SetDefault()

        self.treebook.select()
        self.values = self.get_values()

        wx.EVT_UPDATE_UI(self, self.btnApply.GetId(), self.OnUpdateApply)

        self.callplugin('aftercreate', self)
示例#11
0
    def __init__(self, parent, title, username, may_save):
        wx.Dialog.__init__(self, parent, -1, title, size=(300, -1))

        self.sizer = sizer = ui.VBox(namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.VGroup(tr('Credentials')))
        box1 = box.add(ui.SimpleGrid)
        box1.add(tr('Username:'******'username')
        box1.add(tr('Password:'******'password')
        sizer.add(ui.Check(may_save, tr('Always uses these credentials')), name='save')
        
        sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
        sizer.auto_fit(1)
        
        self.CentreOnParent()
示例#12
0
    def _create(self, replace):
        from modules.wxctrl import FlatButtons

        self.sizer = sizer = ui.HBox(
            padding=0, namebinding='widget').create(self).auto_layout()

        box1 = ui.HBox(2)
        sizer.add(box1, proportion=0, flag=0)
        btn = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/closewin.gif'))
        btn.SetToolTip(wx.ToolTip(tr("Close")))
        box1.add(btn).bind('click', self.OnClose)
        self.btnToggleReplace = btn = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/replace.gif'))
        btn.SetToolTip(wx.ToolTip(tr("Show Replace Pane")))
        box1.add(btn).bind('click', self.OnOpenReplace)

        box2 = ui.VBox(0)
        sizer.add(box2, name='box2')

        box = ui.HBox(2)
        box2.add(box)

        #add find widgets

        box.add(ui.ComboBox, name='findtext').bind('enter', self.OnNext1)\
            .bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        btn = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/next.gif'))
        btn.SetToolTip(wx.ToolTip(tr("Next")))
        box.add(btn, name='btn_next').bind('click', self.OnNext)
        btn = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/prev.gif'))
        btn.SetToolTip(wx.ToolTip(tr("Prev")))
        box.add(btn).bind('click', self.OnPrev)
        box.add(ui.Check(False, tr("Match case")), name="chkCase")
        box.add(ui.Check(False, tr("Whole word")), name="chkWhole")
        box.add(ui.Check(False, tr("Regular expression")), name="chkRe")
        box.add(ui.Check(False, tr("Wrap search")), name="chkWrap")

        #add replace widgets
        if replace:
            self._create_replace()
            self.btnToggleReplace.SetToolTip(
                wx.ToolTip(tr("Hide Replace Pane")))

        # last_controls tracks the control / controls that are last in
        # navigation.
        self.last_controls = []
        self._navigation_hack()
示例#13
0
    def __init__(self, parent, realm, info_list, may_save):
        wx.Dialog.__init__( self, parent, -1, tr('Trust server %s') % realm )

        self.sizer = sizer = ui.VBox(namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.VGroup(tr('Server Certificate')))
        box1 = box.add(ui.SimpleGrid)
        for key, value in info_list:
            box1.add(key, ui.Text(value, style=wx.TE_READONLY))
         
        sizer.add(ui.Check(may_save, tr("Always trust this server")), name='save')

        sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
        sizer.auto_fit(1)

        self.CentreOnParent()
示例#14
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        self.parent = parent

        self.sizer = sizer = ui.VBox(
            padding=0, namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.HBox(padding=2))
        self.btnRefresh = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/classbrowserrefresh.gif'))
        box.add(self.btnRefresh)
        self.code = TextEditor(self, None, 'canvas test', 'texteditor', True)
        self.code.cansavefileflag = False
        self.code.needcheckfile = False
        self.code.savesession = False
        sizer.add(self.code, proportion=1, flag=wx.EXPAND | wx.ALL, border=3)
        sizer.auto_fit(0)
示例#15
0
    def __init__(self, parent, title, defaultvalue, defaultchkvalue):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           style=wx.DEFAULT_DIALOG_STYLE,
                           title=title)

        self.pref = Globals.pref

        self.sizer = sizer = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.VGroup(tr('Lua interpreter')))
        h = box.add(ui.HBox())
        h.add(ui.Label(tr('Select:')))

        interpreters = dict(self.pref.lua_interpreter)
        default_lua_interpreter = self.pref.default_lua_interpreter
        if not default_lua_interpreter in interpreters:
            default_lua_interpreter = self.pref.default_lua_interpreter[0][0]

        h.add(ui.SingleChoice(default_lua_interpreter,
                              sorted(interpreters.keys())),
              name='interpreter').bind(wx.EVT_COMBOBOX, self.OnChanged)
        h.add(ui.Label(tr('Parameters:')))
        h.add(ui.Text(
            self.pref.lua_default_paramters.get(default_lua_interpreter, '')),
              name='parameter')

        h = self.sizer.add(ui.HBox())
        h.add(ui.Label(tr('Parameters of script:')))
        h.add(ui.Text(defaultvalue), name='command_line').tooltip(
            "$file will be replaced with the filename of the current document\n"
            "$path will be replaced with the filename's directory of the current document"
        )
        self.sizer.add(ui.Check(defaultchkvalue,
                                tr('Redirect input and output')),
                       name='redirect')
        self.sizer.add(ui.Check(
            self.pref.lua_show_args,
            tr('Show the Select Arguments dialog at Lua program run')),
                       name='show_args')

        sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER | wx.BOTTOM)
        self.sizer.bind('btnOk', 'click', self.OnOK)
        self.btnOk.SetDefault()

        sizer.auto_fit(1)
示例#16
0
 def __init__(self, title=tr('Select Encoding'), style = wx.DEFAULT_DIALOG_STYLE):
     wx.Dialog.__init__(self, Globals.mainframe, -1, title=title, style = style)
     
     self.sizer = box = ui.VBox(namebinding='widget').create(self).auto_layout()
     grid = box.add(ui.Grid)
     grid.add((0, 0), ui.Radio(label=tr('Encoding:')), name='rdo_encoding').bind(wx.EVT_RADIOBUTTON, self.OnRadio)
     grid.add((0, 1), ui.SingleChoice(None, self.EncodingList), name='encoding')
     grid.add((1, 0), ui.Radio(label=tr('Custom Encoding:')), name='rdo_cus_encoding').bind(wx.EVT_RADIOBUTTON, self.OnRadio)
     grid.add((1, 1), ui.Text, name='cus_encoding')
     
     self.encoding.Enable(True)
     self.cus_encoding.Enable(False)
     
     box.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
     self.btnOk.SetDefault()
     
     box.auto_fit(2)
示例#17
0
 def __init__(self, parent, title=tr('Result')):
     wx.Dialog.__init__(self, Globals.mainframe, -1, style = wx.DEFAULT_DIALOG_STYLE, title = title, size=(600, 300))
     
     self.parent = parent
     self.sizer = box = ui.VBox(namebinding='widget').create(self).auto_layout()
     self.list = CheckList.List(self, columns=[
             (tr("Action"), 120, 'left'),
             (tr("Path"), 400, 'left'),
             ], style=wx.LC_REPORT | wx.SUNKEN_BORDER)
     
     box.add(self.list, proportion=1, flag=wx.ALL|wx.EXPAND, border=5)
     box.add(ui.Label, name='message')
     box.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
     
     box.bind('btnCancel', 'click', self.OnCancel)
     box.auto_fit(0)
     self.btnOk.Disable()
     self.btnCancel.Enable()
示例#18
0
 def __init__(self, parent, title, path):
     wx.Dialog.__init__(self, parent, -1, style = wx.DEFAULT_DIALOG_STYLE, title = title, size=(400, 300))
     self.path = path
     
     self.sizer = box = ui.VBox(namebinding='widget').create(self).auto_layout()
     self.list = CheckList.CheckList(self, columns=[
             (tr("File"), 380, 'left'),
             ], style=wx.LC_REPORT | wx.SUNKEN_BORDER)
     
     box.add(self.list, proportion=1, flag=wx.ALL|wx.EXPAND, border=5)
     self.list.on_check = self.OnCheck
     
     #add selection switch checkbox
     box.add(ui.Check3D(2, tr('Select / deselect All')), name='select').bind('check', self.OnSelect)
     
     box.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
     self.btnOk.SetDefault()
     
     self.init()
示例#19
0
    def __init__(self, parent, title=tr('SVN Settings'), size=(450, -1)):
        self.pref = Globals.pref
        try:
            v = self._get_info()
        except:
            raise

        wx.Dialog.__init__(self, parent, -1, title=title, size=size)

        self.sizer = sizer = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.SimpleGrid)
        box.add(tr('Global ignores'), ui.Text, name='svn_global_ignores')\
            .tooltip(tr('Multiple ignores should be delimeted by space'))

        sizer.add(ui.Check(False, tr('Enable proxy server')), name='proxy')\
            .bind('check', self.OnEnable)
        box = sizer.add(ui.VGroup(tr('Proxy settings')))
        grid = box.add(ui.Grid(growablecol=1))

        grid.add((0, 0), ui.Label(tr('Server Address') + ':'))
        grid.add((0, 1), ui.Text, name='server')
        grid.add((0, 2), ui.Label(tr('Port') + ':'))
        grid.add((0, 3), ui.Int(0, size=(40, -1)), name='port')
        grid.add((1, 0), ui.Label(tr('Username') + ':'))
        grid.add((1, 1), ui.Text, name='username')
        grid.add((2, 0), ui.Label(tr('Password') + ':'))
        grid.add((2, 1), ui.Password, name='password')
        grid.add((3, 0), ui.Label(tr('Proxy timeout in seconds') + ':'))
        grid.add((3, 1), ui.Int, name='timeout')

        sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER | wx.BOTTOM)
        sizer.bind('btnOk', 'click', self.OnOk)
        self.btnOk.SetDefault()

        sizer.auto_fit(1)

        sizer.SetValue(v)
        self.OnEnable(None)
示例#20
0
    def __init__(self, title=tr('Checkout'), size=(450, -1)):
        wx.Dialog.__init__(self, Globals.mainframe, -1, title=title, size=size)

        self.pref = Globals.pref
        self.sizer = sizer = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        box = sizer.add(ui.VGroup(tr('Repository')))
        box.add(ui.Label(tr('URL of repository:')))
        box.add(ui.ComboBox('', self.pref.svn_urls), name='url')
        box.add(ui.Label(tr('Checkout Directory')))
        box.add(ui.Dir(self.pref.svn_checkout_folder), name='dir')

        box = sizer.add(ui.VGroup(tr('Revision')))
        box1 = box.add(ui.HBox)
        box1.add(ui.Check(False, tr('Revision'),
                          name='chk_revision')).bind('check', self.OnCheck)
        box1.add(ui.Text('', size=(80, -1)),
                 name='revision').get_widget().Disable()

        sizer.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER | wx.BOTTOM)
        sizer.bind('btnOk', 'click', self.OnOk)
        self.btnOk.SetDefault()

        sizer.auto_fit(1)
示例#21
0
    def __init__(self, title, path):
        wx.Dialog.__init__(self, Globals.mainframe, -1, style = wx.DEFAULT_DIALOG_STYLE, title = title, size=(600, 500))
        self.pref = Globals.pref
        self.path = path
        self.fileinfos = {}
        self.filelist = []
        
        self.sizer = box = ui.VBox(namebinding='widget').create(self).auto_layout()
        
        box1 = box.add(ui.VGroup(tr("Message")))
        box1.add(ui.Button(tr("Recent Messages"))).bind('click', self.OnHisMsg)
        box1.add(ui.MultiText, name='message')

        #add filenames list
        self.list = CheckList.CheckList(self, columns=[
                (tr("File"), 390, 'left'),
                (tr("Extension"), 70, 'left'),
                (tr("Status"), 100, 'left'),
                ], style=wx.LC_REPORT | wx.SUNKEN_BORDER)
        
        box.add(self.list, proportion=2, flag=wx.EXPAND|wx.ALL, border=5)
        self.list.on_check = self.OnCheck
        
        box.add(
            ui.Check(True, tr('Show unversioned files')), 
            name='chkShowUnVersion').bind('check', self.OnShowUnVersion)
        box.add(
            ui.Check3D(False, tr('Select / deselect All')),
            name='select').bind('check', self.OnSelect)
        
        box.add(ui.simple_buttons(), flag=wx.ALIGN_CENTER|wx.BOTTOM)
        self.btnOk.SetDefault()
        
        box.auto_fit(0)
        
        wx.CallAfter(self.init)
示例#22
0
    def __init__(self, parent, mainframe):
        self.initmixin()
        self.parent = parent
        self.mainframe = mainframe
        self.pref = self.mainframe.pref
        wx.Panel.__init__(self, parent, -1)

        self.alive = False
        self.running = False

        self.box = box = ui.VBox(
            namebinding='widget').create(self).auto_layout()
        box1 = box.add(ui.HBox)
        box1.add(ui.Label(tr('Sites:')))
        box1.add(ui.ComboBox("", self.mainframe.pref.ftp_sites),
                 name='cmbSite').bind(wx.EVT_COMBOBOX, self.OnSiteChanged)
        box1.add(ui.Label(tr('Username:'******'', size=(100, -1)), name='txtUser')
        box1.add(ui.Label(tr('Password:'******'', size=(100, -1)), name='txtPassword')
        box1.add(ui.Button(tr('Connect')),
                 name='btnConnect').bind('click', self.OnConnect)
        box1.add(ui.Button(tr('Disconnect')),
                 name='btnDisconnect').bind('click', self.OnDisconnect)

        box.add(ui.List(columns=[
            (tr("Name"), 500, 'left'),
            (tr("Size"), 80, 'right'),
            (tr("Format"), 80, 'left'),
        ],
                        style=wx.LC_REPORT | wx.SUNKEN_BORDER
                        | wx.LC_SINGLE_SEL),
                name='list')

        box2 = box.add(ui.HBox)
        box2.add(ui.Label(tr('Encoding:')))
        box2.add(ui.ComboBox("Default", ['Default', 'UTF-8', 'Custom'],
                             size=(100, -1)),
                 name='txtEncoding')
        box2.add(ui.Label(tr('Remote path:')))
        box2.add(ui.ComboBox("", self.mainframe.pref.remote_paths),
                 name='txtPath')
        box2.add(ui.Button(tr('Refresh')),
                 name='btnRefresh').bind('click', self.OnRefresh)
        box2.add(ui.Button(tr('Set FTP site...')),
                 name='btnSite').bind('click', self.OnSite)

        self.load()
        self.initlist()

        box.bind('btnConnect', wx.EVT_UPDATE_UI, self.OnUpdateUI)
        box.bind('btnDisconnect', wx.EVT_UPDATE_UI, self.OnUpdateUI)
        box.bind('btnRefresh', wx.EVT_UPDATE_UI, self.OnUpdateUI)
        box.bind('btnSite', wx.EVT_UPDATE_UI, self.OnUpdateUI)
        box.bind('list', wx.EVT_LIST_ITEM_ACTIVATED, self.OnEnter)

        #@add_menu menulist
        self.callplugin_once('add_menu', Ftp.popmenulist)
        #make popup menu
        if self.popmenulist:
            self.popmenu = makemenu.makepopmenu(self, self.popmenulist,
                                                self.imagelist)
            wx.EVT_LIST_ITEM_RIGHT_CLICK(self.list, self.list.GetId(),
                                         self.OnRClick)
            wx.EVT_RIGHT_UP(self.list, self.OnRClick)
示例#23
0
    def __init__(self, parent, editor, autoexpand=True):
        self.initmixin()

        wx.Panel.__init__(self, parent, -1)
        self.parent = parent
        self.editor = editor
        self.autoexpand = autoexpand

        self.activeflag = False

        self.sizer = ui.VBox(namebinding='widget').create(self).auto_layout()
        self.btnRefresh = FlatButtons.FlatBitmapButton(
            self, -1, common.getpngimage('images/classbrowserrefresh.gif'))
        self.sizer.add(self.btnRefresh).bind('click', self.OnRefresh)

        self.imagelist = wx.ImageList(16, 16)

        #add share image list
        self.imagefilenames = []
        self.imageids = {}
        self.callplugin('add_images', self.imagefilenames)
        for name, imagefile in self.imagefilenames:
            self.add_image(name, imagefile)

        style = wx.TR_SINGLE | wx.TR_HIDE_ROOT | wx.TR_HAS_BUTTONS | wx.TR_TWIST_BUTTONS
        if wx.Platform == '__WXMSW__':
            style = style | wx.TR_ROW_LINES
        elif wx.Platform == '__WXGTK__':
            style = style | wx.TR_NO_LINES

        self.tree = wx.TreeCtrl(self, -1, style=style)
        self.tree.AssignImageList(self.imagelist)

        self.sizer.add(self.tree, proportion=1, flag=wx.EXPAND)
        self.root = self.tree.AddRoot('OutlineBrowser')

        self.nodes = {}
        self.ID = 1

        #        wx.EVT_TREE_SEL_CHANGING(self.tree, self.tree.GetId(), self.OnChanging)
        #        wx.EVT_TREE_SEL_CHANGED(self.tree, self.tree.GetId(), self.OnChanged)
        #        wx.EVT_TREE_BEGIN_LABEL_EDIT(self.tree, self.tree.GetId(), self.OnBeginChangeLabel)
        #        wx.EVT_TREE_END_LABEL_EDIT(self.tree, self.tree.GetId(), self.OnChangeLabel)
        wx.EVT_TREE_ITEM_ACTIVATED(self.tree, self.tree.GetId(),
                                   self.OnChanged)
        #        wx.EVT_TREE_ITEM_RIGHT_CLICK(self.tree, self.tree.GetId(), self.OnRClick)
        #        wx.EVT_RIGHT_UP(self.tree, self.OnRClick)
        wx.EVT_TREE_DELETE_ITEM(self.tree, self.tree.GetId(),
                                self.OnDeleteItem)
        #        wx.EVT_LEFT_DCLICK(self.tree, self.OnDoubleClick)
        #        wx.EVT_TREE_ITEM_EXPANDING(self.tree, self.tree.GetId(), self.OnExpanding)
        wx.EVT_LEFT_DOWN(self.tree, self.OnLeftDown)
        wx.EVT_TREE_ITEM_GETTOOLTIP(self.tree, self.tree.GetId(),
                                    self.OnGetToolTip)
        wx.EVT_LEFT_DCLICK(self.tree, self.OnDoubleClick)
        self.tooltip_func = None

        #add init process
        self.callplugin('init', self)

        #        self.SetSizer(self.sizer)
        #        self.SetAutoLayout(True)
        self.sizer.auto_fit(0)

        self.popmenus = None