~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to gui/wxpython/gcp/toolbars.py

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""!
 
1
"""
2
2
@package gcp.toolbars
3
3
 
4
4
@brief Georectification module - toolbars
5
5
 
6
6
Classes:
7
 
 - toolbars::GCPManToolbar
 
7
 - toolbars::GCPMapToolbar
8
8
 - toolbars::GCPDisplayToolbar
9
9
 
10
10
(C) 2007-2011 by the GRASS Development Team
21
21
import wx
22
22
 
23
23
from core              import globalvar
 
24
from core.utils import _
24
25
from gui_core.toolbars import BaseToolbar, BaseIcons
25
 
from icon              import MetaIcon
26
 
   
 
26
from icons.icon import MetaIcon
 
27
 
 
28
 
27
29
class GCPManToolbar(BaseToolbar):
28
 
    """!Toolbar for managing ground control points
 
30
    """Toolbar for managing ground control points
29
31
 
30
 
    @param parent reference to GCP widget
 
32
    :param parent: reference to GCP widget
31
33
    """
32
34
    def __init__(self, parent):
33
35
        BaseToolbar.__init__(self, parent)
74
76
                                    )
75
77
    
76
78
class GCPDisplayToolbar(BaseToolbar):
77
 
    """
78
 
    GCP Display toolbar
79
 
    """
80
 
    def __init__(self, parent):
81
 
        """!
82
 
        GCP Display toolbar constructor
 
79
    """GCP Display toolbar
 
80
    """
 
81
    def __init__(self, parent, toolSwitcher):
 
82
        """GCP Display toolbar constructor
83
83
        """
84
 
        BaseToolbar.__init__(self, parent)
 
84
        BaseToolbar.__init__(self, parent, toolSwitcher)
85
85
        
86
86
        self.InitToolbar(self._toolbarData())
 
87
        self._default = self.gcpset
87
88
        
88
89
        # add tool to toggle active map window
89
90
        self.togglemapid = wx.NewId()
96
97
                                                              BaseIcons["zoomBack"].GetLabel(),
97
98
                                                              _(' / Zoom to map')))
98
99
 
 
100
        for tool in (self.gcpset, self.pan, self.zoomin, self.zoomout):
 
101
            self.toolSwitcher.AddToolToGroup(group='mouseUse', toolbar=self, tool=tool)
 
102
 
99
103
        # realize the toolbar
100
104
        self.Realize()
101
 
        
102
 
        self.action = { 'id' : self.gcpset }
103
 
        self.defaultAction = { 'id' : self.gcpset,
104
 
                               'bind' : self.parent.OnPointer }
105
 
        
106
 
        self.OnTool(None)
107
 
        
 
105
 
108
106
        self.EnableTool(self.zoomback, False)
109
107
        
110
108
    def _toolbarData(self):
111
 
        """!Toolbar data"""
 
109
        """Toolbar data"""
112
110
        icons = {
113
111
            'gcpSet'    : MetaIcon(img = 'gcp-create',
114
112
                                   label = _('Update GCP coordinates'),