@@ -30,6 +30,7 @@ class ToM{
3030 groovy : ' ToM_groovy' ,
3131 copyPaste : ' ToM_copy' ,
3232 select : ' ToM_select' ,
33+ openMap : ' ToM_openMap' ,
3334 ]
3435
3536 static final exeHowIcons = [' emoji-1F507' , ' emoji-2328' , ' emoji-1F5B1' ]
@@ -103,6 +104,9 @@ class ToM{
103104 case styles. select:
104105 addSelectPane(myPanel, tutNode)
105106 break
107+ case styles. openMap:
108+ addOpenMapPane(myPanel, tutNode)
109+ break
106110 default :
107111 ui. informationMessage(' node style not defined' )
108112 break
@@ -388,6 +392,25 @@ class ToM{
388392 myP. add(buttonPanel, tomui. GBC )
389393 }
390394
395+ def static addOpenMapPane (myP , tutNode ){
396+ def sep = File . separator
397+ def nodoMapa = tutNode. children. find{it. text. endsWith(' .mm' )}
398+ def mapFileName = nodoMapa?. text
399+ def Dir = tutNode. map. file. parent
400+ def pathName = Dir + sep + mapFileName
401+ def enabled = ! disableBttn(tutNode)
402+ def msgHtml = tomui. getHtmlFromNote(nodoMapa)?: " Click to open '${ mapFileName} '"
403+ def bttnText = " Open map '${ mapFileName} '"
404+ def bttnToolTip = " Click to open '${ mapFileName} '"
405+ def bttnAction = { e ->
406+ def bttn = e. source
407+ bttn. setEnabled(enabled)
408+ def mapa = getMapFromPath(pathName, true ) // usar mapa indicado (pero oculto)
409+ }
410+ def buttonPanel = tomui. getButtonPanel(msgHtml,bttnText,bttnToolTip, bttnAction, false )
411+ myP. add(buttonPanel, tomui. GBC )
412+ }
413+
391414 // end:
392415
393416 // region: Getting map
0 commit comments