C-sharp-console-gui-framework
C-sharp-console-gui-framework copied to clipboard
new feature: menus
Have you given any thoughts on supporting menus with perhaps sub-menus?
I was thinking about it, but as of now it's uncertain if this will be implemented as a part of the core library.
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.
@TomaszRewak What are the problems you face?
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.
Are you familiar with bitblt and double buffering
http://www.cs.sjsu.edu/faculty/beeson/courses/cs130/LectureNotes/17-DoubleBuffering/DoubleBuffer.html
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?
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.
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.
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.