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

Messages - Djer

#1
Help requests / Re: v0.7 lack of examples ?
16 January 2016, 23:00:42
Okay, thanks !
#2
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.
#3
It looks great!

setValidator seems good to. So it's your choice :)

And thanks for your availability for the users !

#4
I didn't know what a regex is. I just learn it from google. It's very interesting !

I think setTextRule will be easier to understand that setTextRegex for people who don't know what a regex is... (like me  ::) )
and I think the word "rule" is quite representative

Or maybe setInputRule?

:)
#5
I made a mistake, I want to say tgui::EditBox indeed.

Yes, just pass it a function seems good and will keep it simple :)

You're right, the behavior that I explained is too specific.

Good luck for your exams (I'm too in exams for the moment...)
#6
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 :)

#7
Help requests / Re: TGUI v0.7 signal names
07 January 2016, 13:14:37
Thank you !  :)
#8
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?  :)
#9
Oh very sorry I made a mistake, I setted the color somewhere in my code... !

Promised next time I'll be more careful before to post.
#10
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 ! :)
#11
Help requests / Re: problem with Grid
16 June 2015, 18:28:37
Thank you very much.

I completely missed the order to call the functions for the buttons. It's more logic to first load it effectively ...

And for my program I'll do like you said, I'll create a function who manage the widgets positions.

Thanks yet for your help ! :)

#12
Help requests / Re: problem with Grid
16 June 2015, 17:44:10
Tanks for your fast response ! :)

Do you have an idea of how I should do to have a beautiful resizable program with no Grid?

I just want the program are not made only for one fixed resolution ... :/

And for the buttons who doesn't display their text here is my minimal code :


#include <TGUI/TGUI.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    sf::RenderWindow window(sf::VideoMode(1024, 768), "My window");

    tgui::Gui gui(window);

    if(!gui.setGlobalFont("TGUI/fonts/DejaVuSans.ttf"))
        std::cout << "Erreur lors du chargement de la police" << std::endl;

    tgui::Grid::Ptr grid(gui);
    tgui::Button::Ptr buttonA(*grid);
    tgui::Button::Ptr buttonB(*grid);

    buttonA->setText("ButtonA");
    buttonA->setTextFont(gui.getGlobalFont());
    buttonA->load("TGUI/widgets/Black.conf");

    buttonB->setText("ButtonB");
    buttonB->setTextFont(gui.getGlobalFont());
    buttonB->load("TGUI/widgets/Black.conf");

    grid->setGlobalFont(gui.getGlobalFont());
    grid->addWidget(buttonA, 0, 0);
    grid->addWidget(buttonB, 1, 0);
    grid->setSize(1024, 768);




    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();
    }

}
#13
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 ... :)