Create own Controls

Jan 4, 2012 at 9:54 PM

Is there a way to create a own Control? I have manage to create a Control but I don't know how to render the Control.

Jan 9, 2012 at 8:27 AM

I did found it now. When I started browsing the source code.

Coordinator
Jan 10, 2012 at 8:53 AM

Hi!

Sorry for the late answer, I'm in a lot of stress currently.

Glad you found it, but just for completeness, I'll write how I designed it: the GUI has a logical control tree (which manages state, but doesn't know anything about graphics) and a visualizer (which takes care of drawing - currently there's only the FlatGuiVisualizer which renders classical 2D controls with stateless renderers)

  • You can derive from existing controls and if no special renderer is provided for the derived control class, the base classes' one will be used, allowing you to change behavior without even coming into contact with the rendering code
  • You can write your own control renderers for the FlatGuiVisualizer and make them known by adding your assembly to the list of searched assemblies in the visuaizer's repository. This way, you can add completely custom controls without changing a single line of code in Nuclex.UserInterface
  • Finally, you can also write your own visualizer. This enables you to render controls in whatever way you wish, be it in an 80x25 text interface or as 3D objects. It's also the most difficult option, naturally :)
Jan 10, 2012 at 3:24 PM

I love how you have done it, but I would love to see more documents on here. So it is easier to find everything, I did give up for some few days due to I diden't wan't to mess with a such compex code. But when I finaly did I understand it really fast. But it would be nice with some documentations or exemples.