I have a few irons in the fire as far as EEGUI is concerned.
I have never been quite happy with hard-coding "look and feel" stuff, so I am putting in a text initialization file reader type of thing...
Basically, it's a pretty standard implementation of what you'd see normally for this sort of thing. guiControlBase now has the function "LoadControlDefinition(String)" that accepts a file path/name as the parameter... that file is read, and parsed line by line.
There is an overridable function "ParseLine", so derived classes should override it and set up a select/case statement like the one in guiControlBase to properly parse lines var/val pairs for the derived class. Your overridden ParseLine function should also call the base.ParseLine in the "case else" situation that the line could not be parsed in the derived class.
I have written a few helper functions to parse certain types of lines:
ParseBool(String)
ParsePoint(String)
ParseRect(String)
ParseColor(String)
Each of these functions should be used when parsing the VALUE of a line, for any of these particular data types.
- Standard commenting applies... meaning "// this is a comment" will get parsed out, whether it's on its own line, or at the end of any other line.
- Variables are on the left, then an equals sign, then the value.
- Whitespace is trimmed, so a line can be "width=100" or "width = 100"
- One line, one var=val pair.
- Boolean values can be {"y" or "n", "yes" or "no", "1" or "0", "true" or "false"}
- Points, sizes, and rectangles are colon separated. "x:y", "width:height", (rectangle) "left:top:width:height"
- All string comparisons are done using ".tolower" on both sides, so caps doesn't matter.
- Colors are all formatted: "r,g,b,a", and are converted to Singles
- All Enum value strings are the same as the internal Enums (eg: ToolTipDirection=BelowRight)
guiControlBase has, so far...
STRINGS"name"
"tagstring"
"tooltip"
"texture_base"
"texture_mouseover"
"texture_mousedown"
"texture_selected"
"texture_disabled"
BOOLEANS:
"enabled"
"allowfocus"
"allowmouseover"
"ismodal"
"suppressmodalinput"
"iscircular"
"canbedragged" (Array of 4, comma delineated)
"allowdroppedobjects"
"visible"
"texture_base_enabled"
"texture_mouseover_enabled"
"texture_mousedown_enabled"
"texture_selected_enabled"
"texture_disabled_enabled"
"alwaysontop"
"bringtofrontonfocus"
SIZES/POINTS"snaptolocation"
"size"
"maxsize"
"minsize"
"position"
"rectangle"
NUMERICAL (single number)"tagid"
"taborder"
"tooltipdelay"
"movedistancebeforedrag"
"delaybeforedrag"
"clickdelay"
"dblclickdelay"
"alpha"
"height"
"width"
"top"
"left"
ENUMS"tooltipdirection"
"dragbehavior"
"dropbehavior"
COLORS"texture_base_overlaycolor"
"texture_mouseover_overlaycolor"
"texture_mousedown_overlaycolor"
"texture_selected_overlaycolor"
"texture_disabled_overlaycolor"