This UDF helps to speed up GUI applications developpement.
It provides functions for:
- Creating GUI directly from KODA .kxf file
- Creating Advanced InputBoxes from a simple JSON definition
- Take a GUI created by either KODA or JSON and use it as a modal Input Dialog
; #FUNCTION# ====================================================================================================================
; Name ..........: _GUIUtils_CreateFromKODA
; Description ...: Parse a KODA Form file (.kxf) and builds a GUI
; Syntax ........: _GUIUtils_CreateFromKODA($sFileOrXML[, $hParent = Null[, $iWidth = -1[, $iHeight = -1]]])
; Parameters ....: $sFileOrXML - KODA file path or content.
; $hParent - [optional] parent GUI handle. Default is Null.
; $iWidth - [optional] override automatic GUI size calculation. Default is -1 for no override.
; $iHeight - [optional] override automatic GUI size calculation. Default is -1 for no override.
; Return values .: Object (scripting.dictionary) representing the GUI
; Author ........: matwachich
; Remarks .......: You can access to GUI hwnd and control IDs and handles by their names (using helper functions).
; GUI size is calculated to fit GUI content. It is not the size defined in KODA (I'm working to fix this).
; Unsupported things (todo):
; - Controls: Graphic, Updown, Avi, Tray Menu, COM Object, Status Bar, Tool Bar, Image List
; - Hotkeys (accelerator)
; Related .......: _GUIUtils_SetAccels, _GUIUtils_HWnd, _GUIUtils_CtrlID, _GUIUtils_HCtrl
; ===============================================================================================================================
You create your GUI normally in KODA
One simple function call
; #FUNCTION# ====================================================================================================================
; Name ..........: _GUIUtils_CreateFromJSON
; Description ...: Creates an InputBox GUI from JSON definition
; Syntax ........: _GUIUtils_CreateFromJSON($vJson[, $hParent = Null])
; Parameters ....: $vJson - JSON definition.
; $hParent - [optional] parent GUI handle. Default is Null.
; Return values .: Object (scripting.dictionary) representing the GUI
; Author ........: matwachich
; Remarks .......: See JSON_Form_Definition.txt and examples.
; ===============================================================================================================================
And here is the result
You can use a simple JSON defintion to create Input Dialog GUIs. See JSON_Form_Definition.txt.
Simple JSON definition
And here is the result
Here is a showcase of JSON definition.
Advanced JSON definition
And here is the result