Graeme Geldenhuys ha scritto:
On 4/17/07, Giuliano Colla <[EMAIL PROTECTED]> wrote:

Back to business. I've got exactly the same problem, but for me, with
GTK1, changing the TEdit background color works just fine. Doesn't it
work for you?


Hey, progress!!!  It didn't work 2 weeks ago.  :-)

It's still not 100% though.  At least now the TEdit is consistent with
other controls that have the same bug.
http://www.freepascal.org/mantis/view.php?id=7555

I can change the background to a select few colors, but can't set it
back to the default clWindow.  See attached screenshot. The top edit
changed color when I blanked the field, but as soon as I entered data,
it should have changed to clWindow, which it didn't.

This is true for all the controls I've tested.

My workaround: get the Hex value for the default color, and use it instead. In place of clBtnFace I use $E0E0E0, in my environment.
But if you must check the property later, you must set the color twice:

Widget.color := $E0E0E0; // Changes the color
Widget.Color := clBtnFace; // doesn't change anything but sets the property consistently with the color shown.

Cheer up, the road is long and full of sharp stones, but we'll make it!

Giuliano

P.S. I tried to set all conceivable fields of WindowsStyle to the desired color, but the result is always the same. The only workaround available is: 1) Form1.Color := clWatever; // this sets the form property which is seen by ParentColor of children widgets 2) Application.ProcessMessages; (otherwise the change is deferred, and the form goes back to the original color)
3) Form1.Canvas.Color := clWatever;
4) Form1.Canvas.FillRect(0,0,width,height);



Giuliano

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to