Professional Documents
Culture Documents
Recreacao 6
Recreacao 6
Step-By-Step Tutorial
name: myCompanyAddin
object: MyCompanyToolbarMenuObject
Here:
name is the name PML-Addin
object is the name of PML-object which this addin linked to and which contains PML-description of
AVEVA PDMS/MARINE
Step-By-Step Tutorial
--add items into newly created bar menu mnuCompany
!menu = object APPMENU('mnuCompany')
--new item with callback (example dblisting form)
!menu.add('CALLBACK', |Call Dblisting form|, 'show !!rptoutput free')
--new submenu name mnuPipe
!menu.add('MENU', |Piping|, 'mnuPipe')
!!appMenuCntrl.addMenu(!menu, 'All')
--end of definition
--fill submenu mnuPipe with items
!menu = object APPMENU('mnuPipe')
!menu.add('CALLBACK', |Create Pipe|, 'CALLP IPIPE FPIPE')
!!appMenuCntrl.addMenu(!menu, 'All')
--end of submenu definition
endmethod
--toolbar
define method .toolbars()
--toolbar definition
frame .barCompany TOOLBAR 'My company toolbar'
button .b1 tooltip 'Open command window' pixmap /%PMLLIB%\Icons\redbutton32.png width 32 height 32 callback 'show _CADCBTH'
exit
!!appTbarCntrl.addToolbar('barCompany', 'ALL')
--end of toolbar definition
Endmethod
NB. The picture-file and the path for the toolbar icon (marked in yellow) must exists otherwise no icon will be displayed and system gives a
message of unable to find file. Size of the picture is 32x32
then close message and type in white window PML REHASH ALL command then type DESIGN (for
entering PDMS Design) or OUTFITTING (for entering Marine Outfitting)
AVEVA PDMS/MARINE
Step-By-Step Tutorial
Result:
NB. You can simply add then new buttons to your panel by adding new lines with new buttons descriptions into frame container:
Example:
button .b2 tooltip 'Query attributes' pixmap /%PMLLIB%\Icons\greenbutton.png width 32 height 32 callback 'Q ATT'
Just be sure all paths and files are exists
You can also call for a simple macroses placing the callback like
button .b3 tooltip 'Call my macro' pixmap /%PMLLIB%\Icons\bluebutton.png width 32 height 32 callback '$M/path/macro.pmlmac'