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

[Suggestion] Code editor #20

Open
system64MC opened this issue Mar 13, 2025 · 8 comments
Open

[Suggestion] Code editor #20

system64MC opened this issue Mar 13, 2025 · 8 comments

Comments

@system64MC
Copy link
Contributor

Hi! I just found this : https://github.com/BalazsJako/ImGuiColorTextEdit
Do you think this is a good idea to implement this into Imguin?

Thanks for your answer! Also big thanks for your library! Here is what I'm developing with it :

Image

@dinau
Copy link
Owner

dinau commented Mar 13, 2025

Hi, probably updated and implemented for C language version is here
https://github.com/cimgui/cimCTE
I will try implement it for Nim language.

Your application is very cool!

@dinau
Copy link
Owner

dinau commented Mar 14, 2025

That implementation has been done in my local repository.
I'll upload it later.

Image

@dinau
Copy link
Owner

dinau commented Mar 14, 2025

Push has been done.

Update imguin and imguin_examples repository then please try this
https://github.com/dinau/imguin_examples/tree/main/glfw_opengl3_imColorTextEdit

@system64MC
Copy link
Contributor Author

Push has been done.

Update imguin and imguin_examples repository then please try this https://github.com/dinau/imguin_examples/tree/main/glfw_opengl3_imColorTextEdit

Image
Tried both the demo and in my software, works pretty nice! Thanks a lot!
However, is it possible to know when the text is modified? I need to execute some code when I modify the text.
Thanks for your answer!

@dinau
Copy link
Owner

dinau commented Mar 15, 2025

It seems the function that checks modification for text doesn't exist,
so you should check it by your program with Hash function so on.

@system64MC
Copy link
Contributor Author

It seems the function that checks modification for text doesn't exist,
so you should check it by your program with Hash function so on.

I think I found a much more lightweight solution. I can query the Undo Index. What I do is I query this index before I render the editor, and then I query it again after rendering
If the indexes are different, that means some editing was done and thus, the text was changed.

@dinau
Copy link
Owner

dinau commented Mar 16, 2025

That's the good idea!

@system64MC
Copy link
Contributor Author

Hi! I found a problem.

Seems the ALT GR key (or CTRL + ALT) does't work in the editor. I have an AZERTY keyboard and thus, I can't have the square brackets.

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

2 participants