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


Python wx.BitmapButton方法代码示例

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


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

示例1: create_buttons

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def create_buttons(self, use_ppi_px):
        """Create buttons for display preview positioning config."""
        # Buttons - show only if use_ppi_px == True
        self.button_config = wx.Button(self, label="Positions")
        self.button_save = wx.Button(self, label="Save")
        self.button_reset = wx.Button(self, label="Reset")
        self.button_cancel = wx.Button(self, label="Cancel")
        help_bmp = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_BUTTON, (20, 20))
        self.button_help = wx.BitmapButton(self, bitmap=help_bmp, name="butt_help")


        self.button_config.Bind(wx.EVT_BUTTON, self.onConfigure)
        self.button_save.Bind(wx.EVT_BUTTON, self.onSave)
        self.button_reset.Bind(wx.EVT_BUTTON, self.onReset)
        self.button_cancel.Bind(wx.EVT_BUTTON, self.onCancel)
        self.button_help.Bind(wx.EVT_BUTTON, self.onHelp)

        self.move_buttons()

        self.button_config.Show(use_ppi_px)
        self.button_save.Show(False)
        self.button_reset.Show(False)
        self.button_cancel.Show(False) 
开发者ID:hhannine,项目名称:superpaper,代码行数:25,代码来源:gui.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def __init__(
        self,
        parent,
        value=(255, 255, 255),
        pos=wx.DefaultPosition,
        size=(40, wx.Button.GetDefaultSize()[1]),
        style=wx.BU_AUTODRAW,
        validator=wx.DefaultValidator,
        name="ColourSelectButton",
        title = "Colour Picker"
    ):
        self.value = value
        self.title = title
        wx.BitmapButton.__init__(
            self, parent, -1, wx.NullBitmap, pos, size, style, validator, name
        )
        self.SetValue(value)
        self.Bind(wx.EVT_BUTTON, self.OnButton) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:20,代码来源:ColourSelectButton.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=(40, wx.Button.GetDefaultSize()[1]),
        style=wx.BU_AUTODRAW,
        validator=wx.DefaultValidator,
        name="FontSelectButton",
        value=None
    ):
        self.value = value
        wx.BitmapButton.__init__(
            self,
            parent,
            id,
            GetInternalBitmap("font"),
            pos,
            size,
            style,
            validator,
            name
        )
        self.Bind(wx.EVT_BUTTON, self.OnButton) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:26,代码来源:FontSelectButton.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def __init__(self, frame, pnl, item):
        pic_jd = wx.Image(item.img, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        btn_jd = wx.BitmapButton(pnl, -1, pic_jd, pos=(item.x, item.y), size=(100, 100))
        wx.StaticText(pnl, -1, item.title, pos=(item.x + 30, item.y + 110))
        self.frame = frame
        self.frame.Bind(wx.EVT_BUTTON, self.OnClick, btn_jd) 
开发者ID:MyDataHomes,项目名称:Spider,代码行数:8,代码来源:main.py

示例5: add_buttonbar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def add_buttonbar(self):
        self.button_bar = wx.Panel(self)
        self.button_bar_sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.sizer.Add(self.button_bar, 0, wx.LEFT | wx.TOP | wx.GROW)

        for i, (mt, func) in enumerate(functions):
            bm = mathtext_to_wxbitmap(mt)
            button = wx.BitmapButton(self.button_bar, 1000 + i, bm)
            self.button_bar_sizer.Add(button, 1, wx.GROW)
            self.Bind(wx.EVT_BUTTON, self.OnChangePlot, button)

        self.button_bar.SetSizer(self.button_bar_sizer) 
开发者ID:holzschu,项目名称:python3_ios,代码行数:14,代码来源:mathtext_wx_sgskip.py

示例6: create_bezel_buttons

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def create_bezel_buttons(self):
        # load icons into bitmaps
        rb_png = os.path.join(RESOURCES_PATH, "icons8-merge-vertical-96.png")
        bb_png = os.path.join(RESOURCES_PATH, "icons8-merge-horizontal-96.png")
        rb_img = wx.Image(rb_png, type=wx.BITMAP_TYPE_ANY)
        bb_img = wx.Image(bb_png, type=wx.BITMAP_TYPE_ANY)
        rb_bmp = rb_img.Scale(20, 20).Resize((20, 20), (0, 0)).ConvertToBitmap()
        bb_bmp = bb_img.Scale(20, 20).Resize((20, 20), (0, 0)).ConvertToBitmap()

        # create bitmap buttons
        for st_bmp in self.preview_img_list:
            butts = []
            butt_rb = wx.BitmapButton(self, bitmap=rb_bmp, name="butt_bez_r", style=wx.BORDER_NONE)
            butt_bb = wx.BitmapButton(self, bitmap=bb_bmp, name="butt_bez_b", style=wx.BORDER_NONE)
            bez_butt_color = wx.Colour(41, 47, 52)
            butt_rb.SetBackgroundColour(bez_butt_color)
            butt_bb.SetBackgroundColour(bez_butt_color)
            self.bez_butt_sz = butt_rb.GetSize()
            pos_rb, pos_bb = self.bezel_button_positions(st_bmp)
            butt_rb.SetPosition((pos_rb[0], pos_rb[1]))
            butt_bb.SetPosition((pos_bb[0], pos_bb[1]))
            butt_rb.Bind(wx.EVT_BUTTON, self.onBezelButton)
            butt_bb.Bind(wx.EVT_BUTTON, self.onBezelButton)
            self.bez_buttons.append(
                (
                    butt_rb,
                    butt_bb
                )
            )
        self.show_bezel_buttons(False)
        self.create_bezel_popups() 
开发者ID:hhannine,项目名称:superpaper,代码行数:33,代码来源:gui.py

示例7: _create_bitmap_button

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def _create_bitmap_button(self, icon, size=(-1, -1), handler=None):
        button = wx.BitmapButton(self._panel, bitmap=icon, size=size, style=wx.NO_BORDER)

        if handler is not None:
            button.Bind(wx.EVT_BUTTON, handler)

        return button 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:9,代码来源:mainframe.py

示例8: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def __init__(self, *args, **kwargs):
        wx.BitmapButton.__init__(self, *args, **kwargs) 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:4,代码来源:wxwrap.py

示例9: SetToolTip

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def SetToolTip(self, tip):
        if wxPythonPhoenix:
            wx.BitmapButton.SetToolTip(self, tipString=tip)
        else:
            wx.BitmapButton.SetToolTipString(self, tip) 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:7,代码来源:wxwrap.py

示例10: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['CustomWidget'] = CustomWidget
    common.widgets['CustomWidget'] = builder
    common.widgets_from_xml['CustomWidget'] = xml_builder

    return common.make_object_button('CustomWidget', 'custom.xpm', tip='Add a custom widget') 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:custom_widget.py

示例11: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['EditPropertyGridManager'] = EditPropertyGridManager
    common.widgets['EditPropertyGridManager'] = builder
    common.widgets_from_xml['EditPropertyGridManager'] = xml_builder

    return common.make_object_button('EditPropertyGridManager', 'grid.xpm') 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:property_grid_manager.py

示例12: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['EditCheckBox'] = EditCheckBox
    common.widgets['EditCheckBox'] = builder
    common.widgets_from_xml['EditCheckBox'] = xml_builder

    return common.make_object_button('EditCheckBox', 'checkbox.xpm') 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:checkbox.py

示例13: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['EditStaticBitmap'] = EditStaticBitmap
    common.widgets['EditStaticBitmap'] = builder
    common.widgets_from_xml['EditStaticBitmap'] = xml_builder

    return common.make_object_button('EditStaticBitmap', 'static_bitmap.xpm') 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:static_bitmap.py

示例14: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['EditMenuBar'] = EditMenuBar
    common.widgets['EditMenuBar'] = builder
    common.widgets_from_xml['EditMenuBar'] = xml_builder

    return common.make_object_button('EditMenuBar', 'menubar.xpm', 1) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:menubar.py

示例15: initialize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def initialize():
    "initialization function for the module: returns a wx.BitmapButton to be added to the main palette"
    common.widget_classes['EditRadioButton'] = EditRadioButton
    common.widgets['EditRadioButton'] = builder
    common.widgets_from_xml['EditRadioButton'] = xml_builder

    return common.make_object_button('EditRadioButton', 'radio_button.xpm') 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:radio_button.py


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