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

#1
Help requests / Re: ChildWindow close
01 October 2021, 13:49:27
Thanks,
very precise as usual.
#2
Help requests / ChildWindow close
01 October 2021, 12:06:05
Hello,

I have a question regarding the ChildWindow CLOSE event in 0.9.
In the previous version of TGUI what I used to do is to create a childwindow at the start and then using setVisible member to show/hide it. The window is created with the Close button on the title bar. In the ONCLOSE event I set the visible attribute to false.
Now, on 0.9 I do the same thing, but the when  I show the window and use the close button, I am unable to show it again.

I tried using the onEscapeKeyPress event and in this case all works fine.

Do I need to do something else when using the onClose event?

Thanks

Stefano
#3
Help requests / Re: Group events
01 October 2021, 12:00:35
Thanks, that solved my problem.
#4
Help requests / Group events
24 September 2021, 09:56:42
Hello, I have a problem with the group event management.

I used to do guiGroup->handleEvent(event); in the previous version of tgui, but now handleEvent is no more present.

How do I manage all possible events with 0.9?

Thanks
#5
Help requests / Re: problem running 0.9
07 July 2021, 16:05:52
Yes, I am trying a new SFML snapshot. So I should build tgui with it.
#6
Help requests / problem running 0.9
07 July 2021, 10:42:14
Hello,
I am trying to port my application to v0.9 and after resolving all compiler errors when I try to run I get this error:

Unable to fing ingress point for ?getKerning@Font...

(See attached image).

Do you have any idea of what I am doing wrong?

Thanks
#7
Help requests / List view double click
25 June 2020, 17:00:06
Is it possible to know which column has been double-clicked in a listView?

Thanks
#8
Help requests / Re: Combobox signal
30 January 2020, 09:33:22
Will try asap. I have just downloaded the last binary from the Download section (0.8.6).

Thank you
#9
Help requests / Re: Combobox signal
30 January 2020, 09:22:36
With this I get no exception, but the value printed are not the one expected.


void ChangeColor(int val)
{
std::cout << val << std::endl;
}

int main()
{
sf::RenderWindow window(sf::VideoMode(SCREEN_W, SCREEN_H), "Aircraft configurator", sf::Style::Close);
window.setIcon(icon_image.width, icon_image.height, icon_image.pixel_data);

// init gui
tgui::Gui gui;
gui.setTarget(window);

tgui::ComboBox::Ptr combo = tgui::ComboBox::create();
combo->setPosition(100, 100);
combo->addItem("One");
combo->addItem("Two");
combo->connect("ItemSelected", ChangeColor);
gui.add(combo);

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed: window.close(); break;
}

gui.handleEvent(event);
}

window.clear(sf::Color::White);

gui.draw();

window.display();
}

return 0;
}
#10
Help requests / Combobox signal
30 January 2020, 08:56:08
Hi,
I have a combox and I want to connect a function on itemselected that pass the index of the selected item and not the text.

void ChangeColor(int index) { std::cout << index; std::endl;}

...

g_comboColor->connect("ItemSelected", ChangeColor);


This compiles well, but when I run the code I get an exception in SignalImpl.hll

const std::size_t offset = (sizeof...(UnboundArgs) > 0) ? signal.validateTypes({typeid(UnboundArgs)...}) : 0; (line 157)

What am I missing?
#11
Thanks fot the help, will try your solution to change the text.

Fot the future I like most the first solution as it is more clear and more consistent with the other functions.
The image would be a great update, but better would be to have a checkbox.

Best regards
#12
Another question: is there a way to change the menu item text?
I need it to show if an item is selected or not (adding a character in front like this:

  menuItem0
  menuItem1
*menuItem2
  menuItem3
#13
Hi,
I have a little problem with the menu bar.

I have created a menu


auto menu = tgui::MenuBar::create();
menu->getRenderer()->setTextColorDisabled(sf::Color(229*1, 131*0, 4*0));


and then in the main window loop I use two keypresses for enable or disable the menu:


if (event.key.code == sf::Keyboard::A)
    gui.get<tgui::MenuBar>("MenuBar")->setEnabled(false);
else if (event.key.code == sf::Keyboard::S)
    gui.get<tgui::MenuBar>("MenuBar")->setEnabled(true);


The menu is correctly enabled/disabled by the two events, but the problem is that when disabled the menu ites are rendered in RED, but when I reenable the menu the items are again in red untill I move the mouse over them.

Is there something I miss to get the items of the correct color?
#14
Ok, thank you, your fix works fine.
#15
Hello,
I'm using v0.8 with visual studio 2017 and I have a problem.

I have a scrollable panel and inside this I have a combobox. The problem is when I scroll the panel and then try to  open the combobox for selecting a value. The list is scrolled down, and is displayed in incorrect position, even outside the panel (so that is impossible to see).

Any thought?

Thank you