Implement DIALOG(3)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user