TOPIC: overrule system values
#1920
overrule system values 3 Months, 2 Weeks ago
sometimes I need to overrule system value, for example color of readonly fields if I like to have a white and not grey color. Now i can change the system value in stdlib, or subclass object and overrule the method. But I wonder is there easier way to it, not changing stdlib or needing subclass?
 
 
#1921
Re:overrule system values 3 Months, 2 Weeks ago
It depends on the control. FieldControl has textcolor and bgndcolor options. e.g.

Window(#(Field bgndcolor: 0x0000ff, textcolor: 0xff0000))

(Because of byte order, if you specify colors with 0x the order is reversed, it is BGR instead of RGB.)

Other controls may not have these options, but if they inherit from FieldControl it shouldn't be hard to accept the options and simply pass them to FieldControl in the super call in New.
 
 
andrew
 
#1923
Re:overrule system values 3 Months, 2 Weeks ago
I can use the text/bg settings, but in case of readonly bgcolor is still made grey. I used subclass and added:

CTLCOLORSTATIC(wParam, lParam)
{return .CTLCOLOREDIT(wParam: wParam, lParam: lParam);}

this works but the fields change in shape so the layout is not correct any more.

Maybe is not possible and should except greyed out fields. This is also true for window colors then?

Thanks so far!!
 
 
#1926
Re:overrule system values 3 Months, 2 Weeks ago
I have not tried to change the read-only color. It is probably possible but might be tricky. I am not sure why the field would change in shape.

The Window and Dialog background colors come from the window class. Some standard window classes are registered in stdlib Init, but you can register additional ones. Normally we use COLOR.BTNFACE for the background. This will be affected by the user's color settings in Windows.
 
 
andrew
 
#1928
Re:overrule system values 3 Months, 1 Week ago
Ok also think that following windows settings is best, just would like to make possible for user to make personal settings in application. one other way to change color of control is by use background image, also works but may eat to many resource.

Oh one more question: i looked for modeless dialog but it seems not possible. Correct?

Thanks...
 
 
#1930
Re:overrule system values 3 Months, 1 Week ago
I started a new thread for the modeless dialogs.
 
 
andrew