(06-24-2023, 07:48 PM)Dimster Wrote: When you factor in the additional menu item choices of 2,3,4 & 5 , the code can become quite lengthy. Using the modern day QB64PE, I would think the _DELAY command would be drop rate control and "reveal" of the submenu items, as the drop progresses, would be better than the sudden appearance.
bplus is trying to help you with a solution, because adding menu items your way is an impossible way to program. It doesn't matter if you're doing a "dropdown" or any kind of menu. The thing is you need to use a string array to keep track of the elements of the menu, so you could use your menu-creating code again in the future. With the example you provided, you will be able to create that one application, and then hesitate to do another one the same way again.
What if you decided you wanted one menu option to open another menu. Ahh, the sub-menus found in many applications like Libreoffice Writer. It becomes tricky then. Have a double-dimensional string array which is each menu with its distinct set of options. This includes any menu-within-a-menu. Then it requires trickery to show the "main" menus and when to show the sub-menus.
I have code that somebody else wrote long ago for QuickBASIC for a simple menu in SCREEN 0, with colors and stuff. However it doesn't restore the screen area under the menu. Basically it clears the screen, puts on the menu, accepts the input and then clears the screen again for the rest of the program execution. I have to go dig into my backups...
EDIT: Read the previous post again. So what you want is animations? The dumbass animations I'm still trying to kill on Linux LOL which slow down my computer.
Well, then it becomes even more important how you organize your menu. You begin drawing the menu with the first item only, and the box around it. Then a very short pause. Then you redraw the menu, overwriting the bottom of the menu with the second option and restoring the whole box. Then another very short pause. And so on until you have all the menu entries. This is just visual trickery which could affect how the user could interact with the program. I don't know about you but I want snappy response in my programs without discussion. I cannot get it, for example from the QB64 IDE on Linux which is the main reason why I don't use it very much except for formatting source code to post on this forum.