Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Where to put actions to disable menu/popup items

edited December 2003 in End User
I have some global variables (which are sett up at login) so regardless that
I'd like to enable or disable some menu/popup items:

if NOT ActiveVars.ActiveReportAdmin then begin
//my actions
actDataDict.Enabled:=False;
actASCIIEditor.Enabled:=False; //my actions

// rb menu and popu items
mniFileOpen.Enabled:=False;
mniFileNew.Enabled:=False;
mniFileDelete.Enabled:=False;
mniFileRename.Enabled:=False;
ppmFoldersNewFolder.Enabled:=False;
ppmFoldersNewReport.Enabled:=False;
ppmFoldersDelete.Enabled:=False;
ppmFoldersRename.Enabled:=False;
ppmReportsNewFolder.Enabled:=False;
ppmReportsNewReport.Enabled:=False;
ppmReportsDelete.Enabled:=False;
ppmReportsRename.Enabled:=False;
end;

Where to put that code to make all active (enable disable)?

THX!

Benjamin

Comments

  • edited December 2003

    I assume you are trying to customize the Report Explorer. You might try
    setting the ReportExplorer.FolderOptions and ItemOptions prior to calling
    ReportExplorer.Execute.

    You can also replace the explorer form with a customized one. Form an
    example, see ...\RBuilder\Tutorials\Complete\II. Applications\04. End-User
    with Custom Explorer


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2003
    Does it mean that regardless in (let us say) initialization part, where I
    declare that popupItem is diasabled, it is eneabled everytime refresh ... I
    do not get it?
    I thought that in OnCreate is enough..but wrong, then I tried in
    Initialization...all OK except "design menu item"...
    What I want is to disable some menu items (and popupMenuItems as well) for
    all time while custom Report Explorer is opened. In my case it is the same
    user so privileges are not changed during the time.
    I hope my problem i smore clear now.
    THX!

  • edited December 2003

    I do not understand exactly what you trying to accomplish. Try the two
    approaches that I suggested. You may need to trace the RB source code to
    determine the exact timing. Modify the Delphi library path from RBuilder\Lib
    to RBuilder\Source and can trace the code and deetermine exactly what is
    happening.





    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2004
    I just thought this:
    When I put some aditional menus and buttons on toolbar, I need to change
    "TppReportExplorer.Initialize" function from "ppRptExp.pas".
    But when I do that I need to recompile some other dependecies units...so
    this ead me to dead end.

    If I have some actProperties (assigned to some new menus and new buttons)
    where to put such a thing and stay compatible with future versions...

    THX!

  • edited January 2004

    Rather than modifying TppReportExplorer, try writing your own code to
    manipulate the Designer.Menu items.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.