After I designed wrote and finished my program. I did it all over again, this time changing a few things then rewrote it all over again, just cuz in a matter of a few hours. Which is why I chose Pascal and Lazarus as I tinkered with Delphi a long time ago and found how much easier and faster it is to write a program then C++.
In making this different prototype of my program (or perhaps final make before I release it onto the world) I was looking over the LCL then found the TColorButton, then decided to see what it does. To replace the TButton, TShape, and ColorDialog I was using to show what color the user picked.
After I figured out how to use it with the ColorDialog I wrote my code like this, to set a variable to the color picked and have it show on the button instead of a TShape:
var
clr1 : TColor;
....
procedure TForm1.Color1_bnClick( Sender: TObject) ;
begin
clr1:= color1_bn.ColorDialog.Color;
end;
Then when I tested it out to set the Desktop background color on my desktop I found that the button does show the color that I just picked, then when I set the color on the desktop it is the color I picked before and not the one I just picked, then in changing it to a different color again, it then sets the last color picked making the variable one color behind the TColorButton color. It always changing the desktop color to what ever color I pick before changing it to a different color.
I do not think this is a bug persay, only that it is a opps programming error perhaps (pun intended) , if they intended this Color Button to do more then just set a color in the button itself. As a button just doing that I see no real use for it.
I do see a use for it in the way that I am trying to use it .Having something else change to the same color that the Button shows that was picked with a ColorDialog. As it doess set a variable to a color that was picked then logic says this is what it is intended for and that whoever wrote this forgot to have it update the return fully all the way through past the button itself into the last "object" to the left. Because this works.
clr1:= color1_bn.ColorDialog.Color;
As the Variable is "connected" to the ColorButton then to the ColorDialog.Color and it does receive a color picked from the ColorDialog. If it was not intended to do this then it would throw an error, I'd think.
Therefore the TColorButton should then set the variable at the same time and to be the same color that the user sets the color that shows on the ColorButton when the color is chosen all at the same time without delay to either of them.
So I do believe that someone made an opps programming error (pun intended) and forgot to have it update the variable at the same time, I would say.
Instead of having the ColorButton hold onto the color until it is changed again then passing the last color it held to the variable when updating the color it shows on the button to a new color.
I know not of a work around for this using the TColorButton, does anyone else? Otherwise I'll just go back to the TButton and ColorDialog and TShape I was using with my other prototype.