Winmenus using wingraph
WinMenus using wingraph version 1.23
Author: Amine Moulay Ramdane
I have implemented Winmenus using wingraph, this one is graphical, i have also included an Opengl demo and other demos , just execute the real3d1.exe executable inside the zipfile to see how it is powerful.
Now it is both compatible with Delphi and with FreePascal, now it works with Delphi tokyo, but there is only one difference between Delphi and FreePascal, the double click with the left button of the mouse of freepascal is replaced in Delphi with a one click with the middle button of the mouse to avoid a problem.
Description:
Drop-Down Menu widget using the Wingraph unit. Please look at the real3d1.pas demo inside the zip file to know how to use it.
Use the 'Delete' on the keyboard to delete the items
Use the 'Insert' on the keyboard to insert the items
and use the 'Up' and 'Down' and 'PageUp and 'PageDown' on the keyboard to scroll ..
and use the 'Tab' on the keyboard to switch between the Drop Down Menus
and 'Enter' on the keyboard or mouse double click(for FreePascal) or middle mouse click(for Delphi) to select an item..
and the 'Esc' on the keyboard or right mouse click to exit..
and the 'F1' on keyboard to delete all the items from the list
and right arrow and left arrow to scroll on the left or on the right
You can search with SearchName() and NextSearch() methods and now the search with wildcards inside the Widget is working perfectly.
Winmenus is event driven, i have to explain it more to you to understand more...
At first you have to create your Widget menu by executing something like this:
Menu1:=TMenu.create(5,5);
This will create a Widget menu at the coordinate in characters (x,y) = (5,5)
After that you have to set your callbacks,cause my Winmenus is event driven, so you have to do it like this:
Menu1.SetCallbacks(insert,updown);
The SetCallbacks() method will set your callbacks, the first callback
is the callback that will be executed when the insert key is pressed and here above it is the "insert()" function, and the second callback is the callback that will be called when the up and down keys are pressed and here above it is the function "updown" , the remaining callbacks that you can assign are the following keys: Delete and F1 to F12.
After that you have to set your callback function, cause my Winmenus is event driven, so you have to add an item with AddItem() and set the callback function at the same time, like this:
AddItem('First 3D opengl demo',test1);
test1 will be the callback function.
When you execute execute(false) with a parameter equal to false my Winmenus widget will draw your menu without waiting for your input and events, when you set the parameter of the execute() method to true it will wait for your input and events, if the parameter of the execute method is true and the returned value of the execute method is ctTab that means you have pressed on the Tab key.. if the returned value is ctExit that means you have pressed on the Escape key to exit.
I have also included my Graph3D unit for 3D graphism that i have enhanced and that looks like graph unit of Turbo Pascal, and i have included GUI.pas unit that comes with more GUI components, please look at the demo.pas demo inside the zip file to know how to use my Winmenus unit and GUI unit to do GUI.
You can go to download the zip files by clicking on the following web link:
https://drive.google.com/drive/folders/1cFDhyNQ-i9F8xQIFiVxjuqg2UWTsWV1u?usp=sharing
Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freepascal.org/
Operating Systems: Windows..
Required FPC switches: -O3 -Sd
-Sd for delphi mode....