5

I have tried lots of methods associated with RibbonApplicationMenuBar to prevent a user from selecting the RibbonApplicationMenuBar with a mouse until the projects settings are loaded from an inifile and a splashform closes. But nothing seems to work to make the RibbonApplicationMenuBar InActive until told otherwise.

The help file shows nothing about many of the properties of RibbonApplicationMenuBar and the help Wiki the same so I am unable to solve this.

procedure TMainForm.FormCreate( Sender: TObject );
begin
  // make theRibbonApplicationMenuBar1 inactive
  RibbonApplicationMenuBar1.Enabled := False;
  RibbonApplicationMenuBar1.Inactive := True;
  RibbonApplicationMenuBar1.Hide;
  RibbonApplicationMenuBar1.AutoFocus := False;
  // read application settings
  ReadIni( AIniFileFilename );
  // show a splash form
  FormSplash := TFormSplash.Create( MainForm );
  // FormSplash.Parent := MainForm;
  FormSplash.Position := poOwnerFormCenter;
  FormSplash.Show;
  FormSplash.Update;
end;


procedure TMainForm.FormShow( Sender: TObject );
begin
  // close the splash form
  FormSplash.RequestClose;
  // Activate the RibbonApplicationMenuBar
  RibbonApplicationMenuBar1.Enabled := True;
  RibbonApplicationMenuBar1.Inactive := False;
  if RibbonApplicationMenuBar1.CanFocus then
    RibbonApplicationMenuBar1.SetFocus;
  RibbonApplicationMenuBar1.AutoFocus := True;
  RibbonApplicationMenuBar1.SelectApplicationButton;
  RibbonApplicationMenuBar1.Show;
end;

Unless the RibbonApplicationMenuBar is inactive the user can select the RibbonApplicationMenuBar before it is ready to be selected. Any suggestions are appreciated. I know all the methods shown here are not correct or possibly out of order... it is just my attempt to prevent the RibbonApplicationMenuBar from becoming active and clickable until the splash form closes.

Thanks,

Bill

stukelly
  • 4,257
  • 3
  • 37
  • 44
Bill Miller
  • 637
  • 10
  • 20
  • Why don't you show the splash screen modally? That will prevent any interaction with any other form. – David Sep 14 '09 at 07:34
  • Microsoft applications ribbonbar does not become active until the application is fully loaded... i am just trying to duplicate that. I do not want a modal splash screen. – Bill Miller Sep 14 '09 at 13:38
  • I'm not using Delphi's ribbon but what about linking ribbon items to actions. Then you can just enable/disable the action, or even hide it. I agree that ribbon UI should not behave that way. – Mihaela Nov 14 '09 at 02:44
  • If you are not satisfied with native Delphi TRibbon, have a look at Erik van Bilsen's [Windows Ribbon Framework](http://www.bilsen.com/windowsribbon/index.shtml). – menjaraz Dec 19 '11 at 06:24

1 Answers1

0

It is enough to set TRibbon.Enabled to False to disable all Ribbon actions (tested with XE3). Easiest way is set it False in design time. Set it back True for example from OnHide of your splash form. Close splash only when all background activities are done.

Andrei Galatyn
  • 3,322
  • 2
  • 24
  • 38