4 @brief wxGUI Layer Manager - toolbars
7 - toolbars::LMWorkspaceToolbar
8 - toolbars::LMDataToolbar
9 - toolbars::LMToolsToolbar
10 - toolbars::LMMiscToolbar
11 - toolbars::LMVectorToolbar
12 - toolbars::LMNvizToolbar
14 (C) 2007-2011 by the GRASS Development Team
16 This program is free software under the GNU General Public License
17 (>=v2). Read the file COPYING that comes with GRASS for details.
19 @author Michael Barton
20 @author Jachym Cepicky
21 @author Martin Landa <landa.martin gmail.com>
22 @author Anna Kratochvilova <kratochanna gmail.com>
28 from core
import globalvar
30 from nviz.preferences
import NvizPreferencesDialog
32 from icons.icon
import MetaIcon
35 """!Layer Manager `workspace` toolbar
38 BaseToolbar.__init__(self, parent)
45 def _toolbarData(self):
49 'newdisplay' : MetaIcon(img =
'monitor-create',
50 label = _(
'Start new map display')),
51 'workspaceNew' : MetaIcon(img =
'create',
52 label = _(
'Create new workspace (Ctrl+N)')),
53 'workspaceOpen' : MetaIcon(img =
'open',
54 label = _(
'Open existing workspace file (Ctrl+O)')),
55 'workspaceSave' : MetaIcon(img =
'save',
56 label = _(
'Save current workspace to file (Ctrl+S)')),
59 self.parent.OnNewDisplay),
61 (
'workspaceNew', icons[
"workspaceNew"],
62 self.parent.OnWorkspaceNew),
63 (
'workspaceOpen', icons[
"workspaceOpen"],
64 self.parent.OnWorkspaceOpen),
65 (
'workspaceSave', icons[
"workspaceSave"],
66 self.parent.OnWorkspaceSave),
70 """!Layer Manager `data` toolbar
73 BaseToolbar.__init__(self, parent)
80 def _toolbarData(self):
84 'addMulti' : MetaIcon(img =
'layer-open',
85 label = _(
'Add multiple raster or vector map layers (Ctrl+Shift+L)')),
86 'addRast' : BaseIcons[
'addRast'].SetLabel(_(
"Add raster map layer (Ctrl+Shift+R)")),
87 'rastMisc' : MetaIcon(img =
'layer-raster-more',
88 label = _(
'Add various raster map layers (RGB, HIS, shaded relief...)')),
89 'addVect' : BaseIcons[
'addVect'].SetLabel(_(
"Add vector map layer (Ctrl+Shift+V)")),
90 'vectMisc' : MetaIcon(img =
'layer-vector-more',
91 label = _(
'Add various vector map layers (thematic, chart...)')),
92 'addGroup' : MetaIcon(img =
'layer-group-add',
93 label = _(
'Add group')),
94 'addOverlay' : MetaIcon(img =
'layer-more',
95 label = _(
'Add grid or vector labels overlay')),
96 'delCmd' : MetaIcon(img =
'layer-remove',
97 label = _(
'Remove selected map layer(s) from layer tree')),
101 self.parent.OnAddMaps),
102 (
'addrast', icons[
"addRast"],
103 self.parent.OnAddRaster),
104 (
'rastmisc', icons[
"rastMisc"],
105 self.parent.OnAddRasterMisc),
106 (
'addvect', icons[
"addVect"],
107 self.parent.OnAddVector),
108 (
'vectmisc', icons[
"vectMisc"],
109 self.parent.OnAddVectorMisc),
110 (
'addgrp', icons[
"addGroup"],
111 self.parent.OnAddGroup),
112 (
'addovl', icons[
"addOverlay"],
113 self.parent.OnAddOverlay),
114 (
'delcmd', icons[
"delCmd"],
115 self.parent.OnDeleteLayer),
119 """!Layer Manager `tools` toolbar
122 BaseToolbar.__init__(self, parent)
129 def _toolbarData(self):
133 'import' : MetaIcon(img =
'layer-import',
134 label = _(
'Import/link raster or vector data')),
135 'mapcalc' : MetaIcon(img =
'calculator',
136 label = _(
'Raster Map Calculator')),
137 'modeler' : MetaIcon(img =
'modeler-main',
138 label = _(
'Graphical Modeler')),
139 'georectify' : MetaIcon(img =
'georectify',
140 label = _(
'Georectifier')),
141 'composer': MetaIcon(img =
'print-compose',
142 label = _(
'Cartographic Composer')),
146 self.parent.OnImportMenu),
148 (
'mapCalc', icons[
"mapcalc"],
149 self.parent.OnMapCalculator),
150 (
'georect', icons[
"georectify"],
151 self.parent.OnGCPManager),
152 (
'modeler', icons[
"modeler"],
153 self.parent.OnGModeler),
154 (
'mapOutput', icons[
'composer'],
159 """!Layer Manager `misc` toolbar
162 BaseToolbar.__init__(self, parent)
169 def _toolbarData(self):
173 'settings' : BaseIcons[
'settings'].SetLabel(_(
'GUI settings')),
174 'help' : BaseIcons[
'help'].SetLabel(_(
'GRASS manual')),
178 self.parent.OnPreferences),
179 (
'help', icons[
"help"],
184 """!Layer Manager `vector` toolbar
187 BaseToolbar.__init__(self, parent)
194 def _toolbarData(self):
198 'vdigit' : MetaIcon(img =
'edit',
199 label = _(
'Edit vector maps')),
200 'attrTable' : MetaIcon(img =
'table',
201 label = _(
'Show attribute table')),
205 self.parent.OnVDigit),
206 (
'attribute', icons[
"attrTable"],
207 self.parent.OnShowAttributeTable),
216 BaseToolbar.__init__(self, parent)
226 def _toolbarData(self):
229 'cmd' : MetaIcon(img =
'script-save',
230 label = _(
'Generate command for m.nviz.image'),
231 desc = _(
'Generate command for m.nviz.image based on current state')),
232 'settings' : MetaIcon(img =
'3d-settings',
233 label = _(
'3D view mode settings'),
234 desc = _(
'Show 3D view mode settings dialog')),
235 'help' : MetaIcon(img =
'3d-help',
236 label = _(
'Show 3D view mode manual')),
242 (
"settings", icons[
"settings"],
244 (
"help", icons[
"help"],
249 """!Show m.nviz.image command"""
250 self.lmgr.GetLayerTree().GetMapDisplay().GetWindow().
OnNvizCmd()
253 """!Show 3D view mode help"""
256 entry =
'wxGUI.Nviz')
258 log = self.lmgr.GetLogWindow()
259 log.RunCmd([
'g.manual',
263 """!Show nviz notebook page"""
266 self.settingsDialog.Show()
def RunCommand
Run GRASS command.