wxPopupControl's native look?

I'm using wxPopupControl from the Demo and I just noticed the widget
appears differently from similar controls (as shown in the attached
file) in my machine (Win XP, Python 2.2.2, wxPython 2.4.1.2). The down
arrow on the right of the control is different from the down arrow of
a wxChoice, and also a extra border is drawn inside the text field of
the wxPopupControl.

So my questions are: is there some way to configure wxPopupControl so
that its widgets appear in a more 'native look'? Is there another
wxPython popup control with such native look?

Thanks in advance,

-- tacao

p.jpg

This control renders the button itself. I don't think that the little 'down
button' is available as a standard component, which is why the library does
its own thing.

···

-----Original Message-----
From: E. A. Tacao [mailto:tacao@brturbo.com]
Sent: Thursday, December 11, 2003 15:58
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] wxPopupControl's native look?

I'm using wxPopupControl from the Demo and I just noticed the widget
appears differently from similar controls (as shown in the attached
file) in my machine (Win XP, Python 2.2.2, wxPython 2.4.1.2). The down
arrow on the right of the control is different from the down arrow of
a wxChoice, and also a extra border is drawn inside the text field of
the wxPopupControl.

So my questions are: is there some way to configure wxPopupControl so
that its widgets appear in a more 'native look'? Is there another
wxPython popup control with such native look?

Thanks in advance,

-- tacao

In Thursday, December 11, 2003, 11:14:03 PM, Jeff wrote:

This control renders the button itself. I don't think that the
little 'down button' is available as a standard component, which
is why the library does its own thing.

Thanks. While I'm still looking for the right down arrow on the
button, :wink: I was wondering if it's possible to catch some event on a
wxComboBox whenever its drop-down button is clicked and so trigger the
popup instead of its list. Unfortunately, it seems that is not
possible, according to the docs for the wxComboBox events. Is there a
way to override this?

-- tacao

E. A. Tacão wrote:

In Thursday, December 11, 2003, 11:14:03 PM, Jeff wrote:

> This control renders the button itself. I don't think that the
> little 'down button' is available as a standard component, which
> is why the library does its own thing.

Thanks. While I'm still looking for the right down arrow on the
button, :wink: I was wondering if it's possible to catch some event on a
wxComboBox whenever its drop-down button is clicked and so trigger the
popup instead of its list. Unfortunately, it seems that is not
possible, according to the docs for the wxComboBox events. Is there a
way to override this?

No.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

E. A. Tacao wrote:

I'm using wxPopupControl from the Demo and I just noticed the widget
appears differently from similar controls (as shown in the attached
file) in my machine (Win XP, Python 2.2.2, wxPython 2.4.1.2). The down
arrow on the right of the control is different from the down arrow of
a wxChoice, and also a extra border is drawn inside the text field of
the wxPopupControl.

So my questions are: is there some way to configure wxPopupControl so
that its widgets appear in a more 'native look'? Is there another
wxPython popup control with such native look?

Override or replace DrawArrow in the popupctl.PopButton class.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

In Thursday, December 11, 2003, 11:14:03 PM, Jeff wrote:

> This control renders the button itself. I don't think that the
> little 'down button' is available as a standard component, which
> is why the library does its own thing.

Thanks. While I'm still looking for the right down arrow on the
button, :wink: I was wondering if it's possible to catch some event on a
wxComboBox whenever its drop-down button is clicked and so trigger the
popup instead of its list. Unfortunately, it seems that is not
possible, according to the docs for the wxComboBox events. Is there a
way to override this?

I doubt it would be doable in a satisfactory way; if the control was written
in pure python, sure, but in this case I suspect you're doing to see the
list drop down anyway.

In Friday, December 12, 2003, 7:10:51 PM, Robin wrote:

Override or replace DrawArrow in the popupctl.PopButton class.

Yes, but I'm afraid the button would still be with the same look even
after I change the Windows look by choosing another theme.

In Saturday, December 13, 2003, 1:34:45 AM, Jeff wrote:

I doubt it would be doable in a satisfactory way; if the control
was written in pure python, sure, but in this case I suspect
you're doing to see the list drop down anyway.

Yes and no. I'm catching the EVT_LEFT_DOWN event on a wxComboBox and I
can get a popup control with a native look. (Please see the attached
file with the classes and some test code that runs from the Demo.)

It works ok here (Win XP, Python 2.2.2, wxPython 2.4.1.2) with the
mouse, but I found two problems: the drop-down key is not animated
when clicked and if I press <Alt>+<Down Arrow> or <Alt>+<Up Arrow>
when the combo has the focus, the combo's dropdown (and empty) list
appears.

Well I think I can live with the first problem, but I couldn't find a
way to catch keyboard events for a wxComboBox whenever the <Alt> key
is involved (I can intercept every other key but <Alt> by using
EVT_KEY_DOWN or EVT_CHAR). Is there a way to bind those events here?

Thanks in advance,

-- tacao

wxYAPopupCtrl.py (2.61 KB)

E. A. Tacao wrote:

In Friday, December 12, 2003, 7:10:51 PM, Robin wrote:

> Override or replace DrawArrow in the popupctl.PopButton class.

Yes, but I'm afraid the button would still be with the same look even
after I change the Windows look by choosing another theme.

Yep. If you need a native look then you need to use a native control.

In Saturday, December 13, 2003, 1:34:45 AM, Jeff wrote:

> I doubt it would be doable in a satisfactory way; if the control
> was written in pure python, sure, but in this case I suspect
> you're doing to see the list drop down anyway.

Yes and no. I'm catching the EVT_LEFT_DOWN event on a wxComboBox and I
can get a popup control with a native look. (Please see the attached
file with the classes and some test code that runs from the Demo.)

It works ok here (Win XP, Python 2.2.2, wxPython 2.4.1.2) with the
mouse, but I found two problems: the drop-down key is not animated
when clicked and if I press <Alt>+<Down Arrow> or <Alt>+<Up Arrow>
when the combo has the focus, the combo's dropdown (and empty) list
appears.

When you try to use a native control in ways it was not designed then weird things will happen.

Well I think I can live with the first problem, but I couldn't find a
way to catch keyboard events for a wxComboBox whenever the <Alt> key
is involved (I can intercept every other key but <Alt> by using
EVT_KEY_DOWN or EVT_CHAR). Is there a way to bind those events here?

The native control is probably grabbing those events before wxWindows can get them.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!