本文整理汇总了Python中gui_core.toolbars.BaseToolbar类的典型用法代码示例。如果您正苦于以下问题:Python BaseToolbar类的具体用法?Python BaseToolbar怎么用?Python BaseToolbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseToolbar类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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)
示例2: __init__
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)
示例3: __init__
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()
示例4: __init__
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()
示例5: __init__
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)
示例6: __init__
def __init__(self, parent):
BaseToolbar.__init__(self, parent)
self.InitToolbar(self._toolbarData())
# realize the toolbar
self.Realize()
示例7: __init__
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()
示例8: __init__
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()
示例9: __init__
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()
示例10: __init__
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)
示例11: __init__
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()