Topic: File menu

I would like to disable "Settings" and "About" in the file menu before distributing an application to the end user.
Very unusual not being able to customize the file menu.

Re: File menu

Thanks !

Re: File menu

Hello Roger

If you want hide original menus to replace them with your own menus, I can send you my own script to do that

JB

Re: File menu

Yes please. I have sent you a mail.

Re: File menu

Hello Roger

Please find in attachment my zipped menus
Sorry, words are in French, but you will adapt them without difficulty according to your needs.
If any question, no hesitation, send me a message on  forum.
If any problem, I can translate french terms if this can help you.

JB

Post's attachments

Attachment icon Menus.zip 333.38 kb, 556 downloads since 2015-11-16 

Re: File menu

Perfect !
Thanks a lot.

Re: File menu

I have used a script for disabling the file menu in one form, but when I added another form trying the same it failed.

procedure Fleverandorkontakt_OnShow (Sender: string; Action: string);
begin
  Fleverandorkontakt.mniAbout.Visible := False;
  Fleverandorkontakt.mniOptions.Visible := False;
  Fleverandorkontakt.TableGrid1.BestFitColumns(bfBoth);
end;

procedure Fkontraktsansvarlig_OnShow (Sender: string; Action: string);
begin
  Fkontraktsansvarlig.mniAbout.Visible := False;
  Fkontraktsansvarlig.mniOptions.Visible := False;
  Fkontraktsansvarlig.TableGrid1.BestFitColumns(bfBoth);
  //Fkontraktsansvarlig.TableGrid1.Visible := False;
end;


SCRIPT ERROR MESSAGE: Undeclared indentifier:'mniAbout'

When I commented the lines out the application triggered a message for the procedure itself.
Obviously some variable declaration missing, but how do I fix it ?

Re: File menu

roger
Menu present only on Main form, do you have menu on another form?

Dmitry.

Re: File menu

Hi Roger,

You only need to disable the file menu options once, on the first form that is called when you run your application.  So, your script would typically read as follows:

procedure Form1_OnShow (Sender: string; Action: string);
begin
  form1.mniAbout.Visible := False;
  form1.mniOptions.Visible := False;
  form1.mniFile.Visible := False;
end;

The menu options on Form1 and any other form are now all removed.

Hope this helps,
Derek

10 (edited by roger 2015-12-08 16:39:19)

Re: File menu

OK, but when I remove the procedure for the second form the application goes bananas complaining about missing identifier for the next (previously working procedure).

Re: File menu

roger
Please attach your project (zip file without exe and dll)

Dmitry.

Re: File menu

Enclosed, but now I have cleaned up other code in order to try fixing the problem. I just got worse.

Post's attachments

Attachment icon project.zip 5.48 kb, 477 downloads since 2015-12-09 

Re: File menu

roger wrote:

Enclosed, but now I have cleaned up other code in order to try fixing the problem. I just got worse.

I don't get any error messages in your project, how to reproduce the error?

Dmitry.

Re: File menu

Just RUN and the message comes up.

Post's attachments

Attachment icon Skjermbilde.JPG 54.78 kb, 265 downloads since 2015-12-09 

Re: File menu

I see that you commented this line (attached project without commented this line):

//sHello: string; 

You should to comment and this line (first line in your code), because after keyword var variables must be declared:

var
Dmitry.

Re: File menu

That doesn't change the problem. See screen cut.

Post's attachments

Attachment icon Skjermbilde.JPG 36.46 kb, 296 downloads since 2015-12-09 

Re: File menu

In your attached project there is no this code, please attach actual your project.

Dmitry.

Re: File menu

OK

Post's attachments

Attachment icon project.zip 6.11 kb, 450 downloads since 2015-12-09 

Re: File menu

Hi Roger,
I think the problem could simply be the sequence in which your forms are held.
I downloaded your project and encountered the same problem as you. 
When I switched the sequence of the forms, the error is corrected (see roger.jpg).
Maybe this helps.
Derek

Post's attachments

Attachment icon roger.jpg 162.95 kb, 265 downloads since 2015-12-09 

Re: File menu

You are right, but should it be like this ?

Re: File menu

The fixed project.

Post's attachments

Attachment icon project_fixed.zip 7.89 kb, 493 downloads since 2015-12-09 

Dmitry.

Re: File menu

Trying to use the menuline for shifting between forms, but I can't get it right.

Post's attachments

Attachment icon project.zip 34.14 kb, 470 downloads since 2015-12-10 

Re: File menu

roger wrote:

Trying to use the menuline for shifting between forms, but I can't get it right.

Check out this example, how to create mainmenu on other form
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: File menu

The example does not show swapping forms using a file menu.
Form1 shows Form2 by the use of a button.

My goal was having the same file menu on all forms in order to swap between them.

Re: File menu

If you plan using only buttons with standard actions like "New Record, Show Record, Show Form", you can't freely switching between forms, because using modal forms (https://en.wikipedia.org/wiki/Modal_window)


You can switching between forms if you will use script to shows forms, like:

Form2.Show;
Dmitry.