Exemplo n.º 1
0
 def TreeCtrlEvent(self, event):
     id = event.GetId()
     if id == ID_GOTO_PATH:
         item = self.tree_ctrl.GetSelection()
         fileutils.open_file_directory(self.tree_ctrl.GetItemText(item))
         return True
     elif id == ID_REMOVE_PATH:
         self.RemovePath(event)
         return True
     else:
         return True
Exemplo n.º 2
0
 def ProcessEvent(self, event):
     id = event.GetId()
     item = self.GetSelection()
     item_type, item_path = self.GetPyData(item)
     if id == OPEN_CMD_PATH_ID:
         if item_type == ResourceView.DIRECTORY_RES_TYPE:
             filePath = item_path
         else:
             filePath = os.path.dirname(item_path)
         if sysutils.isWindows():
             filePath = filePath.decode('gbk')
         err_code, msg = fileutils.open_path_in_terminator(filePath)
         if err_code != ERROR_OK:
             wx.MessageBox(msg, style=wx.OK | wx.ICON_ERROR)
     elif id == OPEN_DIR_PATH_ID:
         err_code, msg = fileutils.open_file_directory(item_path)
         if err_code != ERROR_OK:
             wx.MessageBox(msg, style=wx.OK | wx.ICON_ERROR)
     elif id == COPY_FULLPATH_ID:
         sysutils.CopyToClipboard(item_path)
     elif id == REFRESH__PATH_ID:
         self.Freeze()
         self.DeleteChildren(item)
         ResourceView(self.GetParent()).LoadDir(item, item_path)
         if self.GetChildrenCount(item) > 0:
             self.SetItemHasChildren(item, True)
         self.Thaw()
Exemplo n.º 3
0
 def OnOpenPathInExplorer(event):
     fileutils.open_file_directory(doc.GetFilename())
Exemplo n.º 4
0
 def OnOpenPathInExplorer(event):
     err_code, msg = fileutils.open_file_directory(doc.GetFilename())
     if err_code != consts.ERROR_OK:
         wx.MessageBox(msg, style=wx.OK | wx.ICON_ERROR)
Exemplo n.º 5
0
 def GotoPath(self, interpreter):
     err_code, msg = fileutils.open_file_directory(interpreter.Path)
     if err_code != ERROR_OK:
         wx.MessageBox(msg, style=wx.OK | wx.ICON_ERROR)