Main Menu
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

Messages - roccio

#51
Help requests / Disable colors
27 June 2016, 16:32:01
Hello,
is possible to define disabled colors for the widget in the theme file?
I was unable to find something.

Thank you.
#52
Help requests / Re: MessageBox problem
24 June 2016, 16:56:06
Thank you very much!
#53
Help requests / Re: MessageBox problem
24 June 2016, 16:43:56
Ok, this way it works. Another question:

is it possible to have the messagebox modal?

how to get the button pressed?

Sorry for so many questions, but I have not found an example of how to use this widget.
#54
Help requests / MessageBox problem
24 June 2016, 12:00:18
Hello again,
I have a problem with the tgui::MessageBox.

I think the problem is with the VisualC++ compiler as it trys to replace MEssageBox with MessageBoxA as it is defined in the macro
#define MessageBox MessageBoxA

Is there a solution for this?
#55
Help requests / Re: Scrollable panel
22 June 2016, 16:22:22
Ok, thank you.

Works perfectly!
#56
Help requests / Scrollable panel
22 June 2016, 16:02:37
Hello, I have a panel I want to scroll and I have taken the code from the "scrollable panel" example. All works well, but I would like to scroll even when I use the mouse wheel over the panel. How can I do this?
#57
General Discussion / Re: Tgui logo?
11 June 2016, 07:51:17
Thank you very much,i will use one of these, maybe with transparent background.
#58
General Discussion / Tgui logo?
11 June 2016, 00:25:56
Hello, i would like to know if there is a tgui logo image (something like the one for sfml) so that i can put it in my project just for credit your library.

Thank you
#59
Help requests / Re: ListBox error
09 June 2016, 12:24:23
Ok, compiled and tested the original problem. Now it works!

Thank you!
#60
Help requests / Re: ListBox error
09 June 2016, 11:54:22
The sfml libs are 64 bit, my generator is Visual Studio 14 2015
#61
Help requests / Re: ListBox error
09 June 2016, 11:44:58
I have another question, I have downloaded cmake and set it up and running, but I have problems compiling in VS2015 for the x64 platform.

I get this error

sfml-graphics.lib(sfml-graphics-2.dll) : fatal error LNK1112
#62
Help requests / Re: ListBox error
09 June 2016, 11:12:29
Thank you very much!
#63
Help requests / Re: ListBox error
09 June 2016, 09:02:12
Here is the code

Code (cpp) Select

#include <TGUI/TGUI.hpp>

tgui::Gui g_gui;

void CreateTab1()
{
tgui::Panel::Ptr panel = g_gui.get<tgui::Panel>("MAIN_PANEL");
panel->removeAllWidgets();

tgui::CheckBox::Ptr checkbox = std::make_shared<tgui::CheckBox>();
checkbox->setPosition(10, 20);
checkbox->setText("check 1");
checkbox->setSize(25, 25);
panel->add(checkbox);
}

void CreateTab2()
{
tgui::Panel::Ptr panel = g_gui.get<tgui::Panel>("MAIN_PANEL");
panel->removeAllWidgets();

tgui::CheckBox::Ptr checkbox = std::make_shared<tgui::CheckBox>();
checkbox->setPosition(10, 20);
checkbox->setText("check 2");
checkbox->setSize(25, 25);
panel->add(checkbox);

tgui::ListBox::Ptr listBox = std::make_shared<tgui::ListBox>();
listBox->setSize(250, 120);
listBox->setItemHeight(25);
listBox->setPosition(10, 50);
listBox->addItem("Item 1");
listBox->addItem("Item 2");
listBox->addItem("Item 3");
panel->add(listBox);
}

void CreateTab3()
{
tgui::Panel::Ptr panel = g_gui.get<tgui::Panel>("MAIN_PANEL");
panel->removeAllWidgets();

tgui::CheckBox::Ptr checkbox = std::make_shared<tgui::CheckBox>();
checkbox->setPosition(10, 20);
checkbox->setText("check 3");
checkbox->setSize(25, 25);
panel->add(checkbox);
}

void CreateTab4()
{
tgui::Panel::Ptr panel = g_gui.get<tgui::Panel>("MAIN_PANEL");
panel->removeAllWidgets();

tgui::CheckBox::Ptr checkbox = std::make_shared<tgui::CheckBox>();
checkbox->setPosition(10, 20);
checkbox->setText("check 4");
checkbox->setSize(25, 25);
panel->add(checkbox);
}

void OnTabChange(std::string selectedTab)
{
if (selectedTab == "TAB1")
CreateTab1();
else if (selectedTab == "TAB2")
CreateTab2();
else if (selectedTab == "TAB3")
CreateTab3();
else if (selectedTab == "TAB4")
CreateTab4();
}

int main()
{
sf::RenderWindow window(sf::VideoMode(1024, 768), VERSION);
g_gui.setWindow(window);


tgui::Tab::Ptr tabs = std::make_shared<tgui::Tab>();
tabs->add("TAB1");
tabs->add("TAB2");
tabs->add("TAB3");
tabs->add("TAB4");
tabs->setPosition(0, 0);
g_gui.add(tabs, "MAIN_TABS");

tgui::Panel::Ptr panel = std::make_shared<tgui::Panel>();
panel->setSize(1024, 743);
panel->setPosition(tabs->getPosition().x, tabs->getPosition().y + tabs->getTabHeight());
g_gui.add(panel, "MAIN_PANEL");

tabs->connect("TabSelected", OnTabChange);
tabs->select("TAB1");

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();

g_gui.handleEvent(event);
}

window.clear(sf::Color::White);
g_gui.draw();
window.display();
}
}
#64
Help requests / ListBox error
08 June 2016, 17:27:56
Hello, I have a problem with the listbox.

What I have is this:
1 panel added to the main gui.
3 tabs added to the gui.
When I change tab i clear all widgets from the panel, and add the new ones.

All works fine, except if I try to add a listbox. The tab shows the correct listbox with the ites, but when I change tab the program crashes.

Any help?

Thank you for this very good library!

roccio