/*""" One sentence function description.
Author: jthi
Creation Date: 2023-11-16
Creation JMP Version: JMP Pro 17.2.0
Description (generally this part is longer explanation about the app): This is part of the template I generally use. I do have different utility
functions which I add through version control as needed and I store my configuration files
separated from this script.
Basic structure for my add-ins/larger tools is:
/my_app
/config
ma_config.jsl
/bin
/externals
ma_utilies.jsl
/doc
my_app.jsl
my_app -> ma prefix. I use this type of prefixes for some of my script names
because JMPs Recent Files shows only the file name, nothing more. This way I can at least
have an idea which config file I'm going to open as I develop many different tools.
/config contains all sorts of configuration files, it could be sql query templates, images,
settings files, specification tables...
/bin contains the scripts which are included to make my_app work
/bin/externals are common scripts/files which I copy as externals (I'm using svn for version control)
as needed (for example generic utility functions, version control functions)
/doc would contain documentation but it is usually empty. User instructions and such
I write to content management system and my code documents itself (mostly). Sometimes
this folder does contain flowcharts or some sort of readme if I feel like those are needed.
Some examples which might (or might not) follow this type of template can be found from community:
- https://community.jmp.com/t5/Discovery-Summit-Europe-2023/Pythonless-Python-Integration-for-JMP-2023-EU-30MP-1265/ta-p/572674
- https://community.jmp.com/t5/JMP-Add-Ins/Analyse-Columns/ta-p/460329
- https://community.jmp.com/t5/JMP-Add-Ins/Enhanced-Sankey-Plot-ESP/ta-p/549745 (different layout)
Todo:
*
*
"""*/
Names Default To Here(1);
app_name = "My App Template";
version_str = "1.0.0";
window_name = app_name || " - version: " || version_str;
help_url = "https://community.jmp.com/";
window_icon = "Distrib"; // Built-in JMP Icons is very helpful for icons
// I either keep the logo in my config folder or store the expression created by
// JMP when I open that (usually I store the expression), for example:
// company_logo = Open("$SAMPLE_IMAGES/tile.jpg", "jpg");
company_logo = Icon Box("JMPLogo") << get picture;
run_app = Expr(
nw = New Window(window_name, Show Menu(0), Show Toolbars(0),
V List Box(align("center"),
H List Box(
Try(Picture Box(company_logo)),
Spacer Box(Size(5,0)),
H List Box(Align(top),
Text Box(app_name, << Set Font Size(22), << Font Color("Red"), << Set Font Style("Bold"), << Set Wrap(500)),
Text Box(version_str, << Set Font Size(11), << Font Color("Black"), << Set Font Style("Plain"))
)
),
Tab Box(
Tab Page Box("Inputs",
// Usually I don't force my tab page box sizes, but if I do, I use Spacer Boxes like this
V List Box(Spacer Box(Size(600, 0)), // Force width using V List Box + Spacer Box
H List Box(Spacer Box(Size(0, 300)), // H List Box + Spacer Box for height
Lineup Box(N Col(1),
Text Box("Some inputs here"), // And content inside this H List Box + Spacer Box
)
)
),
, << Set Base Font("Title")
),
Tab Page Box("Actions",
Lineup Box(N Col(1),
Button Box("OK",
<< Set Icon("RunTableScript")
),
Button Box("Cancel",
<< Set Function(function({this}, (this << top parent) << close window)
)
, << Set Icon("DebuggerAddBreakpoint")
),
Spacer Box(Size(0, 10)),
Button Box("Help", Web(help_url), << Set Icon("WinHelpAbout")),
), << Set Base Font("Title")
), << Set Style("Horizontal Spread")
)
), << Set Window Icon(window_icon)
);
);
run_app;
Write(); // I use Write(); to avoid "returning" the last run line mostly to keep log cleaner