Hello,
I've discovered few months ago what an immediate mode gui was(see
http://sol.gfxile.net/imgui/ for an introduction) and wondered how easy it really was to implement some basic controls. Here is the result of my try. I've coded a very simple gui using this paradigm entirely with SFML(I'm not using any Opengl code, only shapes and text) with the following controls:
button: a push button which display some text
scrollbar: a scrollbar(horizontal and vertical) which supports mouse and wheel movements
textfield: a single line edit text field(can be read-only) which support mouse clicking(but no selection) and some useful shortcuts like end or home
statictext: can display some text without any interaction
checkbox: a two state checkbox which displays some text
listbox: a list box with an automatic scrollbar if necessarywhich support mouse wheel and keyboard
All those controls except the static text have basic support for keyboard focus using the Tab and Alt-Tab combinasion and the Space key to action it(button and check box only) and arrows for movements(list and edit).
Furthermore, you can customize the colors of the controls even if it's not really explained in the code(see the source to understand how it works). I think the code is sufficiently commented to be understood(the header is commented for Doxygen even if there few places where its unfinished).
They are still some things that are not perfect(some come from the immediate mode paradigm) but I've tried to make it as usable as possible. I don't really have time to maintain it because so I post the as-is, feel free to copy and modify it if you want.
Here is a screenshort:
And here is the code(the header is 400 lines long and the code is 1200 lines long)
http://amaury.pouly.free.fr/Public/SfmlIMGui.zipI would also appreciate some feedbacks.