当前位置: 首页>>代码示例>>Python>>正文


Python BaseToolbar.__init__方法代码示例

本文整理汇总了Python中gui_core.toolbars.BaseToolbar.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseToolbar.__init__方法的具体用法?Python BaseToolbar.__init__怎么用?Python BaseToolbar.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui_core.toolbars.BaseToolbar的用法示例。


在下文中一共展示了BaseToolbar.__init__方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent, toolSwitcher):
        """GCP Display toolbar constructor
        """
        BaseToolbar.__init__(self, parent, toolSwitcher)
        
        self.InitToolbar(self._toolbarData())
        self._default = self.gcpset
        
        # add tool to toggle active map window
        self.togglemapid = wx.NewId()
        self.togglemap = wx.Choice(parent = self, id = self.togglemapid,
                                   choices = [_('source'), _('target')])

        self.InsertControl(10, self.togglemap)

        self.SetToolShortHelp(self.togglemapid, '%s %s %s' % (_('Set map canvas for '),
                                                              BaseIcons["zoomBack"].GetLabel(),
                                                              _(' / Zoom to map')))

        for tool in (self.gcpset, self.pan, self.zoomin, self.zoomout):
            self.toolSwitcher.AddToolToGroup(group='mouseUse', toolbar=self, tool=tool)

        # realize the toolbar
        self.Realize()

        self.EnableTool(self.zoomback, False)
开发者ID:caomw,项目名称:grass,代码行数:28,代码来源:toolbars.py

示例2: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent, toolSwitcher):
        """Toolbar Cartographic Composer (psmap.py)

        :param parent: parent window
        """
        BaseToolbar.__init__(self, parent, toolSwitcher)

        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform == 'darwin':
            parent.SetToolBar(self)

        self.InitToolbar(self._toolbarData())
        self._default = self.pointer

        for tool in (self.pointer, self.pan, self.zoomin, self.zoomout,
                     self.drawGraphics, self.addMap):
            self.toolSwitcher.AddToolToGroup(
                group='mouseUse', toolbar=self, tool=tool)

        # custom button for graphics mode selection
        # TODO: could this be somehow generalized?
        self.arrowButton = self.CreateSelectionButton()
        self.arrowButtonId = self.InsertControl(18, self.arrowButton)
        self.arrowButton.Bind(wx.EVT_BUTTON, self.OnDrawGraphicsMenu)

        self.drawGraphicsAction = None
        self.OnAddPoint(event=None)

        self.Realize()

        from psmap.frame import havePILImage
        if not havePILImage:
            self.EnableTool(self.preview, False)
开发者ID:rkrug,项目名称:grass-ci,代码行数:35,代码来源:toolbars.py

示例3: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent):
        BaseToolbar.__init__(self, parent)

        self.icons = {
            'open': MetaIcon(img='open',
                             label=_('Open (Ctrl+O)')),
            'save': MetaIcon(img='save',
                             label=_('Save (Ctrl+S)')),
            'run': MetaIcon(img='execute',
                            label=_('Run (Ctrl+R)')),
            # TODO: better icons for overwrite modes
            'overwriteTrue': MetaIcon(img='locked',
                                      label=_('Activate overwrite')),
            'overwriteFalse': MetaIcon(img='unlocked',
                                       label=_('Deactive overwrite')),
        }

        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform == 'darwin':
            parent.SetToolBar(self)

        self.InitToolbar(self._toolbarData())

        # realize the toolbar
        self.Realize()
开发者ID:GRASS-GIS,项目名称:grass-ci,代码行数:27,代码来源:pyedit.py

示例4: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent, toolSwitcher):
        """RLiSetup toolbar constructor
        """

        BaseToolbar.__init__(self, parent, toolSwitcher,
                             style=wx.NO_BORDER | wx.TB_VERTICAL)

        self.InitToolbar(self._toolbarData())

        if self.parent.samplingtype == SamplingType.REGIONS:
            self._default = self.digitizeregion
        elif self.parent.samplingtype in [SamplingType.MUNITSR,
                                          SamplingType.MMVWINR]:
            self._default = self.digitizeunit
        elif self.parent.samplingtype in [SamplingType.MUNITSC,
                                          SamplingType.MMVWINC]:
            self._default = self.digitizeunitc
        elif self.parent.samplingtype == SamplingType.VECT:
            self._default = None
        else:
            self._default = self.draw

        for tool in (self._default, self.pan, self.zoomIn, self.zoomOut):
            if tool:
                self.toolSwitcher.AddToolToGroup(group='mouseUse',
                                                 toolbar=self, tool=tool)

        # realize the toolbar
        self.Realize()
开发者ID:imincik,项目名称:pkg-grass7,代码行数:31,代码来源:sampling_frame.py

示例5: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent):
        """!
        GCP Display toolbar constructor
        """
        BaseToolbar.__init__(self, parent)
        
        self.InitToolbar(self._toolbarData())
        
        # add tool to toggle active map window
        self.togglemapid = wx.NewId()
        self.togglemap = wx.Choice(parent = self, id = self.togglemapid,
                                   choices = [_('source'), _('target')])

        self.InsertControl(10, self.togglemap)

        self.SetToolShortHelp(self.togglemapid, '%s %s %s' % (_('Set map canvas for '),
                                                              BaseIcons["zoomBack"].GetLabel(),
                                                              _(' / Zoom to map')))

        # realize the toolbar
        self.Realize()
        
        self.action = { 'id' : self.gcpset }
        self.defaultAction = { 'id' : self.gcpset,
                               'bind' : self.parent.OnPointer }
        
        self.OnTool(None)
        
        self.EnableTool(self.zoomback, False)
开发者ID:imincik,项目名称:pkg-grass,代码行数:31,代码来源:toolbars.py

示例6: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
 def __init__(self, parent):
     BaseToolbar.__init__(self, parent)
     
     self.InitToolbar(self._toolbarData())
     
     # realize the toolbar
     self.Realize()
开发者ID:imincik,项目名称:pkg-grass,代码行数:9,代码来源:profile.py

示例7: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent):
        BaseToolbar.__init__(self, parent)

        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform == 'darwin':
            parent.SetToolBar(self)

        self.InitToolbar(self._toolbarData())
        
        # realize the toolbar
        self.Realize()
开发者ID:caomw,项目名称:grass,代码行数:13,代码来源:histogram.py

示例8: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent, controller, toolSwitcher):
        """RDigit toolbar constructor
        """
        BaseToolbar.__init__(self, parent, toolSwitcher)
        self._controller = controller
        self.InitToolbar(self._toolbarData())

        self._mapSelectionComboId = wx.NewId()
        self._mapSelectionCombo = wx.ComboBox(self, id=self._mapSelectionComboId,
                                              value=_("Select raster map"),
                                              choices=[], size=(120, -1))
        self._mapSelectionCombo.Bind(wx.EVT_COMBOBOX, self.OnMapSelection)
        self._mapSelectionCombo.SetEditable(False)
        self.InsertControl(0, self._mapSelectionCombo)
        self._previousMap = self._mapSelectionCombo.GetValue()

        self._colorId = wx.NewId()
        self._color = csel.ColourSelect(parent=self, colour=wx.GREEN,
                                        size=(30, 30))
        self._color.Bind(csel.EVT_COLOURSELECT, lambda evt: self._changeDrawColor())
        self._color.SetToolTipString(_("Set drawing color (not raster cell color)"))
        self.InsertControl(4, self._color)

        self._cellValues = set(['1'])
        self._valueComboId = wx.NewId()
        # validator does not work with combobox, SetBackgroundColor is not working
        self._valueCombo = wx.ComboBox(self, id=self._valueComboId,
                                       choices=list(self._cellValues), size=(80, -1),
                                       validator=FloatValidator())
        self._valueCombo.Bind(wx.EVT_COMBOBOX, lambda evt: self._cellValueChanged())
        self._valueCombo.Bind(wx.EVT_TEXT, lambda evt: self._cellValueChanged())
        self._valueCombo.SetSelection(0)
        self._cellValueChanged()
        self.InsertControl(6, wx.StaticText(self, label=" %s" % _("Cell value:")))
        self.InsertControl(7, self._valueCombo)

        self._widthValueId = wx.NewId()
        # validator does not work with combobox, SetBackgroundColor is not working
        self._widthValue = wx.TextCtrl(self, id=self._widthValueId, value='0',
                                       size=(80, -1), validator=FloatValidator())
        self._widthValue.Bind(wx.EVT_TEXT, lambda evt: self._widthValueChanged())
        self._widthValueChanged()
        self._widthValue.SetToolTipString(
            _("Width of currently digitized line or diameter of a digitized point in map units."))
        self.InsertControl(8, wx.StaticText(self, label=" %s" % _("Width:")))
        self.InsertControl(9, self._widthValue)

        for tool in (self.area, self.line, self.point):
            self.toolSwitcher.AddToolToGroup(group='mouseUse', toolbar=self, tool=tool)
        self.toolSwitcher.toggleToolChanged.connect(self.CheckSelectedTool)
        self._default = self.area
        # realize the toolbar
        self.Realize()
开发者ID:felipebetancur,项目名称:grass-ci,代码行数:55,代码来源:toolbars.py

示例9: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent):
        self.lmgr = parent

        BaseToolbar.__init__(self, parent)

        # only one dialog can be open
        self.settingsDialog = None

        self.InitToolbar(self._toolbarData())

        # realize the toolbar
        self.Realize()
开发者ID:GRASS-GIS,项目名称:grass-ci,代码行数:14,代码来源:toolbars.py

示例10: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent):
        """Animation toolbar constructor
        """
        BaseToolbar.__init__(self, parent)

        self.InitToolbar(self._toolbarData())

        # realize the toolbar
        self.Realize()

        self.isPlayingForward = True
        self.EnableAnimTools(False)
开发者ID:caomw,项目名称:grass,代码行数:14,代码来源:toolbars.py

示例11: __init__

# 需要导入模块: from gui_core.toolbars import BaseToolbar [as 别名]
# 或者: from gui_core.toolbars.BaseToolbar import __init__ [as 别名]
    def __init__(self, parent, lmgrStyle):
        """Toolbar constructor
        """
        self._style = lmgrStyle
        if lmgrStyle & (SIMPLE_LMGR_TB_LEFT | SIMPLE_LMGR_TB_RIGHT):
            direction = wx.TB_VERTICAL
        else:
            direction = wx.TB_HORIZONTAL
        BaseToolbar.__init__(self, parent, style=wx.NO_BORDER | direction)

        self.InitToolbar(self._getToolbarData(self._toolbarData()))

        # realize the toolbar
        self.Realize()
开发者ID:rkrug,项目名称:grass-ci,代码行数:16,代码来源:simplelmgr.py


注:本文中的gui_core.toolbars.BaseToolbar.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。