I have created this ribbon with BGRA Controls.
The panels are defined as TBCPanel. The buttons are defined as TBCButton.
Every time I click on a button that opens a new part of the ribbon I add 1 to the tag of that panel.
I do this so I know which TBCPanel is active.
With this next procedure I activate and deactivate the correct part of the ribbon.
procedure TForm_Lint.Lint_Aanzetten(mTag: Integer);
// mTag keeps track of which level of the ribbon is visible
// 0 = Main Ribbon
// 1 = 1 form is open, ribbon 0 Does not work
// 2 = 2 forms open, ribbon 0 & 1 do not work
// 3 = 3 forms open, ribbon 0,1 & 2 do not work. Etc...
var i: integer;
begin
for i := 0 to ComponentCount-1 do begin
if mTag <> 99 then
if Components[i].InheritsFrom(TBCPanel) then begin
TBCPanel(Components[i]).Enabled := Components[i].Tag = mTag;
end;
end;
end; // Lint_Aanzetten
How can I change the colours of the non-active parts of the ribbon so that it is more clear which part of the ribbon is actually active?
For demonstration purpose let's say:
IF TBCPanel is not active THEN
Change all colours of the TBCButtons in that TBCPanel to RED
ELSE
Change all colours of the TBCButtons in that TBCPanel to BLUE;