C-sharp-console-gui-framework icon indicating copy to clipboard operation
C-sharp-console-gui-framework copied to clipboard

new feature: menus

Open kbilsted opened this issue 5 years ago • 9 comments

Have you given any thoughts on supporting menus with perhaps sub-menus?

kbilsted avatar Dec 03 '19 20:12 kbilsted

I was thinking about it, but as of now it's uncertain if this will be implemented as a part of the core library.

TomaszRewak avatar Dec 05 '19 19:12 TomaszRewak

Menus would be cool, but how do you imagine them working? I am most familiar with TNM console program and how it modeled menus. TNM was an awesome fantasy pro wrestling simulation tool controlled by a console.

image

jzabroski avatar Dec 05 '19 21:12 jzabroski

@TomaszRewak What are the problems you face?

kbilsted avatar Dec 05 '19 21:12 kbilsted

The problematic part of drop down menus is that this framework doesn't support displaying content outside of a control rectangle. You cannot define a negative margin to display something outside of a container. So implementing those menus would require creating an overlay over all other content. It is of course doable (that's how popups are implemented in the example), but it would require spending some time on getting the design right. One of the things that probably couldn't be done is (because of the reason mentioned before) displaying long menus opened form the strip on top of popups that would exceed those popups' size limits.

TomaszRewak avatar Dec 05 '19 21:12 TomaszRewak

Are you familiar with bitblt and double buffering

http://www.cs.sjsu.edu/faculty/beeson/courses/cs130/LectureNotes/17-DoubleBuffering/DoubleBuffer.html

jzabroski avatar Dec 05 '19 21:12 jzabroski

Actually I'm pretty sure that in the case of this framework printing characters on the screen is more expensive then calculating their state. So I don't think double-buffering would help much user-experience-wise. But of course might be worth a try.

How does this relate?

TomaszRewak avatar Dec 05 '19 21:12 TomaszRewak

But it might also depend on the terminal. At least the PS is relatively slow when it comes to displaying characters. On Linux it might be a different story.

But just as a countermeasure, I keep the current state of the screen in a local 2d array just to check if the framework actually has to update given cell. If not, no call to the Console is made.

TomaszRewak avatar Dec 05 '19 21:12 TomaszRewak

The problematic part of drop down menus is that this framework doesn't support displaying content outside of a control rectangle

@TomaszRewak In the demo example picture on the readme, you have a popup spanning several elements.

kbilsted avatar Dec 08 '19 08:12 kbilsted

Because it lives in an overlay over the entire window. So it's defined near the root element. The problematic part is if you would want to have a popup with its own dropdown menu, because it couldn't be simply stored within it. But if it would be stored next to it in the common overlay component, it would be tricky to make both components move together. Of course this wouldn't be a problem if the menu would be trimmed to the size of a popup, because then the overlay could be stored within it.

TomaszRewak avatar Dec 08 '19 11:12 TomaszRewak