當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.ColourData方法代碼示例

本文整理匯總了Python中wx.ColourData方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.ColourData方法的具體用法?Python wx.ColourData怎麽用?Python wx.ColourData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.ColourData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourData [as 別名]
def __init__(self, parent, id=-1, colour=wx.BLACK,
                         pos=wx.DefaultPosition, size=wx.DefaultSize,
                         style = CLRP_DEFAULT_STYLE,
                         validator = wx.DefaultValidator,
                         name = "colourpickerwidget"):
                
                wx.BitmapButton.__init__(self, parent, id, wx.Bitmap(1,1), 
                                         pos, size, style, validator, name)
                self.SetColour(colour)
                self.InvalidateBestSize()
                self.SetInitialSize(size)
                self.Bind(wx.EVT_BUTTON, self.OnButtonClick)
                
                global _colourData
                if _colourData is None:
                    _colourData = wx.ColourData()
                    _colourData.SetChooseFull(True)
                    grey = 0
                    for i in range(16):
                        c = wx.Colour(grey, grey, grey)
                        _colourData.SetCustomColour(i, c)
                        grey += 16 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:24,代碼來源:core.py

示例2: OnButton

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourData [as 別名]
def OnButton(self, event):
        colourData = wx.ColourData()
        colourData.SetChooseFull(True)
        colourData.SetColour(self.value)
        for i, colour in enumerate(eg.config.colourPickerCustomColours):
            colourData.SetCustomColour(i, colour)
        dialog = wx.ColourDialog(self.GetParent(), colourData)
        dialog.SetTitle(self.title)
        if dialog.ShowModal() == wx.ID_OK:
            colourData = dialog.GetColourData()
            self.SetValue(colourData.GetColour().Get())
            event.Skip()
        eg.config.colourPickerCustomColours = [
            colourData.GetCustomColour(i).Get() for i in range(16)
        ]
        dialog.Destroy()
        evt = eg.ValueChangedEvent(self.GetId(), value = self.value)
        wx.PostEvent(self, evt) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:20,代碼來源:ColourSelectButton.py

示例3: __on_colour

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourData [as 別名]
def __on_colour(self, _event):
        colourData = wx.ColourData()
        colourData.SetChooseFull(True)
        colourData.SetColour([level * 255 for level in self._colour])
        for i in range(len(self._colours)):
            colour = [level * 255 for level in self._colours[i]]
            colourData.SetCustomColour(i, colour)

        dlg = CubeColourDialog(self, colourData)
        if dlg.ShowModal() == wx.ID_OK:
            colour = dlg.GetColourData().GetColour()
            colour = [level / 255. for level in colour]
            self.set_colour(colour)
            event = Event(Events.CHANGED)
            post_event(self._eventHandler, event) 
開發者ID:EarToEarOak,項目名稱:RF-Monitor,代碼行數:17,代碼來源:panel_monitor.py

示例4: OnChangeColor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourData [as 別名]
def OnChangeColor(self, event):
        cd = wx.ColourData()
        cd.SetColour(getattr(self.cfg, self.color).toWx())
        dlg = wx.ColourDialog(self, cd)
        dlg.SetTitle(self.colorsLb.GetStringSelection())
        if dlg.ShowModal() == wx.ID_OK:
            setattr(self.cfg, self.color,
                    util.MyColor.fromWx(dlg.GetColourData().GetColour()))
        dlg.Destroy()

        self.cfg2gui() 
開發者ID:trelby,項目名稱:trelby,代碼行數:13,代碼來源:cfgdlg.py

示例5: OnLeftDown

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourData [as 別名]
def OnLeftDown(self, evt):
        data = wx.ColourData()
        data.SetColour(self.GetValue())
        dlg = wx.ColourDialog(self, data)
        if dlg.ShowModal() == wx.ID_OK:
            self.SetValue('#%02X%02X%02X' % dlg.GetColourData().GetColour().Get())
            self.SetModified()
        dlg.Destroy()

################################################################################

# Mapping from wx constants to XML strings 
開發者ID:andreas-p,項目名稱:admin4,代碼行數:14,代碼來源:params.py


注:本文中的wx.ColourData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。