1
0

Implement DIALOG(3)

This commit is contained in:
otya128
2016-12-26 22:16:22 +09:00
parent 80bc64ee9c
commit 0f5c8e08a2
2 changed files with 26 additions and 7 deletions

View File

@@ -3053,6 +3053,32 @@ class BuiltinFunction
} }
import otya.smilebasic.dialog; import otya.smilebasic.dialog;
import otya.smilebasic.project; import otya.smilebasic.project;
static void DIALOG(PetitComputer p, wstring text, out int result)
{
auto dialog = new Dialog(p);
result = p.project.result = cast(DialogResult)dialog.show(text);
}
static void DIALOG(PetitComputer p, wstring text, DefaultValue!int selType, out int result)
{
selType.setDefaultValue(0);
auto dialog = new Dialog(p);
result = p.project.result = cast(DialogResult)dialog.show(text, cast(SelectionType)selType);
}
static void DIALOG(PetitComputer p, wstring text, DefaultValue!int selType, DefaultValue!wstring cap, out int result)
{
selType.setDefaultValue(0);
cap.setDefaultValue("■DIALOG");
auto dialog = new Dialog(p);
result = p.project.result = cast(DialogResult)dialog.show(text, cast(SelectionType)selType, cast(wstring)cap);
}
static void DIALOG(PetitComputer p, wstring text, DefaultValue!int selType, DefaultValue!wstring cap, DefaultValue!int timeout, out int result)
{
selType.setDefaultValue(0);
cap.setDefaultValue("■DIALOG");
timeout.setDefaultValue(0);
auto dialog = new Dialog(p);
result = p.project.result = cast(DialogResult)dialog.show(text, cast(SelectionType)selType, cast(wstring)cap, cast(int)timeout);
}
static void DIALOG(PetitComputer p, wstring text) static void DIALOG(PetitComputer p, wstring text)
{ {
auto dialog = new Dialog(p); auto dialog = new Dialog(p);

View File

@@ -1894,13 +1894,6 @@ class Parser
token = lex.front(); token = lex.front();
if(token.type == TokenType.RParen) break; if(token.type == TokenType.RParen) break;
if(token.type == TokenType.Comma)
{
func.addArg(new VoidExpression(lex.location));
lex.popFront();
token = lex.front();
}
else
func.addArg(expression()); func.addArg(expression());
if(lex.front().type == TokenType.RParen) break; if(lex.front().type == TokenType.RParen) break;
} }