Skip to content

Commit c8844e3

Browse files
committed
added action Pane
1 parent 60207d0 commit c8844e3

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class ToM_actions{
2020
}
2121
static final int pausa = 400
2222

23+
static boolean waiting = false
24+
2325

2426
// end: definitions
2527

@@ -38,30 +40,53 @@ class ToM_actions{
3840
}
3941

4042
def static executeAction(infoAccion , how){
43+
waiting = true
4144
switch(how){
4245
case ex.muted :
4346
execute(infoAccion.action)
47+
waiting = false
4448
break
4549
case ex.showHotKeys :
4650
//looks if it has defined hotKeys
4751
if(infoAccion.keyStroke){
48-
ToM_ui.showTextMessage("${infoAccion.keyStroke} : ${infoAccion.label}".toString(),3000)
52+
def msgDisplayTime = 3000
53+
ToM_ui.showTextMessage("${infoAccion.keyStroke} : ${infoAccion.label}".toString(),msgDisplayTime)
4954
execute(infoAccion.action)
55+
sleep(msgDisplayTime)
56+
waiting = false
5057
break // break is here, because if the action has not defined Hotkeys then it should show the menu way
5158
}
5259
case ex.showMenu :
5360
closeMenus(infoAccion.action)
5461
openMenus(infoAccion.action, pausa)
5562
def timer = new Timer()
56-
def espera = (infoAccion.path.size()*2 + 1)*pausa
63+
def espera = (infoAccion.path.size()*2)*pausa
5764
timer.runAfter(espera){
5865
execute(infoAccion.action)
5966
closeMenus(infoAccion.action)
67+
waiting = false
6068
}
6169
break
6270
}
6371
}
6472

73+
def static executeActions(infoAccions , how){
74+
if(infoAccions){
75+
if(!waiting){
76+
def infoAccion = infoAccions[0]
77+
executeAction(infoAccion , how)
78+
executeActions(infoAccions.drop(1) , how)
79+
} else {
80+
def timer = new Timer()
81+
timer.runAfter(200){
82+
executeActions(infoAccions , how)
83+
}
84+
}
85+
}
86+
}
87+
88+
89+
6590
// end:
6691

6792
// region: ----- getting label / keyStroke / toolTipText from menuEntry -------------------

0 commit comments

Comments
 (0)