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

Author Topic: TGUI: a c++ GUI for SFML (with Form Builder)  (Read 286954 times)

0 Members and 4 Guests are viewing this topic.

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #270 on: December 22, 2012, 12:34:05 pm »
Is it really wrong?
According to this and this (which were the two first search results) it is correct to write "Texus's".

I am not a native English speaker, but from what I have read it looks like both ways are correct but "Texus's" is the preferred form.
TGUI: C++ SFML GUI

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #271 on: December 22, 2012, 04:54:40 pm »
Either is correct.  I don't know that there's a preferred form.  It would certainly vary by source, but I think appending the 's' is more common than not since it more closely resembles the actual pronunciation.

Midleiro F

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #272 on: December 23, 2012, 03:43:16 pm »
I really like the new callback system, I think you're in the right track, good luck!

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #273 on: December 23, 2012, 06:36:58 pm »
I decided to no longer wait until sfml2 is finished.

TGUI v0.5 is now considered to be the (first) stable version.

Here is a small summary of the most important changes:
  • New objects
    • ChildWindow
    • SpinButton
    • AnimatedPicture
    • Tab
    • Grid
  • Performance boost (in some situations)
  • Better design, to allow custom objects
  • Unicode support
  • Many bug fixes

Quote
I really like the new callback system, I think you're in the right track, good luck!
Thanks. I will make the development version of v0.6 public as soon as I finish this new callback system.
With a little bit of luck, this can already be in a few days (otherwise it will be February as originally planned).
TGUI: C++ SFML GUI

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #274 on: December 23, 2012, 07:05:52 pm »
Where can I download 0.5 stable? The link on the site is broken. (https://github.com/texus/TGUI/zipball/v0.5-dev)

And a question, is it possible to have a subwindow but that is only managed by tgui? That I can move inside the window and put widgets there? Something like here http://www.mobygames.com/images/shots/l/262890-guild-wars-eye-of-the-north-windows-screenshot-a-sample-of.jpg but of course less fancy. I think that panel may be the thing, but I'm not sure. Do I have to write my own widget?


texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #275 on: December 23, 2012, 07:31:16 pm »
Quote
Where can I download 0.5 stable? The link on the site is broken.
Sorry about that, I forgot to update it. It should be fixed now.

Quote
And a question, is it possible to have a subwindow but that is only managed by tgui?
Yes, that would be the ChildWindow object.
TGUI: C++ SFML GUI

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #276 on: December 23, 2012, 07:58:31 pm »
Great. Your gui is a no-brainer, I'm going to use it for my game. Very easy to use and integrate into my code. Btw, I downloaded master branch snapshot directly from github, is it the same version as the one you have just uploaded on your site?

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #277 on: December 23, 2012, 08:02:26 pm »
Quote
I downloaded master branch snapshot directly from github, is it the same version as the one you have just uploaded on your site?
Yes, it is exactly the same version.
But once I start with v0.6 then the master branch will become v0.6 and a separate branch will be created for v0.5.
TGUI: C++ SFML GUI

Venevus

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #278 on: December 24, 2012, 07:46:32 am »
I have having difficulties with Cmake 2.8.10.2, tgui 0.5, and visual studio 10 express. I hope this is the most appropriate forum in which to ask such a question, but if not let me know. here goes

I have SFML 2.0 working just fine, i did not have to use cmake to make the project files. I've had success before with cmake on another project (box2d)

the problem is I cannot get cmake to work without error for tgui (and other items i've tried) so I suspect something with my visual studio changed, perhaps i am missing a path variable? i have tried to figure out which one, anyways, the error(s) i get with Cmake are as follows
The C compiler identification is unknown
The CXX compiler identification is unknown
Looking for sys/types.h
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
Looking for sys/types.h - not found
Looking for stdint.h
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
Looking for stdint.h - not found
Looking for stddef.h
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
Looking for stddef.h - not found
Check size of void*
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check size of void* - failed
CMake Error at cmake/Config.cmake:14 (message):
  Unsupported architecture
Call Stack (most recent call first):
  CMakeLists.txt:24 (include)


Configuring incomplete, errors occurred!
 

this is from cmake-gui started from the visual studio command prompt,
i've tried looking up most the messages without any clear definite leads
i've tried adding includes for visual c++ to my system path (i do have sys\types.h, its right there with all the others)
i've tried a lot of things for hours over the past few days, so I'm hoping someone can help me even a little because i'm burnt out on google

Thanks in advance

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #279 on: December 24, 2012, 11:17:01 am »
I found a bug in child window - you can move it outside the window, and if you move it up so the title bar disappears you cant move it back and close it. I see 2 solutions:

- function to set if you want childwindow always fully stay in your main window
- ability to move it through alt + hold (but this will be in conflict with linux windows managers, so maybe it's better to move it through LMB + RMB hold)

The solution #1 is often used in MMORPG games. It can be tweaked so for example when you move it to bottom, you can hide it all except title bar etc. but plain simple "stay fully in window" flag would be really great.

I thought I could handle it myself in my code, but I don't see getPosition function in child window :/

What do you think?

In case you will want to fix in 0.6, could you make v0.5.1 with some kind of getTopLeftCornerCoords (including titlebar) for childwindow? It won't break stable API, it will just add new function (many libs do it, I think you don't need the api to be fully frozen in stable branch, it's not widely-used for production library). Altough, I don't see a reason why it won't become widely-used one day!

Please, I really need it in my game. Your GUI is great, but I just need that little problem to be fixed.

Thanks!

EDIT:
And just a little question, do you plan to add a simple menu? I don't know what's the proper english name, but that of a menu like "File" menu, when you press it you have a vertical list with options to choose. Maybe a suggestion for 0.6 :)?

EDIT2:
Oh and another question. Is it possible to have a panel which has fixed height and it's width is always 100% of the window (so it's resize proof)? And vice versa - fixed width and height in %.

I hope that you will find time to answer me :)
« Last Edit: December 24, 2012, 11:47:26 am by netrick »

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #280 on: December 24, 2012, 12:03:37 pm »
I am going to reply very briefly (I had typed a whole message, but because the preview wasn't loading fast enough I pressed F5. Very bad habit, I lost the whole text with it.)

@Venevus
I can't help with the cmake problem. I never had a problem like that (but I don't have the express version).
You could try with cmake directly instead of cmake-gui but I don't know if that's going to help much.
Otherwise the only thing I can think of is try to re-install VS.

@netrick
All objects are derived from sf::Transformable, so they all have a getPosition function.
I will look into a way to keep the child window fully in the window when I have more time. I remember trying this once and for some reason I didn't do it. So I must have hit some problem with this.

MenuBar is planned for v0.6.

Objects don't have the possibility yet to have their size as a percentage of the window so you will have to do this manually. I even doubt that it will be possible in v0.6, but I am going to add it someday.
TGUI: C++ SFML GUI

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #281 on: December 24, 2012, 12:15:45 pm »
Okay, so getPosition + getTilebarHeight is enough for me, thanks.

And as for % size, the best way to do it manually without changing TGUI code is to catch resized event and reload widgets, yes? I won't lose any texts in editbox etc this way?

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #282 on: December 24, 2012, 12:41:59 pm »
Quote
The best way to do it manually without changing TGUI code is to catch resized event and reload widgets, yes? I won't lose any texts in editbox etc this way?
If by reloading you mean call the load function again then you will probably lose some stuff.
You should rather just call the setSize function of the objects.
TGUI: C++ SFML GUI

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #283 on: December 24, 2012, 04:48:06 pm »
Hey, I wrote code to keep child window in window myself. You said you had some problems, so I will post it here just in case. Of course, the code could receive some optimization and you will need to call it in your child window's move function, but here it is:
                if (tgui::ChildWindow * pointer = tguiWindow.get<tgui::ChildWindow>("childWindow"))
                {
                        if (pointer->getPosition().y < 0)
                        {
                                pointer->setPosition(pointer->getPosition().x, 0);
                        }
                        if (pointer->getPosition().x < 0)
                        {
                                pointer->setPosition(0, pointer->getPosition().y);
                        }
                        if (pointer->getPosition().y > window.getSize().y - pointer->getTitleBarHeight())
                        {
                                pointer->setPosition(pointer->getPosition().x, window.getSize().y - pointer->getTitleBarHeight());
                        }
                        if (pointer->getPosition().x > window.getSize().x - pointer->getSize().x)
                        {
                                pointer->setPosition(window.getSize().x - pointer->getSize().x, pointer->getPosition().y);
                        }
                }
 

You will need to wrap it into function (taking name as argument). I call it after updating input and before rendering.
It has wanted behaviour - in top, right and left window border the childwindow must stay fully in window, and it can hide under bottom border but the titlebar will stay in window.  I use separate sfml window (called window) and tgui form (called tguiWindow). This is also segfault proof in case child window was deleted (the first if).

EDIT:
Also, I found a apperance bug in child window moving. When you move your OS windows (by holding titlebar), the mouse is always fixed at one point on the title bar. However in TGUI's child window the mouse moves very clearly when moving, even outside the titlebar. And it goes back to proper place when you stop moving mouse. This looks very inconsistent, could you look into it? If you don't understand me (my english is poor) I can make a video.

Maybe that's because TGUI child window tries to follow the mouse (and smooth it by movement animation) rather than just render at the mouse position (of course, taking in account that mouse position isn't top left corner but some specific point)?
« Last Edit: December 24, 2012, 05:26:45 pm by netrick »

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #284 on: December 24, 2012, 06:12:12 pm »
After seeing that code I remember what the problem was (and still is).

I cannot ensure that the parent object of the child window will be the tgui window. It is perfectly possible that the child window is inside a panel or another child window. The point is that I cannot access the getSize method. With the current design of my gui it is just not possible.

So you will have to do it manually like you are doing it now. All I could do to make it easier is let the child window send callbacks when it is moved, but that will come with the new callback system in v0.6.

Quote
in TGUI's child window the mouse moves very clearly when moving, even outside the titlebar. And it goes back to proper place when you stop moving mouse.
I don't have such a problem. Here the child window seems to respond like it should.
TGUI: C++ SFML GUI

 

anything