Text color of disabled fields

Missing or incomplete OpenText Gupta product features? Discuss it here!
aleshk
Ukraine
Posts: 81
Joined: 05 Dec 2017, 07:40
Location: Kiev, Ukraine

Text color of disabled fields

Post by aleshk » 03 Apr 2014, 16:03

Hi

In our application in some cases we should open a form in a read only mode.
We could make data field objects as ReadOnly (by some windows functions/messages) but we cannot do that for ComboBoxes and CheckBoxes.
So, we do disabling of all fields to have them not editable.
When we worked in CTD 3.1 disabled fields were quite readable. Now in TD 6.2 disabled fields have too light color and it is difficult to read a field content.
FYI: We (our product management) has choosen "Office 2010 (Release2) Blue" theme for our application

Is it possible to make a text color for disabled fields more dark?
Or it could be even better if the text color for disabled field could be choosen as a Property.

Regards,
Alexander

giscon

Re: Text color of disabled fields

Post by giscon » 03 Apr 2014, 17:04

Hi Alexander.

for data fields you could use the following trick:
- set for the data field in the attribute inspector the property "Editable" = "No" (instead of disabling it at runtime)
- after creation of the form or dialog you can still enable the field by some program code if you want so (or afterwards again disable it),
Now, in the "disabled state", the text color of the data field will still be the usual black (if the default color is not changed) and not the light gray.

Unfortunately this does not work for objects as check boxes because you cannot set an "Editable" property in the attribute inspector for them. So you have to disable such objects at runtime - and their text color will change to the light gray ...
Annotation: SalColorSet doesn't help here, too - it seems to have no effect for the text color of disabled fields.

Best regards
Guenter
Giscon Systems GmbH

User avatar
Peter.Hugk
Germany
Posts: 340
Joined: 06 Mar 2017, 07:48
Location: Germany

Re: Text color of disabled fields

Post by Peter.Hugk » 04 Apr 2014, 07:16

For datafields and combo boxes we use the following functions:

Code: Select all

Function: disableWindow
   Description: ersetzt SalDisableWindow(), funktioniert aber nicht für checkboxes: 
         Das Fenster behält durch VisWinSetFlags() seine schwarze Textfarbe 
         und wird - wie bei disabled üblich - grau angezeigt
   Returns
   Parameters
      Window Handle: hWnd2Disable
   Static Variables
   Local variables
   Actions
      Call VisWinSetFlags( hWnd2Disable, WF_DisplayOnly, TRUE )
      Call SalColorSet( hWnd2Disable, COLOR_IndexWindow, COLOR_3DFace )
Function: enableWindow
   Description: ersetzt SalEnableWindow()
   Returns
   Parameters
      Window Handle: hWnd2Disable
   Static Variables
   Local variables
   Actions
      Call VisWinSetFlags( hWnd2Disable, WF_DisplayOnly, FALSE )
      Call SalColorSet( hWnd2Disable, COLOR_IndexWindow, COLOR_Default )
For check boxes we also do not know a way to make the check mark black instead of the light gray.

Regards,
Peter

giscon

Re: Text color of disabled fields

Post by giscon » 04 Apr 2014, 08:33

Hi Peter,
thank you for your example.
The check mark of a checkbox, disabled by your function, will still be light gray, but the text for the checkbox will now keep it's black color, making it much better readable.
Very good.

Best regards
Guenter
Giscon Systems GmbH

Return to “Enhancement suggestions”

Who is online

Users browsing this forum: [Ccbot] and 0 guests