本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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()
示例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
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BitmapButton [as 别名]
def __init__(self, *args, **kwargs):
wx.BitmapButton.__init__(self, *args, **kwargs)
示例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)
示例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')
示例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')
示例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')
示例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')
示例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)
示例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')