Main Menu
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

Topics - Djer

#1
Help requests / v0.7 lack of examples ?
16 January 2016, 21:13:40
Hi Texus,

How can we know how to create widgets? (The widgets constructors in the documentation don't help us since they are created by the tgui::Theme)
How can we know if we have to use the tgui::Theme::load() function to create a widget?

The examples show us just a few widgets...

For example, the tgui::Panel::Ptr doesn't require the tgui::Theme::load() function to be create.
#2
Hello (again, today) Texus,

That would be great to add a way to define a rule for checking the text in a tgui::EditBox.
I have create my own way to do that, so it's not urgent, but that would be great to add it to you library when you have some time :)

I saw an old post on that where you said that :

Re: Limiting Type of Input Edit Box/Text Box Accepts
« Reply #1 on: November 23, 2015, 04:56:05 pm »


1) You can call editBox->setNumbersOnly() to disallow text in it, but there is currently no way to limit the edit box to integers only (e.g. the following can be written in a numbers only edit box: "-1.235e6"). There are a lot of different uses for limiting characters (some would want only positive integers, others would want floats but without the optional 'e' behind it, ...) and I have not yet found a way to provide a proper way to allow all these possibilities.

2) An edit box is a single line of text without newlines, a text box is a multi-lined text field.



Maybe you can just add a function to the tgui::TextBox:

void setTextRule(std::unique_ptr<TextRule> rule)


The TextRule class would have a virtual bool check(std::string textEntered) function

And so we can create our own rules by creating a class inherited by TextRule

You can just check if the text entered correspond to our expactations by calling the check() function on the event lostFocus

The constructor of TextRule would take a default value (string) who can be used when the user enter a bad text.

and why not too a description of the expected value (used for the tooltip)? ...And the possibility to put a messageBox with this description when the user enter a bad value.


I don't think it would take a lot of time :)

#3
Help requests / TGUI v0.7 signal names
07 January 2016, 11:34:09
Hello,

I would like to upgrade my TGUI version.
So I read the v0.7 tutorials and I saw that the type of signal is now represented by a string instead of an enum.
I looked for the different values we can use (like : "pressed", "clicked", "checked" ...) in the documentation but I didn't see them ... :/

Is there a list of that values somewhere?  :)
#4
Hi,

I report that it is actually (in 0.6.6 version) not possible to change the text color of a MenuBar, I tested it with the .conf file and with the setTextColor().
We can just change the SelectedTextColor but not the TextColor.

A simple oversight ?

Thanks you yet for the library ! :)
#5
Help requests / problem with Grid
16 June 2015, 15:59:19
Hello,

First thanks you very much for this amazing library, it makes my life easier.

I want to create a map editor for a small game in a resizable window. So I think that Grid can help me.

For now I tried to create a MenuBar inside a Grid but after many tests, It doesn't work.

Here is a summary of my code :

m_fileMenuBar->load("TGUI/widgets/Black.conf");
    m_fileMenuBar->addMenu("File");
    m_fileMenuBar->addMenuItem("File", "New");
    m_fileMenuBar->addMenuItem("File", "Open");
    m_fileMenuBar->addMenuItem("File", "Save");
    m_fileMenuBar->addMenuItem("File", "Save as");
    m_fileMenuBar->addMenuItem("File", "Close");
    m_fileMenuBar->addMenuItem("File", "Quit");

    m_fileMenuBar->addMenu("Edit");
    m_fileMenuBar->addMenuItem("Edit", "Copy");
    m_fileMenuBar->addMenuItem("Edit", "Cut");
    m_fileMenuBar->addMenuItem("Edit", "Paste");

    m_fileMenuBar->addMenu("Options");

    m_fileMenuBar->setSize(800, 40);
    m_fileMenuBar->setTextColor(sf::Color::White);
    m_fileMenuBar->setTextFont(tgui::Gui::getGlobalFont());


    m_button1->load("TGUI/widgets/Black.conf");
    m_button1->setText("BUTTON1");

    m_button2->load("TGUI/widgets/Black.conf");
    m_button2->setText("BUTTON2");


    m_mainGrid->addWidget(m_fileMenuBar, 0, 0);
    m_mainGrid->addWidget(m_button1, 0, 1);
    m_mainGrid->addWidget(m_button2, 0, 2);
    m_mainGrid->setPosition(0,0);
    m_mainGrid->setSize(1920, 1024);


(That code is for testing)

The two Button don't display their text and the Menubar doesn't respond to mouse clic correctly.

Do I do anything incorrectly ?

--> Sorry for my English, I speak French ... :)