[GRASS-SVN] r52864 - grass/branches/develbranch_6/gui/wxpython/nviz
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 23 10:27:11 PDT 2012
Author: annakrat
Date: 2012-08-23 10:27:11 -0700 (Thu, 23 Aug 2012)
New Revision: 52864
Modified:
grass/branches/develbranch_6/gui/wxpython/nviz/tools.py
Log:
wxNviz: tooltips added (merge from trunk, r52863)
Modified: grass/branches/develbranch_6/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/nviz/tools.py 2012-08-23 17:19:25 UTC (rev 52863)
+++ grass/branches/develbranch_6/gui/wxpython/nviz/tools.py 2012-08-23 17:27:11 UTC (rev 52864)
@@ -235,8 +235,9 @@
# perspective
# set initial defaults here (or perhaps in a default values file), not in user settings
#todo: consider setting an absolute max at 360 instead of undefined. (leave the default max value at pi)
+ tooltip = _("Adjusts the viewer's angle of view")
self._createControl(panel, data = self.win['view'], name = 'persp',
- range = (1,180),
+ tooltip = tooltip, range = (1, 120),
bind = (self.OnViewChange, self.OnViewChanged, self.OnViewChangedText))
gridSizer.Add(item = wx.StaticText(panel, id = wx.ID_ANY, label = _("Perspective:")),
@@ -247,8 +248,10 @@
flag = wx.ALIGN_CENTER)
# twist
+ tooltip = _("Rotates the scene about the horizontal axis."
+ " An angle of 0 is flat. The scene rotates between -90 and 90 degrees.")
self._createControl(panel, data = self.win['view'], name = 'twist',
- range = (-180,180),
+ tooltip = tooltip, range = (-180,180),
bind = (self.OnViewChange, self.OnViewChanged, self.OnViewChangedText))
gridSizer.Add(item = wx.StaticText(panel, id = wx.ID_ANY, label = _("Twist:")),
pos = (1, 1), flag = wx.ALIGN_CENTER)
@@ -257,11 +260,15 @@
flag = wx.ALIGN_CENTER)
# height + z-exag
+ tooltip = _("Adjusts the viewer's height above the scene")
self._createControl(panel, data = self.win['view'], name = 'height', sliderHor = False,
- range = (0, 1),
+ tooltip = tooltip, range = (0, 1),
bind = (self.OnViewChange, self.OnViewChanged, self.OnViewChangedText))
+ tooltip = _("Adjusts the vertical exaggeration of the surface. "
+ "As an example, if the easting and northing are in meters and the elevation in feet, "
+ "a vertical exaggeration of .305 would produce a true (unexaggerated) surface. ")
self._createControl(panel, data = self.win['view'], name = 'z-exag', sliderHor = False,
- range = (0, 10), floatSlider = True,
+ tooltip = tooltip, range = (0, 10), floatSlider = True,
bind = (self.OnViewChange, self.OnViewChanged, self.OnViewChangedText))
self.FindWindowById(self.win['view']['z-exag']['slider']).SetValue(1)
self.FindWindowById(self.win['view']['z-exag']['text']).SetValue(1)
@@ -292,18 +299,23 @@
here = wx.ToggleButton(panel, id = wx.ID_ANY, label = _("here"))
here.Bind(wx.EVT_TOGGLEBUTTON, self.OnLookAt)
here.SetName('here')
+ here.SetToolTipString(_("Allows you to select a point on the surface "
+ "that becomes the new center of view. "
+ "Click on the button and then on the surface."))
viewSizer.Add(item = here, flag = wx.TOP|wx.BOTTOM|wx.LEFT|wx.ALIGN_CENTER_VERTICAL,
border = 5)
center = wx.Button(panel, id = wx.ID_ANY, label = _("center"))
center.Bind(wx.EVT_BUTTON, self.OnLookAt)
center.SetName('center')
+ center.SetToolTipString(_("Resets the view to the original default center of view"))
viewSizer.Add(item = center, flag = wx.TOP|wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL,
border = 5)
top = wx.Button(panel, id = wx.ID_ANY, label = _("top"))
top.Bind(wx.EVT_BUTTON, self.OnLookAt)
top.SetName('top')
+ top.SetToolTipString(_("Sets the viewer directly over the scene's center position. This top view orients approximately north south."))
viewSizer.Add(item = top, flag = wx.TOP|wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL,
border = 5)
@@ -845,8 +857,9 @@
gridSizer.AddGrowableCol(3)
# position
+ tooltip = _("Changes the x, y, and z position of the current surface")
self._createControl(panel, data = self.win['surface'], name = 'position',
- range = (-10000, 10000), floatSlider = True,
+ tooltip = tooltip, range = (-10000, 10000), floatSlider = True,
bind = (self.OnSurfacePosition, self.OnSurfacePositionChanged, self.OnSurfacePositionText))
axis = wx.Choice (parent = panel, id = wx.ID_ANY, size = (75, -1),
@@ -960,8 +973,9 @@
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Horizontal X:")),
pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Sets the X coordinate of the current cutting plane")
self._createControl(panel, data = self.win['cplane']['position'], name = 'x', size = 250,
- range = (-1000, 1000), sliderHor = True, floatSlider = True,
+ range = (-1000, 1000), sliderHor = True, floatSlider = True, tooltip = tooltip,
bind = (self.OnCPlaneChanging, self.OnCPlaneChangeDone, self.OnCPlaneChangeText))
self.FindWindowById(self.win['cplane']['position']['x']['slider']).SetValue(0)
self.FindWindowById(self.win['cplane']['position']['x']['text']).SetValue(0)
@@ -975,8 +989,9 @@
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Horizontal Y:")),
pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Sets the Y coordinate of the current cutting plane")
self._createControl(panel, data = self.win['cplane']['position'], name = 'y', size = 250,
- range = (-1000, 1000), sliderHor = True, floatSlider = True,
+ range = (-1000, 1000), sliderHor = True, floatSlider = True, tooltip = tooltip,
bind = (self.OnCPlaneChanging, self.OnCPlaneChangeDone, self.OnCPlaneChangeText))
self.FindWindowById(self.win['cplane']['position']['y']['slider']).SetValue(0)
self.FindWindowById(self.win['cplane']['position']['y']['text']).SetValue(0)
@@ -991,8 +1006,9 @@
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Rotation:")),
pos = (2, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Rotates the current cutting plane about vertical axis")
self._createControl(panel, data = self.win['cplane']['rotation'], name = 'rot', size = 250,
- range = (0, 360), sliderHor = True,
+ range = (0, 360), sliderHor = True, tooltip = tooltip,
bind = (self.OnCPlaneChanging, self.OnCPlaneChangeDone, self.OnCPlaneChangeText))
self.FindWindowById(self.win['cplane']['rotation']['rot']['slider']).SetValue(0)
self.FindWindowById(self.win['cplane']['rotation']['rot']['text']).SetValue(0)
@@ -1005,9 +1021,10 @@
# cutting plane tilt
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Tilt:")),
- pos = (3, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ pos = (3, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Rotates the current cutting plane about horizontal axis")
self._createControl(panel, data = self.win['cplane']['rotation'], name = 'tilt', size = 250,
- range = (0, 360), sliderHor = True,
+ range = (0, 360), sliderHor = True, tooltip = tooltip,
bind = (self.OnCPlaneChanging, self.OnCPlaneChangeDone, self.OnCPlaneChangeText))
self.FindWindowById(self.win['cplane']['rotation']['tilt']['slider']).SetValue(0)
self.FindWindowById(self.win['cplane']['rotation']['tilt']['text']).SetValue(0)
@@ -1020,9 +1037,10 @@
# cutting pland height
gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
label = _("Height:")),
- pos = (4, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ pos = (4, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Sets the Z coordinate of the current cutting plane (only meaningful when tilt is not 0)")
self._createControl(panel, data = self.win['cplane']['position'], name = 'z', size = 250,
- range = (-1000, 1000), sliderHor = True,
+ range = (-1000, 1000), sliderHor = True, tooltip = tooltip,
bind = (self.OnCPlaneChanging, self.OnCPlaneChangeDone, self.OnCPlaneChangeText))
self.FindWindowById(self.win['cplane']['position']['z']['slider']).SetValue(0)
self.FindWindowById(self.win['cplane']['position']['z']['text']).SetValue(0)
@@ -1650,8 +1668,9 @@
gridSizer.Add(item = posSizer, pos = (0, 0))
# height
+ tooltip = _("Adjusts the light height")
self._createControl(panel, data = self.win['light'], name = 'z', sliderHor = False,
- range = (0, 100),
+ range = (0, 100), tooltip = tooltip,
bind = (self.OnLightChange, self.OnLightChanged, self.OnLightChange))
heightSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
@@ -1689,8 +1708,9 @@
gridSizer.Add(item = wx.StaticText(panel, id = wx.ID_ANY, label = _("Brightness:")),
pos = (1, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Adjusts the brightness of the light")
self._createControl(panel, data = self.win['light'], name = 'bright', size = 300,
- range = (0, 100),
+ range = (0, 100), tooltip = tooltip,
bind = (self.OnLightValue, self.OnLightChanged, self.OnLightValue))
gridSizer.Add(item = self.FindWindowById(self.win['light']['bright']['slider']),
pos = (1, 1), flag = wx.ALIGN_CENTER_VERTICAL)
@@ -1699,8 +1719,9 @@
flag = wx.ALIGN_CENTER)
gridSizer.Add(item = wx.StaticText(panel, id = wx.ID_ANY, label = _("Ambient:")),
pos = (2, 0), flag = wx.ALIGN_CENTER_VERTICAL)
+ tooltip = _("Adjusts the ambient light")
self._createControl(panel, data = self.win['light'], name = 'ambient', size = 300,
- range = (0, 100),
+ range = (0, 100), tooltip = tooltip,
bind = (self.OnLightValue, self.OnLightChanged, self.OnLightValue))
gridSizer.Add(item = self.FindWindowById(self.win['light']['ambient']['slider']),
pos = (2, 1), flag = wx.ALIGN_CENTER_VERTICAL)
@@ -2444,7 +2465,7 @@
return panel
- def _createControl(self, parent, data, name, range, bind = (None, None, None),
+ def _createControl(self, parent, data, name, range, tooltip = None, bind = (None, None, None),
sliderHor = True, size = 200, floatSlider = False):
"""!Add control (Slider + TextCtrl)"""
data[name] = dict()
@@ -2480,6 +2501,8 @@
style = wx.TE_PROCESS_ENTER)
text.SetName('text')
+ if tooltip:
+ text.SetToolTipString(tooltip)
if bind[2]:
text.Bind(wx.EVT_TEXT_ENTER, bind[2])
text.Bind(wx.EVT_KILL_FOCUS, bind[2])
@@ -4814,7 +4837,8 @@
def __init__(self, parent, mapwindow, id = wx.ID_ANY,
**kwargs):
PositionWindow.__init__(self, parent, mapwindow, id, **kwargs)
-
+ self.SetToolTipString(_("Adjusts the look direction (azimuth). "
+ "Click and drag the puck to change the current eye position."))
self.data = self.mapWindow.view
self.PostDraw()
@@ -4846,6 +4870,8 @@
def __init__(self, parent, mapwindow, id = wx.ID_ANY,
**kwargs):
PositionWindow.__init__(self, parent, mapwindow, id, **kwargs)
+ self.SetToolTipString(_("Adjusts the light direction. "
+ "Click and drag the puck to change the light direction."))
self.data = self.mapWindow.light
self.quick = False
More information about the grass-commit
mailing list