Skip to content

Conversation

lizlooney
Copy link
Collaborator

Show button instead of event handler block in toolbox if the event handler has already been used.

Modified code that puts event handler blocks in the toolbox so that if an event handler is already on the workspace, a button for that event is put in the toolbox. If the user hits the button, an info message tells the user that the event handler is already on the workspace.

Added class Button to toolbox/items.ts.
Added support for making a category initially expanded.
Cleaned up other classes in toolbox/items.ts.

Modified getHardwareCategory in toolbox/hardware_category.ts so the Hardware or Robot category are initially expanded.

Modified getToolboxJSON in toolbox/toolbox.ts so it prevent a problem with blockly choking on our Category class.

Added support for making a category initially expanded.
Cleaned up other classes in toolbox/items.ts.

Modified getHardwareCategory in toolbox/hardware_category.ts so the Hardware or Robot category are initially expanded.

Modified getToolboxJSON in toolbox/toolbox.ts so it prevent a problem with blockly choking on our Category class.

Modified code that puts event handler blocks in the toolbox so that if an event handler is already on the workspace, a button for that event is put in the toolbox. If the user hits the button, an info message tells the user that the event handler is already on the workspace.
@lizlooney lizlooney requested a review from alan412 September 6, 2025 04:47
@lizlooney
Copy link
Collaborator Author

Here's what it looks like:

Screenshot 2025-09-05 at 9 49 50 PM

Here's what it looks like when the user clicks on the button:

Screenshot 2025-09-05 at 9 50 10 PM

Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this! A few minor comments.

If the blockly workspace is RTL, reverse the words in the button text.
@lizlooney lizlooney requested a review from alan412 September 9, 2025 06:32
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one minor question, but really this can be merged either way.

@lizlooney lizlooney merged commit c6cbe4f into wpilibsuite:main Sep 9, 2025
1 check passed
@lizlooney lizlooney deleted the pr_event_handler branch September 9, 2025 15:21
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