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

Create Rollup Box GUI element #406

Closed
wants to merge 2 commits into from

Conversation

Spacerulerwill
Copy link

I propose the addition of a GuiRollupBox function, which is similar to the GuiDropdownBox function but the elements appear above instead of below. This is useful in cases where there is a bottom-level toolbar that still need some kind of select menu, as shown below. With a GuiDropdownBox the elements would have fallen off the bottom of the screen.
rollupbar
To implement this, I have refactored the logic of GuiDropdownBox into a new function called GuiDropdownBoxEx, which accepts an additional parameter for direction. This allows both GuiDropdownBox and GuiRollupBox to share the same core functionality, only differing by which direction they pass to GuiDropdownBoxEx. This is my first proper open source contribution so I apologize in advance for any mistakes.

@raysan5
Copy link
Owner

raysan5 commented May 31, 2024

@Spacerulerwill This property could be added to GuiDropdownBox() but the PR should be redesigned to follow raygui design.

A new property can be added in GuiDropdownBoxProperty, for example DROPDOWN_ROLL_UP, with default/initial value as 0. Then consider that property directly on GuiDropdownBox() with no need to add new controls.

So users will write code as:

GuiSetStyle(DROPDOWNBOX, DROPDOWN_ROLL_UP, 1); // Setup dropdown box to roll-up
GuiDropdownBox(...);
GuiSetStyle(DROPDOWNBOX, DROPDOWN_ROLL_UP, 0); // Reset dropdown box to roll-down

@raysan5
Copy link
Owner

raysan5 commented Jul 16, 2024

@Spacerulerwill Are you reviewing this PR with proposed changes?

@Spacerulerwill
Copy link
Author

@Spacerulerwill Are you reviewing this PR with proposed changes?

Apologise for the delay, I forgot about your response. I will review it in the coming days and make the changes

raysan5 added a commit that referenced this pull request Jul 18, 2024
@raysan5
Copy link
Owner

raysan5 commented Jul 18, 2024

@Spacerulerwill Just added it, I needed it for one of my tools. Thanks anyway!

@raysan5 raysan5 closed this Jul 18, 2024
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