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


Python wx.ColourDialog方法代碼示例

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


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

示例1: on_change_high_color

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def on_change_high_color(self, event):
        """Change the high color and refresh display."""
        print("High color menu item clicked!")
        cd = wx.ColourDialog(self)
        cd.GetColourData().SetChooseFull(True)

        if cd.ShowModal() == wx.ID_OK:
            new_color = cd.GetColourData().Colour
            print("The color {} was chosen!".format(new_color))
            self.panel.on_color_change({'high': new_color, 'low': None})
            self.panel.Refresh()
        else:
            print("no color chosen :-(")
        cd.Destroy()

    # TODO: See the 'and' in the docstring? Means I need a separate method! 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:18,代碼來源:wm_frame.py

示例2: OnButton

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [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: OnChangeColor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [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

示例4: OnButtonClick

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def OnButtonClick(self, evt):
                global _colourData
                _colourData.SetColour(self.colour)
                dlg = wx.ColourDialog(self, _colourData)
                if dlg.ShowModal() == wx.ID_OK:
                    _colourData = dlg.GetColourData()
                    self.SetColour(_colourData.GetColour())
                    evt = wx.ColourPickerEvent(self, self.GetId(), self.GetColour())
                    self.GetEventHandler().ProcessEvent(evt) 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:11,代碼來源:core.py

示例5: on_change_low_color

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def on_change_low_color(self, event):
        """Change the low color and refresh display."""
        print("Low Color menu item clicked!")
        cd = wx.ColourDialog(self)
        cd.GetColourData().SetChooseFull(True)

        if cd.ShowModal() == wx.ID_OK:
            new_color = cd.GetColourData().Colour
            print("The color {} was chosen!".format(new_color))
            self.panel.on_color_change({'high': None, 'low': new_color})
            self.panel.Refresh()
        else:
            print("no color chosen :-(")
        cd.Destroy() 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:16,代碼來源:wm_frame.py

示例6: getDialog

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def getDialog(self):
        return wx.ColourDialog(self) 
開發者ID:chriskiehl,項目名稱:Gooey,代碼行數:4,代碼來源:chooser.py

示例7: OnLeftDown

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [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

示例8: onForecolor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def onForecolor(self, event): # wxGlade: DisplayDialog.<event_handler>
        dlg = wx.ColourDialog(self)
        dlg.GetColourData().SetChooseFull(True)
        dlg.GetColourData().SetColour(self.parent.settings.forecolor)
        if dlg.ShowModal() == wx.ID_OK:
            self.forecolor = dlg.GetColourData().GetColour().Get()
            self.parent.settings.forecolor = self.forecolor
            self.parent.updateTextctrl()
        dlg.Destroy() 
開發者ID:nccgroup,項目名稱:Zulu,代碼行數:11,代碼來源:displayDialog.py

示例9: onBackcolor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ColourDialog [as 別名]
def onBackcolor(self, event): # wxGlade: DisplayDialog.<event_handler>
        dlg = wx.ColourDialog(self)
        dlg.GetColourData().SetChooseFull(True)
        dlg.GetColourData().SetColour(self.parent.settings.backcolor)
        if dlg.ShowModal() == wx.ID_OK:
            self.backcolor = dlg.GetColourData().GetColour().Get()
            self.parent.settings.backcolor = self.backcolor
            self.parent.updateTextctrl()
        dlg.Destroy() 
開發者ID:nccgroup,項目名稱:Zulu,代碼行數:11,代碼來源:displayDialog.py


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