forked from fuopy/ABasm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dlgRunProgram.cpp
58 lines (47 loc) · 969 Bytes
/
dlgRunProgram.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "globals.h"
#include "data.h"
#include "dlgRunProgram.h"
#include "save.h"
bool showRunProgramDialog()
{
arduboy.fillRect(18-1, 8-1, 96+2, 48+2, 0);
arduboy.drawBitmap(18, 8, gfx_rundialog, 96, 48, 1);
arduboy.display();
arduboy.tunes.tone(TONE_MENUBAR_BEEP, 10);
updateInput();
while(true)
{
if(!arduboy.nextFrame()) continue;
if(B_PRESSED)
{
arduboy.drawBitmap(24, 38, gfx_invertbutton, 28, 11, 2);
arduboy.display();
while(true)
{
if(!arduboy.nextFrame()) continue;
if(B_RELEASED)
{
return false;
}
updateInput();
}
}
else if(A_PRESSED)
{
arduboy.drawBitmap(79, 38, gfx_invertbutton, 28, 11, 2);
arduboy.display();
while(true)
{
if(!arduboy.nextFrame()) continue;
if(A_RELEASED)
{
if(!(UP_DOWN || DOWN_DOWN || LEFT_DOWN || RIGHT_DOWN))
saveProgram();
return true;
}
updateInput();
}
}
updateInput();
}
}