Menu

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.

Show posts Menu

Messages - rbenn674

#1
Help requests / Re: Enabled
18 December 2022, 22:57:27
Thanks for the reply.

I verified no issue as you mentioned with a new knob. I realized the OpacityDisabled was set to "0" instead "-1" default. Not entirely sure what that does but that was the cause of my issue. Thanks again for leading me in the right direction.
#2
Help requests / Enabled
18 December 2022, 18:07:45

I was under the impression that enable = 0 should make the widget visible, but not actionable.

QuoteVisible and enabled
The enabled property determines if a widget receives events. If a widget is disabled, it will still be drawn but it will be unresponsive to your mouse clicks.


However, if I set a widget enable to false, this also makes my widget no longer visible. Is this intended?

I am trying to set a knob to exact positions based on a separate event, whereas the knob itself isn't adjustable (ie:disabled).
#3
Found 3 of the bigger ones with leak type you mentioned..

    valueEditBox->onReturnOrUnfocus([=]{ onChange(valueEditBox->getText()); });
    buttonMore->onFocus([=]{ m_propertiesContainer->focusNextWidget(); });
square->onMousePress([=](tgui::Vector2f pos){ onSelectionSquarePress(square, pos); });

 This solved most of the leaks.
#4
I feel at least one item maybe
    for (auto& widget : widgets)
    {
        auto icon = tgui::Picture::create("resources/widget-icons/" + widget.first + ".png");
        auto name = tgui::Label::create(widget.first);
        name->setPosition({icon->getSize().x * 1.1f, "50% - 10"});
        name->setTextSize(14);

        auto verticalLayout = tgui::VerticalLayout::create();
        verticalLayout->setPosition(0, topPosition);
        verticalLayout->setSize({bindWidth(toolbox) - toolbox->getScrollbarWidth(), icon->getSize().y + 4});
        verticalLayout->getRenderer()->setPadding({2});

        auto panel = tgui::Panel::create();
        panel->getRenderer()->setBackgroundColor(tgui::Color::Transparent);
        panel->add(icon);
        panel->add(name);
        verticalLayout->add(panel);
        toolbox->add(verticalLayout);

        panel->onClick([=]{
            createNewWidget(widget 




I need to look into it further but it seems like "widget" is a pointer that creates a bunch of panel objects with lambda calls and then disappears with the objects still existing. Nothing that I can see owns these objects to deconstruct them.

I suppose it gets eventually added to m_gui by copy which should get removed on deconstruction. But I'm not sure about the original created panel and vertical layout, I suppose I need to look at the create() function.

The onClick() does get passed many copies, but they should be deleted on the m_gui->removeAllWidgets().

Screenshot 2022-12-12 215907.png
#5
Any ideas on where some of the biggest leakers would be on load? I see a lot of text edit box objects and I feel the toolbox() that gets reloaded may be one of the culprits. I also saw a lot of mouse events in the GUI base and container duplicated. I assume there is a pointer to an object that gets recreated on every load. Just trying to correct anything major that isn't being emptied/deconstructed before a re-loaded state.



Screenshot 2022-12-10 232442.png
#6
Eh, just noticed that it was catching it and setting the field to blank. Guess no harm really.
#7
Ever noticed the bad_cast being thrown on creation of objects due to the UserData field or is this just me?
I just noticed the program was throwing them on object creations.


Screenshot_20221210_065153.png
#8
Well I did as you mentioned and built the program using the pre-compiled files with the root file Cmake... It works perfectly the first attempt (after including the resource folder etc. so it doesn't close immediately).

I then deleted my repository gui-builder folder contents, re-ran the cmake and tossed all the same .dll files + resource folder .etc from the precompiled build and everything works now. Not sure why it wasn't working before, either a glitch with cMake or one of my .dll files was incorrect like tgui-d.dll ?
Anyways, thanks for the help...
#9
I am using Cmake inside of Visual Studio. I am building the gui-builder.exe itself with rewritten source code, so I assumed CMake was required to do this.

I am using the pre compiled for my project (for which I have no issues), but in modifying the gui-builder I am using github pulls and Cmake.

I checked my cmake for the working debug repository and it is exactly the same. So strange.

There is two options to build in my cmake for "install" or "build":

Screenshot_20221209_015046.png

JSon for cmake:

{
  "configurations": [
    {
      "name": "x86-Debug",
      "generator": "Ninja",
      "configurationType": "Debug",
      "inheritEnvironments": [ "msvc_x86_x64" ],
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "variables": [
        {
          "name": "SFML_DIR",
          "value": "C:/Users/rbenn/Documents/Visual Studio 2019/SimpleGui/SimpleGui/SFML-2.5.1/lib/cmake/SFML",
          "type": "PATH"
        },
        {
          "name": "TGUI_USE_STATIC_STD_LIBS",
          "value": "False",
          "type": "BOOL"
        },
        {
          "name": "TGUI_SHARED_LIBS",
          "value": "False",
          "type": "BOOL"
        },
        {
          "name": "CMAKE_MAKE_PROGRAM",
          "value": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe",
          "type": "FILEPATH"
        }
      ]
    },
#10
I am using a pre-compiled version of SFML 2.5.1.

Yes they are in two different folders:
out\install\x86-Release\lib

out\install\x86-Debug\lib

Looking into the debug library I see tgui-d.lib & pdb, and tgui-s-d.lib & tgui-s-d.lib are inside.

Yes, Define Static was performed. I actually have tried many combinations of options in CMAKE to try to make the build work without issues.

gdi32.lib was not in the SFML folder and never has been. The other two are in there.

I redownloaded the "Visual C++ 15 (2017) - 32-bit" and verified gdi32.lib does not exist.

The strange thing is, I have a separate repos directory that does work in debug mode, and in static, although I had to change settings in cmake quite a bit to get that to work, and in that build I cannot get the dynamic linking to work.

Also, what is difference between the "gui-builder.exe (install)" and "gui-builder.exe" ?
#11
When using Cmake to compile and run a debug version of gui-builder I receive the following error:

Exception thrown at 0x79C8F860 (sfml-system-d-2.dll) in gui-builder.exe: 0xC0000005: Access violation reading location 0x00000027.

I have tried compiling as a static exe but I always seem to get a load of LNK issues. I have successfully compiled and run the release version with no issues.

Screenshot 2022-12-08 170346.png
#12
Feature requests / Re: GUI Builder
06 December 2022, 23:06:11
I agree it will be a fair challenge. It may require rewriting some other parts of the code in order to "log" each action in parts. But just like you mentioned a partial functionality allowing the undo of a single deletion or moved object would be great.
#13
Feature requests / GUI Builder
06 December 2022, 21:06:39
This is a really helpful and useful tool.  It would be very beneficial to add a "Control Z" or undo / redo button. Also, draggable widgets in the layer list to move them from group to group would be helpful. Maybe I can help with this in time.
#14
Fixed it. The unsigned int was throwing it off. Changed it to

group1->setPosition(10, (-(float)scrollValue));
with success.

Thanks for the help.
#15
Initially
group1->setPosition(0,-scrollValue);Error:   C4146   unary minus operator applied to unsigned type, result still unsigned         


Changed to
group1->setPosition(0,0-scrollValue);
This worked, however as soon as scrollValue goes positive from 0 the group disappears completely and will not return onto the screen even when scrollValue is returned to 0.

Actually tried setting position to any value and it disapears. Not sure what I am missing.
#16
So the problem with this is the following:

Say I have a group with positon 0, 0 but my button in the group is at 150, 150. As I scroll the screen down the group needs to move up and off the screen, however this would require the positon to be subtracted from 0, ie a negative number. When entering a new positon of a negative number an error will appear.

Also, I don't see any function to change the positon of the group currently available.

I suppose I could create a double large window, say 4096 x 4096, instead of 2048 x 2048, move the window view to start at 2048, 2048 instead of 0, 0  to allow objects to move up off the screen, but that seems a bit inefficient as well... But maybe the larger window isn't inefficient as long as the view is smaller.
#17
Furthering this question, I would like to use 2 GUI objects so that I can move the view of one GUI, and leave the view of the other gui the same so that it stays on top since it has the file menu header and scroll bars etc.. Does this seem logical or would it be more beneficial to do this in 1 gui object?

I haven't found a good way to make the individual groups or panels move correctly within a single GUI. Normally with a window you can update the view and move it around a larger image. You can do this with a single gui but it moves the whole gui, however I'm not sure about moving individual groups or panels or canvases.
#18
When you have both optional and custom callback parameters ie:
button4->onPress([](int customValue, tgui::String buttonText){ /* ... */ }, 5);
How do you do the same thing with a function pass?

For instance, you do this to get the button text by itself:
void buttonPressedCallback2(tgui::String buttonText);
button4->onPress(&buttonPressedCallback2);

But say I have a custom parameter as well I want to pass to the function as well, I can't find a way to make it work except with using Lambdas.
#19
Help requests / Re: Child Window Clipping
04 December 2022, 23:44:23
Disregard. The group size was set smaller than the window size preventing it from moving outside the group.
#20
Help requests / Child Window Clipping
04 December 2022, 23:01:57
Hello, for some reason the child window is being clipped around the original view resolution after the window has been resized. I have tried increasing the gui view size but it still does not render it. The strange thing is I can render a panel outside this area, just not the child window.

Any idea how I allow for tgui to draw the child window to the new window size?

Screenshot 2022-12-04 170056.png
#21
I updated my VS to the newest version and all errors are now gone :) . You must be using a lot of C++20 methods where I am still stuck in my old C++ 11 and 03 standards as that is when I was taught.

Thanks
#22
Yes, selecting build will remove the errors listed but I still have all the error marks on the code page. I will try updating my VS, but I have other projects and libraries with 0  errors in IntelliSense. I can understand warnings, but the errors being there is a little too much for me.
#23
Installation help / Incomplete Type is not allowed
03 December 2022, 02:34:23
I am getting a lot of "Incomplete Type is not allowed" errors on VB 2019. I don't see any issues with the header files and it does compile but I am still lit up with errors. Any ideas?

Screenshot 2022-12-02 202244.png