1
#-----------------------------------------------------------------------------
2
# Name: EditorHelper.py
5
# Author: Riaan Booysen
8
# RCS-ID: $Id: EditorHelper.py,v 1.9 2004/08/16 13:28:13 riaan Exp $
9
# Copyright: (c) 2001 - 2004
11
#-----------------------------------------------------------------------------
13
""" Global namespace for general IDE window ids, image indexes and registries """
15
import Preferences, Utils
17
(wxID_EDITOROPEN, wxID_EDITORSAVE, wxID_EDITORSAVEAS, wxID_EDITORCLOSEPAGE,
18
wxID_EDITORREFRESH, wxID_EDITORDESIGNER, wxID_EDITORDEBUG, wxID_EDITORHELP,
19
wxID_DEFAULTVIEWS, wxID_EDITORSWITCHTO, wxID_EDITORDIFF, wxID_EDITORPATCH,
20
wxID_EDITORTOGGLEVIEW, wxID_EDITORSWITCHEXPLORER, wxID_EDITORSWITCHSHELL,
21
wxID_EDITORSWITCHPALETTE, wxID_EDITORSWITCHINSPECTOR,
22
wxID_EDITORTOGGLERO, wxID_EDITORHELPFIND, wxID_EDITORRELOAD,
23
wxID_EDITORHELPABOUT, wxID_EDITORHELPGUIDE, wxID_EDITORHELPTIPS,
24
wxID_EDITORHELPOPENEX,
25
wxID_EDITORPREVPAGE, wxID_EDITORNEXTPAGE,
26
wxID_EDITORBROWSEFWD, wxID_EDITORBROWSEBACK,
27
wxID_EDITOREXITBOA, wxID_EDITOROPENRECENT,
28
wxID_EDITORHIDEPALETTE, wxID_EDITORWINDIMS, wxID_EDITORWINDIMSLOAD,
29
wxID_EDITORWINDIMSSAVE, wxID_EDITORWINDIMSRESDEFS,
30
wxID_EDITORSWITCHPREFS,
31
) = Utils.wxNewIds(36)
34
def imgIdxRange(cnt=0):
35
""" Allocates either a range of image indexes or a single one """
38
rng = range(imgCounter, imgCounter + cnt)
39
imgCounter = imgCounter + cnt
42
imgCounter = imgCounter + 1
45
builtinImgs =('Images/Modules/FolderUp_s.png',
46
'Images/Modules/Folder_s.png',
47
'Images/Modules/Folder_green_s.png',
48
'Images/Modules/Folder_cyan_s.png',
49
'Images/Shared/SystemObj.png',
50
'Images/Shared/SystemObjOrdered.png',
51
'Images/Shared/SystemObjBroken.png',
52
'Images/Shared/SystemObjPending.png',
53
'Images/Shared/SystemObjDisabled.png',
54
'Images/Modules/ZopeConn_s.png',
55
'Images/Shared/BoaLogo.png',
56
'Images/Modules/Drive_s.png',
57
'Images/Modules/NetDrive_s.png',
58
'Images/Modules/FolderBookmark_s.png',
59
'Images/Modules/OpenEditorModels_s.png',
60
'Images/Modules/PrefsFolder_s.png',
61
'Images/Shared/PrefsSTCStyles.png',
62
'Images/Editor/RecentFiles.png',
63
'Images/Editor/Shell.png',
64
'Images/Editor/Explorer.png',
65
'Images/Modules/HelpBook_s.png',
67
# Like builtinImgs, but stores list of tuples, (imgIdx, name)
70
def addPluginImgs(imgPath):
71
imgIdx = imgIdxRange()
72
pluginImgs.append( (imgIdx, imgPath) )
77
# Indexes for the imagelist
78
(imgFolderUp, imgFolder, imgPathFolder, imgCVSFolder, imgSystemObj,
79
imgSystemObjOrdered, imgSystemObjBroken, imgSystemObjPending, imgSystemObjDisabled,
80
imgZopeConnection, imgBoaLogo, imgFSDrive, imgNetDrive, imgFolderBookmark,
81
imgOpenEditorModels, imgPrefsFolder, imgPrefsSTCStyles, imgRecentFiles,
82
imgShell, imgExplorer, imgHelpBook,
84
imgTextModel, imgBitmapFileModel, imgUnknownFileModel, imgInternalFileModel,
87
# List of name, func tuples that will be installed under the Tools menu.
90
# Registry of all modules {modelIdentifier : Model} (populated by EditorModels)
91
# Used for images and header identifier
93
# Mapping of file extension to model (populated by EditorModels)
95
# List of image file extensions
97
# Dict of ext:Model entries. For types where not all files of that ext are images
98
imageSubTypeExtReg = {}
99
# List of extensions for internal filetypes created by Boa
100
internalFilesReg = []
101
# Dict of ext:Model entries which can be further identified by reading a header from the source
102
inspectableFilesReg = {}
103
# List of extensions for additional binary files (will not be searched)
105
def getBinaryFiles():
106
return imageExtReg + binaryFilesReg
109
# All non python files identified by extension
110
for mod in modelReg.values():
111
if mod.ext not in ['.*', '.intfile', '.pybin'] +inspectableFilesReg.keys():
112
extMap[mod.ext] = mod
1
#-----------------------------------------------------------------------------
2
# Name: EditorHelper.py
5
# Author: Riaan Booysen
8
# RCS-ID: $Id: EditorHelper.py,v 1.11 2005/05/18 12:05:11 riaan Exp $
9
# Copyright: (c) 2001 - 2005
11
#-----------------------------------------------------------------------------
13
""" Global namespace for general IDE window ids, image indexes and registries """
15
import Preferences, Utils
17
(wxID_EDITOROPEN, wxID_EDITORSAVE, wxID_EDITORSAVEAS, wxID_EDITORCLOSEPAGE,
18
wxID_EDITORREFRESH, wxID_EDITORDESIGNER, wxID_EDITORDEBUG, wxID_EDITORHELP,
19
wxID_DEFAULTVIEWS, wxID_EDITORSWITCHTO, wxID_EDITORDIFF, wxID_EDITORPATCH,
20
wxID_EDITORTOGGLEVIEW, wxID_EDITORSWITCHEXPLORER, wxID_EDITORSWITCHSHELL,
21
wxID_EDITORSWITCHPALETTE, wxID_EDITORSWITCHINSPECTOR,
22
wxID_EDITORTOGGLERO, wxID_EDITORHELPFIND, wxID_EDITORRELOAD,
23
wxID_EDITORHELPABOUT, wxID_EDITORHELPGUIDE, wxID_EDITORHELPTIPS,
24
wxID_EDITORHELPOPENEX,
25
wxID_EDITORPREVPAGE, wxID_EDITORNEXTPAGE,
26
wxID_EDITORBROWSEFWD, wxID_EDITORBROWSEBACK,
27
wxID_EDITOREXITBOA, wxID_EDITOROPENRECENT,
28
wxID_EDITORHIDEPALETTE, wxID_EDITORWINDIMS, wxID_EDITORWINDIMSLOAD,
29
wxID_EDITORWINDIMSSAVE, wxID_EDITORWINDIMSRESDEFS,
30
wxID_EDITORSWITCHPREFS,
31
) = Utils.wxNewIds(36)
34
def imgIdxRange(cnt=0):
35
""" Allocates either a range of image indexes or a single one """
38
rng = range(imgCounter, imgCounter + cnt)
39
imgCounter = imgCounter + cnt
42
imgCounter = imgCounter + 1
45
builtinImgs =('Images/Modules/FolderUp.png',
46
'Images/Modules/Folder.png',
47
'Images/Modules/Folder_green.png',
48
'Images/Modules/Folder_cyan.png',
49
'Images/Shared/SystemObj.png',
50
'Images/Shared/SystemObjOrdered.png',
51
'Images/Shared/SystemObjBroken.png',
52
'Images/Shared/SystemObjPending.png',
53
'Images/Shared/SystemObjDisabled.png',
54
'Images/Modules/ZopeConn.png',
55
'Images/Shared/BoaLogo.png',
56
'Images/Modules/Drive.png',
57
'Images/Modules/NetDrive.png',
58
'Images/Modules/FolderBookmark.png',
59
'Images/Modules/OpenEditorModels.png',
60
'Images/Modules/PrefsFolder.png',
61
'Images/Shared/PrefsSTCStyles.png',
62
'Images/Editor/RecentFiles.png',
63
'Images/Editor/Shell.png',
64
'Images/Editor/Explorer.png',
65
'Images/Modules/HelpBook.png',
67
# Like builtinImgs, but stores list of tuples, (imgIdx, name)
70
def addPluginImgs(imgPath):
71
imgIdx = imgIdxRange()
72
pluginImgs.append( (imgIdx, imgPath) )
77
# Indexes for the imagelist
78
(imgFolderUp, imgFolder, imgPathFolder, imgCVSFolder, imgSystemObj,
79
imgSystemObjOrdered, imgSystemObjBroken, imgSystemObjPending, imgSystemObjDisabled,
80
imgZopeConnection, imgBoaLogo, imgFSDrive, imgNetDrive, imgFolderBookmark,
81
imgOpenEditorModels, imgPrefsFolder, imgPrefsSTCStyles, imgRecentFiles,
82
imgShell, imgExplorer, imgHelpBook,
84
imgTextModel, imgBitmapFileModel, imgUnknownFileModel, imgInternalFileModel,
87
# List of name, func tuples that will be installed under the Tools menu.
90
# Registry of all modules {modelIdentifier : Model} (populated by EditorModels)
91
# Used for images and header identifier
93
# Mapping of file extension to model (populated by EditorModels)
95
# List of image file extensions
97
# Dict of ext:Model entries. For types where not all files of that ext are images
98
imageSubTypeExtReg = {}
99
# List of extensions for internal filetypes created by Boa
100
internalFilesReg = []
101
# Dict of ext:Model entries which can be further identified by reading a header from the source
102
inspectableFilesReg = {}
103
# List of extensions for additional binary files (will not be searched)
105
def getBinaryFiles():
106
return imageExtReg + binaryFilesReg
109
# All non python files identified by extension
110
for mod in modelReg.values():
111
if mod.ext not in ['.*', '.intfile', '.pybin'] +inspectableFilesReg.keys():
112
extMap[mod.ext] = mod