Just try to make a minimal example before posting. If you make a mistake like this one then you will most likely find it yourself while making the example, and otherwise I will ask for an example anyway
.
.
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
.
void CloseAndSaveCallback(const AddObjectDialog* this, Obj obj)std::bind(&AddObjectDialog::CloseAndSaveCallback, this, p.object)p.button->bindCallback(std::bind(&AddObjectDialog::CloseAndSaveCallback, this, p.object), tgui::Button::LeftMouseClicked);
QuoteDo you have an idea of how I should do to have a beautiful resizable program with no Grid?In v0.6 there is no build-in way, but Grid is not the only option. For more control you can basically have a function that you call every time the window is resized that will call setPosition and setSize on all your widgets. Obviously this can result in a lot of code but then you at least control where everything is positioned under any resolution.
Quotesprite.setPosition(40, getChildWindow(financeChildWin)->getSize().y * 0.5);It took me some time to understand what was going wrong, but this is where the mistake lies.QuoteI was not able to provide an executable because I was guessing you use LinuxYou guessed right
. Even if you added a .exe which I could run with wine, I wouldn't be able to do anything with it anyway since I need the code to make small changes and test stuff.
Quotewe can see that the widgets that are in the panel aren't hidden when they get out of itThis is not supposed to happen, so lets focus on fixing this and then see if the problem with the invisible text still persists.
childWindow->bindCallback(tgui::ChildWindow::Closed);gui.remove(callback.widget);
QuoteWhen I have got Checkbox and I change a "Enabled" value to false. I can't get focus to it in "Form builder" clicking it.This is a side-effect of how the form builder works, it relies on tgui for everything, including the events. If a widget gets disabled then it will no longer send callbacks. There is no simple workaround for this.
QuoteI can't acces a all items.This is something that I can still fix. I'll fix that tomorrow.
Quotebut few bindCallback's covering the different types of the callbacks used by different widgetsAlthough not very easy to find (it is spread over multiple places due to the widgets inheriting from each other), the information can be found in the documentation. You would have to look for the <WidgetName>Callbacks enum inside the class. For SpinButton that would be here (hmm, small typo in that part, I'll fix that in the next version). In the diagram on top of the page you see that SpinButton inherits from ClickableWidget, so if you click on that ClickableWidget node then you will end on a page containing this. And if you do that again then you end up in the Widget class which gives you the remaining callback triggers here.
QuoteI couldn't use this since XP limited Visual Studio 2008, which didn't allow C++11.Actually Windows XP supports up to VS2010 which is the minimum supported version of tgui 0.6. It is only from tgui 0.7 onwards that I drop support for VS on XP (but MinGW can still be used) as the minimum compiler becomes VS2013.
spinButton->bindCallback(tgui::SpinButton::ValueChanged);// Load a small to medium sized texture, set it to repeat
sf::Texture texture;
texture.loadFromFile("Filename.jpg");
texture.setRepeated(true);
// Create the sprite and give it a texture rect that is several times larger than the size of the texture
sf::Sprite sprite;
sprite.setTexture(texture);
sprite.setTextureRect({0, 0, 800, 600});
// Draw the sprite and see if it displays without gaps between the repeated texture
window.draw(sprite);while (window.isOpen()) {
handleEvents();
if (playerTurn)
takeTurn(player);
else
opponentTurn();
drawEverything();
}
template <typename T> bool isWidgetPresentInContainer(string passed_widgetName, vector<typename T::Ptr> containerList) { /* ... */ }QuoteSo I'm assuming that this is actually a std::vector issue?This isn't really an "issue", both vectors are of a completely different type as far as the compiler is concerned. I know that it would be nice if it would just accept that both version just are similar to a vector of pointers of any type, but that is not how c++ works. C++ is statically typed which leads to these vectors being incompatible. Its just a limitation of the language.
Quotehowever there was no better driver available as I fearedIf the problem is specific to the driver that you use then downgrading might work, but it is just as possible that it won't change anything or even make things worse.
QuoteIt's good to hear TGUI-0.6.8 can be used with SFML-2.1 can work with cmake.Actually I just remembered that you can't use TGUI 0.6.8 with SFML 2.1. You need at least SFML 2.2.
QuoteThat subject is no longer posted on the forum or I can't find itI guess it is this one: https://en.sfml-dev.org/forums/index.php?topic=12611.0
Quotea way of testing SFML 2.1 with TGUI-0.6.8 Visual C++12 (2013) - 32bit?The precompiled library in the download is only compatible with sfml 2.3 (thats just how libraries work on windows, they are only compatible with one specific version). So if you want to use tgui with sfml 2.1 then you will have to compile tgui yourself with cmake.
gui.setGlobalFont("DejaVuSans.ttf");bool setRatio(Widget::Ptr widget, float ratio);layout->add(widget);
layout->setRatio(widget, 0.5f);
void insertSpace(unsigned int position, float ratio);
void addSpace(float ratio);void insert(unsigned int position, const tgui::Widget::Ptr& widget, const sf::String& widgetName = "");
void add(const tgui::Widget::Ptr& widget, const sf::String& widgetName = "");
void setRatio(const tgui::Widget::Ptr& widget, float ratio);
void setRatio(unsigned int position, float ratio);layout->add(widget);
layout->insert(2, widget2);
layout->setRatio(1, 0.5f); // Set the ratio of the space
layout->setRatio(0, 0.5f); // Set ratio of the first widget
layout->setRatio(widget2, 0.5f); // Set ratio of the second widgetvoid insertSpace(unsigned int position, float ratio);
void addSpace(float ratio);layout->add(widget);
layout->addSpace(0.5f);
layout->add(widget2);
layout->setRatio(0, 0.5f); // Set ratio of the first widget
layout->setRatio(widget2, 0.5f); // Set ratio of the second widget
Quotecanvas->clear();That code will clear the canvas with a black color.canvas->clear(sf::Color::Transparent);panel->setBackgroundColor(sf::Color::Transparent);