Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - JohnGreek

#1
'MessageBox' in namespace 'tgui' does not name a type

Under windows - MinGW the class name tgui::MessageBox conflicts with MinGW's MessageBox Winapi defines.
The solution i tried is the following:

1. Go to winuser.h of the compiler directory and comment out the #define MessageBox __MINGW_NAME_AW(MessageBox) and #define MessageBoxEx __MINGW_NAME_AW(MessageBoxEx)


2.#undef MessageBox
#undef MessageBoxA
#undef MessageBoxW

On the project header file.


With this workaround i managed to get it working without any error-warning. Is this known or am i doing something wrong with my includes?

Also tgui::MessageBox::setSize(float,float); doesn't do anything unless it's called after
tgui::MessageBox::addButton(sf::String&);


Is this normal?
#2
Hello.

I am using TGUI v0.6.5 compiled as shared lib on windows 7 - MinGW.
My IDE is QtCreator and i' m using Qt in conjunction with SFML & TGUI.

I have 3 classes, 1 is pure virtual "GameState", 2 is the "GameWindow" with the sf::RenderWindow and the sf::Event and 3 is a state( the login screen in this situation ) called "LoginScreen" which is inheriting from  "GameState".

I create a GameState pointer(currentState) and assign a new LoginScreen object on it.
Then in the GameWindow main loop i call currentState->HandleEvents, HandleLogic etc.

In my LoginScreen class i have 2 variables passed by reference, the sf::RenderWindow and the sf::Event so all the events on the main window are passed to the LoginScreen. The program crashes when there is a new event on the window at the myGUI->handleEvent(*LoginEvent); This is my LoginScreen::HandleEvent():

void LoginScreen::HandleEvents()
{
    while( LoginWindow->pollEvent(*LoginEvent) )
    {
        if (LoginEvent->type == sf::Event::Closed)
            LoginWindow->close();


        myGUI->handleEvent(*LoginEvent); <- This is where the crash occurs, tried with commenting out as well
        //QApplication::processEvents();
    }
}


I started the debugger but the only thing i get is (??) at function names and one file;
libstdc++6.dll

Like the error is coming from this..
Also, before i implemented the state machine and had only 1 class
as MainWindow the myGUI->handleEvent(*LoginEvent) was working just fine.

Any ideas?
#3
I have created a panel in my GUI and i set a Button as children with position (0, 0) relative to the panel
when i hover the mouse on the button i receive the event and the image changes, pressed works fine as well
but when i move the mouse while hovering outside the panel while the mouse had hover it stays on hover state. I add the button after i initialize it with tgui::Panel::add(button, "button") but when i create the button i don't set the GUI in the constructor.

Any ideas?


EDIT: Fixed on new release of TGUI v0.6.5
#4
Hello, i' m trying to use TGUI v6.4 for my game but i am stuck on something very weird.
I have a GameWindow class as a base for my test and i create the tgui::GUI object dynamically.
After this i initialize an EditBox defined in my header like this

Header:
tgui::EditBox::Ptr textBoxUsername;

Source:
textBoxUsername= tgui::EditBox::Ptr(*myGUI);


1st of all is this the correct way to do it?

If not please tell me how. Now on to the point.
After i initialize my EditBox and call this: textBoxUsername->load("widgets/Black.conf");
my windows becomes black whatever i try.

My enviroment is Windows 7
Compiler MinGW (DW)
I compiled from source through CMAKE but i set it to shared though i use SFML in my game statically. Could this be an issue?


Thanks in advance!



Edit: How stupid of me.. i just read on the forum that linkage must be the same for SFML AND TGUI
i had SFML static and TGUI dynamic..