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


Python Resources.getHandBitmap方法代码示例

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


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

示例1: BuildToolbar

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import getHandBitmap [as 别名]
    def BuildToolbar(self):
        tb = wx.ToolBar(self,-1)
        self.ToolBar = tb
        
        tb.SetToolBitmapSize((24,24))
        
        tb.AddTool(ID_POINTER_BUTTON, Resources.getPointerBitmap(), isToggle=True, shortHelpString = "Pointer")
        wx.EVT_TOOL(self, ID_POINTER_BUTTON, self.SetToolMode)

        tb.AddTool(ID_ZOOM_IN_BUTTON, Resources.getMagPlusBitmap(), isToggle=True, shortHelpString = "Zoom In")
        wx.EVT_TOOL(self, ID_ZOOM_IN_BUTTON, self.SetToolMode)
        
        tb.AddTool(ID_ZOOM_OUT_BUTTON, Resources.getMagMinusBitmap(), isToggle=True, shortHelpString = "Zoom Out")
        wx.EVT_TOOL(self, ID_ZOOM_OUT_BUTTON, self.SetToolMode)
        
        tb.AddTool(ID_MOVE_MODE_BUTTON, Resources.getHandBitmap(), isToggle=True, shortHelpString = "Move")
        wx.EVT_TOOL(self, ID_MOVE_MODE_BUTTON, self.SetToolMode)
        
        tb.AddSeparator()
        
        tb.AddControl(wx.Button(tb, ID_ZOOM_TO_FIT_BUTTON, "Zoom To Fit",wx.DefaultPosition, wx.DefaultSize))
        wx.EVT_BUTTON(self, ID_ZOOM_TO_FIT_BUTTON, self.ZoomToFit)

        tb.Realize()
        S = tb.GetSize()
        tb.SetSizeHints(S[0],S[1])
        return tb
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:29,代码来源:NavCanvas.py

示例2: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import getHandBitmap [as 别名]
    def __init__(
        self, parent, id=wx.ID_ANY, size=wx.DefaultSize, **kwargs
    ):  # The rest just get passed into FloatCanvas
        wx.Panel.__init__(self, parent, id, size=size)

        self.Modes = [
            ("Pointer", GUIMode.GUIMouse(), Resources.getPointerBitmap()),
            ("Zoom In", GUIMode.GUIZoomIn(), Resources.getMagPlusBitmap()),
            ("Zoom Out", GUIMode.GUIZoomOut(), Resources.getMagMinusBitmap()),
            ("Pan", GUIMode.GUIMove(), Resources.getHandBitmap()),
        ]

        self.BuildToolbar()
        ## Create the vertical sizer for the toolbar and Panel
        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(self.ToolBar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4)

        self.Canvas = FloatCanvas.FloatCanvas(self, **kwargs)
        box.Add(self.Canvas, 1, wx.GROW)

        self.SetSizerAndFit(box)

        # default to first mode
        # self.ToolBar.ToggleTool(self.PointerTool.GetId(), True)
        self.Canvas.SetMode(self.Modes[0][1])

        return None
开发者ID:apetcho,项目名称:wxPython-2,代码行数:29,代码来源:NavCanvas.py

示例3: BuildToolbar

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import getHandBitmap [as 别名]
    def BuildToolbar(self):
        tb = wx.ToolBar(self)
        self.ToolBar = tb
        tb.SetToolBitmapSize((24,24))

        self.PointerTool = tb.AddRadioTool(wx.ID_ANY, bitmap=Resources.getPointerBitmap(), shortHelp = "Pointer")
        self.Bind(wx.EVT_TOOL, lambda evt : self.SetMode(Mode=self.GUIMouse), self.PointerTool)

        self.ZoomInTool = tb.AddRadioTool(wx.ID_ANY, bitmap=Resources.getMagPlusBitmap(), shortHelp = "Zoom In")
        self.Bind(wx.EVT_TOOL, lambda evt : self.SetMode(Mode=self.GUIZoomIn), self.ZoomInTool)
    
        self.ZoomOutTool = tb.AddRadioTool(wx.ID_ANY, bitmap=Resources.getMagMinusBitmap(), shortHelp = "Zoom Out")
        self.Bind(wx.EVT_TOOL, lambda evt : self.SetMode(Mode=self.GUIZoomOut), self.ZoomOutTool)

        self.MoveTool = tb.AddRadioTool(wx.ID_ANY, bitmap=Resources.getHandBitmap(), shortHelp = "Move")
        self.Bind(wx.EVT_TOOL, lambda evt : self.SetMode(Mode=self.GUIMove), self.MoveTool)

        tb.AddSeparator()

        self.ZoomButton = wx.Button(tb, label="Zoom To Fit")
        tb.AddControl(self.ZoomButton)
        self.ZoomButton.Bind(wx.EVT_BUTTON, self.ZoomToFit)

        tb.Realize()
        ## fixme: remove this when the bug is fixed!
        wx.CallAfter(self.HideShowHack) # this required on wxPython 2.8.3 on OS-X

        return tb
开发者ID:Einstein-NTE,项目名称:einstein,代码行数:30,代码来源:NavCanvas.py


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