Is there a color selector in drop-down combobox?

Good evening everyone

I’m using the wxColourDialog, a color chooser dialog.

But it is too tiresome that users have to click “OK” to close the dialog after we select a color.

I want host a color selector (or color picker or color edit or color chooser) like this

or like this:

Should I write a new control based on wxCombo or wxChoice? But I don’t know which methods should be overload or override.

Or there are some better ideas? I want your help!

language: Python 2.7, UI: wxPython 3.0

The BitmapComboBox is basically what you are looking for…
wx.EVT_COMBOBOX_DROPDOWN with ColourDB and or a custom Popup Window works fine for the type of functionality you are looking for.

Creating a Custom PyControl is probably the best, but takes more work to get done. It depends on if you will use this type of control often or just want to slap together a generic one made of other widgets.

@ Robin: But it seams with wxPy2.9.5 and wxPy3.0 the images isn’t showing in the combo when closed up. I was thinking you said a fix was done… Or is that still pending?

···

On Saturday, January 18, 2014 8:21:18 AM UTC-6, sunyt game wrote:

Good evening everyone

I’m using the wxColourDialog, a color chooser dialog.

But it is too tiresome that users have to click “OK” to close the dialog after we select a color.

I want host a color selector (or color picker or color edit or color chooser) like this

or like this:

Should I write a new control based on wxCombo or wxChoice? But I don’t know which methods should be overload or override.

Or there are some better ideas? I want your help!

language: Python 2.7, UI: wxPython 3.0

Thanks! It is the control that I want.

在 2014年1月19日星期日UTC+8上午3时11分05秒,Metallicow写道:

···

On Saturday, January 18, 2014 8:21:18 AM UTC-6, sunyt game wrote:

Good evening everyone

I’m using the wxColourDialog, a color chooser dialog.

But it is too tiresome that users have to click “OK” to close the dialog after we select a color.

I want host a color selector (or color picker or color edit or color chooser) like this

or like this:

Should I write a new control based on wxCombo or wxChoice? But I don’t know which methods should be overload or override.

Or there are some better ideas? I want your help!

language: Python 2.7, UI: wxPython 3.0

The BitmapComboBox is basically what you are looking for…
wx.EVT_COMBOBOX_DROPDOWN with ColourDB and or a custom Popup Window works fine for the type of functionality you are looking for.

Creating a Custom PyControl is probably the best, but takes more work to get done. It depends on if you will use this type of control often or just want to slap together a generic one made of other widgets.

@ Robin: But it seams with wxPy2.9.5 and wxPy3.0 the images isn’t showing in the combo when closed up. I was thinking you said a fix was done… Or is that still pending?

Finally, I code a color selector as I want it to be.
Download:https://github.com/gamesun/PopupColorSelector/releases

A Demo of using PopupColorSelector.

Highlight on focus.

在 2014年1月19日星期日UTC+8上午10时04分32秒,sunyt game写道:

···

On Saturday, January 18, 2014 8:21:18 AM UTC-6, sunyt game wrote:

Good evening everyone

I’m using the wxColourDialog, a color chooser dialog.

But it is too tiresome that users have to click “OK” to close the dialog after we select a color.

I want host a color selector (or color picker or color edit or color chooser) like this

or like this:

Should I write a new control based on wxCombo or wxChoice? But I don’t know which methods should be overload or override.

Or there are some better ideas? I want your help!

language: Python 2.7, UI: wxPython 3.0

The BitmapComboBox is basically what you are looking for…
wx.EVT_COMBOBOX_DROPDOWN with ColourDB and or a custom Popup Window works fine for the type of functionality you are looking for.

Creating a Custom PyControl is probably the best, but takes more work to get done. It depends on if you will use this type of control often or just want to slap together a generic one made of other widgets.

@ Robin: But it seams with wxPy2.9.5 and wxPy3.0 the images isn’t showing in the combo when closed up. I was thinking you said a fix was done… Or is that still pending?

Thanks! It is the control that I want.

在 2014年1月19日星期日UTC+8上午3时11分05秒,Metallicow写道:

Congratulation! Good to see you came up with a initial solution.

Your code could be shorted and optimized a bit from quick glance.
ColorTable would probably be better as tuples for quicker access and also your widget generation could go in a simple loop.

Here is a small usable sample app I wrote real quick using colourDB with a bit different popup approach. based on your pics generally what you wanted.
Not that I really needed any more color tools for ‘Color Pickin` Pro’ tho…
wxPython Licensed Attachment. Could be used as a popup also.

Again, Thanks for sharing.

ColourDBSelectorApp.py (2.93 KB)

···

On Tuesday, January 28, 2014 7:40:57 AM UTC-6, sunyt game wrote:

Finally, I code a color selector as I want it to be.
Download:https://github.com/gamesun/PopupColorSelector/releases

Thanks for your suggestions.
Code has been modified just now.

在 2014年1月29日星期三UTC+8下午8时26分30秒,Metallicow写道:

···

On Tuesday, January 28, 2014 7:40:57 AM UTC-6, sunyt game wrote:

Finally, I code a color selector as I want it to be.
Download:https://github.com/gamesun/PopupColorSelector/releases

Congratulation! Good to see you came up with a initial solution.

Your code could be shorted and optimized a bit from quick glance.
ColorTable would probably be better as tuples for quicker access and also your widget generation could go in a simple loop.

Here is a small usable sample app I wrote real quick using colourDB with a bit different popup approach. based on your pics generally what you wanted.
Not that I really needed any more color tools for ‘Color Pickin` Pro’ tho…
wxPython Licensed Attachment. Could be used as a popup also.

Again, Thanks for sharing.