當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。