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

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

0 Members and 1 Guest are viewing this topic.

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #180 on: August 26, 2012, 05:38:31 pm »
I'm getting "tgui::LoadingBar has no member 'setText' " with the newest version. Not sure if it's my fault but I thought I built it correctly.

EDIT: No mention of "setText" in LoadingBar.cpp. Maybe I should redownload the source.
EDIT #2: Fixed now.
EDIT #3: Unresolved external symbols - OBJECT::textEntered(char) and Label::draw

Ah. Nothing I am doing is changing this last problem - I rebuilt it, debug/release are matching with the CMake options, and I'm getting unresolved symbols as described above. Is this a bug or am I still doing something wrong? (would appreciate a quick answer as I'm using this as part of Ludum Dare, 48 hour game making competition, and I only have 9 hours left).

Tried the latest gitHub TGUI and I get build errors. Going to go back a version...
« Last Edit: August 26, 2012, 06:17:18 pm by pighead10 »
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #181 on: August 26, 2012, 06:19:08 pm »
I have no idea what is going wrong, but OBJECT doesn't has a method textEntered.

Are u linking statically or dynamically?
I guess you are using Visual Studio?
On what OS?

I will try building with the same configuration (if possible) and see if I get the same problem.

Edit: What build errors?
« Last Edit: August 26, 2012, 06:21:50 pm by texus »
TGUI: C++ SFML GUI

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #182 on: August 26, 2012, 06:29:03 pm »
The latest version on here: https://github.com/texus/TGUI (when I pressed 'download this repository as a zip file') produced a few build errors but I can't remember them - I have now reverted to an older version. There was something about return type being invalid. I think I remember something about a font not being able to be returned as a const when it was a pointer... or something :)

I'm linking dynamically on Windows 7, Visual Studio 2010 express.
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #183 on: August 26, 2012, 06:34:57 pm »
I hope you selected the v0.5-dev branch and didn't download the master as this is v0.4.
Of course if you are using the RC version of sfml then you will need v0.4.

Edit: Just build sfml and tgui from the latest sources and I don't have any problem. The only difference is that I used vs2008 but that shouldn't matter.
« Last Edit: August 26, 2012, 06:45:22 pm by texus »
TGUI: C++ SFML GUI

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #184 on: August 26, 2012, 06:54:06 pm »
It was the 0.5 dev version. Following the link from the website gave me the linker errors and the latest github page gave me build errors. I tried redownloading/building it 3 times and I still got the same errors. =/
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #185 on: August 26, 2012, 07:01:36 pm »
Quote
Following the link from the website gave me the linker errors and the latest github page gave me build errors.
The one on my site is just a link to the one on GitHub. Are u sure that you aren't downloading the master branch?
You do have the latest sfml version, right?

Anyway, this has to be solved and it seems to be something on your side because I don't have this problem.
Could you send me the libraries and dlls that you have build and a small test code to reproduce it?
TGUI: C++ SFML GUI

Kubik

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #186 on: August 26, 2012, 07:13:19 pm »
Hello? I make my own level manager by our library "TGUI". So i make objects in this way:
void CreateEditBox(tgui::Window &window, tgui::EditBox *editbox, int x, int y, string value, int w=225, int h=20)
{
    editbox = window.addEditBox();
    editbox->load("objects/EditBox/Black");
    editbox->setBorders(4, 2, 2, 4);
    editbox->setPosition(x, y);
    editbox->setText(value);
    editbox->setSize(w, h);
}
so  in loop of tgui's events i want to get Text of edit box. How i can do it? if i use function EditBox->getText()? i get error "segmentation fault".

pighead10

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Hog Pog
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #187 on: August 26, 2012, 07:16:25 pm »
Quote
Following the link from the website gave me the linker errors and the latest github page gave me build errors.
The one on my site is just a link to the one on GitHub. Are u sure that you aren't downloading the master branch?
You do have the latest sfml version, right?

Anyway, this has to be solved and it seems to be something on your side because I don't have this problem.
Could you send me the libraries and dlls that you have build and a small test code to reproduce it?

I'll try again later. Right now I have a game to make ^^
Immortui - Zombie puzzle game: http://immortui.hogpog.co.uk

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #188 on: August 26, 2012, 07:34:15 pm »
I tried the fix, and it works some of the time.

I have 3 EditBoxes.
1 of them is added directly to the Form, and that works as it should.
The other 2 are both added to the same Panel, and when I call unfocus() on one of them, while it is focussed, the other one gets focussed.

I have tried calling unfocus() on the panel, but that gives an error that the call is ambiguous.

Also, Building worked fine, but I did get an error when building the INSTALL target in release mode. I am having no problems after copying the appropriate files, though.
Building in Debug mode gave no error.

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #189 on: August 26, 2012, 07:48:13 pm »
Your CreateEditBox should be defined like this. (note the & after EditBox*)
void CreateEditBox(tgui::Window &window, tgui::EditBox*& editbox, int x, int y, string value, int w=225, int h=20)

If you don't do this then your pointer outside this function will not point to the created object.
TGUI: C++ SFML GUI

Kubik

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #190 on: August 26, 2012, 07:55:31 pm »
thank you? it work. Did i can use you lib v 0.5 in SFML v 2.0 RC?

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #191 on: August 26, 2012, 08:09:48 pm »
The behaviour with the edit boxes is as expected. Unfocusing is similar to using the tab key.
I didn't know you were trying to unfocus all of the objects. But I have just added an unfocusAllObjects function, so you can now just use window.unfocusAllObjects().

I was a little bit too fast with adding focus and unfocus to all objects as it indeed makes the calls ambigious in Panel.
I have renamed the ones from Group (and thus the one in Panel and Window) to focusObject and unfocusObject.

The install target is something I haven't got working either in visual studio. So until I take the time to figure out how to get it working, you will just have to copy the form builder executable to the right place yourself.

Quote
Did i can use you lib v 0.5 in SFML v 2.0 RC?
No you will have to compile the latest sfml version to use tgui v0.5.
TGUI: C++ SFML GUI

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #192 on: August 26, 2012, 08:45:50 pm »
The behaviour with the edit boxes is as expected. Unfocusing is similar to using the tab key.
I didn't know you were trying to unfocus all of the objects. But I have just added an unfocusAllObjects function, so you can now just use window.unfocusAllObjects().
How about changing the name of unfocus() to focusNext(), then? It is always good to avoid side effects.

Also, is it possible to disable the tab key functionality entirely?

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #193 on: August 26, 2012, 09:12:16 pm »
I'll change the name to focusNextObject tomorrow.

To disable the tab usage, just do this:
tgui::tabKeyUsageEnabled = false;
TGUI: C++ SFML GUI

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #194 on: August 26, 2012, 09:25:27 pm »
To disable the tab usage, just do this:
tgui::tabKeyUsageEnabled = false;
That gives me a linker error:
Quote
error LNK2001: unresolved external symbol "bool tgui::tabKeyUsageEnabled" (?tabKeyUsageEnabled@tgui@@3_NA)

 

anything