Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for building a formula builder UI #8137

Open
binaryduke opened this issue Nov 8, 2024 · 0 comments
Open

Suggestions for building a formula builder UI #8137

binaryduke opened this issue Nov 8, 2024 · 0 comments

Comments

@binaryduke
Copy link

Version/Branch of Dear ImGui:

Version 1.95.1, Branch: master

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Windows 10 + MSVC 2022

Full config/build information:

No response

Details:

Looking for some suggestions on handling user interaction in a formula builder. Example UI attached.

I'm implementing a formula builder for mathematical expressions that can also handle objects within my application. The screenshot is a good example of the UI type.

I'm fine with:

  • constraining the Formula box to specific characters, e.g. mathematical operators, parenthesis, etc.
  • managing a hierarchy of functions (Insert Functions) and adding these to the formula box

I'm struggling a little with:

  • a nice way to enable deletion of an inserted Function from the Formula box. I'm toying with:
    • having the Function displayed as a small button (but then it's not an editable text box that they can use to type operators), then click to select and the delete key, or a right click popup menu, or a popup menu enabling the Function to be changed or deleted. What's most intuitive I think would be to have the user place the cursor to the right of the button or object and press the delete key. I feel like I have an inherent conflict between avoiding displaying it in square brackets (which seems nasty) and having it as a widget
  • a nice way to handle user-inserted parentheses to deal with calculation precedence. If it's a freely editable text box (with character input constraints) then this is quite simple (subject to syntax checking). If it's more object/wizard-based, then I'm struggling with how a user can define where they want to place the parentheses

Any tips, suggestions, examples would be great. Thx!

Screenshots/Video:

Screenshot 2024-11-08 at 08 40 00

Minimal, Complete and Verifiable Example code:

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant