Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "start": [
- { "window": "Primary" },
- { "window": "WindowDock" }
- ],
- "windows": {
- "Primary": {
- "parent": "default:fixed_window",
- "body": [
- {
- // Either "type" or "def"
- // "type" loads a registered template
- // "def" loads a widget definition from "widgetDefinition"
- // All other properties must begin with 'p:' and are defined by templates
- "type": "default:window_root",
- "prop:children": [
- { "def": "Editor" },
- { "def": "Toolbox" }
- ],
- "prop:layout": "ShareWidths"
- }
- ],
- "properties": {
- // Calls functions
- "position": ["default:centralize_x", "default:centralize_y"],
- "dimensions": ["C2/3Width", "C3/5Height"]
- }
- },
- "WindowDock": {
- "parent": "default:window_dock",
- "properties": {
- "position": ["default:centralize_x", "default:align_bottom_y"],
- "dimensions": "inherit"
- }
- }
- },
- // Function name must start with a Capital letter
- "functions": {
- "C2/3Width": {
- // This function template returns double by defualt
- "function": "default:calculate",
- // Poland expression
- // $XXX are environmental variables filled in when constructing the GUI
- "param:expr": ["*", "$SCREEN_WIDTH", ["/", 2, 3]],
- // Force casting function result
- "param:return": "int"
- },
- "C3/5Height": {
- "function": "default:calculate",
- "param:expr": ["*", "$SCREEN_HEIGHT", ["/", 3, 5]],
- "param:return": "int"
- },
- "ShareWidths": {
- "function": "default:grid",
- "param:layout": [
- [1, 2]
- ],
- "param:wportions": [0.8, 0.2],
- "param:hportions": [1]
- },
- "CheckRegistry": {
- "function:": "default:call_method",
- "param:method": "jsonui.exmaple.registry.RegistryHandler.getInstance"
- }
- },
- // Widget definition must start with a Capital letter
- "widgetDefinitions": {
- "Editor": {
- "type": "default:class_definition",
- "prop:class": "jsonui.example.cad.CADEditor"
- },
- "Toolbox": {
- "type": "default:box/strict_table",
- "event": {
- "onInitialAttach": [
- // Supports both reference and inline functions
- "CheckRegistry",
- {
- "function:": "default:call_method",
- "param:method": "jsonui.example.cad.CADToolbox.addToolboxOptions"
- }
- ]
- },
- "prop:growDir": "down",
- "prop:overflowDir": "right",
- "prop:margin": {
- "top": 4,
- "right": 4,
- "bottom": 4,
- "left": 4
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement