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
Text color of disabled fields
Re: Text color of disabled fields
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
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
Re: Text color of disabled fields
For datafields and combo boxes we use the following functions:
For check boxes we also do not know a way to make the check mark black instead of the light gray.
Regards,
Peter
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 )
Regards,
Peter
Re: Text color of disabled fields
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
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
Who is online
Users browsing this forum: [Ccbot] and 0 guests