Library
5.00 Library:
The library/common directory contains the files used to implement scaling and theming of scripts utilizing the Lokasenna GUI library, and the dh_Toolkit library. The library/classes directory contain modified Lokasenna classes (see Classes section).
5.00.1 library/common directory
dh_Toolkit_core.lua:
This module is the heart of dh_Toolkit. It manages the scaling of the script window, managing themes, scaling fonts, and saving and loading the settings pertaining to both. It also contains the color functions used by some of the classes. It provides a "Preferences" window for choosing scaling and themes. For proper usage refer to the highly commented dh_Template files in the "scripts" directory.
This file also contains some utility functions that may be of use to adeveloper. See the file for further explanation. The most likely to be used by the developer are:
function DHTK.return_focus_to_reaper()
function DHTK.hash_table_length(t)
function DHTK.table_index_from_value(tbl, val)
function DHTK.validate_name(name, show_msg)
There are several other functions which are used by dh_ThemeDesigner which are made public. You probably won't need to use them, but see file for description.
dh_Toolkit_themes.lua:
This module contains several pre-defined themes, and the functions for handling colors and setting the theme. You probably will not need to directly access any of these.
gui_overrides.lua:
Although I attempted to develop dh_Toolkit without making any modifications to the Lokasenna GUI, I eventually found it necessary. The Lokasenna text elements classes do not reuse their drawing buffers if re-initialized while a script is running. This can result in a script crashing due to a lack of buffers. I have overridden those classes' init( ) functions to overcome that.
GUI.GetBuffer( ) function limits buffer assignment to the range of 1023 to z-layer max + 1. This made no sense to me. Buffers shouldn't need to be tied to z-layers. So I have also overridden that function. Ideally, I think the Lokasenna GUI should be updated, but in the interim this works fine.
This file needs to be loaded after the Lokasenna classes are loaded.
5.00.2 library/classes directory
dh_Toolkit defines element classes derived from the Lokasenna classes. They differ mainly with renaming of some property names, and/or default colors, and in some cases additional properties and functionality. They are prefixed with "dh_". For basic functionality and usage of the Lokasenna GUI and its classes refer to its website. Any differences are noted on page "4.02 Classes".