how to disable a panel with controls, without affecting the visibility ?

hello,

I've a panel with a lot of controls ( textctrl, choice, combo, grid, buttons).
Now I want to disable alle the controls on the panel,
which can easily be done by setting Panel.Enable(False).
there's one disadvantage,
because everything is disabled, everything gets grayed and becomes almost unreadable.

Is there a way to disable controls like Choice / Combo,
without changing the color or at least give it a good readable color ?
( I know it's a bad thing to change the default behavior, but in this case it's really necessary)

thanks,
Stef

One way that comes to mind is to intercept the mouse, key, and char events for each of the widgets. There are some widget types where it may not fully block everything, but it probably will for the basic widget types.

···

On 5/27/11 4:02 PM, Stef Mientki wrote:

hello,

I've a panel with a lot of controls ( textctrl, choice, combo, grid, buttons).
Now I want to disable alle the controls on the panel,
which can easily be done by setting Panel.Enable(False).
there's one disadvantage,
because everything is disabled, everything gets grayed and becomes almost unreadable.

Is there a way to disable controls like Choice / Combo,
without changing the color or at least give it a good readable color ?
( I know it's a bad thing to change the default behavior, but in this case it's really necessary)

--
Robin Dunn
Software Craftsman

thanks Robin,
yeah, that's a possibility.

I'm also thinking of another solution
(O like to keep things as simple as possible),
I think I can limit the widgets to TextCtrl and Choice,
TextCtrl can be disabled (or made readonly) while maintaining the readibility.
For the Choice another solution is needed,
making a new widget consisting of a Choice and TextCtrl, placed over each other,
while only one of them is visible,
this might work.

cheers,
Stef

···

On 30-05-2011 21:23, Robin Dunn wrote:

On 5/27/11 4:02 PM, Stef Mientki wrote:

hello,

I've a panel with a lot of controls ( textctrl, choice, combo, grid, buttons).
Now I want to disable alle the controls on the panel,
which can easily be done by setting Panel.Enable(False).
there's one disadvantage,
because everything is disabled, everything gets grayed and becomes almost unreadable.

Is there a way to disable controls like Choice / Combo,
without changing the color or at least give it a good readable color ?
( I know it's a bad thing to change the default behavior, but in this case it's really necessary)

One way that comes to mind is to intercept the mouse, key, and char events for each of the
widgets. There are some widget types where it may not fully block everything, but it probably
will for the basic widget types.

thanks Robin,
yeahthat's a possibility.

I'm also thinking of another solution
(O like to keep things as simple as possible),
I think I can limit the widgets to TextCtrl and Choice,
TextCtrl can be disabled (or made readonly) while maintaining the readibility.
For the Choice another solution is needed,
making a new widget consisting of a Choice and TextCtrl, placed over each other,
while only one of them is visible,
this might work.

cheers,
Stef

···

On 30-05-2011 21:23, Robin Dunn wrote:

On 5/27/11 4:02 PM, Stef Mientki wrote:

hello,

I've a panel with a lot of controls ( textctrl, choice, combo, grid, buttons).
Now I want to disable alle the controls on the panel,
which can easily be done by setting Panel.Enable(False).
there's one disadvantage,
because everything is disabled, everything gets grayed and becomes almost unreadable.

Is there a way to disable controls like Choice / Combo,
without changing the color or at least give it a good readable color ?
( I know it's a bad thing to change the default behavior, but in this case it's really necessary)

One way that comes to mind is to intercept the mouse, key, and char events for each of the
widgets. There are some widget types where it may not fully block everything, but it probably
will for the basic widget types.

Perhaps you can draw a transparent window in front of it?

Rufus

···

----- Original Message ----- From: "Stef Mientki" <stef.mientki@gmail.com>
To: <wxpython-users@googlegroups.com>
Sent: Tuesday, May 31, 2011 1:49 PM
Subject: Re: [wxPython-users] how to disable a panel with controls, without affecting the visibility ?

On 30-05-2011 21:23, Robin Dunn wrote:

On 5/27/11 4:02 PM, Stef Mientki wrote:

hello,

I've a panel with a lot of controls ( textctrl, choice, combo, grid, buttons).
Now I want to disable alle the controls on the panel,
which can easily be done by setting Panel.Enable(False).
there's one disadvantage,
because everything is disabled, everything gets grayed and becomes almost unreadable.

Is there a way to disable controls like Choice / Combo,
without changing the color or at least give it a good readable color ?
( I know it's a bad thing to change the default behavior, but in this case it's really necessary)

One way that comes to mind is to intercept the mouse, key, and char events for each of the
widgets. There are some widget types where it may not fully block everything, but it probably
will for the basic widget types.

thanks Robin,
yeahthat's a possibility.

I'm also thinking of another solution
(O like to keep things as simple as possible),
I think I can limit the widgets to TextCtrl and Choice,
TextCtrl can be disabled (or made readonly) while maintaining the readibility.
For the Choice another solution is needed,
making a new widget consisting of a Choice and TextCtrl, placed over each other,
while only one of them is visible,
this might work.

cheers,
Stef

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en