Where to put actions to disable menu/popup items
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
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
This discussion has been closed.
Comments
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
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!
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
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!
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