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.


Messages - roccio

Pages: [1] 2 3 4
1
Help requests / Re: menu bar colors when enabled/disabled
« on: 10 August 2019, 16:26:52 »
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

2
Help requests / Re: menu bar colors when enabled/disabled
« on: 09 August 2019, 14:07:32 »
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

3
Help requests / menu bar colors when enabled/disabled
« on: 09 August 2019, 10:44:44 »
Hi,
I have a little problem with the menu bar.

I have created a menu

Code: [Select]
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:

Code: [Select]
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?

4
Help requests / Re: scrollablepanel & combobox (0.8)
« on: 25 June 2018, 15:48:41 »
Ok, thank you, your fix works fine.

5
Help requests / scrollablepanel & combobox (0.8)
« on: 22 June 2018, 11:35:58 »
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

6
Help requests / Re: v0.8-dev - Passing custom parameters
« on: 16 May 2018, 09:39:28 »
Still have the same error (Visual C++ 2015 reports error C2075).

Code: [Select]
class PanelClient
{
private:
    void windowChooseKey(const std::string& textbox)
   {
        std::cout << "Here I am" << std::endl;
   }
}

 later in code...

Code: [Select]
button->connect("pressed", &PanelClient::windowChooseKey, this, "txtWindowShowKey" );

When compiling error C2075

7
Help requests / Re: v0.8-dev - Picture signals
« on: 16 May 2018, 09:18:19 »
Sorry, but the test code was made just for an example. In my real code I have put a breakpoint and it never stops.
I have tried to change the test with std::cout as you wrote, but I got nothing in my console (neither stops if I put a breakpoint in the function).

I am using VC2015 under windows 10 (1803)

8
Help requests / v0.8-dev - Picture signals
« on: 15 May 2018, 16:58:19 »
Hello again :)
I have a problem with the picture widget. I am trying to connect it with a DoubleClicked signal, but it seems not to fire.

Code: [Select]
int Test()
{
sf::RenderWindow window;
tgui::Gui gui;

window.create(sf::VideoMode(800, 600), "test", sf::Style::Close);
window.setFramerateLimit(60);

gui.setTarget(window);

sf::Texture texture;
texture.loadFromFile("images\\tgui-logo.png");

tgui::Picture::Ptr picture = tgui::Picture::create();
picture->getRenderer()->setTexture(texture);
picture->connect("DoubleClicked", []() {printf("Pressed"); });
gui.add(picture);

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

gui.handleEvent(event);
}
window.clear(sf::Color(223, 223, 223));
gui.draw();
window.display();
}

return 1;
}

Am I missing something?

9
Help requests / v0.8-dev - Passing custom parameters
« on: 15 May 2018, 13:57:51 »
Hello, I have not understand how to correctly pass custom parameters is signal functions.
In my case I have a class member function that has 1 parameter as input

Code: [Select]
void PanelClient::windowChooseKey(const std::string& textbox)
I connect this function to a button press

Code: [Select]
button->connect("pressed", &PanelClient::windowChooseKey, "txtWindowShowHideKey", this);
but I am not able to compile.

What's the correct way of doing this?

10
Help requests / Re: Listbox signals
« on: 11 May 2018, 13:41:08 »
good  ;)

11
Help requests / Re: Listbox signals
« on: 11 May 2018, 13:13:20 »
Hi again, I have a problem with the listbox, maybe I'm doing something wrong. My program crashes when I call listbox->removeAllItems() and points to ListBox.cpp line 916 (   m_items[m_hoveringItem].setColor(m_textColorCached);)

I'm using VC 2015 and shared libs:

Code: [Select]
void Test()
{
sf::RenderWindow window({ 600,600 }, "test");
tgui::Gui gui(window);
tgui::ListBox::Ptr listbox = tgui::ListBox::create();
gui.add(listbox);

listbox->addItem("uno");
listbox->addItem("due");
listbox->addItem("tre");

listbox->connect("MousePressed", [=]() { listbox->removeAllItems(); });

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

gui.handleEvent(event);
}

window.clear();
gui.draw();
window.display();
}
}

12
Help requests / Re: MenuBar problem
« on: 11 May 2018, 09:12:17 »
Seems to work well now.
Thank you, great work!

13
Help requests / Re: Listbox signals
« on: 10 May 2018, 16:57:02 »
Ok, thank, this worked perfectly!

14
Help requests / Re: MenuBar problem
« on: 10 May 2018, 16:36:05 »
To not have the error you can comment the gui.add(menu) line OR gui.setFont(font);

 :-\

15
Help requests / Listbox signals
« on: 10 May 2018, 16:31:37 »
I have some problems going from 0.7 to 0.8 regarding the signals and in particular the old connectEx functions.
In example I had a function called when an item in a list box is selected. The function passed to the old connectEx used a parameter Callback that reported the selectedItemId.

How can I get the same with the new signal system?

Sorry for the noob question, but I have not found any tutorial...

Pages: [1] 2 3 4