1
0

Add dialog.d

This commit is contained in:
otya128
2016-12-25 20:10:36 +09:00
parent 5ba4424bb7
commit f88715ba76
3 changed files with 101 additions and 1 deletions

66
SMILEBASIC/dialog.d Normal file
View File

@@ -0,0 +1,66 @@
module otya.smilebasic.dialog;
import otya.smilebasic.petitcomputer;
import derelict.sdl2.sdl;
import derelict.sdl2.image;
import derelict.opengl3.gl;
import derelict.opengl3.gl3;
class DialogBase
{
abstract void render();
}
enum SelectionType
{
ok,
noYes,
backNext,
cancelConfirm,
cancelExecute,
next,
}
enum ButtonResult
{
a = 128,
b = 129,
x = 130,
y = 131,
up = 132,
down = 133,
left = 134,
right = 135,
l = 136,
r = 137,
touch = 140,
}
class Dialog : DialogBase
{
private PetitComputer petitcom;
this(PetitComputer petitcom)
{
this.petitcom = petitcom;
}
private int result;
override void render()
{
}
int show(wstring text)
{
petitcom.dialog = this;
auto area = petitcom.showTouchScreen();
while (true)
{
auto to = petitcom.touchPosition();
}
petitcom.hideTouchScreen();
return result;
}
}