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.


Topics - roccio

Pages: [1] 2
1
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?

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

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

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

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

7
Help requests / Tabs disable
« on: 09 March 2018, 10:07:13 »
Hello,
I have some tabs in my application, but I would like to disable one (ore more) if something happens.
Is this possible?

Thanks

8
Help requests / close sub menu on mouse exit
« on: 02 May 2017, 13:46:15 »
Hi,
just wanted to know if there is a way to close a submenu when mouse get out of the menu block.

Thank you

9
Help requests / listbox theme
« on: 07 April 2017, 14:17:43 »
Hello, I wish to set the hover color in my theme file for the listbox:

ListBox {
    BackgroundColor : (255, 255, 255);
    TextColor : (10, 10, 10);
    SelectedBackgroundColor : (51, 153, 255);
    SelectedTextColor : (250, 250, 250);
    BorderColor : (200, 200, 200);
    Borders : (1, 1, 1, 1);
    Scrollbar : "Scrollbar";
}

This is my current source, how can I add the hover background and text color?

10
Help requests / Copy and paste editbox
« on: 07 March 2017, 14:25:41 »
Hello,
sorry if this has been already discussed, I have used the search function but have not found anything.
My problem is to have an editbox where I can paste the string from the clipboard.

Any advice?

11
Help requests / RemoveAllWidget
« on: 26 January 2017, 10:40:37 »
Hello,
just a question,
will removeAllWidgets free all memory allocated for the widgets?

12
Help requests / Combobox with many many items
« on: 19 August 2016, 16:45:30 »
Hello, I need a combobox with many items, (say over 1000), but if I add all the creation is very slow and even change item is a pain (better in release, but debug it's unusable). It there a workaround for this? Maybe I can load a little number of items (say 20) and when moving the list reload the correct ones. How can I do something like that? Or if are there better solution...

thank you

13
Help requests / Crash 32 bit debug
« on: 29 July 2016, 16:42:18 »
Hello, I am trying to make my application work for 32 bit machines. I use Visual Studio 2015 under win 10. I have downloaded the tgui libs for x86 and I can compile without problems.
Even if I run in release mode all works ok, only when trying to run in debug mode.

Here a very little test

Code: [Select]
#include <TGUI/TGUI.hpp>

int main()
{
tgui::Theme::Ptr theme = std::make_shared<tgui::Theme>("gui.cfg");
if (theme != nullptr)
tgui::Label::Ptr LABEL_TEMPLATE = theme->load("label");

return 0;
}

and here is the config file

Code: [Select]
Label {
    TextColor : (10, 10, 10);
}

Any ideas?

Thank you

14
Help requests / Disable colors
« on: 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.

15
Help requests / MessageBox problem
« on: 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?

Pages: [1] 2