Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4479

Winmenus 1.31

From aminer <aminer@toto.net>
Newsgroups comp.programming
Subject Winmenus 1.31
Date 2014-06-01 19:31 -0700
Organization albasani.net
Message-ID <lmgd3g$rfo$1@news.albasani.net> (permalink)

Show all headers | View raw


Hello,

As i have told you just before , i am a fan of good old days of Turbo 
Pascal, this is why i have designed my Parallel archiver like that, also 
i have implemented another one of my libraries called Winmenus
and you have to take a look at this one, i have also designed it like
that cause i am a fan of good old days of Turbo pascal, it can be 
compiled for 32 bit and 64 bit for Win32,Win64,Linux,OSX (x86).

I have designed Winmenus like that to code some of my projects as
Windowss or Unix commands for shell console... believe me the access 
from the keyboard methodology can be good and fast ...

Here it is:

WinMenus version 1.4

Author: Amine Moulay Ramdane

Description:

Drop-Down Menu widget using the Object Pascal CRT unit. Please look at 
the test.pas(a kind of file manager for windows) and test1.pas examples 
inside the zip file.

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' to scroll ..
and use the 'Tab' on the keyboard to switch between the Drop Down Menus
and 'Enter' to select an item..
and the 'Esc' on the keyboard 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

Winmenus is event driven, i have to explain all 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 (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(test,insert,updown);

The SetCallbacks() method will set your callbacks, the first callback 
parameter is the callback that will be executed when the "Enter" key is 
pressed and here it is the "test()" function , the second callback
is the callback that will be executed when the insert key is pressed and 
here above it is the "insert()" function, and the third 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 follwing keys: Delete and F1 to F12.

After that you can add your items to the Menu by calling the AddItem()
method like this:

Menu1.AddItem(inttostr(i));

After that you will enter a loop like this , the template of this loop 
must look like the following, that's not difficult to understand:

Here it is:

===
repeat

textbackground(blue);
clrscr;
menu2.execute(false);
menu1.execute(false);

case i mod 2 of

1: ret:=Menu1.Execute(true);
0: ret:=Menu2.Execute(true);
end;
if ret=ctTab then inc(i);

until ret=ctExit;

menu1.free;
menu2.free;

end.

==

When you execute menu1.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.

You can download Winmenus 1.4 from:

https://sites.google.com/site/aminer68/winmenus

Next step i will code a console GUI for Parallel archiver with my 
Winmenus...


Thank you,
Amine Moulay Ramdane.

Back to comp.programming | Previous | Next | Find similar | Unroll thread


Thread

Winmenus 1.31 aminer <aminer@toto.net> - 2014-06-01 19:31 -0700

csiph-web