Sub Class_Globals
Private fx As JFX
Private pn As Pane
Private tf As TextField
Private bt As Button
Private event As String
Private go As Object
Public ValueReturn As String
End Sub
Public Sub Initialize(Component As Object,View As Form, NameEvent As String)
go = Component
event = NameEvent
pn.Initialize("")
View.RootPane.AddNode(pn,10,10,300,32)
tf.Initialize("tf")
pn.AddNode(tf,0,0,200,32)
bt.Initialize("bt")
bt.Text = "Click"
pn.AddNode(bt,200+1,0,50,32)
End Sub
public Sub PaneTop(value As Double)
pn.Top = value
End Sub
public Sub PaneLeft(value As Double)
pn.Left = value
End Sub
public Sub PaneWidth(value As Double)
pn.PrefWidth = value
End Sub
public Sub PaneHeight(value As Double)
pn.PrefWidth = value
End Sub
Public Sub ButtonVisible(value As Boolean)
bt.Visible = value
End Sub
Public Sub ButtonTitle(value As String)
bt.Text = value
End Sub
public Sub ButtonInternal(value As Boolean)
If value = True Then
bt.Left = ( pn.GetNode(0).Left + pn.GetNode(0).PrefWidth) - ( pn.GetNode(1).PrefWidth + 2)
bt.top = pn.GetNode(0).Top + 2
bt.PrefHeight = pn.GetNode(0).PrefHeight - 4
Else
bt.Left = pn.GetNode(0).Left + pn.GetNode(0).PrefWidth + 1
bt.PrefHeight = pn.GetNode(0).PrefHeight
End If
End Sub
Public Sub TextValue(value As String)
tf.Text = value
End Sub
Public Sub TextTag(value As Object)
tf.Tag = value
End Sub
Public Sub TextPrompt(value As String)
tf.PromptText = value
End Sub
private Sub bt_action
If tf.Text <> "" Then
ValueReturn = tf.Text
CallSubDelayed(go,event)
Else
fx.Msgbox(Null,"field value is empty and invalid","Alert")
End If
End Sub
private Sub tf_Action
If bt.Visible = True Then Return
If tf.Text <> "" Then
ValueReturn = tf.Text
CallSubDelayed(go,event)
Else
fx.Msgbox(Null,"field value is empty and invalid","Alert")
End If
End Sub