Task

Create a window that has:

   a label that says   "There have been no clicks yet" 
   a button that says   "click me"


Upon clicking the button with the mouse, the label should change and show the number of times the button has been clicked.




 
#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