Пример #1
0
    def __init__(
        self,
        parent,
        id=-1,
        bitmap=wx.NullBitmap,
        label="",
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=0,
        validator=wx.DefaultValidator,
        name="bitmaptextbutton",
    ):
        """Constructor"""

        self._art = RB.RibbonMSWArtProvider()
        # self._art = RB.RibbonArtProvider()
        wx.lib.buttons.GenBitmapButton.__init__(self, parent, id, bitmap, pos,
                                                size, style | wx.BU_EXACTFIT,
                                                validator, name)
        self.SetLabel(label)
        self.enter_state = False
        self.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.on_leave)
        image = self.bmpLabel.ConvertToImage()
        imageutils.grayOut(image)
        self.bmpLabel2 = wx.Bitmap(image)
        self.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE))
Пример #2
0
 def test_lib_agw_ribbonArtProviders(self):
     rib = RB.RibbonBar(self.frame,
                        wx.ID_ANY,
                        agwStyle=RB.RIBBON_BAR_DEFAULT_STYLE
                        | RB.RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS)
     rib.SetArtProvider(RB.RibbonDefaultArtProvider())
     rib.SetArtProvider(RB.RibbonAUIArtProvider())
     rib.SetArtProvider(RB.RibbonMSWArtProvider())
     rib.SetArtProvider(RB.RibbonOSXArtProvider())
Пример #3
0
 def Realize(self):
     if MSW_STYLE:
         global ORG_LIKE_PRIMARY
         if not ORG_LIKE_PRIMARY:
             ORG_LIKE_PRIMARY = RB.art_msw.LikePrimary
             RB.art_msw.LikePrimary = like_primary
         provider = RB.RibbonMSWArtProvider()
         (dummy, secondary, tertiary) = provider.GetColourScheme(None, 1, 1)
         colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)
         colour2 = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNTEXT)
         provider.SetColourScheme(colour, secondary, colour2)
         provider._tab_label_colour = colour2
         provider._button_bar_label_colour = colour2
     else:
         provider = RB.RibbonAUIArtProvider()
     self.SetArtProvider(provider)
     RB.RibbonBar.Realize(self)
Пример #4
0
    def OnMSWProvider(self, event):

        self._ribbon.DismissExpandedPanel()
        self.SetArtProvider(RB.RibbonMSWArtProvider())