当前位置: 首页>>代码示例>>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;未经允许,请勿转载。