AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

Dialog Box Layout - Page II.

Right, now sit up straight and pay attention.
Open a new file and copy and paste this into it :

afra1 : dialog {
	label = "B" ;

	: column {

	: row {

		: text {label = "No";}
		: text {label = "Chainage";}
		: text {label = "Existing";}
		: text {label = "Chainage";}
		: text {label = "Proposed";}

	}

	: row {
		: text {label = "  1";}
		: edit_box {key = eb1; width = 7; value = "000.000";}
		: edit_box {key = eb1a; width = 7; value = "00.000";}
		: edit_box {key = eb1b; width = 7; value = "000.000";}
		: edit_box {key = eb1c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  2";}
		: edit_box {key = eb2; width = 7; value = "000.000";}
		: edit_box {key = eb2a; width = 7; value = "00.000";}
		: edit_box {key = eb2b; width = 7; value = "000.000";}
		: edit_box {key = eb2c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  3";}
		: edit_box {key = eb3; width = 7; value = "000.000";}
		: edit_box {key = eb3a; width = 7; value = "00.000";}
		: edit_box {key = eb3b; width = 7; value = "000.000";}
		: edit_box {key = eb3c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  4";}
		: edit_box {key = eb4; width = 7; value = "000.000";}
		: edit_box {key = eb4a; width = 7; value = "00.000";}
		: edit_box {key = eb4b; width = 7; value = "000.000";}
		: edit_box {key = eb4c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  5";}
		: edit_box {key = eb5; width = 7; value = "000.000";}
		: edit_box {key = eb5a; width = 7; value = "00.000";}
		: edit_box {key = eb5b; width = 7; value = "000.000";}
		: edit_box {key = eb5c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  6";}
		: edit_box {key = eb6; width = 7; value = "000.000";}
		: edit_box {key = eb6a; width = 7; value = "00.000";}
		: edit_box {key = eb6b; width = 7; value = "000.000";}
		: edit_box {key = eb6c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  7";}
		: edit_box {key = eb7; width = 7; value = "000.000";}
		: edit_box {key = eb7a; width = 7; value = "00.000";}
		: edit_box {key = eb7b; width = 7; value = "000.000";}
		: edit_box {key = eb7c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  8";}
		: edit_box {key = eb8; width = 7; value = "000.000";}
		: edit_box {key = eb8a; width = 7; value = "00.000";}
		: edit_box {key = eb8b; width = 7; value = "000.000";}
		: edit_box {key = eb8c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  9";}
		: edit_box {key = eb9; width = 7; value = "000.000";}
		: edit_box {key = eb9a; width = 7; value = "00.000";}
		: edit_box {key = eb9b; width = 7; value = "000.000";}
		: edit_box {key = eb9c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "10";}
		: edit_box {key = eb10; width = 7; value = "000.000";}
		: edit_box {key = eb10a; width = 7; value = "00.000";}
		: edit_box {key = eb10b; width = 7; value = "000.000";}
		: edit_box {key = eb10c; width = 7; value = "00.000";}
	}
	: row {
	: text {label = "11";}
		: edit_box {key = eb11; width = 7; value = "000.000";}
		: edit_box {key = eb11a; width = 7; value = "00.000";}
		: edit_box {key = eb11b; width = 7; value = "000.000";}
		: edit_box {key = eb11c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "12";}
		: edit_box {key = eb12; width = 7; value = "000.000";}
		: edit_box {key = eb12a; width = 7; value = "00.000";}
		: edit_box {key = eb12b; width = 7; value = "000.000";}
		: edit_box {key = eb12c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "13";}
		: edit_box {key = eb13; width = 7; value = "000.000";}
		: edit_box {key = eb13a; width = 7; value = "00.000";}
		: edit_box {key = eb13b; width = 7; value = "000.000";}
		: edit_box {key = eb13c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "14";}
		: edit_box {key = eb14; width = 7; value = "000.000";}
		: edit_box {key = eb14a; width = 7; value = "00.000";}
		: edit_box {key = eb14b; width = 7; value = "000.000";}
		: edit_box {key = eb14c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "15";}
		: edit_box {key = eb15; width = 7; value = "000.000";}
		: edit_box {key = eb15a; width = 7; value = "00.000";}
		: edit_box {key = eb15b; width = 7; value = "000.000";}
		: edit_box {key = eb15c; width = 7; value = "00.000";}
	}

	}

	ok_only;
	
}

Save this as "afra1.dcl". Now view the dialog :

Did you notice how we where forced to include an "OK" button within the dialog?
Don't worry though, we'll remove that later.

Ok, on to the next section. Open a new file and add this coding :

        afra2 : dialog {
	label = "C" ;

	: column {

		: edit_box {key = "eb16"; label = "Base Level";
				edit_width = 12;value = "00.000";}
		: edit_box {key = "eb17"; label = "Top Level";
				edit_width = 12; value = "00.000";}
		: edit_box {key = "eb18"; label = "Horizontal Scale 1 :";
				edit_width = 12; value = "200";}
		: edit_box {key = "eb19"; label = "Vertical Scale 1 :";
				edit_width = 12; value = "50";}
		: edit_box {key = "eb20"; label = "Title";
				edit_width = 20;value = "Chainage";}
		: toggle {key = "tg1"; value = 1;
				label = "Description On/Off";}
	}
		
	ok_only;
}
        

Save this as "afra2.dcl" and then display it. It will look like this :

Now let's add the the other two text boxes :

afra2 : dialog {
	label = "C" ;

	: column {

		: edit_box {key = "eb16"; label = "Base Level";
				edit_width = 12;value = "00.000";}
		: edit_box {key = "eb17"; label = "Top Level";
				edit_width = 12; value = "00.000";}
		: edit_box {key = "eb18"; label = "Horizontal Scale 1 :";
				edit_width = 12; value = "200";}
		: edit_box {key = "eb19"; label = "Vertical Scale 1 :";
				edit_width = 12; value = "50";}
		: edit_box {key = "eb20"; label = "Title";
				edit_width = 20; value = "Chainage";}
		: toggle {key = "tg1"; value = 1;
				label = "Description On/Off";}

		: edit_box {key = "eb21"; label = "Path";
				edit_width = 20; value = "C:\\";}
		: edit_box {key = "eb22"; label = "File Name";
				edit_width = 20; value = "default";}
	}
		
	ok_only;
}

This will give us this :


Ok, time now to put this all together. This is what we need to do :
 

 

The following coding is a merged version of the three dialog boxes that you have just created:

afralisp : dialog {
	   label = "Cross Section Level Information" ;

	: row {

	: boxed_column {

	: row {

		: text {label = "No";}
		: text {label = "Chainage";}
		: text {label = "Existing";}
		: text {label = "Chainage";}
		: text {label = "Proposed";}

	}

	: row {
		: text {label = "  1";}
		: edit_box {key = eb1; width = 7; value = "000.000";}
		: edit_box {key = eb1a; width = 7; value = "00.000";}
		: edit_box {key = eb1b; width = 7; value = "000.000";}
		: edit_box {key = eb1c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  2";}
		: edit_box {key = eb2; width = 7; value = "000.000";}
		: edit_box {key = eb2a; width = 7; value = "00.000";}
		: edit_box {key = eb2b; width = 7; value = "000.000";}
		: edit_box {key = eb2c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  3";}
		: edit_box {key = eb3; width = 7; value = "000.000";}
		: edit_box {key = eb3a; width = 7; value = "00.000";}
		: edit_box {key = eb3b; width = 7; value = "000.000";}
		: edit_box {key = eb3c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  4";}
		: edit_box {key = eb4; width = 7; value = "000.000";}
		: edit_box {key = eb4a; width = 7; value = "00.000";}
		: edit_box {key = eb4b; width = 7; value = "000.000";}
		: edit_box {key = eb4c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  5";}
		: edit_box {key = eb5; width = 7; value = "000.000";}
		: edit_box {key = eb5a; width = 7; value = "00.000";}
		: edit_box {key = eb5b; width = 7; value = "000.000";}
		: edit_box {key = eb5c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  6";}
		: edit_box {key = eb6; width = 7; value = "000.000";}
		: edit_box {key = eb6a; width = 7; value = "00.000";}
		: edit_box {key = eb6b; width = 7; value = "000.000";}
		: edit_box {key = eb6c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  7";}
		: edit_box {key = eb7; width = 7; value = "000.000";}
		: edit_box {key = eb7a; width = 7; value = "00.000";}
		: edit_box {key = eb7b; width = 7; value = "000.000";}
		: edit_box {key = eb7c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  8";}
		: edit_box {key = eb8; width = 7; value = "000.000";}
		: edit_box {key = eb8a; width = 7; value = "00.000";}
		: edit_box {key = eb8b; width = 7; value = "000.000";}
		: edit_box {key = eb8c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "  9";}
		: edit_box {key = eb9; width = 7; value = "000.000";}
		: edit_box {key = eb9a; width = 7; value = "00.000";}
		: edit_box {key = eb9b; width = 7; value = "000.000";}
		: edit_box {key = eb9c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "10";}
		: edit_box {key = eb10; width = 7; value = "000.000";}
		: edit_box {key = eb10a; width = 7; value = "00.000";}
		: edit_box {key = eb10b; width = 7; value = "000.000";}
		: edit_box {key = eb10c; width = 7; value = "00.000";}
	}
	: row {
	: text {label = "11";}
		: edit_box {key = eb11; width = 7; value = "000.000";}
		: edit_box {key = eb11a; width = 7; value = "00.000";}
		: edit_box {key = eb11b; width = 7; value = "000.000";}
		: edit_box {key = eb11c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "12";}
		: edit_box {key = eb12; width = 7; value = "000.000";}
		: edit_box {key = eb12a; width = 7; value = "00.000";}
		: edit_box {key = eb12b; width = 7; value = "000.000";}
		: edit_box {key = eb12c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "13";}
		: edit_box {key = eb13; width = 7; value = "000.000";}
		: edit_box {key = eb13a; width = 7; value = "00.000";}
		: edit_box {key = eb13b; width = 7; value = "000.000";}
		: edit_box {key = eb13c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "14";}
		: edit_box {key = eb14; width = 7; value = "000.000";}
		: edit_box {key = eb14a; width = 7; value = "00.000";}
		: edit_box {key = eb14b; width = 7; value = "000.000";}
		: edit_box {key = eb14c; width = 7; value = "00.000";}
	}
	: row {
		: text {label = "15";}
		: edit_box {key = eb15; width = 7; value = "000.000";}
		: edit_box {key = eb15a; width = 7; value = "00.000";}
		: edit_box {key = eb15b; width = 7; value = "000.000";}
		: edit_box {key = eb15c; width = 7; value = "00.000";}
	}

	}
	

	: boxed_column {

		: edit_box {key = "eb16"; label = "Base Level";
				edit_width = 12;value = "00.000";}
		: edit_box {key = "eb17"; label = "Top Level";
				edit_width = 12; value = "00.000";}
		: edit_box {key = "eb18"; label = "Horizontal Scale 1 :";
				edit_width = 12; value = "200";}
		: edit_box {key = "eb19"; label = "Vertical Scale 1 :";
				edit_width = 12; value = "50";}
		: edit_box {key = "eb20"; label = "Title";
				edit_width = 20; value = "Chainage";}
		: toggle {key = "tg1"; value = 1;
				label = "Description On/Off";}

		: edit_box {key = "eb21"; label = "Path";
				edit_width = 20; value = "C:\\";}
		: edit_box {key = "eb22"; label = "File Name";
				edit_width = 20; value = "default";}
		
	: row {

	: button {label = "OK"; key = "accept";	mnemonic = "O";
			alignment = centered; width = 12; is_default = true;}
	: button {label = "Cancel"; key = "cancel";mnemonic = "C";
			alignment = centered; width = 12;}

	}

	: row {

	: button {label = "Save"; key = "save";
			mnemonic = "S";	alignment = centered; width = 12;}
	: button {label = "Load";key = "load";
			mnemonic = "L";	alignment = centered; width = 12;}

	}

	: row {

	: button {label = "Help..."; key = "help";
			mnemonic = "H"; alignment = centered; width = 12;}
	: button {label = "About..."; key = "About";
			mnemonic = "H";	alignment = centered; width = 12;}

	}

	}

	}

}

Save this as "AfraLisp.dcl".
Your merged dialog will now look like this :

Ok, I admit that it's not exactly the same but it's as close as dammit.
You could, if you are that way inclined, mess around with boxed columns, boxed rows, and spacers, to get a closer match, and if you feel the need, then go for it!!!
Me, I'm out of here to fetch myself a beer.


Want to download the source coding? Just click here. 

 
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