2 @package psmap.toolbars
4 @brief wxPsMap toolbars classes
7 - toolbars::PsMapToolbar
9 (C) 2007-2011 by the GRASS Development Team
11 This program is free software under the GNU General Public License
12 (>=v2). Read the file COPYING that comes with GRASS for details.
14 @author Anna Kratochvilova <kratochanna gmail.com>
22 from core
import globalvar
24 from icons.icon
import MetaIcon
28 """!Toolbar Cartographic Composer (psmap.py)
30 @param parent parent window
32 BaseToolbar.__init__(self, parent)
38 self.
action = {
'id' : self.pointer }
40 'bind' : self.parent.OnPointer }
45 self.EnableTool(self.preview,
False)
47 def _toolbarData(self):
51 'scriptSave' : MetaIcon(img =
'script-save',
52 label = _(
'Generate text file with mapping instructions')),
53 'scriptLoad' : MetaIcon(img =
'script-load',
54 label = _(
'Load text file with mapping instructions')),
55 'psExport' : MetaIcon(img =
'ps-export',
56 label = _(
'Generate PostScript output')),
57 'pdfExport' : MetaIcon(img =
'pdf-export',
58 label = _(
'Generate PDF output')),
59 'pageSetup' : MetaIcon(img =
'page-settings',
60 label = _(
'Page setup'),
61 desc = _(
'Specify paper size, margins and orientation')),
62 'fullExtent' : MetaIcon(img =
'zoom-extent',
63 label = _(
"Full extent"),
64 desc = _(
"Zoom to full extent")),
65 'addMap' : MetaIcon(img =
'layer-add',
66 label = _(
"Map frame"),
67 desc = _(
"Click and drag to place map frame")),
68 'deleteObj' : MetaIcon(img =
'layer-remove',
69 label = _(
"Delete selected object")),
70 'preview' : MetaIcon(img =
'execute',
71 label = _(
"Show preview")),
72 'quit' : MetaIcon(img =
'quit',
73 label = _(
'Quit Cartographic Composer')),
74 'addText' : MetaIcon(img =
'text-add',
76 'addMapinfo' : MetaIcon(img =
'map-info',
77 label = _(
'Map info')),
78 'addLegend' : MetaIcon(img =
'legend-add',
80 'addScalebar' : MetaIcon(img =
'scalebar-add',
81 label = _(
'Scale bar')),
82 'addImage' : MetaIcon(img =
'image-add',
84 'addNorthArrow': MetaIcon(img =
'north-arrow-add',
85 label = _(
'North Arrow')),
86 'drawGraphics': MetaIcon(img =
'edit',
87 label = _(
'Add simple graphics')),
88 'pointAdd' : MetaIcon(img =
'point-add',
90 'lineAdd' : MetaIcon(img =
'line-add',
92 'rectangleAdd': MetaIcon(img =
'rectangle-add',
93 label = _(
'Rectangle')),
98 self.parent.OnLoadFile),
99 (
'instructionFile', icons[
'scriptSave'],
100 self.parent.OnInstructionFile),
102 (
'pagesetup', icons[
'pageSetup'],
103 self.parent.OnPageSetup),
105 (
"pointer", BaseIcons[
"pointer"],
106 self.parent.OnPointer, wx.ITEM_CHECK),
107 (
'pan', BaseIcons[
'pan'],
108 self.parent.OnPan, wx.ITEM_CHECK),
109 (
"zoomin", BaseIcons[
"zoomIn"],
110 self.parent.OnZoomIn, wx.ITEM_CHECK),
111 (
"zoomout", BaseIcons[
"zoomOut"],
112 self.parent.OnZoomOut, wx.ITEM_CHECK),
113 (
'zoomAll', icons[
'fullExtent'],
114 self.parent.OnZoomAll),
116 (
'addMap', icons[
'addMap'],
117 self.parent.OnAddMap, wx.ITEM_CHECK),
118 (
'addRaster', BaseIcons[
'addRast'],
119 self.parent.OnAddRaster),
120 (
'addVector', BaseIcons[
'addVect'],
121 self.parent.OnAddVect),
122 (
"dec", BaseIcons[
"overlay"],
124 (
"drawGraphics", icons[
"drawGraphics"],
126 (
"delete", icons[
"deleteObj"],
127 self.parent.OnDelete),
129 (
"preview", icons[
"preview"],
130 self.parent.OnPreview),
131 (
'generatePS', icons[
'psExport'],
132 self.parent.OnPSFile),
133 (
'generatePDF', icons[
'pdfExport'],
134 self.parent.OnPDFFile),
136 (
"help", BaseIcons[
'help'],
138 (
'quit', icons[
'quit'],
139 self.parent.OnCloseWindow))
143 """!Decorations overlay menu
145 self.
_onMenu(((self.
icons[
"addLegend"], self.parent.OnAddLegend),
146 (self.
icons[
"addMapinfo"], self.parent.OnAddMapinfo),
147 (self.
icons[
"addScalebar"], self.parent.OnAddScalebar),
148 (self.
icons[
"addText"], self.parent.OnAddText),
149 (self.
icons[
"addImage"], self.parent.OnAddImage),
150 (self.
icons[
"addNorthArrow"], self.parent.OnAddNorthArrow)))
153 """!Simple geometry features (point, line, rectangle) overlay menu
159 self.
_onMenu(((self.
icons[
"pointAdd"], self.parent.OnAddPoint),
160 (self.
icons[
"lineAdd"], self.parent.OnAddLine),
161 (self.
icons[
"rectangleAdd"], self.parent.OnAddRectangle),