texus / tgui Goto Github PK
View Code? Open in Web Editor NEWCross-platform modern c++ GUI
Home Page: https://tgui.eu
License: zlib License
Cross-platform modern c++ GUI
Home Page: https://tgui.eu
License: zlib License
Hi,
I found small bug related with right alt. When using editbox, I noticed that whenever I press right alt + "a" the text in the control is cleared and put character "ą" (Polish diacritical mark). I made some investigation and found functionality ctrl + a which select text. Then I saw that insert right alt + a is recognized as ctrl + alt + a. It's looks weird but I found on internet information that it is normal. Functionality in editbox to select all text, checks only ctrl key and doesn't check other special keys. I think should be checked if other special keys aren't pressed.
More about this: http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx
TGUI 0.7
Regards,
When I loaded gui from file and widget have name with space then I received tgui::Exception.
When you set a size for a splitted button that is below the combined widths of it's L,R,M images, the button still has a minimum width of L+R+M, but the hitbox for mouse callback gets set to the specified size.
At first I thought this was probably expected behaviour because you aren't meant to set a size below L+M+R, but this only happens when the vertical size is left at the original vertical size. If i also scale on the y-Axis the button scales correctly, even below L+M+R. Then it seems to use scaling algorithm for the parts.
I think a form builder would be highly beneficial for use with TGUI. While for some projects hardcoding is fine, TGUI is also just as viable a choice for projects with large UI's with its robust and modern C++ design, making for hardcoding to become and more painful.
A form builder for v0.7 should at minimum have support for the original features of v0.6 (excluding deprecated parts of the API).
Due to the fact that v0.7 adds some significant new concepts and features, the form builder should likely reflect this. For example, the more advanced scaling and layout features.
I'd like to for this to be a discussion about what features should be in a v0.7 form builder.
There are a lot of things that the Tab class is missing, at least some of these should be added. The fixed tab width will definitely be added to v0.7 v0.8 while an tab with images is very likely to be added as well.
Edit: The following features are not be part of the rewrite. They could still be added in the future, but this issue will not remain open until then.
tgui::Button::PressedSpaceKeyPressed & tgui::Button::ReturnKeyPressed never trigger, not even when hovered above the button with the mouse and manually focused (in case that would matter).
other callbacks (including tgui::Button::AllButtonCallbacks, I guess because they contain if a button gets the focus) work fine.
Sometime I need associate widget with additional data. Now i must do it by std::map or std::vector. But more comfortable would be get data direct from widget. Could you add to the widget additional pointer to external data?
Below I join examples of function declarations.
void *getAdditionalData() const;
void setAdditionalData(void* data);
At the moment, the only way I can think of implementing tables is to have multiple list boxes side-by-side. Obviously this is not ideal, and would be much nicer if there were some built-in way to do this.
It would be useful to be able to capture things like "UP" or "CTRL-K" in an EditBox. One use case I've found recently was when using the EditBox as command input and allowing a history. Being able to capture the arrow keys here would make it easier to navigate the history.
When I tried to compile TGUI, I got this error :
TGUI\src\Widgets\Knob.cpp:370:77: error: call of overloaded 'abs(float)' is ambiguous
allowedAngle = 360 - abs(m_endRotation - m_startRotation);
(There is 3 other occurrences of abs in this file)
I could fix it by using std::abs
instead of abs
.
I'm using mingw64 on Windows 7 g++ version 6.2.0
warning: deleting object of polymorphic class type 'tgui::Gui' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
This occurs when using dynamic allocation via operator new and operator delete for tgui::Gui instances.
I get errors such as "stoi is not a member of std" now when compiling using mingw32-make and CMake.
I checked CMAKE_CXX_FLAGS and it is
-Wall -Wextra -Wshadow -Wno-long-long -pedantic -std=c++0x
It seems to include the -std=c++0x flag that is necessary but the error I am getting is the error that would occur if the flag was not there.
It appears that setSize causes a segmentation fault when using it like this (taken from example program):
picture->setSize(tgui::bindMax(800, windowWidth), tgui::bindMax(600, windowHeight));
I'm using TGUI version 0.7.4 and SFML 2.2.3 on Linux 64 bit.
I was looking at the commit below
bb6ef34
I can't find the documentation for enableTabKeyUsage and disableTabKeyUsage
This makes me think that it isn't even being generated despite the effort to document them
I wouldn't even know these functions exist if I didn't read the commit
Font doesn't work if the child window is added in gui after adding widgets in child window. Tested on the full example. To reproduce the bug only move the line 138 after 144, in other words add firstly the widgets to the child window and after add the child window to the gui. I'm using v0.7-dev.
So I thought of adding in a Time Widget which is just a label that updates itself to the current system time.
I can open a pull request if your interested, or you can do it. I don't mind.
Thoughts?
Can you change in class WidgetLoader in function load the stringstream on istream?
Then widgets can be loaded directly from file and the current functionality will be untouched.
A similar change can be made in class WidgetSaver, instead of stringstream used ostream.
I think they are all template-related. Do you already know about them?
I'm asking because it seems like you already have/had problems with VS2013 (ListBox.cpp Line 64/65).
SFML is suported, TGUI?
When I used layout as a string like this :
label_->setPosition({"&.w < w ? 0 : (&.w - w) / 2"}, { "&.h < h ? 0 : (&.h - h) / 2" });
the condition in this expression is incorrectly calculated. Instead of
&.w < w
&.h < h
is calculated:
&.w > w
&.h > h
When I try to run this code, the stack overflow occurs:
sf::RenderWindow window(sf::VideoMode(800, 600), "Window");
tgui::Panel::Ptr m_panel_1 = std::make_shared<tgui::Panel>();
tgui::Panel::Ptr m_panel_4 = std::make_shared<tgui::Panel>();
tgui::Label::Ptr nazwa_1 = std::make_shared<tgui::Label>();
nazwa_1->setAutoSize(true);
nazwa_1->setTextSize(14);
nazwa_1->setTextColor({ 255,255,255 });
m_panel_1->add(nazwa_1, "Nazwa");
nazwa_1->setPosition({ "w > &.w ? 0 : (&.w - w) / 2" }, { "h > &.h ? 0 : (&.h - h) / 2" });
m_panel_1->setBackgroundColor(sf::Color::Transparent);
tgui::Panel::Ptr m_panel_2 = tgui::Panel::copy(m_panel_1);
tgui::Panel::Ptr m_panel_3 = tgui::Panel::copy(m_panel_1);
tgui::Label::Ptr nazwa_2 = m_panel_2->get<tgui::Label>("Nazwa");
tgui::Label::Ptr nazwa_3 = m_panel_3->get<tgui::Label>("Nazwa");
m_panel_4->add(m_panel_1, "1");
m_panel_4->add(m_panel_2, "2");
m_panel_4->add(m_panel_3, "3");
tgui::Gui gui(window);
gui.setFont("resource\\arial.ttf");
nazwa_1->setText("Text");
nazwa_2->setText("Text");
nazwa_3->setText("Text");
gui.add(m_panel_4, "4");
nazwa_3->setText("Text");
I get the same error as #54 when loading widgets from a file.
File where i receive this error:
Panel {
Position: (150, 150);
Size: (410, 110);
Renderer {
BackgroundColor: Transparent;
}
Picture.ObrazObiektu {
Filename: "resource\\Brak_obrazka.png";
Position: (5, 5);
Size: ("&.h-10", "&.h-10");
}
}
I'm not sure weather this is an actual bug or not, but I can't seem to find any sort of solution to this problem so I'm coming here. That being said:
It seems no matter what I do, my console seems to cut off the lower part of words. The text is too far down in the chatbox and despite using all the available commands I can't correctly position the text to avoid being cut off. Here's a screenshot of the cut-off:
the window is 400_w_ 200_h_, and the console is composed of an EditBox
at the bottom and a ChatBox
that will list commands.
in my Initialize function I set the properties of both to:
d_console_edit_box = tgui::EditBox::Ptr(gui);
d_console_edit_box->load("TGUI/widgets/black.conf");
d_console_edit_box->setSize(400,20);
d_console_edit_box->setPosition(0,180);
d_console_edit_box->setTextSize(12);
d_console_edit_box->setMaximumCharacters(32);
d_console_edit_box->setText("> ");
d_console_command_list = tgui::ChatBox::Ptr(gui);
d_console_command_list->load("TGUI/widgets/black.conf");
d_console_command_list->setSize(400,180);
d_console_command_list->setPosition(0,0);
d_console_command_list->removeScrollbar();
d_console_command_list->setLinesStartFromBottom(true);
d_console_command_list->setLineLimit(COMMAND_COUNT+1);
d_console_command_list->setTextSize(12);
d_console_command_list->setTextColor(d_console_edit_box->getTextColor());
I'm setting the size of the text the same in both these boxes, yet my Edit box doesn't do any sort of cutting off as my Chat box is doing. Is this a bug?
I have problem with drawing text in tgui::ChatBox like on screenshot
Here code where i create chat box:
m_chatPanel = tgui::Panel::Ptr((*gui));
m_chatPanel->setPosition(0, GraphicSystem::instance()->getWindowHeight() - 282);
m_chatPanel->setSize(260, 282);
m_chatPanel->setBackgroundColor(sf::Color(50,50,50));
{
m_chatBox = tgui::ChatBox::Ptr((*m_chatPanel));
m_chatBox->load("data/gui/objects/Black.conf");
m_chatBox->setPosition(10, 10);
m_chatBox->setSize(240, 222);
m_chatBox->setTextSize(12);
m_editBoxChat = tgui::EditBox::Ptr((*m_chatPanel));
m_editBoxChat->load("data/gui/objects/Black.conf");
m_editBoxChat->setPosition(10, 242);
m_editBoxChat->setSize(240, 30);
m_editBoxChat->setTextSize(12);
}
My config:
SFML revision SFML/SFML@44b98b4
TGUI revision 2189df4
Win7 64 pro sp1
mingw 4.7.4
The findCharacterPos function returns a global position. The limitTextWidth function crashes on line 861 because that code assumed a local position.
Line 858 should become the following:
while (m_TextBeforeSelection.findCharacterPos(m_DisplayedText.getSize()).x - getPosition().x > width)
Although no other problems are visible, other uses of findCharacterPos should be reviewed. EditBox uses the function on various places, and not all seem to take the position into account. Now we are at it, look at the other widgets as well.
Wasn't findCharacterPos used because of a bug in getLocalBounds (about spaces at the beginning and end of the string)? If this bug has been fixed then the code can perhaps use getLocalBounds again?
String expression to counting dynamically size and position of widgets looks cool 👍
I wonder, how it will be behave this mechanism used in many widgets? Did you do performance tests?
Have you considered using lambda expressions? I know that could be impossibly to used it with the save/load functionality and could be probably a lot of other problems about which i don't know. What do you think about that?
I am currently trying to use Swig to bind TGUI to Lua. However, they make a statement that Swig does not recognize "non-conventional type declarations."[1] In SharedWidgetPtr.hpp, I have to change the friend keyword to be placed before the return type. If this is not done, I get that a syntax error is in your header file. I think swapping the location of the friend keyword is a really simple change. Thanks.
bool friend operator ==(const SharedWidgetPtr<T>& left, const U* right) // Error
friend bool operator ==(const SharedWidgetPtr<T>& left, const U* right) // OK
There should be a way to handle resource loading completely out of the library. For example if you wanna load your resources out of a zip file or you wanna use physfs (http://icculus.org/physfs/) you need to be able to load every resource with custom code.
OS: Windows7
Error at runtime:
Run-Time Check Failure #3 - The variable 'trackWidth' is being used without being initalized
This Error comes if i move the mouse over the window ....
The checkbox size doesn't mean the same thing that for other widgets. That causes some problems, specially when you are using it in a Grid.
First the widget can't be correctly centred.
Then, in a Grid, if acceptTextClick is enabled, it will be buggy. More exactly, you will lose the focus somewhere on the Text.
(https://f.cloud.github.com/assets/3678095/463918/825ffc28-b5af-11e2-9d64-4ad80b56db78.png)
OS: Windows 7
MinGW32 + Cmake 2.8.10
Start receiving this:
An internal OpenGL call failed in RenderTarget.cpp (399) : GL_INVALID_VALUE, a numeric argument is out of range
On oldest TGUI revision ab69785 all is good.
Problem config:
SFML revision SFML/SFML@718588f
TGUI revision e79a554
Win8 32 pro and Win7 64 pro
gcc 4.8.0
Hi,
I found bug in chatbox in tgui 0.7 in code below:
// Display the last lines when there is no scrollbar
if (!m_scroll)
{
if (positionY > getSize().y)
{
float diff = positionY - getSize().y;
for (auto it = m_panel->getWidgets().begin(); it != m_panel->getWidgets().end(); ++it)
(*it)->setPosition({(*it)->getPosition().x, (*it)->getPosition().y - diff});
}
}
When in chatbox is no scrollbar, appears an error in the calculation of positionY and it cause cutting off half of the last line.
I try change getSize().y on m_panel->getSize().y and it help. After that change it looks good.
I'm currently designing a console for my project using TGUI, and I've had to do a couple workarounds. I was curious if you think these implementations could be useful, if so I could attempt to add this to TGUI.
Here is an example of when adding an upside down list box could be useful
the console is actually an Edit box at the bottom for input, and a List box right above is echoing past commands for the user to see. The work around i've been doing at the moment is I've had to preallocate 13 items to fill the size of the listbox, and upon modification I need to pretend the last element is the first:
d_console_command_list = tgui::ListBox::Ptr(gui);
d_console_command_list->load("TGUI/widgets/black.conf");
d_console_command_list->setSize(400,180);
d_console_command_list->setPosition(0,0);
d_console_command_list->removeScrollbar();
d_console_command_list->setItemHeight(15);
for(int i = 0; i < COMMAND_COUNT+1; i++) {
d_console_command_list->addItem(" ", i);
}
what might be useful for others is being able to instead set the listbox to add an item starting from the bottom instead, with an on/off function say listDirection(bool up=true);
. Ugly name but you see what I'm proposing. that could cut that code down to
d_console_command_list = tgui::ListBox::Ptr(gui);
d_console_command_list->load("TGUI/widgets/black.conf");
d_console_command_list->setSize(400,180);
d_console_command_list->setPosition(0,0);
d_console_command_list->removeScrollbar();
d_console_command_list->setItemHeight(15);
d_console_command_list->listDirection(false); //list starting from bottom
not only that, but when echoing commands/output and handling when to cut off information all that would be required would when that the upper most element goes beyond a current threshold simply delete said item. It would be a much clear approach to my current way of doing this called translateUp
//move all commands up one to simulate a normal console
for(int i = 0; i < COMMAND_COUNT; i++) {
std::string next = (d_console_command_list->getItem(i+1)).toAnsiString();
d_console_command_list->changeItem(i,
next);
}
//change the last element to what the user just entered
d_console_command_list->changeItem(
COMMAND_COUNT,
d_console_edit_box->getText().getData()
);
d_console_edit_box->setText("> ");
Let me know what you think, and if you think this would be something TGUI might want to support.
I have just give a try on this GUI toolkit, and find out the menu bar fail to display Japanese.
ScreenShot:
That bug was introduced in your commit bd65356.
When you have a Label with a text like:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
turpis enim. Etiam sit amet sapien faucibus, euismod urna vel,
ultrices et quis turpis. Quisque varius consequat mauris lacinia
dapibus. Suspendisse et lorem sollicitudin, varius sit orci non,
volutpat mi.
only
Lorem ipsum
turpis enim.
ultrices et
dapibus. Sus
volutpat mi.
will be displayed, because you use the last character to determine the width of the Label.
Then use install on linux i get this problems:
=======================================================
======================= Build =========================
=======================================================
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SFML 2.1 in /home/taten/Dev/SFML_project/SFML_install/include
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/i386-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/i386-linux-gnu/libGL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/taten/Dev/TGUI_project/TGUI_build
-- Found SFML 2.1 in /home/taten/Dev/SFML_project/SFML_install/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/taten/Dev/TGUI_project/TGUI_build
Scanning dependencies of target tgui
[ 3%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TGUI.cpp.o
[ 6%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Callback.cpp.o
[ 9%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Transformable.cpp.o
[ 12%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Widget.cpp.o
[ 15%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o
[ 18%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Picture.cpp.o
[ 21%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Button.cpp.o
[ 25%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Checkbox.cpp.o
[ 28%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/RadioButton.cpp.o
[ 31%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/EditBox.cpp.o
[ 34%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Slider.cpp.o
[ 37%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Scrollbar.cpp.o
[ 40%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ListBox.cpp.o
[ 43%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/LoadingBar.cpp.o
[ 46%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ComboBox.cpp.o
[ 50%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TextBox.cpp.o
[ 53%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/SpriteSheet.cpp.o
[ 56%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/AnimatedPicture.cpp.o
[ 59%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/SpinButton.cpp.o
[ 62%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Slider2d.cpp.o
[ 65%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Tab.cpp.o
[ 68%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ConfigFile.cpp.o
[ 71%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TextureManager.cpp.o
[ 75%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Container.cpp.o
[ 78%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Panel.cpp.o
[ 81%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ChildWindow.cpp.o
[ 84%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Grid.cpp.o
[ 87%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Gui.cpp.o
[ 90%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ClickableWidget.cpp.o
[ 93%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/MenuBar.cpp.o
[ 96%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ChatBox.cpp.o
[100%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/MessageBox.cpp.o
Linking CXX shared library ../../lib/libtgui-d.so
[100%] Built target tgui
[100%] Built target tgui
Install the project...
-- Install configuration: "Debug"
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Transformable.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Label.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/SharedWidgetPtr.inl
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ClickableWidget.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/LoadingBar.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/AnimatedPicture.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/TGUI.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ChatBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/RadioButton.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/SpinButton.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/SpriteSheet.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Container.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ListBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Picture.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/MenuBar.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/SharedWidgetPtr.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Tab.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Grid.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ConfigFile.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/FormBuilder
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/FormBuilder/MenuBar.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/FormBuilder/Form.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/FormBuilder/WidgetData.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/FormBuilder/FormBuilder.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/MessageBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Config.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Scrollbar.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/EditBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Panel.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/TextureManager.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ChildWindow.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/TextBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Checkbox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Button.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Borders.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Slider2d.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/ComboBox.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Gui.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Callback.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Defines.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Slider.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/./include/TGUI/Widget.hpp
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/lib/libtgui-d.so.0.6
-- Installing: /home/taten/Dev/TGUI_project/TGUI_install/lib/libtgui-d.so
CMake Error at src/TGUI/cmake_install.cmake:73 (FILE):
file cannot create directory: /usr/local/share/tgui-0.6/widgets. Maybe
need administrative privileges.
Call Stack (most recent call first):
cmake_install.cmake:41 (INCLUDE)
make: *** [install] Ошибка 1
Problem config:
Lubuntu 13.04 x32
gcc 4.7.3
SFML revision SFML/SFML@369b7fa
TGUI revision e96d087
In my application I use Polish Locale. We are using ',' as decimal separator.
When I write something like that:
label_->setSize({ "{ ( &.w - &.h - 20 ) * 0.715 , ( &.h - 11 ) * 0.15 }" });
Layout counting it wrongly. '0.715' is interpreted as '0', because function atof expected ',' instead of '.'
But when I set decimal separator as ',' then this expression will be wrongly interpreted.
I noticed that theme loading was moved to widget creation in 0.7-dev branch.
This is much better than that in 0.6, but still leave problems for coding:
If I wanna avoid multiple theme loads for widgets, I have to use copy methods like this:
auto button1 = Button::create(filename, section);
....
button2 = button1->copy();
....
If using a theme manager, we can write codes like this, which is more graceful:
auto themeMan = ThemeManager::create(filename);
...
auto button1 = Button::create(themeMan, section);
...
auto button2 = Button::create(themeMan, secion);
...
Also, a theme manager could handle widgets of different types more efficiently, for only parsing theme config file once.
When execute this code:
tgui::Panel::Ptr m_panel = std::make_shared<tgui::Panel>();
tgui::Label::Ptr nazwa_ = std::make_shared<tgui::Label>();
m_panel->add(nazwa_, "NazwaObiektu");
nazwa_->setSize({ "{ ( &.w - &.h - 20 ) * 0.715 , ( &.h - 11 ) * 0.15 }" });
m_panel->setSize(410, 110);
I receive stack overflow.
Hello,
I have try tgui 0.8-dev for make it my project (Multi-Game launcher) ...
Lot's of work is finish , i'm happy ... Now i create "light" interface
And i have see no option for change color of label, i can't downgrade to 0.7 at this point .
Can you add it please ?
I found problem in functionality of loading/saving widgets in TGUI v0.7.
In my application I'm using polish locale. In Poland we are using ',' as separator in decimal numbers.
When I save widget in size: width = 10.5 and height = 11.5 then the output file contain:
Size: (10,5, 11,5);
The reading function doesn't handle it.
It seems that Panel do not clip any more its children.
Adding window.resetGLState();
or
window.pushGLState();
gui.draw();
window.popGLState();
has no effect.
Here is a example code that shows the issue:
#include <TGUI/Gui.hpp>
#include <TGUI/Button.hpp>
#include <TGUI/Panel.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "TGUI");
tgui::Gui gui(window);
gui.setGlobalFont("DejaVuSans.ttf");
auto panel = tgui::Panel::create({100, 100});
gui.add(panel);
auto button = tgui::Button::create();
button->setText("TGUI");
button->setSize(200, 200);
panel->add(button);
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();
}
return 0;
}
Hi,
I downloaded TGUI-0.6.5 and compiled/installed it on Linux (Ubuntu) with SFML 2.1. The examples compiled successfully too, however, they give segmentation fault. The following is the minimal example that fails (assuming sansation.ttf
is in same directory):
#include <TGUI/TGUI.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "Window");
tgui::Gui gui(window);
gui.setGlobalFont("sansation.ttf");
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();
}
}
Running through gdb
gives the following backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7f71eff in tgui::Gui::draw(bool) () from /usr/local/lib/libtgui.so.0.6.5
(gdb) bt
#0 0xb7f71eff in tgui::Gui::draw(bool) () from /usr/local/lib/libtgui.so.0.6.5
#1 0x08049324 in main ()
I commented out gui.draw();
and it runs fine, so something is wrong with that. I cloned latest TGUI branch, but same results, although I didn't try it with latest SFML branch because I assumed it should work with stable SFML version, so maybe the current branch isn't compatible with SFML 2.1?
When a ComboBox is opened:
-if there is a widget in the cell below, this widget will partially hide the ComboBox.
-if the ComboBox is at the bottom of the Grid, you won't be able to select an item when it is opened. (Focus is lost).
For the first point, I am not sure, but perhaps, everywhere, the focused widget should be drawn at the end (and handle events the first).
For the second point, the focused widget might always test if it contains the mouse or not, even if the mouse is not on the parent container.
There is a mismatch between the id a function receives when it is connected and the one returned from the connect function.
Inside connect, function registered with: id
Value returned from connect: id+1.
This leads to an exception when disconnect is called with the returned id. I have this behavior, e.g., when connecting/disconnecting a function to the clicked signal of a button.
See this code:
checkbox->bindCallbackEx(function, tgui::Checkbox::Checked | tgui::Checkbox::Unchecked);
void function(const tgui::Callback& callback)
{
if (callback.checked != callback.widget->isChecked())
cout<<"this message appears";
}
function was called before widget state was changed (callback.ckecked has the right value, not callback.widget->isChecked())
I don't fix this myself because I am not sure if there are other widgets and/or other triggers like this. Probably RadioButton...
I have proposition of new feature in ChatBox widget. Now ChatBox adds line always at the bottom of the list. I propose to add an attribute to class and/or a parameter to the add function which informs about the order of the insertion elements (new at the top or new at the bottom of the list).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.