September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,70 +1,70 @@
|
|||
#import system.
|
||||
#import forms.
|
||||
#import extensions.
|
||||
|
||||
#class Window
|
||||
import forms.
|
||||
import extensions.
|
||||
|
||||
class Window
|
||||
{
|
||||
#field form.
|
||||
#field btmIncrement.
|
||||
#field btmRandom.
|
||||
#field txtNumber.
|
||||
object form.
|
||||
object btmIncrement.
|
||||
object btmRandom.
|
||||
object txtNumber.
|
||||
|
||||
#constructor new
|
||||
constructor new
|
||||
[
|
||||
form := SDIDialog new.
|
||||
btmIncrement := Button new.
|
||||
btmRandom := Button new.
|
||||
txtNumber := Edit new.
|
||||
|
||||
form controls
|
||||
+= btmIncrement
|
||||
+= btmRandom
|
||||
+= txtNumber.
|
||||
form controls;
|
||||
append:btmIncrement;
|
||||
append:btmRandom;
|
||||
append:txtNumber.
|
||||
|
||||
form set &caption:"Rosseta Code".
|
||||
form set &x:100 &y:100.
|
||||
form set &width:160 &height:120.
|
||||
form
|
||||
set caption:"Rosseta Code";
|
||||
set x:100 y:100;
|
||||
set width:160 height:120.
|
||||
|
||||
txtNumber set &x:7 &y:7.
|
||||
txtNumber set &width:140 &height:25.
|
||||
txtNumber set &caption:"0".
|
||||
txtNumber
|
||||
set x:7 y:7;
|
||||
set width:140 height:25;
|
||||
set caption:"0".
|
||||
|
||||
btmIncrement set &x:7 &y:35.
|
||||
btmIncrement set &width:140 &height:25.
|
||||
btmIncrement set &caption:"Increment".
|
||||
btmIncrement set &onClick:args
|
||||
btmIncrement
|
||||
set x:7 y:35;
|
||||
set width:140 height:25;
|
||||
set caption:"Increment";
|
||||
set onClick: (:args)
|
||||
[ $self $onButtonIncrementClick ].
|
||||
|
||||
[ $self $onButtonIncrementClick. ].
|
||||
|
||||
btmRandom set &x:7 &y:65.
|
||||
btmRandom set &width:140 &height:25.
|
||||
btmRandom set &caption:"Random".
|
||||
btmRandom set &onClick:args
|
||||
|
||||
[ $self $onButtonRandomClick. ].
|
||||
btmRandom
|
||||
set x:7 y:65;
|
||||
set width:140 height:25;
|
||||
set caption:"Random";
|
||||
set onClick(:args)
|
||||
[ $self $onButtonRandomClick ]
|
||||
]
|
||||
|
||||
#method $onButtonIncrementClick
|
||||
$onButtonIncrementClick
|
||||
[
|
||||
#var number := txtNumber value toInt.
|
||||
var number := txtNumber value; toInt.
|
||||
|
||||
number := number + 1.
|
||||
$self $changeTextBoxValue:number.
|
||||
]
|
||||
|
||||
#method $onButtonRandomClick
|
||||
$onButtonRandomClick
|
||||
[
|
||||
(messageDialog open &caption:"Inf" &question:"Really reset to random value?")?
|
||||
if(messageDialog open caption:"Inf" question:"Really reset to random value?")
|
||||
[
|
||||
$self $changeTextBoxValue:(randomGenerator eval:99999999).
|
||||
].
|
||||
$self $changeTextBoxValue(randomGenerator eval:99999999)
|
||||
]
|
||||
]
|
||||
|
||||
#method $changeTextBoxValue : number
|
||||
$changeTextBoxValue : number
|
||||
[
|
||||
txtNumber set &caption:(number literal).
|
||||
txtNumber set caption(number literal).
|
||||
]
|
||||
|
||||
#method => form.
|
||||
dispatch => form.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue