Professional Documents
Culture Documents
MS3D Appmenu Readme
MS3D Appmenu Readme
--------
OVERVIEW
--------
The APPMENU INI files are used for installing menu entires onto the
"MineSight" application menu of MS3D. You can control what your menu
looks like for all projects or on a project by project basis.
Modifications of this file should only be done if you know what you are
doing, so always MAKE A BACKUP!
--------------
SPECIFICATIONS
--------------
VARIABLE SUBSTITUTIONS
----------------------
At runtime certain items are known, and when the INI file is loaded it
will perform variable substitutions using the $(var) notation. For
example, consider that you want to launch a program, and supply the
project directory,
::
...
program=doozle_drap.exe
args="$(ProjectDir)"
...
::
doozle_drap.exe "C:\projects\BigGoldMine"
VARIABLES
.........
$(Config)
$(MEDEXE)
$(MS3DProcessDir)
$(ProjectDir)
Points to the directory that was selected on the MS3D Splash Screen.
$(ResourceDir)
Your application menu may want to either make a single menu entry or it
may want to specify a submenu. You can handle this by specifying more
than one entry in the "menu/list" entry. As in,
::
; Example of a submenu
[menu]
title = Economic Planner (MSEP)
mnemonic = E
requires = any
list = msep_compass, msepc
Where the list will give the full specifications for the menu entry. In
this case there would need to be [msep_compass] and [msepc] sections.
If you just wanted to have a single entry (i.e. no submenu), you would
do the following,
::
Then there would exist an [msda] section that had the full configuration
options.
COMMON ENTRIES
--------------
**type, required**
This indicates what type of menu entry you have. See the `ENTRIES
BASED ON TYPES`_ section for a list of available types.
**title, required/optional**
**mnemonic, optional**
**requires, required/optional**
The following specifications are type specific. Any given section needs
to have certain entries defined based on its type.
compass_group
.............
This specifies that you wish to open a specific menu and a specific
group on the Compass Dialog. A compass_group type should have the
following entries,
**mnu, required**
This is the name of the MNU file for searching for a group. If
the MNU file is not found, a warning is posted to the MS3D
Message Box, and MSCOMPASS is "just opened".
**group, required**
This is group to select from the supplied MNU box. This group
will be active when you select this menu entry. The
group name is case sensitive.
**default_group, required**
**searchdirs, required**
exe
...
**program, required**
**args, optional**
These are args that are applied to the given program. Tip, use
the "ini" variables to get interesting results (see "Variable
Substitutions" above).
**searchdirs, required**
**is_recurse_search, required**
**is_dotnet, optional**
**reg, optional**
**reg_key, optional**
function
........
**function, required**
msge
....
**script, required**
This is the script file name that we are too search for.
**searchdirs, required**
**is_recurse_search, required**
-------------
ERROR LOGGING
-------------
--------
EXAMPLES
--------
SUB-MENU
--------
::
[menu]
title = My Applications
mnemonic = M
requires = any
list = fizzle_wizzle, fuzzle_goozzle
[fizzle_wizzle]
type=exe
title=Fizzle Wizzle
mnemonic=F
requires=any
program=fizzle_wizzle.exe
searchdir=$(MS3DProcessDir)\my_apps, $(MEDEXE)\my_apps
is_rescurse_search=false
is_dotnet=false
[fuzzle_goozzle]
type=exe
title=Fuzzle Goozzle
mnemonic=F
requires=any
program=fuzzle_goozzle.exe
searchdir=$(MS3DProcessDir)\my_apps, $(MEDEXE)\my_apps
is_rescurse_search=false
is_dotnet=false
::
My Applications->Fizzle Wizzle
Fuzzle Goozzle
::
[ms3d.exe dir]\my_apps
[%medexe%]\my_apps
MENU
----
::
[watcha_ma_callit]
type=exe
title=New Watcha Ma Callit
mnemonic=N
requires=watcha
program=watcha.exe
searchdir=$(MS3DProcessDir)\watcha, $(MS3DProcessDir)\watcha_beta,
$(MEDEXE)\watcha, $(MEDEXE)\watcha
is_recurse=false
is_dotnet=true
::
when the user clicks that menu entry, it will find the program in
either,
::
[ms3d.exe dir]\watcha
[ms3d.exe dir]\watcha_beta
[%medexe%]\watcha
[%medexe%]\watcha_beta
First, lets consider what the script will do. In this case the script
will take one parameter -- the project directory -- and print it on a
Tkinter dialog.
.. python::
import sys
import Tkinter
import tkMessageBox
tk = Tkinter.Tk()
tk.withdraw()
tk.deiconify()
tk.lift()
tk.mainloop()
That's the script to print the dialog. Now lets create a "command file"
run python against this script.
::
SETLOCAL
:: Execute
%CALL_PYTHON% %SCRIPTPATH% %*
ENDLOCAL
::
SET MYROOT=%~d0%~p0
::
c:\myproject\python_scripts\my_script.py
\wxWidgets\__init__.py
...other wxWidgets
...files...
.. python::
import wxWidgets
print wxWidgets.__file__
::
c:\myproject\python_scripts\wxWidgets\__init__.py
Now that we have all that defined, lets create our appmenu INI file. In
this case we will create a single entry,
::
[menu]
list=helloworld_project
[helloworld_project]
; It is an EXE project, we are launching Python.exe
type=exe
title=Helloworld Project!
mnemonic=H
requires=anykey
; We want to spawn the command file that we created, since that file
; controls how the data is outputted.
program=helloworld_project.cmd
args=$(ProjectDir)
searchdir=$(ProjectDir)\python_scripts
is_recurse=false
is_dotnet=false
You could have put the :file:`python_scripts` sub directory into the same
directory as :file:`MS3D.EXE`, and get a result that runs across all projects at
a particular site.
::
[menu]
list=em_info
[em_info]
type=msge
title=Python/MSGRAIL Info
mnemonic=P
requires=anykey
script=em-info.py
searchdirs=$(MS3DProcessDir)\scripts, $(MEDEXE)\scripts
is_recurse=false
This will create a menu entry called "Python/MSGRAIL Info" that when
activated will launch the "em-info.py" script as an "Embedded" script.
---
FAQ
---