Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Accepting User Input, and Gui/library recommendations?  (Read 3948 times)

0 Members and 3 Guests are viewing this topic.

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Accepting User Input, and Gui/library recommendations?
« 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! :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #1 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 (gets my recommendation), TGUI or basically anything that can implement an OpenGL renderer (e.g. GWEN or CEGUI).
Good luck! :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #2 on: November 01, 2012, 04:59:15 pm »
I too recommend SFGUI.
Back to C++ gamedev with SFML in May 2023

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Accepting User Input, and Gui/library recommendations?
« Reply #3 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 (gets my recommendation), TGUI or basically anything that can implement an OpenGL renderer (e.g. GWEN or CEGUI).
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. ^_^

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #4 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.
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Accepting User Input, and Gui/library recommendations?
« Reply #5 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #6 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
« Last Edit: November 01, 2012, 10:22:28 pm by FRex »
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #7 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #8 on: November 01, 2012, 11:05:11 pm »
Oh yes, I'm a genius and moved only .dlls onto this machine. :-X
Back to C++ gamedev with SFML in May 2023

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Accepting User Input, and Gui/library recommendations?
« Reply #9 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. ;)

 

anything