ChrisS85/CGUI — pull request #51 by maul-esel (2012-09-24 16:35:04+00:00)
Title: Register control classes

Instead of relying on a control class' name (inflexible) and hardcoding classes which implement several controls (even more inflexible), control classes are now registered:

CGUI provides a (static) `RegisterControl(name, class)` method which adds name and class to an object. `AddControl()` then checks that object for the class corresponding to the requested control type.

This allows:

* flexible names for control classes
* registering the same control under several names - dynamically instead of hardcoded
* several controls implemented by one class
* different names for a control (e.g. `"DropDownList"`, `"DDL"`, ...)

The `RegisterControl()` method is now called by the control classes from a static field initialization, but could theoretically be called at any point - from which on the control type is immediately available to the user.