-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialog.grph
More file actions
40 lines (40 loc) · 1.41 KB
/
dialog.grph
File metadata and controls
40 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#requires GRPH 1.7
#import stdio
back = (640,480 color[0 128 128])
Rectangle titlebar = Rectangle("TitleBar" 10,10 620,30 WHITE)
Text title = Text("Question" 30,30 0 20 BLACK)
Path cross = Path(BLACK 1F)
moveTo cross: 605,15
lineTo cross: 625,35
moveTo cross: 625,15
lineTo cross: 605,35
Rectangle rootPane = Rectangle("RootPane" 10,40 620,320 color[240 240 240])
Text text = Text("Do you really want to eat this pizza?" 50,100 0 30 BLACK)
Rectangle yesButton = Rectangle("YesButton" 510,300 100,40 color[192 192 192])
Text yesText = Text("Yes" 542,328 0 20 BLACK)
Rectangle noButton = Rectangle("NoButton" 390,300 100,40 color[192 192 192])
Text noText = Text("No" 430,328 0 20 BLACK)
Rectangle noFocus = Rectangle("NoFocus" 392,302 95,35 BLACK 1F cut {1F, 1F})
Group dialog = Group("Dialog" titlebar title cross rootPane text yesButton yesText noButton noText noFocus)
validate: dialog
boolean continue = true
#while continue
#if getSelectedShape[] == dialog
#if getMousePos[] > 605,15 && getMousePos[] < 625,35
unvalidate: dialog
continue = false
log["CLOSED selected"]
// Do CLOSE action...
#elseif getMousePos[] > 510,300 && getMousePos[] < 610,340
unvalidate: dialog
continue = false
log["YES selected"]
// Do YES action...
#elseif getMousePos[] > 390,300 && getMousePos[] < 490,340
unvalidate: dialog
continue = false
log["NO selected"]
// Do NO action...
resetSelectedShape:
wait: 500
//