Skip to content

Conversation

@AntonioND
Copy link

@AntonioND AntonioND commented Nov 2, 2024

All I've had to do was to fix a build error due to a missing include.

The tests don't build due to a missing header (gadgeteventargs.h) so no
new makefiles have been added to the tests folder.

Also, some fixes have been added to this PR (one of them thanks to
@Gabryx64).

@AntonioND
Copy link
Author

I'm not sure if you're interested in this. If you aren't, I can keep the changes in my fork.

The tests don't build due to a missing header (gadgeteventargs.h) so no
new makefiles have been added to the tests folder.
AntonioND and others added 2 commits January 14, 2025 01:38
I fixed the TextBox class by simply replacing everything with just a
subclass of MultiLineTextBox and ovverriding some methods.

I also fixed a bug in MultiLineTextBox that wouldn't let me open a
keyboard by double clicking if it was empty. I simply initialized the
object with "." as text if the text was empty and then after the first
draw I removed the dot and made the gadget be redrawn.
The red slider is currently broken.
Some gadgets disable events temporarily so that they can do tasks
without triggering user-defined handlers.

We need a new getRaisesEvents() helper to get the original state of the
raisesEvents flag because raisesEvents() doesn't just return the value
of the flag, it also checks if there is an event handler and if the
shelved flag is true.

This was discovered because ColourPicker had a bug where the red slider
wouldn't update the color, but the others did. That happened because the
dimensions of the red slider were changed before assigning an event
handler, so raisesEvents() was false even though the raisesEvents flag
was true.
This was pretty obvious in the "keyboard_textbox" example, where pressing
the shift/caps lock button. The rightmost part of the characters in the
keyboard wouldn't be cleared correctly, some part of it would remain when
shifting from uppercase to lowercase (because uppercase is bigger).

This change also has the effect of reducing the size of the binary because
it reuses markTextRectDamaged() rather than reimplementing similar code in
all the affected functions.
@AntonioND AntonioND changed the title Add support for BlocksDS Add support for BlocksDS and various fixes Mar 2, 2025
@AntonioND
Copy link
Author

As you see, this PR also has a few bugfixes as well. I'm not sure if you're maintaining this library right now. If you want to ignore the BlocksDS build system you can also apply the other patches by yourself, or I can remove them from this PR.

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

Successfully merging this pull request may close these issues.

2 participants