Skip to content

Commit 6ee374e

Browse files
committed
added 'go back' to GOTO button
1 parent 85b9d03 commit 6ee374e

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

Tutorial-o-Matic/Tutorial-o-Matic.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
<node TEXT="- better scrollspeed&#xa;- message when command no present in Menu for active map&#xa;- added execute_scripts_without_network_restriction: true so web images could be loaded&#xa;- improved showMenu to show actions in extended submenus&#xa;- changed &apos;Close tutorial&apos; to &apos;Stop tutorial&apos;&#xa;- tables have now black borders&#xa;- Codeblocks have special style in EditorPanes&#xa;- links in EditorPanes are now clickeable and open the default web browser&#xa;- added a listener to resize height of content panel when tabpanel width changes&#xa;- added newPage styles and functionality&#xa;- added Table of Contents styles and functionality&#xa;- added Table of Contents button to &apos;next page&apos; panel&#xa;- added GOTO style and its functionality&#xa;- added Action style and its functionality&#xa;- added groovy style and its functionality&#xa;- enables multiple tutorials in one map&#xa;- added &apos;copy&apos; style and its functionality&#xa;- added &apos;select&apos; style and its functionality&#xa;- added &apos;openMap&apos; style and its functionality&#xa;- added &apos;inspect tutorial map&apos; functionality" ID="ID_1550125378"/>
175175
</node>
176176
<node TEXT="v0.0.4" ID="ID_1654795865">
177-
<node TEXT="- corrected link to version.properties&#xa;- information of pasted nodes now is saved in each map for later exersizes and multiple exercizing maps" ID="ID_312985717"/>
177+
<node TEXT="- corrected link to version.properties&#xa;- information of pasted nodes now is saved in each map for later exersizes and multiple exercizing maps&#xa;- added &apos;go back&apos; when using &apos;GOTO&apos; panes" ID="ID_312985717"/>
178178
</node>
179179
</node>
180180
<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_624388795">

Tutorial-o-Matic/src/main/groovy/ToM.groovy

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ToM{
9797
addTOCPane(myPanel, tutNode)
9898
break
9999
case styles.goto:
100-
addGotoPane(myPanel, tutNode.children)
100+
addGotoPane(myPanel, tutNode.children, nextTutNodes[0])
101101
break
102102
case styles.action:
103103
addActionPane(myPanel, tutNode)
@@ -202,17 +202,33 @@ class ToM{
202202
}
203203
}
204204

205-
def static addGotoPane(myP, nodos){
205+
def static addGotoPane(myP, nodos, backNode){
206206
nodos.findAll{n -> n.link.node?true:false}.each{nodo ->
207-
def targetNode = nodo.link.node
208-
def msgHtml = nodo.note?tomui.getHtmlFromNote(nodo):null
209-
def bttnText = nodo.text
210-
def bttnToolTip = "Click to go to '${bttnText}' section"
211-
def bttnAction = { e -> fillPage(myP, targetNode, true, true) }
207+
def targetNode = nodo.link.node
208+
def msgHtml = nodo.note?tomui.getHtmlFromNote(nodo):null
209+
def bttnText = nodo.text
210+
def bttnToolTip = "Click to go to '${bttnText}' section"
211+
def bttnAction = { e -> gotoAction(myP, targetNode, backNode) }
212212
def buttonPanel = tomui.createButtonPanel(msgHtml,bttnText,bttnToolTip, bttnAction, false)
213213
myP.add(buttonPanel, tomui.GBC)
214214
}
215215
}
216+
217+
def static gotoAction(myP,targetNode, backNode){
218+
myP.removeAll()
219+
addReturnPane(myP, backNode)
220+
fillPage(myP, targetNode, true, false)
221+
addReturnPane(myP, backNode)
222+
}
223+
224+
def static addReturnPane(myP, backNode){
225+
def msgHtml = "Return to '${backNode.text}' page"
226+
def bttnText = 'go back'
227+
def bttnToolTip = "Click to go to '${backNode.text}' section"
228+
def bttnAction = { e -> fillPage(myP, backNode, true, true)}
229+
def buttonPanel = tomui.createButtonPanel(msgHtml,bttnText,bttnToolTip, bttnAction, false)
230+
myP.add(buttonPanel, tomui.GBC)
231+
}
216232

217233
def static addGroovyPane(myP, nodoT){
218234
def enabled = !disableBttn(nodoT)

0 commit comments

Comments
 (0)