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 - texus

Pages: 1 ... 92 93 [94] 95 96 ... 99
1396
Help requests / Re: arrays on 30 editBoxes
« on: 23 July 2013, 11:49:05 »
You don't need to write quotes around the function calls.

You aren't executing the code. You're code is just like this (and hopefully you see that this won't work).
Code: [Select]
Name[i] = "blablabla";
Group1Ime[i] = "someString";

So replace
Code: [Select]
EditBoxNames[i] = Group1->get("Ime" + "to_string(i)"); // error here becouse of "", even with Ime[i]with
Code: [Select]
EditBoxNames[i] = Group1->get("Ime" + to_string(i));to remove the error.

1397
General Discussion / Re: C# binding
« on: 22 July 2013, 22:58:58 »
I looked at what I still had to do and I noticed that you won't have to expect any progress soon.

I don't see a reason for changes like inheriting from the IDisposable class. Unlike sfml which makes calls to the C lib, I made a port and everything should be managed resources. So the code seems finished.
The TextBox won't be written as I will wait for the c++ version to change (the new form builder has a bigger priority).
And copying the c++ documentation is also a lot of work (going from javadoc to the xml docs).
Last but not least, eveything should be tested, but I don't even find the time to do that for the c++ version.

So you can consider the current version as final for now.

The only thing that I actually did in the last few days for the c# version, was buying and setting up a new site for it.
I also added tested the library on a different linux pc and wrote a tutorial for it.
The TGUI.Net library can now be found on tgui.net.

Edit: Some changes that were made in the c++ version in the last weeks aren't in the c# version yet. So there might be another version coming with these changes, but I won't put a date on it. And everything should remain compatible so when the time comes you can just replace the old dll with the new one.

1398
General Discussion / Re: Basic auto resizing is working!
« on: 21 July 2013, 20:22:56 »
I don't have the time to look into this right now, but I have a small question.

How do you know when the widgets need to be resized?
The resize event tells that the window gets resized, but because the view stays the same, everything gets stretched by default. The resizing and repositioning should happen when the the view gets changes, right? Then you would have to call some function to resize the gui.

Could you also send me a more full code, because I still don't completely get the picture of how the gui responds exactly.

1399
Help requests / Re: scrollbar tutorials?
« on: 19 July 2013, 20:13:45 »
Then just use Container* instead of Panel*. Right now I'm just writing example code, not necessary something that can be compiled.

1400
Help requests / Re: scrollbar tutorials?
« on: 19 July 2013, 19:52:20 »
The line should be
Code: [Select]
std::cout << callback.widget->getParent()->get("Group1").get() << std::endl;(which prints the real internal pointer instead of my smart pointer class)

Wait, you made the scrollbar part of Group1 right?
That line assumes that scrollbar is part of the gui. It first asks for the parent (which is supposed to be gui) and then search for the panel called "Group1". But your scrollbar is part of Group1, so when accessing the parent, you already find Group1 and you thus no longer have to search for it.

So change
Code: [Select]
tgui::Panel::Ptr Group1 = callback.widget->getParent()->get("Group1");into
Code: [Select]
tgui::Panel* Group1 = callback.widget->getParent();
As you can see sometimes have to use a normal pointer (*) and sometimes my smart pointer (::Ptr).
This is still a bit of a problem in tgui, but I'll look into this so that in the future everything should work with these smart pointers.

1401
Help requests / Re: scrollbar tutorials?
« on: 19 July 2013, 19:26:27 »
Right before this line
Code: [Select]
tgui::Scrollbar::Ptr scrollbar(*Group1, "Scrollbar");add
Code: [Select]
std::cout << Group1.get() << std::endl;
On top of your scrollbarValueChanged function add
Code: [Select]
std::cout << callback.widget << std::endl;
std::cout << callback.widget->getParent() << std::endl;
std::cout << callback.widget->getParent()->get("Group1") << std::endl;

And perhaps add this inside the for loop in scrollbarValueChanged
Code: [Select]
std::cout << widgets[i].get() << std::endl;
Is any of the things that get printed a null pointer?
The error means that you are calling a function on some null pointer, so somewhere, something isn't initialized properly.

1402
Help requests / Re: scrollbar tutorials?
« on: 19 July 2013, 17:52:10 »
I see two solutions for the scrollbar.
- You have the scrollbar directly in the gui. When loginScreen or mainScreen is visible, you call scrollbar->hide() and when Group1 becomes visible again you call scrollbar->show().
- You make a different scrollbar inside every groups that need it. This will allow every scrollbar to have its own callback function and to do different things in every group.

The reason why your Group2 doesn't react on the scrollbar, is that you access Group1 in scrollbarValueChanged.
If you could find a way to access the current group, e.g. holding some string that contains either "Group1" or  "Group2" and then use the string like this:
Code: [Select]
tgui::Panel::Ptr panel = callback.widget->getParent()->get(theString);Then you can keep the scrollbar in your gui and it will be able to scroll the widgets in whatever group you want by just adjusting the string.

1403
Help requests / Re: scrollbar tutorials?
« on: 19 July 2013, 10:02:51 »
Quote
So
Code: [Select]
tgui::Scrollbar::Ptr scrollbar(*Group1);
Doesnt work, when i change values of scrollbar [with mouse or mouse scroll] program crashes with
Code: [Select]
/usr/local/include/TGUI/SharedWidgetPtr.hpp:271: T* tgui::SharedWidgetPtr<T>::operator->() const [with T = tgui::Panel]: Assertion `m_WidgetPtr != __null' failed.
You are doing something with a null pointer. At first I was a bit surprised because I though this crash came from inside tgui, but I think the problem lies in your scrollbarValueChanged function.
Do you have code like "gui->get("Scrollbar")" there or something like that?

Because what I notice is that when you pass 'gui' to it you also give the widget a name, but when you pass '*Group1' to it you don't give it a name.
So if it is the problem that I suspect than you just need "tgui::Scrollbar::Ptr scrollbar(*Group1, "Scrollbar");".

Although I don't see why the scrollbar should be inside the panel instead of just in the gui.

Quote
except i see scrollbar in panel where i dont need scrollbar
What exactly do you mean with this?

Quote
Need to figure out how to access each editBoxes to read it values, and to modify them.
You can get them back later with the get function on your Group1.

But make sure all widgets have unique names.
If you are still creating the pictures as before then you are going to get name conflicts.
You are calling your pictures "1", "2", "3", "4", ...
But you are also calling your edit boxes "1", "2", "3", "4", ...

So maybe you should write
tgui::EditBox::Ptr Name(*Group1, "EditBox" + tgui::to_string(i));
Like this, your edit boxes will be named "EditBox1", "EditBox2", "EditBox3", ...
And you can get them from Group1 later with this name.

If you would have two widgets with the same name then getting them from Group1 will only give you the first occurence (first added widget with that name), and it will be impossible to access the other widget.

1404
General Discussion / Re: Widget config files bug
« on: 19 July 2013, 09:42:49 »
That's because I don't think Slider2d should be a widget that belongs to the Black theme.
My original idea for Slider2d was to create something like a color scheme.

I kept it seperately because I don't think people will need to use a slider2d with these image very much.

There just are no images that fit with the BabyBlue style (just like for Tab, although this is going to be added later).

1405
Help requests / Re: scrollbar tutorials?
« on: 18 July 2013, 23:05:12 »
Too bad that I don't drink beer :)

1406
Help requests / Re: scrollbar tutorials?
« on: 18 July 2013, 19:23:39 »
You missed something in my previous message.
Quote
Then at the end of your scrollbarValueChanged function, you set it to "callback.value".

Adding "scrollbarValue = callback.value;" at the end of scrollbarValueChanged makes it work.

1407
Help requests / Re: scrollbar tutorials?
« on: 18 July 2013, 10:34:19 »
You should just fix your setPosition formula. You set all widgets to x=20, so obviously the buttons will change their original position.

The trick is to keep all objects on their starting position minus the scrollbar value.

For this you will also need the old scrollbar value, so you'll have to store that.
In the example code, you could make a global variable scrollbarValue (int) and set its value to 0.
Then at the end of your scrollbarValueChanged function, you set it to "callback.value".

The setPosition line would then have to become:
widgets[i]->move(0, scrollbarValue - callback.value);

That should solve all problems.

Also, the scrollbar isn't part of the panel I guess, so you no longer have to check the widget name against "Scrollbar" as that will never match.

1408
Feature requests / Re: Label - set size
« on: 17 July 2013, 23:35:47 »
Clipping was removed earlier because the fix wasn't in sfml yet. I agree that now the fix is already in the github version and because most people do use windows it isn't a problem to add it again.

The changes have just been pushed.

1409
Help requests / Re: scrollbar tutorials?
« on: 17 July 2013, 22:57:14 »
Your scrolling the whole gui, including the panel. You can easily see this when you give the panel a background color. You should only be scrolling the contents of the panel.
void scrollbarValueChanged(const tgui::Callback& callback)
{
    tgui::Panel::Ptr panel = callback.widget->getParent()->get("Group1");

    // Reposition the object
    std::vector<tgui::Widget::Ptr> widgets = panel->getWidgets();
    std::vector<sf::String> widgetNames = panel->getWidgetNames();

Also if you don't want the buttons to move then you should just add them to the gui (pass 'gui' as parameter instead of '*Group1' when creating them).

1410
Installation help / Re: gcc errors in linux
« on: 17 July 2013, 22:06:34 »
Thanks for testing these builds.

But I think it is not really necessary to test the gcc builds on linux. You use the same compiler than I am and I am getting smarter recently, I'm starting to actually compile the builds myself before pushing to github. I do forget it from time to time, but usually I am aware of warnings.

Pages: 1 ... 92 93 [94] 95 96 ... 99