Code Monkey home page Code Monkey logo

Comments (4)

raysan5 avatar raysan5 commented on June 21, 2024 1

This is how I use the GuiTextBox():

// User side GuiTexBox variables
char textBoxText[64] = "My text";
bool textBoxEditMode = false;

// Control drawing (ENTER accepts input text)
if (GuiTextBox((Rectangle){ 25, 215, 125, 30 }, textBoxText, 64, textBoxEditMode)) textBoxEditMode = !textBoxEditMode;

// But... what should happen if ESCAPE is pressed? Accept current input or cancel current edition?
if (textBoxEditMode && IsKeyPressed(KEY_ESCAPE)) 
{
    // In some of my tools ESCAPE is used to undo current edit and return to previous value (rGuiLayout tool)
    // So users are free to manage that kind of scenarios themselfs
    textBoxEditMode = false;
}

from raygui.

raysan5 avatar raysan5 commented on June 21, 2024

I didn't add it because it could be problematic for some users. In my tools I just manage it on user-side, that's a benefit of the functions that register the edition mode.

from raygui.

danielchasehooper avatar danielchasehooper commented on June 21, 2024

Problematic? How so? That's how OS controls work.

What is the edition mode? I don't see anything named like that in the code.

from raygui.

raysan5 avatar raysan5 commented on June 21, 2024

Escape key should be managed at user level due to the implications it could imply on main program.

from raygui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.