A script to add a colored dish to the order
When ordering a dish marked with a colored button, the script adds this dish to the order with the same color.
procedure CheckViewOnGetColors(Sender: TObject; CheckItem: TObject; Selected: boolean; var Color, FontColor: TColor); begin if SYS.ObjectInheritsFrom(CheckItem, 'TDish') then begin if (TDish(CheckItem).State = disOpened) then if not Selected then begin Color := Trk7menuitem(TDish(CheckItem).RefItem).VisualType_BColor; FontColor := Trk7menuitem(TDish(CheckItem).RefItem).VisualType_TextColor; end else begin Color := clBlack; FontColor := clWhite; // Color := Trk7menuitem(TDish(CheckItem).RefItem).VisualType_TextColor; // FontColor := Trk7menuitem(TDish(CheckItem).RefItem).VisualType_BColor; end; end; end;