Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
using fwt
|
||||
using gfx
|
||||
|
||||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
button1 := Button
|
||||
{
|
||||
text = "don't click!"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
echo ("clicked by code")
|
||||
}
|
||||
}
|
||||
button2 := Button
|
||||
{
|
||||
text = "click"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
// fire all the event listeners on button1
|
||||
button1.onAction.fire(e)
|
||||
}
|
||||
}
|
||||
Window
|
||||
{
|
||||
title = "simulate mouse event"
|
||||
size = Size (300, 200)
|
||||
button1,
|
||||
button2,
|
||||
}.open
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using [java] java.awt::Robot
|
||||
using [java] java.awt.event::InputEvent
|
||||
using fwt
|
||||
using gfx
|
||||
|
||||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
button := Button
|
||||
{
|
||||
text = "click for robot"
|
||||
onAction.add |Event e|
|
||||
{
|
||||
robot := Robot ()
|
||||
robot.mouseMove (50, 50) // move to screen point 50, 50
|
||||
robot.mousePress (InputEvent.BUTTON1_MASK) // and click mouse
|
||||
robot.mouseRelease (InputEvent.BUTTON1_MASK)
|
||||
}
|
||||
}
|
||||
Window
|
||||
{
|
||||
title = "simulate mouse event"
|
||||
size = Size (300, 200)
|
||||
button,
|
||||
}.open
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue