Example #1
0
    def __init__(self, parent, ID, title, pos, size, pm, paths):
        wxFrame.__init__(self, parent, ID, title, pos, size,
                         wxWANTS_CHARS|wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE, title)

        self.procMngr = pm

        if 0:
            #self.SetIcon(wxIcon(d, 16, 16))
            bmp = TheArtProvider.GetBitmap(TheArtProvider.SM, wxART_FRAME_ICON, (16, 16))
            ico = wxIcon("",16)
            ico.CopyFromBitmap(bmp)
            self.SetIcon(ico)

        self.SetIcons(smicons.GetIconBundle())

        self.refreshStr = " Refresh the display"
        self.goUpStr = " Go up to parent item"
        self.goBackStr = " Go to previous item in history"
        self.goForwardStr = " Go to next item in history"
        self.goHomeStr = " Go to home directory"
        self.copyStr = " Copy selected items to clipboard"
        self.cutStr = " Cut selected items to clipboard"
        self.pasteStr = " Paste from clipboard"
        self.deleteStr = " Delete selected items"
        self.setupToolbar()
        self.setupMenus()

        self.splitterId = wxNewId()
        self.splitter = wxSplitterWindow(self, self.splitterId)

        # validity of 'paths'
        newPaths = []
        for path in paths:
            path = os.path.abspath(os.path.expanduser(path))
            if not os.path.exists(path) or not os.path.isdir(path):
                continue
            newPaths.append(path)
        if not newPaths: # no valid paths
            newPaths.append("/")
        paths = newPaths

        self.ntbook = smNotebook(self.splitter, wxNewId(), self.statusBar, self.OnItemSelected,
                                 self.ShowHidden, paths)
        self.dirCtrl = smDirCtrl(self.splitter, false, self.OnDirSelected, paths[0])

        self.splitter.SetMinimumPaneSize(20)
        self.splitter.SplitVertically(self.dirCtrl, self.ntbook)
        self.splitter.SetSashPosition(100)

        # let the menus and accelerator tables do the work
        #EVT_KEY_DOWN(self, self.OnKeyDown)
        # I cannot get these to work through menu accelerators (aka keyboard shortcuts)
        # It interferes with label editing: steals keystrokes!
        aTable = wxAcceleratorTable([(wxACCEL_NORMAL, WXK_BACK, self.goUpId),
                                     (wxACCEL_ALT, WXK_LEFT, self.goBackId),
                                     (wxACCEL_ALT, WXK_RIGHT, self.goForwardId),
                                     (wxACCEL_NORMAL, WXK_DELETE, self.deleteId)])
        self.dirCtrl.SetAcceleratorTable(aTable)
        self.ntbook.SetAcceleratorTable(aTable)
Example #2
0
 def getSolipsisIconWxIcon():
     return wxIcon(ImageManager.imgDir + 'icon_solipsis.png', wxBITMAP_TYPE_PNG)
Example #3
0
def setIcon(frame):
    if sys.platform == "win32":
        frame.SetIcon(wxIcon("resources/pws.ico", wxBITMAP_TYPE_ICO))