Displaying Non-Editable controls

Hi,

I've got some wx.TextCtrl- and wx.ComboBox-Controls in my application.
The application might set some of them into "non-editable" state.

Is there a "preferred" way to show this changed state in the UI? Like
graying out. I don't want to use foo.Enabled(False) because I cannot
scroll the controls-contents anymore as well as copy and paste is no
longer available.

I've then tried to set the BackgroundColour() to either wx.NullColour or
another (gray) color, but this doesn't work on all platforms. On wxMSW
(2.6.1.0) dropdowns are gray if their background is set to
wx.NullColour. On wxMac background of checkboxes and dropdowns is white
when using wx.NullColour. The next thing was trying to change the
foregroundcolor, which does not work on wxGTK (2.6.3.3) at all (for
TextCtrl/ComboBox).

So I was wondering how other are solving this problem.

Thanks for your help,

Johannes

···

--
BYTEWISE Software GmbH Tel +43 (5577) 89877-0
i.A. Johannes Vetter Fax +43 (5577) 89877-66
A-6890 Lustenau, Enga 2 http://www.bytewise.at
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Individuelle Datenbanklösungen für GNU/Linux, Windows und
Mac OSX: http://www.bytewise.at/leistungen/gnue-indiv.html

Johannes Vetter wrote:

Hi,

I've got some wx.TextCtrl- and wx.ComboBox-Controls in my application.
The application might set some of them into "non-editable" state.

Is there a "preferred" way to show this changed state in the UI? Like
graying out. I don't want to use foo.Enabled(False) because I cannot
scroll the controls-contents anymore as well as copy and paste is no
longer available.

I've then tried to set the BackgroundColour() to either wx.NullColour or
another (gray) color, but this doesn't work on all platforms. On wxMSW
(2.6.1.0) dropdowns are gray if their background is set to
wx.NullColour. On wxMac background of checkboxes and dropdowns is white
when using wx.NullColour. The next thing was trying to change the
foregroundcolor, which does not work on wxGTK (2.6.3.3) at all (for
TextCtrl/ComboBox).

So I was wondering how other are solving this problem.

Disabling the control is really the only native way to give the native disabled LnF.

···

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