1wxGUI.toolboxes(1) GRASS GIS User's Manual wxGUI.toolboxes(1)
2
3
4
7 The Toolboxes is a way to customize items in wxGUI menu. Toolboxes en‐
8 able to:
9
10 • hide unused menu items in menu (e.g. Imagery, Database) or sub‐
11 menu (e.g. Wildfire modeling)
12
13 • change order of menu items and subitems
14
15 • add new menu items (e.g. Temporal)
16
17 • add addons modules
18
19 • add your own modules
20
21 Toolboxes are configured through two XML files (main_menu.xml and tool‐
22 boxes.xml) located in your user home GRASS directory, subdirectory
23 toolboxes ($HOME/.grass8/toolboxes/ on UNIX). Currently, there is no
24 GUI front-end for toolboxes, however only simple editing of text files
25 is needed.
26
27 Brief description of file main_menu.xml
28 This file represents the main menu (File, Settings, Raster, ...). By
29 modifying this file you show and hide menu items which are represented
30 by subtoolbox tag.
31
32 Tag user-toolboxes-list is interpreted as a menu containing a list of
33 all user-defined toolboxes. If not needed it can be removed.
34
35 Following lines can be copied to .grass8/toolboxes/main_menu.xml and by
36 removing, adding or reordering lines users can change the main menu
37 items. See further examples.
38 <?xml version="1.0" encoding="UTF-8"?>
39 <toolbox name="MyMainMenu">
40 <label>Default GRASS GIS main menu bar</label>
41 <items>
42 <subtoolbox name="File"/>
43 <subtoolbox name="Settings"/>
44 <subtoolbox name="Raster"/>
45 <subtoolbox name="Vector"/>
46 <subtoolbox name="Imagery"/>
47 <subtoolbox name="Volumes"/>
48 <subtoolbox name="Database"/>
49 <user-toolboxes-list />
50 <subtoolbox name="Help"/>
51 </items>
52 </toolbox>
53
54 Brief description of file toolboxes.xml
55 This file contains structure and description of individual toolboxes.
56 Note that both Raster and e.g. Query raster maps are individual tool‐
57 boxes although one contains the other. Tag toolbox contains subtoolbox
58 tags which are defined later in the file. These nested toolboxes are
59 linked through name attribute.
60
61 Apart from subtoolbox tag, tag toolbox can contain individual items
62 (modules) and separators (for visual separation in the menu tree).
63 <?xml version="1.0" encoding="UTF-8"?>
64 <toolboxes>
65 <toolbox name="Raster">
66 <label>&Raster</label>
67 <items>
68 <subtoolbox name="DevelopRasterMap"/>
69 <subtoolbox name="ManageRasterColors"/>
70 <subtoolbox name="QueryRasterMaps"/>
71 <subtoolbox name="RasterMapTypeConversions"/>
72 <separator/>
73 <module-item name="r.buffer">
74 <label>Buffer rasters</label>
75 </module-item>
76 ...
77 ...
78 <toolbox name="QueryRasterMaps">
79 <label>Query raster maps</label>
80 <items>
81 <module-item name="r.what">
82 <label>Query values by coordinates</label>
83 </module-item>
84 <module-item name="r.what.color">
85 <label>Query colors by value</label>
86 </module-item>
87 </items>
88 </toolbox>
89
90 To redefine a toolbox (or use it as a template), copy specific part of
91 file grass7/gui/wxpython/xml/toolboxes.xml from GRASS installation to a
92 new file in user home (.grass8/toolboxes/toolboxes.xml) and edit it.
93 Rename this new toolbox.
94
96 Hiding menu items
97 If we are for example working only with raster data, we can hide menu
98 items Vector and Database. The file main_menu.xml then contains the
99 following lines where we omitted the two toolboxes:
100 <?xml version="1.0" encoding="UTF-8"?>
101 <toolbox name="CustomizedMainMenu">
102 <label>Default GRASS GIS main menu bar</label>
103 <items>
104 <subtoolbox name="File"/>
105 <subtoolbox name="Settings"/>
106 <subtoolbox name="Raster"/>
107 <subtoolbox name="Imagery"/>
108 <subtoolbox name="Volumes"/>
109 <user-toolboxes-list />
110 <subtoolbox name="Help"/>
111 </items>
112 </toolbox>
113
114 Creating custom toolbox
115 In this example we create a new toolbox Favorites containing existing
116 GRASS module and toolbox, custom module created by the user and addon
117 module. The toolboxes.xml file contains following lines:
118 <?xml version="1.0" encoding="UTF-8"?>
119 <toolboxes>
120 <toolbox name="MyFavorites">
121 <label>&Favorites</label>
122 <items>
123 <module-item name="g.region">
124 <label>Set region</label>
125 </module-item>
126 <module-item name="r.mask">
127 <label>Mask</label>
128 </module-item>
129 <separator/>
130 <module-item name="m.myown">
131 <label>Do my own stuff</label>
132 </module-item>
133 <module-item name="i.histo.match">
134 <label>Calculate histogram matching</label>
135 </module-item>
136 <subtoolbox name="RasterReportsAndStatistics"/>
137 </items>
138 </toolbox>
139 </toolboxes>
140
141 Optionally, we can add this toolbox to the main menu items. The
142 main_menu.xml file contains following lines:
143 <?xml version="1.0" encoding="UTF-8"?>
144 <toolbox name="CustomizedMainMenu">
145 <label>Default GRASS GIS main menu bar</label>
146 <items>
147 <subtoolbox name="File"/>
148 <subtoolbox name="Settings"/>
149 <subtoolbox name="Raster"/>
150 <subtoolbox name="Vector"/>
151 <subtoolbox name="Imagery"/>
152 <subtoolbox name="Volumes"/>
153 <subtoolbox name="Database"/>
154 <user-toolboxes-list />
155 <subtoolbox name="Favorites"/>
156 <subtoolbox name="Help"/>
157 </items>
158 </toolbox>
159
160 If we have user-toolboxes-list tag in the main_menu.xml file, our cus‐
161 tom toolbox will be listed in the automatically added Toolboxes main
162 menu item. The screenshot shows the resulting menu:
163
165 After the first start of wxGUI with custom toolboxes, .grass/toolboxes
166 directory will contain file menudata.xml which is auto-generated and
167 should not be edited.
168
170 wxGUI
171 wxGUI components
172
174 Anna Petrasova, OSGeoREL, Faculty of Civil Engineering, Czech Technical
175 University in Prague
176 Vaclav Petras, OSGeoREL, Faculty of Civil Engineering, Czech Technical
177 University in Prague
178
180 Available at: wxGUI Toolboxes source code (history)
181
182 Accessed: Saturday Jan 21 17:40:37 2023
183
184 Main index | Wxgui index | Topics index | Keywords index | Graphical
185 index | Full index
186
187 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
188
189
190
191GRASS 8.2.1 wxGUI.toolboxes(1)