Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,57 @@
|
|||
import forms;
|
||||
import extensions;
|
||||
|
||||
public class MainWindow : SDIDialog
|
||||
{
|
||||
Button btmIncrement;
|
||||
Button btmRandom;
|
||||
Edit txtNumber;
|
||||
|
||||
constructor new()
|
||||
<= new()
|
||||
{
|
||||
btmIncrement := Button.new();
|
||||
btmRandom := Button.new();
|
||||
txtNumber := Edit.new();
|
||||
|
||||
self
|
||||
.appendControl:btmIncrement
|
||||
.appendControl:btmRandom
|
||||
.appendControl:txtNumber;
|
||||
|
||||
self.Caption := "Rosseta Code";
|
||||
self.setRegion(100, 100, 160, 120);
|
||||
|
||||
txtNumber.setRegion(7, 7, 140, 25);
|
||||
txtNumber.Caption := "0";
|
||||
|
||||
btmIncrement.setRegion(7, 35, 140, 25);
|
||||
btmIncrement.Caption := "Increment";
|
||||
btmIncrement.onClick := (args){ self.onButtonIncrementClick() };
|
||||
|
||||
btmRandom.setRegion(7, 65, 140, 25);
|
||||
btmRandom.Caption := "Random";
|
||||
btmRandom.onClick := (args){ self.onButtonRandomClick() };
|
||||
}
|
||||
|
||||
private onButtonIncrementClick()
|
||||
{
|
||||
var number := txtNumber.Value.toInt();
|
||||
|
||||
number := number + 1;
|
||||
self.changeTextBoxValue(number)
|
||||
}
|
||||
|
||||
private onButtonRandomClick()
|
||||
{
|
||||
if(messageDialog.showQuestion("Inf", "Really reset to random value?"))
|
||||
{
|
||||
self.changeTextBoxValue(randomGenerator.eval(99999999))
|
||||
}
|
||||
}
|
||||
|
||||
private changeTextBoxValue(number)
|
||||
{
|
||||
txtNumber.Caption := number.toString()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<Form X="100" Y="100" Width="160" Height="120" Caption="Rosseta Code">
|
||||
<Edit ID="txtNumber" X="7" Y="7" Width="140" Height="25" Caption="0">
|
||||
</Edit>
|
||||
<Button ID="btmIncrement" X="7" Y="35" Width="140" Height="25" Caption="Increment" onClick="onButtonIncrementClick">
|
||||
</Button>
|
||||
<Button ID="btmRandom" X="7" Y="65" Width="140" Height="25" Caption="Random" onClick="onButtonRandomClick">
|
||||
</Button>
|
||||
</Form>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import xforms;
|
||||
import forms;
|
||||
import extensions;
|
||||
|
||||
public class MainWindow
|
||||
{
|
||||
SDIForm form;
|
||||
|
||||
Button btmIncrement;
|
||||
Button btmRandom;
|
||||
Edit txtNumber;
|
||||
|
||||
constructor new()
|
||||
{
|
||||
form := xforms.executePath("main.xs", self);
|
||||
|
||||
btmIncrement := form.Controls.btmIncrement;
|
||||
btmRandom := form.Controls.btmRandom;
|
||||
txtNumber := form.Controls.txtNumber;
|
||||
}
|
||||
|
||||
onButtonIncrementClick(sender)
|
||||
{
|
||||
var number := txtNumber.Value.toInt();
|
||||
|
||||
number := number + 1;
|
||||
self.changeTextBoxValue(number)
|
||||
}
|
||||
|
||||
onButtonRandomClick(sender)
|
||||
{
|
||||
if(messageDialog.showQuestion("Inf", "Really reset to random value?"))
|
||||
{
|
||||
self.changeTextBoxValue(randomGenerator.eval(99999999))
|
||||
}
|
||||
}
|
||||
|
||||
private changeTextBoxValue(number)
|
||||
{
|
||||
txtNumber.Caption := number.toString()
|
||||
}
|
||||
|
||||
dispatch() => form;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue