Recent

Author Topic: [BUG CONFIRMED] Color Property TCheckBox and TRadioButton  (Read 8018 times)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
[BUG CONFIRMED] Color Property TCheckBox and TRadioButton
« on: February 16, 2013, 12:35:11 pm »
Hi I had tried a lot but it does not works for me,

Checkbox1.Font.Color:=clRed; 
Radiobutton1.Font.Color:=clRed;

Windows 7 SP1 and Windows XP Sp3.
Lazarus 1.0.4 fpc 2.6.0

Is there any other way to implement this.


Update:

Bug Reported : http://bugs.freepascal.org/view.php?id=23905

Please help, which svn version is good enough for this task, so i can continue with development.
« Last Edit: February 17, 2013, 11:38:50 am by deepaak99 »
Holiday season is online now. :-)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Color Property TCheckBox and TRadioButton
« Reply #1 on: February 16, 2013, 01:12:52 pm »
Droping those components on a form and changing the font.color property from the object inspector I did not see any problem the color is shown correctly on the designer at least
Lazarus 1.1 r38674 FPC 2.6.1 i386-win32-win32/win64 on win7 32bits.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Color Property TCheckBox and TRadioButton
« Reply #2 on: February 16, 2013, 01:24:37 pm »
It is related to themes and Windows version.
For example when I implemented the filter support for options dialog in Lazarus, I first used a distinctive font color to indicate matches.
Unfortunately it did not work on Windows for me and for many others, but it worked for some people. On Linux it worked always.
Anyway, I had to change it for Bold-Italics text which worked always.

If someone knows how to fix it, I would be happy to hear.

Juha
« Last Edit: February 17, 2013, 02:02:20 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Color Property TCheckBox and TRadioButton
« Reply #3 on: February 16, 2013, 02:07:01 pm »
Droping those components on a form and changing the font.color property from the object inspector I did not see any problem the color is shown correctly on the designer at least
Lazarus 1.1 r38674 FPC 2.6.1 i386-win32-win32/win64 on win7 32bits.


Is lazarus 1.1 is release version
Holiday season is online now. :-)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Color Property TCheckBox and TRadioButton
« Reply #4 on: February 16, 2013, 02:52:02 pm »
The latest release of lazarus is 1.0.6 I'm using a daily build until the fpc 2.6.2 comes out and lazarus makes a release with it, I'm waiting it out.
« Last Edit: February 16, 2013, 02:54:35 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Color Property TCheckBox and TRadioButton
« Reply #5 on: February 16, 2013, 04:55:18 pm »
The latest release of lazarus is 1.0.6 I'm using a daily build until the fpc 2.6.2 comes out and lazarus makes a release with it, I'm waiting it out.

Is it safe to use daily build in product development .

It is really a good news, hope it is released soon.

Which daily version is good, please mention
Holiday season is online now. :-)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Color Property TCheckBox and TRadioButton
« Reply #6 on: February 17, 2013, 04:27:05 am »
Is there any workaround in lazarus 1.0.6 (FPC 2.6.0) for this problem.
Holiday season is online now. :-)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Color Property TCheckBox and TRadioButton
« Reply #7 on: February 17, 2013, 09:57:18 am »
If it is theme based as juha said then I do not think that a newer Lazarus version will help. I have themes disabled on my laptop it is not powerful enough to support them. You can disable them and test on your system to find out.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Color Property TCheckBox and TRadioButton
« Reply #8 on: February 17, 2013, 10:40:13 am »
If it is theme based as juha said then I do not think that a newer Lazarus version will help. I have themes disabled on my laptop it is not powerful enough to support them. You can disable them and test on your system to find out.


I am thinking to subclass the window and override the WM_CTLCOLORSTATIC Message. But it also failed.
Holiday season is online now. :-)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Color Property TCheckBox and TRadioButton
« Reply #9 on: February 17, 2013, 10:57:20 am »
I am unable to subclass this control, Why


Code: [Select]
function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam; lParam: LParam):LRESULT; stdcall;
var
 hdcStatic : HDC;
Begin
  case uMsg of
       WM_CTLCOLORSTATIC:
         Begin
           hdcStatic := HDC(wParam);
           SetTextColor(hdcStatic, RGB(23,73,107));
           SetBkColor(hdcStatic, RGB(0,0,0));
           result := LRESULT(GetStockObject(NULL_BRUSH));
         End;
  End;
   result:=CallWindowProc(PrevWndProc,Ahwnd, uMsg, WParam, LParam);
End; 

Holiday season is online now. :-)

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: [BUG CONFIRMED] Color Property TCheckBox and TRadioButton
« Reply #10 on: February 17, 2013, 11:39:20 am »
Please help, which svn version is good enough for this task, so i can continue with development.
Holiday season is online now. :-)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: [BUG CONFIRMED] Color Property TCheckBox and TRadioButton
« Reply #11 on: February 17, 2013, 11:55:10 am »
Strange question. Why don't you just use trunk?

You can always have another stable Lazarus installed with a different primary-config-path. See the wiki articles on installing Lazarus side by side.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Color Property TCheckBox and TRadioButton
« Reply #12 on: February 17, 2013, 02:00:29 pm »
I am thinking to subclass the window and override the WM_CTLCOLORSTATIC Message. But it also failed.

Did you understand what people explain to you about Windows themes?
Did you try to change / disable them?

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

lainz

  • Guest
Re: [BUG CONFIRMED] Color Property TCheckBox and TRadioButton
« Reply #13 on: February 17, 2013, 02:55:57 pm »
If you want to use custom colors and ensure that the final user will see them, and don't worry if the user has themes or not use Custom Drawn Controls.

There is a theme with uses images and is really easy to modify (just change the images):

http://wiki.lazarus.freepascal.org/BGRAControls#Custom_Drawn_Windows_7

Or do your own theme.

Custom Drawn comes with Lazarus, is an official package, just install it and rebuild lazarus, and is in the components folder.

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: [BUG CONFIRMED] Color Property TCheckBox and TRadioButton
« Reply #14 on: February 19, 2013, 07:00:21 am »
Strange question. Why don't you just use trunk?

You can always have another stable Lazarus installed with a different primary-config-path. See the wiki articles on installing Lazarus side by side.

Using the latest trunk Lazarus 1.1 40350M with FPC 2.6.1

The results are same.  :(

I had found that when changing the parent background color changes the checkbox/radiobutton background color successfully, but this is not possible from property editor/code.

If some how parent font color can be applied to checkbox/radiobutton font.color, then it will help a lot. Same as parent background color.
« Last Edit: February 19, 2013, 07:07:58 am by deepaak99 »
Holiday season is online now. :-)

 

TinyPortal © 2005-2018