Topic: Color coding panels

Hi all,


I was trying to add color coding feature to panels using EHW script but couldn't make it work. Could anybody help please.


Sample project attached:

Post's attachments

Attachment icon Moving Panels and Color.zip 17.77 kb, 225 downloads since 2020-12-23 

Adam
God... please help me become the person my dog thinks I am.

Re: Color coding panels

Adam,
In your SETTINGS table you have multiple records. You are checking for colors in record id of 1, but record id of 1 does not exist. I changed the record id 2 to 1 and this corrected it. But since all panel colors did not have values, it was causing an error. I put an IFNULL in your SQL statement to get around this error.

Post's attachments

Attachment icon Moving Panels and Color Corrected.zip 350.65 kb, 227 downloads since 2020-12-23 

Re: Color coding panels

ehwagner wrote:

Adam,
In your SETTINGS table you have multiple records. You are checking for colors in record id of 1, but record id of 1 does not exist. I changed the record id 2 to 1 and this corrected it. But since all panel colors did not have values, it was causing an error. I put an IFNULL in your SQL statement to get around this error.


Hi EHW,
Thank you very much for your kind help...
Unless, I'm doing something wrong, records 55555.. and 6666.. colors seems to stay same even after changing colors of say record 666.. Panel colors are not record specific atm.

Adam
God... please help me become the person my dog thinks I am.

Re: Color coding panels

Adam,
It was a little confusing to me. Your code is only retrieving values from one record in the SETTINGS table even though you have multiple records in there. So if you want to have multiple settings then you need to retrieve the corresponding values based on the selected row in your tablegrid. See attached for fix.

Post's attachments

Attachment icon Moving Panels and Color Fixed.zip 350.86 kb, 253 downloads since 2020-12-24 

Re: Color coding panels

Thanks a lot EHW...............
Great stuff as usual... Truly appreciated..........

On new record previous record colors were displayed on form2. I added the following under Fom2 onShow to overcome

If Form2.dbAction = 'NewRecord' then
  begin
  Form2.PanelColPanel01.Color := $00D3D3D3;
  Form2.PanelColPanel02.Color := $00D3D3D3;
  Form2.PanelColPanel03.Color := $00D3D3D3;
  Form2.PanelColPanel04.Color := $00D3D3D3;
  end;

Merry Christmas and Happy New Year to you and ALL....

Adam
God... please help me become the person my dog thinks I am.