Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
#Region Project Attributes
|
||||
#MainFormWidth: 593
|
||||
#MainFormHeight: 179
|
||||
#End Region
|
||||
|
||||
Sub Process_Globals
|
||||
Private fx As JFX
|
||||
Private MainForm As Form
|
||||
Private btnClickMe As Button
|
||||
Private lblClickCounter As Label
|
||||
Private nClicks As Int = 0
|
||||
Private aPlurals() As Object = Array As Object(Array As String("has","click"),Array As String("have","clicks"))
|
||||
End Sub
|
||||
|
||||
Sub AppStart (Form1 As Form, Args() As String)
|
||||
MainForm = Form1
|
||||
MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
|
||||
MainForm.Show
|
||||
End Sub
|
||||
|
||||
Sub btnClickMe_Action
|
||||
nClicks = nClicks + 1
|
||||
Dim aPlural() As Object = aPlurals(IIF(nClicks=1,0,1))
|
||||
lblClickCounter.Text = "There " & aPlural(0) & " been " & (nClicks) & " " & aPlural(1) & " so far."
|
||||
End Sub
|
||||
|
||||
Sub IIF(test As Boolean, trueVal As Object, falseVal As Object) As Object
|
||||
If test Then
|
||||
Return trueVal
|
||||
Else
|
||||
Return falseVal
|
||||
End If
|
||||
End Sub
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.collections.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.paint.*?>
|
||||
<?import javafx.scene.web.*?>
|
||||
|
||||
|
||||
<AnchorPane id="paneMain" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="179.0" prefWidth="593.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Button id="btnClickMe" layoutX="254.0" layoutY="90.0" mnemonicParsing="false" text="Click Me">
|
||||
<font>
|
||||
<Font size="20.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Label id="lblClickCounter" layoutX="162.0" layoutY="31.0" text="There have been no clicks as yet.">
|
||||
<font>
|
||||
<Font size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
(define (ui-add-button text) ;; helper
|
||||
(define b (ui-create-element "button" '((type "button"))))
|
||||
(ui-set-html b text)
|
||||
(ui-add b))
|
||||
|
||||
(define (panel )
|
||||
(ui-clear)
|
||||
(define *clicks* 0)
|
||||
(define text (ui-create-element "span" '((style "font-weight:bold"))))
|
||||
(ui-add text)
|
||||
(ui-set-html text "No click yet")
|
||||
|
||||
(define btn (ui-add-button "Click-me"))
|
||||
(define (count-clicks elem)
|
||||
(++ *clicks*)
|
||||
(ui-set-html text *clicks*))
|
||||
(ui-on-click btn count-clicks)
|
||||
|
||||
(stdout-hide #t)
|
||||
(stdin-hide #t)) ;; end panel definition
|
||||
|
||||
(panel)
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#Include "windows.bi"
|
||||
|
||||
Dim As HWND Window_Main, Static_Text, Button_Click
|
||||
Dim As MSG msg
|
||||
Dim As Integer Num_Click
|
||||
Dim As String Text
|
||||
|
||||
'Create a window with a static text control and a button:
|
||||
Window_Main = CreateWindow("#32770", "Simple Windowed Application", WS_OVERLAPPEDWINDOW Or WS_VISIBLE, 100, 100, 350, 200, 0, 0, 0, 0)
|
||||
Static_Text = CreateWindow("STATIC", "There have been no clicks yet", WS_VISIBLE Or WS_CHILD Or WS_BORDER, 10, 30, 300, 20, Window_Main, 0, 0, 0)
|
||||
Button_Click = CreateWindow("BUTTON", "Click me", WS_VISIBLE Or WS_CHILD, 100, 70, 100, 20, Window_Main, 0, 0, 0)
|
||||
|
||||
'Windows message loop:
|
||||
Num_Click = 0
|
||||
While GetMessage(@msg, Window_Main, 0, 0)
|
||||
TranslateMessage(@msg)
|
||||
DispatchMessage(@msg)
|
||||
Select Case msg.hwnd
|
||||
Case Button_Click
|
||||
If msg.message = WM_LBUTTONDOWN Then
|
||||
Num_Click = Num_Click + 1
|
||||
If Num_Click = 1 Then
|
||||
Text = "Button has been clicked once"
|
||||
Else
|
||||
Text = "Button has been clicked " + Str(Num_Click) + " times"
|
||||
End If
|
||||
SetWindowText(Static_Text, Text)
|
||||
End If
|
||||
Case Window_Main
|
||||
If msg.message = WM_COMMAND Then End
|
||||
End Select
|
||||
Wend
|
||||
|
||||
End
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
on startMovie
|
||||
|
||||
-- window settings
|
||||
_movie.stage.title = "Hello World!"
|
||||
_movie.stage.titlebarOptions.visible = TRUE
|
||||
_movie.stage.rect = rect(0,0,320, 240)
|
||||
_movie.centerStage = 1
|
||||
|
||||
-- create a label (called "field" in Director)
|
||||
m = new(#field)
|
||||
m.name = "label"
|
||||
m.rect = rect(0,0,320,0)
|
||||
m.text = "There have been no clicks yet"
|
||||
m.alignment = "center"
|
||||
|
||||
-- create sprite, assign field
|
||||
_movie.puppetSprite(1, TRUE)
|
||||
sprite(1).member = m
|
||||
sprite(1).loc = point(0,80)
|
||||
|
||||
-- create a button
|
||||
m = new(#button)
|
||||
m.rect = rect(0,0,220,0)
|
||||
m.text = "click me"
|
||||
m.alignment = "center"
|
||||
|
||||
-- create sprite, assign button
|
||||
_movie.puppetSprite(2, TRUE)
|
||||
sprite(2).member = m
|
||||
sprite(2).loc = point(50,105)
|
||||
|
||||
-- create new script at runtime, assign it to button sprite
|
||||
m = new(#script)
|
||||
m.scriptType = #score
|
||||
m.scriptText = "on mouseDown"&RETURN&\
|
||||
" m=member(""E&"label""E&")"&RETURN&\
|
||||
" m.text=string(integer(m.text)+1)"&RETURN&\
|
||||
"end"
|
||||
sprite(2).scriptInstanceList.add(m.script.new())
|
||||
|
||||
-- force immediate update
|
||||
_movie.updateStage()
|
||||
|
||||
-- show the window
|
||||
_movie.stage.visible = 1
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import gtk2
|
||||
|
||||
var
|
||||
win = windowNew WINDOW_TOPLEVEL
|
||||
button = buttonNew "Click me"
|
||||
label = labelNew "There have been no clicks yet"
|
||||
vbox = vboxNew(true, 1)
|
||||
counter = 0
|
||||
|
||||
proc clickedMe(o: var PButton, l: PLabel) =
|
||||
inc counter
|
||||
l.setText "You clicked me " & $counter & " times"
|
||||
|
||||
nim_init()
|
||||
win.setTitle "Click me"
|
||||
vbox.add label
|
||||
vbox.add button
|
||||
win.add vbox
|
||||
discard win.signal_connect("delete-event", SignalFunc mainQuit, nil)
|
||||
discard button.signal_connect("clicked", SignalFunc clickedMe, label)
|
||||
win.showAll()
|
||||
main()
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
include arwen.ew
|
||||
|
||||
constant main = create(Window,"myApp",0,0,100,100,300,200, 0)
|
||||
constant label = create(Label, "There have been no clicks yet",0,main,10,10,250,30,0)
|
||||
constant btn = create(Button,"Click me",0,main,100,50,100,30,0)
|
||||
integer count = 0
|
||||
|
||||
function mainHandler(integer id, integer msg, atom wParam, object lParam)
|
||||
without warning
|
||||
if id=btn and msg=WM_COMMAND then
|
||||
count += 1
|
||||
setText(label,sprintf("clicked %d times",count))
|
||||
end if
|
||||
return 0
|
||||
end function
|
||||
setHandler(btn,routine_id("mainHandler"))
|
||||
|
||||
WinMain(main,SW_NORMAL)
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Load "guilib.ring"
|
||||
|
||||
MyApp = New qApp {
|
||||
num = 0
|
||||
win1 = new qWidget() {
|
||||
setwindowtitle("Hello World")
|
||||
setGeometry(100,100,370,250)
|
||||
|
||||
btn1 = new qpushbutton(win1) {
|
||||
setGeometry(150,200,100,30)
|
||||
settext("click me")
|
||||
setclickevent("clickme()")}
|
||||
|
||||
Lineedit1 = new qlineedit(win1) {
|
||||
setGeometry(10,100,350,30)}
|
||||
show()}
|
||||
Exec()}
|
||||
|
||||
func clickme
|
||||
num += 1
|
||||
lineedit1.settext( "you clicked me " + num + " times")
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
require('Gtk2') -> init
|
||||
|
||||
# Window.
|
||||
var window = %s<Gtk2::Window>.new
|
||||
window.signal_connect('destroy' => { %s<Gtk2>.main_quit })
|
||||
|
||||
# VBox.
|
||||
var vbox = %s<Gtk2::VBox>.new(0, 0)
|
||||
window.add(vbox)
|
||||
|
||||
# Label.
|
||||
var label = %s<Gtk2::Label>.new('There have been no clicks yet.')
|
||||
vbox.add(label)
|
||||
|
||||
# Button.
|
||||
var count = 0
|
||||
var button = %s<Gtk2::Button>.new(' Click Me ')
|
||||
vbox.add(button)
|
||||
button.signal_connect('clicked' => {
|
||||
label.set_text(++count)
|
||||
})
|
||||
|
||||
# Show.
|
||||
window.show_all
|
||||
|
||||
# Main loop.
|
||||
%s<Gtk2>.main
|
||||
Loading…
Add table
Add a link
Reference in a new issue