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: scrollablepanel & combobox (0.8)
« on: 25 June 2018, 15:48:41 »
Ok, thank you, your fix works fine.

2
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

3
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

4
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)

5
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?

6
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?

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

8
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();
}
}

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

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

11
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);

 :-\

12
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...

13
Help requests / Re: MenuBar problem
« on: 10 May 2018, 16:21:32 »
I'm using Visual C++ 2015 and using dynamic link.

14
Help requests / Re: MenuBar problem
« on: 10 May 2018, 14:50:26 »
Here it is:

Code: [Select]
int main(int argc, char** argv)
{
sf::RenderWindow window;
sf::Font font;
tgui::Gui gui;

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

font.loadFromFile("fonts\\segoeui.ttf");
gui.setTarget(window);
gui.setFont(font);

tgui::MenuBar::Ptr  menu = tgui::MenuBar::create();
gui.add(menu);
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 9;

Just comment the
gui.add(menu);

and no errors on exit

15
Help requests / MenuBar problem
« on: 10 May 2018, 14:35:36 »
Hello,
I have updated SFML to 2.5.0 and TGUI 0.8 dev all compiled with source by myself.
It all works well, but I have a problem when using tgui::Menubar.

What I do is just this:
- load a font
- set this font to tgui::gui
- create a MenuBar
- add menubar to gui

then normal event processing and rendering.

All works, only when I close the program I have this error:

Failed to activate OpenGL context: Operazione completata.

An internal OpenGL call failed in Texture.cpp(117).
Expression:
   glDeleteTextures(1, &texture)
Error description:
   GL_INVALID_OPERATION
   The specified operation is not allowed in the current state.


This is not happening if I just don't add the menubar to gui.

Is there something I miss?

Pages: [1] 2 3 4