AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Page I. Page II Home. Page IV.

Creating Menu's - Page III.

Before loading the following menu, you should really un-load any of the test menu's that you still have loaded. If you don't, you just might run out of space on your menu bar.

OK, I see you're back. Now load the following menu file : 

***MENUGROUP=TEST3

***POP1
P1-1[&Test Menu 3]
P1-2[&Layer 2 On]^C^CLayer;M;2;;			//menu item
P1-3[--]						//divider
P1-4[&Ortho On/Off]^C^C^O				//menu item
P1-5[--]						//divider
P1-6[->&Change]						//submenu label
P1-7[->C&hange Layer]					//submenu label
P1-8[Change to Layer 1]^C^CChange;\;P;LA;1;;		//submenu items
P1-9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1-10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1-11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;		//submenu terminator
P1-12[->Ch&ange Colour]					//submenu label
P1-13[Change to Colour 3]^C^CChange;\;P;C;1;;		//submenu items
P1-14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1-15[Change to Colour 3]^C^CChange;\;P;C;3;;	
P1-16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;	//submenu terminator
P1-17[--]						//divider
P1-18[&Kenny](alert "Kenny is Handsome")		//menu item

Your menu, hopefully, should look like this :

M4

 


Right, enough of pull-downs for the meantime. Let's now have a look at Image Menu's.

Firstly, we need to create a couple of slides to display in our image menu.
Let's create some slides named D1 to D8, DDOOR and HDDOOR.
You can create these slides yourself using any object that you wish, as long as they are named as stated. (I need the server space and drawing files are rather big.) Now we need to create a file library as a container for these slides.

Locate the Slidelib.exe function. It is normally in your Acad Support directory. Copy it to the same directory as your slides.
Now create a text file named Slidelist.LST and in it, make a list of all the slide names. (Remember to check spelling and case.)

D1
D2
D3
D4
D5
D6
D7
D8
DDOOR
HDDOOR

Make sure that this file is also in the same directory as the slides.
Now go to DOS. (Remember that 'black' place?)
At the DOS prompt find your way to the directory where your slides, Slidelib.exe and Slidelist.LST are located.
Type : 

slidelib DOORS < Slidelist.LST then ENTER.
If you have done everything correct, DOORS.SLB should be created.
Next, we need to add an Image section to our menu file : 
***MENUGROUP=TEST4

***POP1
P1_1[&Test Menu 4]
P1_2[&Layer 2 On]^C^CLayer;M;2;;
P1_3[--]
P1_4[&Ortho On/Off]^C^C^O
P1_5[--]
P1_6[->&Change]
P1_7[->C&hange Layer]
P1_8[Change to Layer 1]^C^CChange;\;P;LA;1;;
P1_9[Change to Layer 2]^C^CChange;\;P;LA;2;;
P1_10[Change to Layer 3]^C^CChange;\;P;LA;3;;
P1_11[<-Change to Layer 4]^C^CChange;\;P;LA;4;;
P1_12[->Ch&ange Colour]
P1_13[Change to Colour 3]^C^CChange;\;P;C;1;;
P1_14[Change to Colour 3]^C^CChange;\;P;C;2;;
P1_15[Change to Colour 3]^C^CChange;\;P;C;3;;
P1_16[<-<-Change to Colour 4]^C^CChange;\;P;C;4;;
P1_17[--]
P1_18[&Kenny](alert "Kenny is Handsome")
P1_19[--]
P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=*		//calls Image Menu

***IMAGE
**DOORS
[DOORS Created by Kenny Ramage ]
[DOORS(D1,DOOR1)]INSERT;*D1;\;;
[DOORS(D2,DOOR2)]INSERT;*D2;\;;
[DOORS(D3,DOOR3)]INSERT;*D3;\;;
[DOORS(D4,DOOR4)]INSERT;*D4;\;;
[DOORS(D5,DOOR5)]INSERT;*D5;\;;
[DOORS(D6,DOOR6)]INSERT;*D6;\;;
[DOORS(D7,DOOR7)]INSERT;*D7;\;;
[DOORS(D8,DOOR8)]INSERT;*D8;\;;
[DOORS(DDOOR,DOUBLE DOOR)]INSERT;*DDOOR;\;;
[DOORS(HDDOOR,DOOR & HALF)]INSERT;*HDDOOR;\;;
[ FITTINGS]$I=KENNY.FITTINGS $I=*

The first line, ***IMAGE, defines the Image section of the menu.
The second line, **DOORS, is the name of the Image section submenu.
The third line is the title of the label that appears at the top.
The following lines get a bit more complicated so, let's dissect them.

[DOORS(D1,DOOR)]INSERT;*D1;\;;

[DOORS is the name of the slide library.
(D1, is the name of the specific slide.
,DOOR1)] is the label that is displayed in the list box.
INSERT;*D1;\;; is the menu macro.

Your Pull Down menu should now look like this :

M5

And your Image menu like this (with different images of course) :

M6

Did you notice the method of calling the image menu?

P1_20[Image Menu]^C^C$I=TEST4.DOORS $I=*

Good, at least some one is awake ;-)
Phew...(Wipe's sweat off brow)....Time for a break.
Next we'll move on to Custom Toolbars.

See you on the next page......

Page I. Page II. Home. Page IV.
 
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website