'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim gg As xnGrid
End Sub
Sub gg_fill
Dim t0 As Long
Dim t1 As Long
Dim dd As Long
t0 = DateTime.Now
For r = 0 To 100
Dim v As String
If r Mod 3 = 0 Then
v = ""
Else
v = "o=" & r
End If
gg.RowAppend ( Array As String ( "c=" & r , "d=" & r , "g=" & r , v ) )
Next
t1 = DateTime.Now
dd = t1 - t0
Log ( dd )
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim bt_paint As Button
Dim t As Int : t = 5dip
Dim h As Int : h = 45dip
' create buttons
bt_paint.Initialize("bt_paint")
bt_paint.Text = "create"
Activity.AddView ( bt_paint , 0dip , t , 90dip , 40dip )
t = t + h
If gg.IsInitialized = False Then
gg.Initialize("gg")
gg.RowHeight = 48dip
gg.HeaderHeight = 30dip
gg.HeaderTextSize = 13
gg.RowTextSize = 13
gg.HeaderTextColor = Colors.Yellow
gg.RowTextColor = Colors.Yellow
gg.SelectedOddColor = Colors.Green
gg.SelectedEvenColor = Colors.Magenta
Dim cc(4) As xnGridCol
cc(0).Initialize2 ( "Cod." , "cod" , 40dip , Gravity.TOP + Gravity.LEFT )
gg.ColAppend ( cc(0) )
cc(1).Initialize2 ( "Des." , "des" , 0dip , Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL)
gg.ColAppend ( cc(1) )
cc(2).Initialize2 ( "Grp." , "grp" , 60dip , Gravity.BOTTOM + Gravity.RIGHT )
gg.ColAppend ( cc(2) )
cc(3).Initialize2 ( "Other" , "other" , 60dip , Gravity.LEFT )
gg.ColAppend ( cc(3) )
Activity.AddView ( gg , 5dip , t , 180dip , 100%y - t - 10dip )
gg_fill
bt_paint_click
End If
End Sub
Sub bt_paint_click
gg.Multiselect = False
gg.GridWidth = 1dip
gg.GridColor = Colors.Red
gg.PixelFix = False
Dim t0 As Long
Dim t1 As Long
Dim dd As Long
t0 = DateTime.Now
gg.GridCreate2 ( False )
t1 = DateTime.Now
dd = t1 - t0
Log ( dd )
End Sub