2 @package nviz.preferences
4 @brief Nviz (3D view) preferences window
7 - preferences::NvizPreferencesDialog
9 (C) 2008-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 Martin Landa <landa.martin gmail.com> (Google SoC 2008/2010)
15 @author Enhancements by Michael Barton <michael.barton asu.edu>
16 @author Anna Kratochvilova <KratochAnna seznam.cz> (Google SoC 2011)
23 import wx.lib.colourselect
as csel
25 from core
import globalvar
30 """!Nviz preferences dialog"""
31 def __init__(self, parent, title = _(
"3D view settings"),
32 settings = UserSettings):
33 PreferencesBaseDialog.__init__(self, parent = parent, title = title,
35 self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR,
'grass_nviz.ico'), wx.BITMAP_TYPE_ICO))
46 self.SetMinSize(self.GetBestSize())
47 self.SetSize(self.
size)
48 self.btnDefault.SetToolTipString(_(
"Revert settings to default, changes are not applied"))
50 def _createViewPage(self, notebook):
51 """!Create notebook page for view settings"""
52 panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
54 notebook.AddPage(page = panel,
55 text =
" %s " % _(
"View"))
57 pageSizer = wx.BoxSizer(wx.VERTICAL)
59 box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
60 label =
" %s " % (_(
"View")))
61 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
62 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
65 pvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'persp')
66 ipvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'persp', internal =
True)
67 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
68 label = _(
"Perspective:")),
69 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
70 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
72 pos = (row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
74 pval = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
75 initial = pvals[
'value'],
78 self.
winId[
'nviz:view:persp:value'] = pval.GetId()
79 gridSizer.Add(item = pval, pos = (row, 2),
80 flag = wx.ALIGN_CENTER_VERTICAL)
82 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
84 pos = (row, 3), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
86 pstep = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
87 initial = pvals[
'step'],
89 max = ipvals[
'max']-1)
90 self.
winId[
'nviz:view:persp:step'] = pstep.GetId()
91 gridSizer.Add(item = pstep, pos = (row, 4),
92 flag = wx.ALIGN_CENTER_VERTICAL)
96 posvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'position')
97 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
98 label = _(
"Position:")),
99 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
100 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
102 pos = (row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
104 px = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
105 initial = posvals[
'x'] * 100,
108 self.
winId[
'nviz:view:position:x'] = px.GetId()
109 gridSizer.Add(item = px, pos = (row, 2),
110 flag = wx.ALIGN_CENTER_VERTICAL)
112 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
114 pos = (row, 3), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
116 py = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
117 initial = posvals[
'y'] * 100,
120 self.
winId[
'nviz:view:position:y'] = py.GetId()
121 gridSizer.Add(item = py, pos = (row, 4),
122 flag = wx.ALIGN_CENTER_VERTICAL)
128 tvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'twist')
129 itvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'twist', internal =
True)
130 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
131 label = _(
"Twist:")),
132 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
133 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
134 label = _(
"value:")),
135 pos = (row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
137 tval = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
138 initial = tvals[
'value'],
141 self.
winId[
'nviz:view:twist:value'] = tval.GetId()
142 gridSizer.Add(item = tval, pos = (row, 2),
143 flag = wx.ALIGN_CENTER_VERTICAL)
147 zvals = UserSettings.Get(group =
'nviz', key =
'view', subkey =
'z-exag')
148 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
149 label = _(
"Z-exag:")),
150 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
151 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
152 label = _(
"value:")),
153 pos = (row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
155 zval = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
156 initial = zvals[
'value'],
159 self.
winId[
'nviz:view:z-exag:value'] = zval.GetId()
160 gridSizer.Add(item = zval, pos = (row, 2),
161 flag = wx.ALIGN_CENTER_VERTICAL)
164 boxSizer.Add(item = gridSizer, proportion = 1,
165 flag = wx.ALL | wx.EXPAND, border = 3)
166 pageSizer.Add(item = boxSizer, proportion = 0,
167 flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
170 box = wx.StaticBox(parent = panel, id = wx.ID_ANY,
171 label =
" %s " % (_(
"Image Appearance")))
172 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
173 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
174 gridSizer.AddGrowableCol(0)
177 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
178 label = _(
"Background color:")),
179 pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
181 color = csel.ColourSelect(panel, id = wx.ID_ANY,
182 colour = UserSettings.Get(group =
'nviz', key =
'view',
183 subkey = [
'background',
'color']),
184 size = globalvar.DIALOG_COLOR_SIZE)
185 color.SetName(
'GetColour')
186 self.
winId[
'nviz:view:background:color'] = color.GetId()
187 gridSizer.Add(item = color, pos = (0, 1))
189 boxSizer.Add(item = gridSizer, proportion = 1,
190 flag = wx.ALL | wx.EXPAND, border = 5)
191 pageSizer.Add(item = boxSizer, proportion = 0,
192 flag = wx.EXPAND | wx.ALL,
195 panel.SetSizer(pageSizer)
199 def _createFlyPage(self, notebook):
200 """!Create notebook page for view settings"""
201 panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
203 notebook.AddPage(page = panel,
204 text =
" %s " % _(
"Fly-through"))
205 pageSizer = wx.BoxSizer(wx.VERTICAL)
207 box = wx.StaticBox(parent = panel, id = wx.ID_ANY,
208 label =
" %s " % (_(
"Fly-through mode")))
209 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
210 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
211 gridSizer.AddGrowableCol(0)
214 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
215 label = _(
"Move exag:")),
216 pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
218 moveExag = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 20,
219 initial = UserSettings.Get(group =
'nviz', key =
'fly',
220 subkey = [
'exag',
'move']),
222 self.
winId[
'nviz:fly:exag:move'] = moveExag.GetId()
223 gridSizer.Add(item = moveExag, pos = (0, 1))
226 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
227 label = _(
"Turn exag:")),
228 pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL)
230 turnExag = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 20,
231 initial = UserSettings.Get(group =
'nviz', key =
'fly',
232 subkey = [
'exag',
'turn']),
234 self.
winId[
'nviz:fly:exag:turn'] = turnExag.GetId()
235 gridSizer.Add(item = turnExag, pos = (1, 1))
237 boxSizer.Add(item = gridSizer, proportion = 1,
238 flag = wx.ALL | wx.EXPAND, border = 5)
239 pageSizer.Add(item = boxSizer, proportion = 0,
240 flag = wx.EXPAND | wx.ALL,
243 panel.SetSizer(pageSizer)
247 def _createLightPage(self, notebook):
248 """!Create notebook page for light settings"""
249 panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
251 notebook.AddPage(page = panel,
252 text =
" %s " % _(
"Lighting"))
254 pageSizer = wx.BoxSizer(wx.VERTICAL)
256 box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
257 label =
" %s " % (_(
"Light")))
258 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
259 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
263 posvals = UserSettings.Get(group =
'nviz', key =
'light', subkey =
'position')
264 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
265 label = _(
"Position:")),
266 pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
267 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
269 pos = (0, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
271 px = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
272 initial = posvals[
'x'] * 100,
275 self.
winId[
'nviz:light:position:x'] = px.GetId()
276 gridSizer.Add(item = px, pos = (0, 2),
277 flag = wx.ALIGN_CENTER_VERTICAL)
279 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
281 pos = (0, 3), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
283 py = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
284 initial = posvals[
'y'] * 100,
287 self.
winId[
'nviz:light:position:y'] = py.GetId()
288 gridSizer.Add(item = py, pos = (0, 4),
289 flag = wx.ALIGN_CENTER_VERTICAL)
291 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
293 pos = (0, 5), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
295 pz = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
296 initial = posvals[
'z'],
299 self.
winId[
'nviz:light:position:z'] = pz.GetId()
300 gridSizer.Add(item = pz, pos = (0, 6),
301 flag = wx.ALIGN_CENTER_VERTICAL)
304 brightval = UserSettings.Get(group =
'nviz', key =
'light', subkey =
'bright')
305 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
306 label = _(
"Brightness:")),
307 pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL)
309 bright = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
313 self.
winId[
'nviz:light:bright'] = bright.GetId()
314 gridSizer.Add(item = bright, pos = (1, 2),
315 flag = wx.ALIGN_CENTER_VERTICAL)
318 ambval = UserSettings.Get(group =
'nviz', key =
'light', subkey =
'ambient')
319 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
320 label = _(
"Ambient:")),
321 pos = (2, 0), flag = wx.ALIGN_CENTER_VERTICAL)
323 amb = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
327 self.
winId[
'nviz:light:ambient'] = amb.GetId()
328 gridSizer.Add(item = amb, pos = (2, 2),
329 flag = wx.ALIGN_CENTER_VERTICAL)
332 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
333 label = _(
"Color:")),
334 pos = (3, 0), flag = wx.ALIGN_CENTER_VERTICAL)
336 color = csel.ColourSelect(panel, id = wx.ID_ANY,
337 colour = UserSettings.Get(group =
'nviz', key =
'light',
339 size = globalvar.DIALOG_COLOR_SIZE)
340 color.SetName(
'GetColour')
341 self.
winId[
'nviz:light:color'] = color.GetId()
342 gridSizer.Add(item = color, pos = (3, 2))
345 boxSizer.Add(item = gridSizer, proportion = 1,
346 flag = wx.ALL | wx.EXPAND, border = 5)
347 pageSizer.Add(item = boxSizer, proportion = 0,
348 flag = wx.EXPAND | wx.ALL,
351 panel.SetSizer(pageSizer)
355 def _createSurfacePage(self, notebook):
356 """!Create notebook page for surface settings"""
357 panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
359 notebook.AddPage(page = panel,
360 text =
" %s " % _(
"Surface"))
362 pageSizer = wx.BoxSizer(wx.VERTICAL)
366 box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
367 label =
" %s " % (_(
"Draw")))
368 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
369 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
372 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
373 label = _(
"Mode:")), flag = wx.ALIGN_CENTER_VERTICAL,
375 mode = wx.Choice(parent = panel, id = wx.ID_ANY, size = (-1, -1),
376 choices = [_(
"coarse"),
379 self.
winId[
'nviz:surface:draw:mode'] = mode.GetId()
380 mode.SetName(
'GetSelection')
381 mode.SetSelection(UserSettings.Get(group =
'nviz', key =
'surface',
382 subkey = [
'draw',
'mode']))
383 gridSizer.Add(item = mode, flag = wx.ALIGN_CENTER_VERTICAL,
387 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
388 label = _(
"Fine mode:")), flag = wx.ALIGN_CENTER_VERTICAL,
390 res = UserSettings.Get(group =
'nviz', key =
'surface', subkey = [
'draw',
'res-fine'])
391 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
392 label = _(
"resolution:")), flag = wx.ALIGN_CENTER_VERTICAL,
394 fine = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
398 self.
winId[
'nviz:surface:draw:res-fine'] = fine.GetId()
400 gridSizer.Add(item = fine, flag = wx.ALIGN_CENTER_VERTICAL,
404 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
405 label = _(
"Coarse mode:")), flag = wx.ALIGN_CENTER_VERTICAL,
407 res = UserSettings.Get(group =
'nviz', key =
'surface', subkey = [
'draw',
'res-coarse'])
408 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
409 label = _(
"resolution:")), flag = wx.ALIGN_CENTER_VERTICAL,
411 coarse = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
415 self.
winId[
'nviz:surface:draw:res-coarse'] = coarse.GetId()
417 gridSizer.Add(item = coarse, flag = wx.ALIGN_CENTER_VERTICAL,
420 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
421 label = _(
"style:")), flag = wx.ALIGN_CENTER_VERTICAL,
423 style = wx.Choice(parent = panel, id = wx.ID_ANY, size = (-1, -1),
424 choices = [_(
"wire"),
426 self.
winId[
'nviz:surface:draw:style'] = style.GetId()
427 style.SetName(
'GetSelection')
428 style.SetSelection(UserSettings.Get(group =
'nviz', key =
'surface',
429 subkey = [
'draw',
'style']))
430 self.
winId[
'nviz:surface:draw:style'] = style.GetId()
432 gridSizer.Add(item = style, flag = wx.ALIGN_CENTER_VERTICAL,
435 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
436 label = _(
"wire color:")), flag = wx.ALIGN_CENTER_VERTICAL,
438 color = csel.ColourSelect(panel, id = wx.ID_ANY,
439 colour = UserSettings.Get(group =
'nviz', key =
'surface',
440 subkey = [
'draw',
'wire-color']),
441 size = globalvar.DIALOG_COLOR_SIZE)
442 color.SetName(
'GetColour')
443 self.
winId[
'nviz:surface:draw:wire-color'] = color.GetId()
444 gridSizer.Add(item = color, flag = wx.ALIGN_CENTER_VERTICAL,
447 boxSizer.Add(item = gridSizer, proportion = 1,
448 flag = wx.ALL | wx.EXPAND, border = 5)
449 pageSizer.Add(item = boxSizer, proportion = 0,
450 flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
453 panel.SetSizer(pageSizer)
457 def _createVectorPage(self, notebook):
458 """!Create notebook page for vector settings"""
459 panel = wx.Panel(parent = notebook, id = wx.ID_ANY)
461 notebook.AddPage(page = panel,
462 text =
" %s " % _(
"Vector"))
464 pageSizer = wx.BoxSizer(wx.VERTICAL)
467 box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
468 label =
" %s " % (_(
"Vector lines")))
469 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
470 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
474 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
475 label = _(
"Width:")),
476 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
478 iwidth = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
482 self.
winId[
'nviz:vector:lines:width'] = iwidth.GetId()
483 iwidth.SetValue(UserSettings.Get(group =
'nviz', key =
'vector',
484 subkey = [
'lines',
'width']))
485 gridSizer.Add(item = iwidth, pos = (row, 1),
486 flag = wx.ALIGN_CENTER_VERTICAL)
489 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
490 label = _(
"Color:")),
491 pos = (row, 4), flag = wx.ALIGN_CENTER_VERTICAL)
492 icolor = csel.ColourSelect(panel, id = wx.ID_ANY,
493 size = globalvar.DIALOG_COLOR_SIZE)
494 icolor.SetName(
'GetColour')
495 self.
winId[
'nviz:vector:lines:color'] = icolor.GetId()
496 icolor.SetColour(UserSettings.Get(group =
'nviz', key =
'vector',
497 subkey = [
'lines',
'color']))
498 gridSizer.Add(item = icolor, flag = wx.ALIGN_CENTER_VERTICAL,
500 boxSizer.Add(item = gridSizer, proportion = 1,
501 flag = wx.ALL | wx.EXPAND, border = 5)
502 pageSizer.Add(item = boxSizer, proportion = 0,
503 flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
507 box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
508 label =
" %s " % (_(
"Vector points")))
509 boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
510 gridSizer = wx.GridBagSizer(vgap = 3, hgap = 5)
514 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
516 pos = (row, 0), flag = wx.ALIGN_CENTER_VERTICAL)
518 isize = wx.SpinCtrl(parent = panel, id = wx.ID_ANY, size = (65, -1),
522 self.
winId[
'nviz:vector:points:size'] = isize.GetId()
523 isize.SetValue(UserSettings.Get(group =
'nviz', key =
'vector',
524 subkey = [
'points',
'size']))
525 gridSizer.Add(item = isize, pos = (row, 1),
526 flag = wx.ALIGN_CENTER_VERTICAL)
529 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
530 label = _(
"Marker:")),
531 pos = (row, 2), flag = wx.ALIGN_CENTER_VERTICAL)
532 isym = wx.Choice (parent = panel, id = wx.ID_ANY, size = (100, -1),
533 choices = UserSettings.Get(group =
'nviz', key =
'vector',
534 subkey = [
'points',
'marker'], internal =
True))
535 isym.SetName(
"GetSelection")
536 self.
winId[
'nviz:vector:points:marker'] = isym.GetId()
537 isym.SetSelection(UserSettings.Get(group =
'nviz', key =
'vector',
538 subkey = [
'points',
'marker']))
539 gridSizer.Add(item = isym, flag = wx.ALIGN_CENTER_VERTICAL,
543 gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
544 label = _(
"Color:")),
545 pos = (row, 4), flag = wx.ALIGN_CENTER_VERTICAL)
546 icolor = csel.ColourSelect(panel, id = wx.ID_ANY,
547 size = globalvar.DIALOG_COLOR_SIZE)
548 icolor.SetName(
'GetColour')
549 self.
winId[
'nviz:vector:points:color'] = icolor.GetId()
550 icolor.SetColour(UserSettings.Get(group =
'nviz', key =
'vector',
551 subkey = [
'points',
'color']))
552 gridSizer.Add(item = icolor, flag = wx.ALIGN_CENTER_VERTICAL,
555 boxSizer.Add(item = gridSizer, proportion = 1,
556 flag = wx.ALL | wx.EXPAND, border = 5)
557 pageSizer.Add(item = boxSizer, proportion = 0,
558 flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
561 panel.SetSizer(pageSizer)
566 """!Button 'Set to default' pressed"""
567 self.settings.userSettings = copy.deepcopy(self.settings.defaultSettings)
570 for gks
in self.winId.keys():
573 group, key, subkey = gks.split(
':')
574 value = self.settings.Get(group, key, subkey)
576 group, key, subkey, subkey1 = gks.split(
':')
577 value = self.settings.Get(group, key, [subkey, subkey1])
578 if subkey ==
'position':
579 if subkey1
in (
'x',
'y'):
580 value = float(value) * 100
581 win = self.FindWindowById(self.
winId[gks])
582 if win.GetName() ==
'GetSelection':
583 value = win.SetSelection(value)
585 value = win.SetValue(value)
588 """Apply Nviz settings for current session"""
589 for item
in self.winId.keys():
591 group, key, subkey = item.split(
':')
594 group, key, subkey, subkey1 = item.split(
':')
596 id = self.
winId[item]
597 win = self.FindWindowById(id)
598 if win.GetName() ==
'GetSelection':
599 value = win.GetSelection()
600 elif win.GetName() ==
'GetColour':
601 value = tuple(win.GetValue())
603 value = win.GetValue()
605 if subkey ==
'position':
606 if subkey1
in (
'x',
'y'):
607 value = float(value) / 100
609 self.settings.Set(group, value, key, [subkey, subkey1])
611 self.settings.Set(group, value, key, subkey)
613 self.toolWin.LoadSettings()
617 """!Save button pressed
619 Apply changes and save settings to configuration file
623 UserSettings.ReadSettingsFile(settings = fileSettings)
624 fileSettings[
'nviz'] = UserSettings.Get(group =
'nviz')
626 UserSettings.SaveToFile(fileSettings)
627 self.parent.goutput.WriteLog(
628 _(
'3D view settings saved to file <%s>.') % UserSettings.filePath)
def _createFlyPage
Create notebook page for view settings.
def _createSurfacePage
Create notebook page for surface settings.
def _createVectorPage
Create notebook page for vector settings.
def OnApply
Button 'Apply' pressed Posts event EVT_SETTINGS_CHANGED.
def OnSave
Save button pressed.
def OnDefault
Button 'Set to default' pressed.
def _createViewPage
Create notebook page for view settings.
def _createLightPage
Create notebook page for light settings.