SFML community forums

Help => General => Topic started by: Flash619 on November 01, 2012, 03:46:42 pm

Title: Accepting User Input, and Gui/library recommendations?
Post by: Flash619 on November 01, 2012, 03:46:42 pm
       So I have come to the point in my engine, where I will need the user to input a string into a little box in the window. It seems I have two choices for this, either 1, I can try to create my own mini window and take a crash course on the win32 library functions to try to figure out how to implement and read from a basic text box. Or I can try to find some sort of Library such as Qt or WxWidgets, and use some of their build in functions for it.

         Now having never done any three of the above options, I really was hoping to get some personal input on the subject, as to what you would recommend and possibly why. I do think making my own system for message box's and input would give much more custom control, but at the same time, it seems like a big chance for me to create a lot of inefficient/possibly unstable code because I have never used text box's before, ever. ^^;; The only popup experience I have is a win32 message box that accepts yes or no. >.>

        So yes I would love to hear your input. Like I said if possible I would like to have the box within the window itself, and not another separate popup window. It would basically have two buttons and a text box. Let me know what you think, and huge thanks in advance! :)
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: eXpl0it3r on November 01, 2012, 03:57:14 pm
I can try to create my own mini window and take a crash course on the win32 library functions to try to figure out how to implement and read from a basic text box. Or I can try to find some sort of Library such as Qt or WxWidgets, and use some of their build in functions for it.
Like I said if possible I would like to have the box within the window itself, and not another separate popup window.
Using an GUI library like MFC, Qt or WxWidget won't give you the possibility to have GUI elements on top of the OpenGL/SFML rendering (afaik), thus you can't really use those.
The 'easiest' thing would be to use the OS specific 'message boxes' (or Qt's equivalent), but this would then be a 'pop-up' window, which you don't want.
So this leaves you with the SFML/OpenGL GUIs, like SFGUI (http://sfgui.sfml-dev.de/) (gets my recommendation), TGUI (http://en.sfml-dev.org/forums/index.php?topic=7023.0) or basically anything that can implement an OpenGL renderer (e.g. GWEN (https://code.google.com/p/gwen/) or CEGUI (http://www.cegui.org.uk/wiki/index.php/Main_Page)).
Good luck! :)
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: FRex on November 01, 2012, 04:59:15 pm
I too recommend SFGUI.
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: Flash619 on November 01, 2012, 05:27:53 pm
I can try to create my own mini window and take a crash course on the win32 library functions to try to figure out how to implement and read from a basic text box. Or I can try to find some sort of Library such as Qt or WxWidgets, and use some of their build in functions for it.
Like I said if possible I would like to have the box within the window itself, and not another separate popup window.
Using an GUI library like MFC, Qt or WxWidget won't give you the possibility to have GUI elements on top of the OpenGL/SFML rendering (afaik), thus you can't really use those.
The 'easiest' thing would be to use the OS specific 'message boxes' (or Qt's equivalent), but this would then be a 'pop-up' window, which you don't want.
So this leaves you with the SFML/OpenGL GUIs, like SFGUI (http://sfgui.sfml-dev.de/) (gets my recommendation), TGUI (http://en.sfml-dev.org/forums/index.php?topic=7023.0) or basically anything that can implement an OpenGL renderer (e.g. GWEN (https://code.google.com/p/gwen/) or CEGUI (http://www.cegui.org.uk/wiki/index.php/Main_Page)).
Good luck! :)

This definitively looks interesting! I had never heard of it before, and it looks, amazing. o.o; Thanks a bunch! :D I'll update this later to tell how it went. ^_^
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: FRex on November 01, 2012, 07:53:48 pm
If you liked the old Steam gui(white text, dirty green window bar,dark grey background) you will love how SFGUI looks by default.
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: binary1248 on November 01, 2012, 08:45:40 pm
If you liked the old Steam gui(white text, dirty green window bar,dark grey background) you will love how SFGUI looks by default.
You forgot to mention that it also isn't that hard to theme the look of the widgets since it can be done without a single line of code. I also hate the steam look but I was too lazy to try to convince Tank to change it :D.
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: FRex on November 01, 2012, 08:52:11 pm
I love that look. ;D
Is there any written tutorial about creating own widgets(or about anything except hello world really..)?
I mean, source if fun to read:
Quote
// Get the font face that Laurent tries to hide from us.
// Authentic SFML comment: implementation details
// All your font face are belong to us too.
but some tutorials would be nice. :P
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: eXpl0it3r on November 01, 2012, 10:59:00 pm
Is there any written tutorial about creating own widgets(or about anything except hello world really..)?
but some tutorials would be nice. :P
SFGUI comes with quite a few examples, that possibly show every single widget in use. Should be quite easy to extract the information from those with the help of the doxygen documentation.
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: FRex on November 01, 2012, 11:05:11 pm
Oh yes, I'm a genius and moved only .dlls onto this machine. :-X
Title: Re: Accepting User Input, and Gui/library recommendations?
Post by: Tank on November 02, 2012, 08:24:14 am
Quote
I also hate the steam look but I was too lazy to try to convince Tank to change it
:o

Regarding the documentation: It's something that's seriously lacking in the project, true. The website contains some basic sections about the principles etc. However a good manual/guide is still missing. We're accepting contributions for that, too. ;)