Page 1 of 2 12>
Topic Options
#23706 - 2002-06-23 03:29 AM DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
I'm working on a DOS-based application and I came a cross the PopupMenu function. Anyway, this one was almost exactly what I was looking for but I wanted something more.

Let's say you got 10 items in this menu, the first 5 items shows on the left, the next 5 on the side. And for selecting the items you use the arrows, just like in the function I mentioned above.

Does anyone know if this is possible at all, and if there's a function somewhere for this already?

//punkie

Top
#23707 - 2002-06-23 06:13 AM Re: DOS Menu
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Hello Punkie and welcome to the board.

In order to assist others better (so that they may assist you better) Please try to provide a little more information in your posts.

Please include the link to what script you're talking about so others don't have to search for it.
UDF: PopupMenu() - Windows-like popup menu for DOS console

and

PopupMenu() - Windows-like PopUp Menu for DOS Console

Also please let others know the following.

1. What version of KiXtart you're using.
2. What version of Windows for Server and Client
3. What DOS application you're using (in case some else uses it and knows more what you're talking about.)

I have not used this script before so I can not help you with it at this time (unless I write and test the code myself). Shawn (the author of the code) does visit the board daily and I'm sure he will soon see and respond to your post. If not perhaps someone else has used it and can help you further.

Thanks again for visiting the board...

Top
#23708 - 2002-06-23 06:48 AM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
Oh thanks for clearing that up, I wasn't thinking.

The application I was talking about is designed for handling system and networks on the local computer, and I have hard to believe anyone has heard of it because it's for private use.

The whole thing is running through a batch file and that's when Kixtart comes in which has some really nice scripting features.

I don't remember what DOS version it is, but it's under Win2000 Pro and I guess that's v7 or v8 of DOS. And the latest version of kix (4.10).

And I have to say this is a really nice board [Smile]

Top
#23709 - 2002-06-23 07:57 AM Re: DOS Menu
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Punkie,

Im almost positive that there isn't a function posted on this board (or any other other kixtart board) that matches your requirements exactly. Thats not to say that you/me/we couldn't modify this UDF to fit your needs. But I'm having a hard time visualizing what it is your after. Is there any kind of Windows or DOS GUI program that implements what your describing ? Could you describe what your after again, using more words, or maybe provide a internet link to something similar ?

-Shawn

Top
#23710 - 2002-06-23 08:27 AM Re: DOS Menu
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I remember way back when.. I used to use a graphical menuing system from Neosoft called Quikmenu..

Shareware: $35

QuikMenu III for DOS
Price:
Full version: $35*
Upgrade from previous DOS versions: $20*
Site and Network licenses are also available.
We also offer discounts for qualified educational institutions.

* Price does not include shipping and handling.

Summary:
QuikMenu III provides an attractive and easy to use graphical desktop environment for DOS-based systems. The icon and button interface allows for quick and intuitive interaction with everyday computer tasks. A full set of desktop utilities are provided. Management and network compatible features are included for business and other multiple system installations. QuikMenu III is not a memory resident TSR.

Features:
PROGRAM HANDLING: QuikMenu III can launch any DOS-based program with a single mouse click or keystroke. QuikMenu can automatically recognize and configure menus for many major software applications. Icons and buttons may also be configured to ask for a filename to load with the program being launched. And additional keystrokes may be stuffed into the keyboard, to be executed after the command is launched.

FILE MANAGEMENT: Files may be copied, moved, renamed, deleted, viewed, or have attributes displayed. DOS subdirectories may be created, renamed, deleted, copied or moved. Actions may be executed on single files/directories, or groups. Search for particular files or a group of files in a specific directory or across the entire disk. ASCII text files may be created, viewed and edited—handy to create or modify batch and other files.

CUSTOMIZATION: Elements placed on the desktop by the user may be arranged freeform. Icons may be selected from among 100 which are included. An integrated icon editor allows creation of custom icons, as well as import/export of Windows™ ICO format icons and PCX images. Buttons may be selected from a wide selection of 2 and 3-D styles. A variety of included screen fonts, styles and sizes may be used. Select and modify colors for any desktop element. PCX format graphic images or logos can be placed as background wallpaper. Users may define up to 68 buttons for each screen, with up to 50 menu screens available. Buttons may even be hidden for greater security. Icons or buttons may be included to jump to related menus.

UTILITIES: Calculator with paper tape; Multiple, colorful menu Screen Savers; Date/time display Appointment calendar with notepad; Phone/address book database; Telephone dialer (requires modem); Macro recorder (QuikMenu actions)

COMPUTER USAGE TRACKING: QuikMenu can track which programs are being used on the computer. This is useful for verifying business use for tax purposes, for billing clients, management oversight, etc. Summary and detail reports may be generated. These may be sorted by date, program or user and searches for usage of specific programs may be conducted.

PASSWORD PROTECTION: Passwords may be applied to program launching buttons/icons, menu modification, QuikMenu command buttons, and access to other menu screens.

NETWORKS: Multi-user. Runs on all DOS-based networks, including Novell® and LANtastic™. An E-Mail utility allows users to send and receive mail from other QuikMenu III users on the network. Master Password override allows administrators to access to all systems. Computer usage tracking by user is also supported. Administrators can password lock access to DOS or other features. Affordable Site License pricing is offered for installations of 5 or more users.

OTHER FEATURES: Works with or without a mouse; Automatic installation; On-line, context sensitive Help; Shell to DOS; Optional hidden command buttons; Dialing icons and buttons; Sound effects (on/off) Speed keys (on/off); Use icons, buttons or icons on buttons; Hypertext style page links; Calendar templates; User defined page titles Export Phonebook database and Time log data to ASCII format.

System Requirements:
  • IBM PC, XT, AT, PS/1, PS/2, 286, 386, 486, Pentium™-based, or 100% compatible computer.
  • CGA, EGA, VGA, Hercules monochrome, or compatible graphics card and monitor. (See “Supported Video Cards” below.)
  • 512K minimum system RAM. EMS, XMS and virtual Disk memory are also supported.
    A hard disk.
  • MS DOS versions 3.1 (or higher).
  • Options: Microsoft, Logitech, or compatible mouse/pointing device; Hayes compatible modem; any DOS-based network.
Supported Video Cards:QuikMenu III will run on computer systems equipped with a Hercules monochrome, CGA, EGA, VGA or 100% compatible graphics card and monitor.
Note: In 16 color mode, CGA video cards display at 320x200. This mode has too few pixels to build a useful menu screen, or to display utilities. Therefore, QuikMenu must be run on CGA in high resolution, 640x200, 2 color mode.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#23711 - 2002-06-23 09:30 AM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
Shawn,
I'm not sure how to really explain it, I can't think of any program that has this except windows explorer where you have bunch of files and folders.

When you scroll down to end of the screen, it goes up scrolling to the next colum. I'm going to try to draw something here... lol

code:
+----------------------+
col1 col2
+----------------------+
item1 item6
item2 item7
... ...
item5 item10
+----------------------+

Now when you scroll down you get first to the bottom on colum 1 (item5), if you continue to scroll it starts on item6 to item10.

I hope this make some sense, but what I would like if it works is to be able to set a limit number for each colum, like in this case 5 items per colum.

Another idea I had was that you could scroll to the side on the PopupMenu function, but that isn't so important for me at the moment. Just a suggestion in case you decide to work on it.

Kent,
I have looked at different menu systems for DOS but all I could find was boot menus and similar, that mostly just worked in full screen. But when I saw what Shawn had made then I started looking for more but couldn't find anything, I didn't think it was even possible to do that just with a scripting system as Kix.

Thanks for all comments, I appreciate it [Smile]

Top
#23712 - 2002-06-24 12:39 AM Re: DOS Menu
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Try searching for DOS scripting websites. There is a lot of good ones. Also search for some DOS utilities sites. There are several freeware DOS menu utilities, but they all tend to have various limitations. Your best bet is just experiment with each one you find & see if it suits your needs.

I am not sure what you mean by "popupmenu". In DOS it is very difficult to emulate Windows. Most DOS menu programs are text based, I have never personally seen a freeware version that can generate controlable popup menus. Most are just a better version of what DOS6 provides. By the way, why is the DOS6 menus unsuitable?

I suspect you are looking for the unatainable. Dos implies no Windows, thus no Kixtart4 & no programs like Shawn's. Without the Windows OS running it is very hard to look like Windows.

It is not scripting that limits you, it is the fact that you are not running Windows that limits you. DOS is an ancient and a very limited environment.

I believe this is not really the correct forum for this question. A better board might be:

http://discussions.virtualdr.com/

Post your question in the DOS section. This board has the best DOS teckie I have ever come across. His name is "Vernon Frazee". He use to be the moderator of the DOS section but last year he moved to the WinMe section. If you can't get an answer from posting in the DOS section, try asking Vernon directly.
_________________________
Jack

Top
#23713 - 2002-06-24 11:19 AM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
JackLothian,
I've looked around at different DOS sites, including some forums without any luck. And Kix has been the best scripting system for what i'm trying to do, the problem is i'm still a bit new at it.

What I meant about the PopupMenu, is the function Shawn wrote. Located here. I know DOS don't support real "popups" but if you look at Shawn's function, it does give you a nice menu-like interface. And that's exactly what I wanted with some modifications.

The reason I don't like the current DOS menus, is because they only work in full screen, usually is slow and takes space compare to a Kix script. This is going to operate in the Command-prompt window.

Does any know any other scripting system that maybe could do this kind of things?

Top
#23714 - 2002-06-24 07:45 PM Re: DOS Menu
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
punkie -

This is definitely possible using KiXtart. I assume you want to have a menu-based system for launching applications or command-line utilities. It would be pretty straightforward to modify PopupMenu to do what you want. You can post your requirements and we'll be glad to help you out.
_________________________
Dean

Top
#23715 - 2002-06-24 09:10 PM Re: DOS Menu
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Agreed, definitely possible, but straight-forward - hmmmm. I think I know what punkie is after here. If PopupMenu is described as a single-column listbox, then what punkie is after is a multi-column listbox. Think he drew a pretty good picture of what is required, up above.

But, modifying PopupMenu to support n number of columns, plus all the things that go along with that (tabbing from bottom of column one to top of column two, support for tabbing across columns, layout calculations and maybe having to deal with truncated columns) ... figured that would be a little tricky. Unless one created a highly specialized version of the UDF, one that was more specialized for multi-column support - maybe one that provided limited layout options ( to ease development) ?

If this sounds like an open-ended challenge for the other members of this board, consider it as such. I would be the first to offer congrats to anyone that successfully got this going !

-Shawn

Top
#23716 - 2002-06-24 10:57 PM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
It makes me really happy to hear it's possible [Smile] Then I know i'm at least on right track here, and yes I'm going to run some utilities from the command-line and using a menu like this would make it alot easier.

I think you understood exactly what I meant Shawn, but are there anyone willing to try to write this code? Is it anything I can do to help? I'm guessing it's easier for you that are more familiar with the Kix scripting than me even though it sounds a little complicated.

Thanks in advance for any help you can give me [Smile]
I'm actually surprised no one has asked for this before.

Top
#23717 - 2002-06-26 06:02 PM Re: DOS Menu
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
punkie -

Actually, I already have a running start on the script. I am able to create multiple columns on the screen from an array. Now I just need to add the code for moving the cursor and we'll be set. I will post it here when it is finished.

Thanks for the challenge, Shawn!
_________________________
Dean

Top
#23718 - 2002-06-26 06:16 PM Re: DOS Menu
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm impressed Dean (really). How much time have you spent on it ? Does it have any limitations ? Well done.
Top
#23719 - 2002-06-26 07:00 PM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
Wow that's amazing! You're fast [Smile]
I really appreciate all this, just wish I knew more about Kix scripting but I will with time.

Thanks Dean.

Top
#23720 - 2002-06-26 10:01 PM Re: DOS Menu
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
Hopefully, I will have some more time to work on it tonight. Way too busy at work to do kix!

The script takes an array as a parameter, then calculates the maximum column width based on the array values. Then it determines the number of columns needed based on the count of items. Of course, it will return an error if all the items will not fit on the screen. Everything after that is just math calculations and display manipulation. Creating a movable cursor will be just slightly more challenging. [Razz]

Estimated scripting time so far: 30 minutes

[ 26 June 2002, 22:03: Message edited by: Dean B. ]
_________________________
Dean

Top
#23721 - 2002-06-27 10:03 AM Re: DOS Menu
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
It sounds pretty good, but i'm not sure what you mean with cursor. I didn't think it was possible for mouse support just with a kix script. As long as you can scroll with the key arrows then i'm happy [Smile]

I was thinking of having keyword support too, like using F1-F12 for the items but I probably could add that myself sometime later.

Top
#23722 - 2002-06-27 01:50 PM Re: DOS Menu
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
punkie -

What I meant by cursor was a "highlight" that indicates the currently selected item. You would use the keyboard arrows to move the cursor to different items. This is identical to the way Shawn's PopupMenu function works.

I am nearly finished with the script. I have a little more debugging to do and then I will post.

Estimated time spent: 60 minutes
_________________________
Dean

Top
#23723 - 2002-06-28 04:30 AM Re: DOS Menu
Dean B. Offline
Fresh Scripter

Registered: 2002-02-04
Posts: 46
Loc: Allegan, MI USA
punkie -

Okay, here is my first attempt. Hopefully I have eradicated all the bugs. I have included a sample of how you would use the function. Have fun!

Shawn (or anyone else), I would appreciate any helpful suggestions you would have for improving this function.

code:
$menu = "Dir %systemdrive%", "Dir %windir%", "Type c:\autoexec.bat", "Type c:\config.sys", 
"Dir %userprofile%", "Dir %Temp%"
$pick = kixmenu ($menu,5,"Menu")

select case $pick = 0
shell "%comspec% /c dir %systemdrive%"
case $pick = 1
shell "%comspec% /c dir %windir%"
case $pick = 2
shell "%comspec% /c type c:\autoexec.bat"
case $pick = 3
shell "%comspec% /c type c:\config.sys"
case $pick = 4
shell '%comspec% /c dir "%userprofile%"'
case $pick = 5
shell '%comspec% /c dir "%temp%"'
endselect

; KixMenu.kix
; version 1.0 for Kix2001
; written by Dean E. Behrman
; created 06.25.2002

function kixmenu ($_array,$_maxrows,optional $_title)
;$_array: Items to display in tabular format
;$_maxrows: Specify the maximum number of rows in the table
;$_title: Optional title for the window

cls
if val(@kix) <> 4
? "Requires Kixtart 2001"
$kixmenu = -1
exit 1
endif

dim $_width,$_acount,$_cols,$_rows,$_currow,$_curcol,$_curitem,$_colitems[1],$_rowitems[1],$_x,$_key
$_rc = setoption("HideCursor","ON")
$_width = 0 $_currow = 0 $_curcol = 0 $_curitem = 0
if $_maxrows <= 0
$_maxrows = 24
endif

$_acount = ubound($_array)
for $_x = 0 to $_acount
$_item = $_array[$_x]
if len($_item) > $_width
$_width = len($_item)
endif
next

$_maxcols = 78 / ($_width + 1)
if $_maxcols < 1 or $_acount > ($_maxcols * $_maxrows)
$kixmenu = -1
goto end
endif
if $_acount / $_cols > $_maxrows
$kixmenu = -1
goto end
endif
$_cols = ($_acount / $_maxrows) + 1
$_rows = ($_acount + 1) / $_cols
gosub drawscreen
gosub buildmenu
gosub pickitem
:end
$rc = setoption("HideCursor","OFF")
cls
return

:drawscreen
Color w+/b
Box (0,0,$_maxrows+1,79,"SINGLE")
if $_title <> "" and $_title <> 0
at (0,1) $_title
endif
return

:buildmenu
$_curitem = 0
redim $_colitems[$_cols], $_rowitems[$_rows]
for $_curcol = 0 to $_cols
for $_currow = 0 to $_rows - 1
if $_curitem <= $_acount
at ($_currow + 1,$_curcol * ($_width + 1) + 1) $_array[$_curitem]
$_colitems[$_curcol] = $_currow
$_rowitems[$_currow] = $_curcol
endif
$_curitem = $_curitem + 1

next
next
return

:pickitem
$_currow = 0 $_curcol = 0 $_curitem = 0
gosub showcursor
at (0,0)
do
get $_key
if asc($_key) = 224 ; Extended Key
get $_key
if asc($_key) = 80 ; Down Arrow
gosub hidecursor
$_currow = $_currow + 1
$_curitem = $_curitem + 1
if $_currow > $_colitems[$_curcol]
$_currow = 0
$_curitem = $_curitem - $_colitems[$_curcol] - 1
endif
gosub showcursor
endif
if asc($_key) = 72 ; Up Arrow
gosub hidecursor
$_currow = $_currow - 1
$_curitem = $_curitem - 1
if $_currow < 0
$_currow = $_colitems[$_curcol]
$_curitem = $_curitem + $_colitems[$_curcol] + 1
endif
gosub showcursor
endif
if asc($_key) = 75 ; Left Arrow
gosub hidecursor
$_curcol = $_curcol - 1
if $_curcol < 0
$_curcol = $_rowitems[$_currow]
$_curitem = $_curitem + $_rowitems[$_currow] * $_rows
else
$_curitem = $_curitem - $_colitems[$_curcol] - 1
endif
gosub showcursor
endif
if asc($_key) = 77 ; Right Arrow
gosub hidecursor
$_prev = $_curcol
$_curcol = $_curcol + 1
if $_curcol > $_rowitems[$_currow]
$_curcol = 0
$_curitem = $_curitem - $_rowitems[$_currow] * $_rows
else
$_curitem = $_curitem + $_colitems[$_prev] + 1
endif
gosub showcursor
endif
endif
until asc($_key) = 13 or asc($_key) = 27 ; ENTER or ESC

if asc($_key) = 13
$kixmenu = $_curitem
else
$kixmenu = -2
endif
return

:showcursor
color b/w+
at ($_currow + 1,$_curcol * ($_width + 1) + 1) $_array[$_curitem]
color w/n
at (0,0)
return

:hidecursor
color w+/b
at ($_currow + 1,$_curcol * ($_width + 1) + 1) $_array[$_curitem]
color w/n
at (0,0)
return

endfunction


Estimated scripting time: 2 hours
_________________________
Dean

Top
#23724 - 2002-06-28 05:05 AM Re: DOS Menu
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Dean,
After that bit of generosity I tried to give you your fifth star. I gues I don't carry enought weight.

Punkie,
I think Dean deserves a five star vote from you as well.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#23725 - 2002-06-28 05:11 AM Re: DOS Menu
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I just gave Dean a five star blast too !
Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 710 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.522 seconds in which 0.401 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org