Allegro SKILL Tutorial | Forms




Copy the following code in a file form.il and save it in the directory C:/cadence/setup/skill (or the directory that allegro.ilinit points to).

 
axlCmdRegister( "formbutton" `formbutton)
; -----------------------------------------------------------------
procedure( formbutton()

	les1_form = axlFormCreate( (gensym) "les1.form" nil 'les1_form_Action t)
	axlFormDisplay(les1_form)

); end of procedure
; -----------------------------------------------------------------
procedure( les1_form_Action(les1_form)
	case( les1_form->curField

		("Close_button"
        	axlFormClose( les1_form )
		 	axlCancelEnterFun( )
      	); --------------------------

 		("Run_button"
			if( axlFormGetField( les1_form "report") then  
				axlUIConfirm( "Report value is t (True) ")
			else
				axlUIConfirm( "Report value is nil (False) ")
			); end if
			
      	); --------------------------	
	); end case
); end of procedure
; -----------------------------------------------------------------


What does this skill code do



There are four axl statements for the form

axlFormCreate - Creates a Form
axlFormDisplay - to Display the form
axlFormClose - to Close the form
axlFormGetField - retrieve the elements in the form



Other code should be easy to follown.
Now creat another file called les1.form with the following content
 
FILE_TYPE=FORM_DEFN VERSION=2
FORM
FIXED
PORT 25 20
HEADER "Referencedesigner.com"

TILE
#======================
FIELD report
FLOC 2 2
CHECKLIST "Create report"
ENDFIELD


FIELD Run_button
FLOC 2 17
MENUBUTTON "Run" 7 3
ENDFIELD

FIELD Close_button
FLOC 11 17
MENUBUTTON "Close" 7 3
ENDFIELD

#======================
ENDTILE

ENDFORM

Save the file in the same directory as you brd file. Assuming everything is right you can just type hello form at the Command and it will pop up a form.


Here is the complete action captured in youtube

Exercise


Change the line
FIELD Run_button FLOC 2 17
to
FIELD Run_button FLOC 2 10
and check that the location of the Run Button Changes.
We have not done any PCB related function, but you may have got the taste of it. You can embed the actions as we will learn later on.