Repository navigation
Expand file tree
/
Copy pathMainWebPage.xojo_code
More file actions
697 lines (682 loc) · 17.7 KB
/
Copy pathMainWebPage.xojo_code
File metadata and controls
697 lines (682 loc) · 17.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
#tag WebPage
Begin WebPage MainWebPage
AllowTabOrderWrap= True
Compatibility = ""
ControlCount = 0
ControlID = ""
CSSClasses = ""
Enabled = False
Height = 476
ImplicitInstance= True
Index = -2147483648
Indicator = 0
IsImplicitInstance= False
LayoutDirection = 0
LayoutType = 0
Left = 0
LockBottom = False
LockHorizontal = False
LockLeft = True
LockRight = False
LockTop = True
LockVertical = False
MinimumHeight = 400
MinimumWidth = 600
PanelIndex = 0
ScaleFactor = 0.0
TabIndex = 0
Title = "Untitled"
Top = 0
Visible = True
Width = 658
_ImplicitInstance= False
_mDesignHeight = 0
_mDesignWidth = 0
_mPanelIndex = -1
Begin WebListBox ExampleListBox
AllowRowReordering= False
ColumnCount = 6
ColumnWidths = ""
ControlID = ""
CSSClasses = ""
DefaultRowHeight= 49
Enabled = True
GridLineStyle = 3
HasBorder = True
HasHeader = True
HeaderHeight = 0
Height = 436
HighlightSortedColumn= True
Index = -2147483648
Indicator = ""
InitialValue = "Name Email Website Status Priority "
LastAddedRowIndex= 0
LastColumnIndex = 0
LastRowIndex = 0
Left = 20
LockBottom = True
LockedInPosition= False
LockHorizontal = False
LockLeft = True
LockRight = True
LockTop = True
LockVertical = False
NoRowsMessage = ""
PanelIndex = 0
ProcessingMessage= ""
RowCount = 0
RowSelectionType= 0
Scope = 2
SearchCriteria = ""
SelectedRowColor= &c0272D300
SelectedRowIndex= 0
TabIndex = 0
TabStop = True
Tooltip = ""
Top = 20
Visible = True
Width = 399
_mPanelIndex = -1
End
Begin WebTextField EmailTextField
AllowAutoComplete= False
AllowSpellChecking= False
Caption = "Email:"
ControlID = ""
CSSClasses = ""
Enabled = True
FieldType = 2
Format = ""
Height = 70
Hint = ""
Index = -2147483648
Indicator = ""
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
MaximumCharactersAllowed= 0
PanelIndex = 0
ReadOnly = False
Scope = 2
TabIndex = 2
TabStop = True
Text = ""
TextAlignment = 0
Tooltip = ""
Top = 98
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebTextField NameTextField
AllowAutoComplete= False
AllowSpellChecking= False
Caption = "Name:"
ControlID = ""
CSSClasses = ""
Enabled = True
FieldType = 0
Format = ""
Height = 70
Hint = ""
Index = -2147483648
Indicator = ""
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
MaximumCharactersAllowed= 0
PanelIndex = 0
ReadOnly = False
Scope = 2
TabIndex = 1
TabStop = True
Text = ""
TextAlignment = 0
Tooltip = ""
Top = 20
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebPopupMenu StatusPopupMenu
ControlID = ""
CSSClasses = ""
Enabled = True
Height = 38
Index = -2147483648
Indicator = ""
InitialValue = "New\nCreated\nDone\nCancelled"
LastAddedRowIndex= 0
LastRowIndex = 0
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
PanelIndex = 0
RowCount = 0
Scope = 2
SelectedRowIndex= 0
SelectedRowText = ""
TabIndex = 5
TabStop = True
Tooltip = ""
Top = 292
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebLabel StatusLabel
Bold = False
ControlID = ""
CSSClasses = ""
Enabled = True
FontName = ""
FontSize = 0.0
Height = 38
HTMLElement = 0
Index = -2147483648
Indicator = ""
Italic = False
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
Multiline = False
PanelIndex = 0
Scope = 2
TabIndex = 4
TabStop = True
Text = "Status:"
TextAlignment = 0
TextColor = &c00000000
Tooltip = ""
Top = 254
Underline = False
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebButton AddButton
AllowAutoDisable= False
Cancel = False
Caption = "Add"
ControlID = ""
CSSClasses = ""
Default = True
Enabled = True
Height = 38
Index = -2147483648
Indicator = 1
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
Outlined = False
PanelIndex = 0
Scope = 2
TabIndex = 6
TabStop = True
Tooltip = ""
Top = 418
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebTextField WebsiteTextField
AllowAutoComplete= False
AllowSpellChecking= False
Caption = "Website:"
ControlID = ""
CSSClasses = ""
Enabled = True
FieldType = 5
Format = ""
Height = 70
Hint = ""
Index = -2147483648
Indicator = ""
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
MaximumCharactersAllowed= 0
PanelIndex = 0
ReadOnly = False
Scope = 2
TabIndex = 3
TabStop = True
Text = ""
TextAlignment = 0
Tooltip = ""
Top = 176
Visible = True
Width = 200
_mPanelIndex = -1
End
Begin WebCheckbox WebCheckBoxSelected
Caption = "Is Checked"
ControlID = ""
CSSClasses = ""
Enabled = True
Height = 34
Indeterminate = False
Index = -2147483648
Indicator = ""
Left = 438
LockBottom = False
LockedInPosition= False
LockHorizontal = False
LockLeft = False
LockRight = True
LockTop = True
LockVertical = False
PanelIndex = 0
Scope = 2
TabIndex = 7
TabStop = True
Tooltip = ""
Top = 355
Value = False
Visible = True
Width = 200
_mPanelIndex = -1
End
End
#tag EndWebPage
#tag WindowCode
#tag Method, Flags = &h21
Private Sub ResetForm()
NameTextField.Text = ""
EmailTextField.Text = ""
WebsiteTextField.Text = ""
StatusPopupMenu.SelectedRowIndex = 0
WebCheckBoxSelected.Value = False
NameTextField.SetFocus
End Sub
#tag EndMethod
#tag EndWindowCode
#tag Events ExampleListBox
#tag Event
Sub CustomCellAction(row As Integer, column As Integer, identifier As String, value As Variant)
If identifier = "GroupButtonPressed" Then
Select Case value
Case "view"
Var isChecked As Boolean = Me.CellCheckBoxValueAt(row, 0)
Var name As String = Me.CellTextAt(row, 0)
Var email As String = Me.CellTagAt(row, 1)
MessageBox(name + " <" + email + "> ; isChecked = " + isChecked.ToString)
Case "delete"
Me.RemoveRowAt(row)
End Select
End If
If identifier = "PopupMenuSelectionChanged" Then
Var popup As PopupMenuCellRenderer = PopupMenuCellRenderer(Me.CellRendererAt(row, column))
popup.SelectedRowIndex = value.IntegerValue
Me.CellRendererAt(row, column) = popup
MessageBox(Me.CellTextAt(row, 0) + " priority changed to " + popup.RowTextAt(value.IntegerValue))
End If
If identifier = "StatusRefreshButtonPressed" Then
Me.CellRendererAt(row, column) = New StatusCellRenderer(StatusCellRenderer.States.Healthy, "OK", False)
End If
End Sub
#tag EndEvent
#tag Event
Sub CellAction(row As Integer, column As Integer, value As Variant)
If column = 0 Then
MessageBox(value.StringValue)
End If
End Sub
#tag EndEvent
#tag EndEvents
#tag Events AddButton
#tag Event
Sub Pressed()
ExampleListBox.AddRow(NameTextField.Text, "email", "website", "status", "priority", "actions")
Var index As Integer = ExampleListBox.LastAddedRowIndex
' Checkbox cell with text
ExampleListBox.CellTypeAt(index, 0) = WebListBox.CellTypes.CheckBox
ExampleListBox.CellCheckBoxValueAt(index, 0) = WebCheckBoxSelected.Value
' Gravatar cell
ExampleListBox.CellRendererAt(index, 1) = New GravatarCellRenderer(EmailTextField.Text, EmailTextField.Text)
ExampleListBox.CellTagAt(index, 1) = EmailTextField.Text
' Text with copy button cell
ExampleListBox.CellRendererAt(index, 2) = New TextWithCopyButtonCellRenderer(WebsiteTextField.Text, True)
' Status cell
Var state As StatusCellRenderer.States
Select Case StatusPopupMenu.SelectedRowValue
Case "New"
state = StatusCellRenderer.States.Unknown
Case "Created"
state = StatusCellRenderer.States.Unknown
Case "Done"
state = StatusCellRenderer.States.Healthy
Case "Cancelled"
state = StatusCellRenderer.States.Unhealthy
End Select
ExampleListBox.CellRendererAt(index, 3) = New StatusCellRenderer(state, StatusPopupMenu.SelectedRowValue, True)
' Popup menu cell
Var priorities() As String = Array("Low", "Medium", "High")
ExampleListBox.CellRendererAt(index, 4) = New PopupMenuCellRenderer(priorities, 1)
' Actions cell
Var actionButtons() As GroupButtonItem
actionButtons.Add(New GroupButtonItem("view", "View"))
actionButtons.Add(New GroupButtonItem("delete", "Delete", "danger"))
ExampleListBox.CellRendererAt(index, 5) = New GroupButtonsCellRenderer(actionButtons)
ResetForm
End Sub
#tag EndEvent
#tag EndEvents
#tag ViewBehavior
#tag ViewProperty
Name="PanelIndex"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="ControlCount"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="_mPanelIndex"
Visible=false
Group="Behavior"
InitialValue="-1"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
InitialValue=""
Type="String"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Top"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="ControlID"
Visible=false
Group="Behavior"
InitialValue=""
Type="String"
EditorType="MultiLineEditor"
#tag EndViewProperty
#tag ViewProperty
Name="Enabled"
Visible=false
Group="Behavior"
InitialValue=""
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Height"
Visible=true
Group="Behavior"
InitialValue="400"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LayoutType"
Visible=true
Group="Behavior"
InitialValue="LayoutTypes.Fixed"
Type="LayoutTypes"
EditorType="Enum"
#tag EnumValues
"0 - Fixed"
"1 - Flex"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="LockBottom"
Visible=true
Group="Behavior"
InitialValue="False"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LockHorizontal"
Visible=true
Group="Behavior"
InitialValue="False"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LockLeft"
Visible=true
Group="Behavior"
InitialValue="True"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LockRight"
Visible=true
Group="Behavior"
InitialValue="False"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LockTop"
Visible=true
Group="Behavior"
InitialValue="True"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="LockVertical"
Visible=true
Group="Behavior"
InitialValue="False"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="MinimumHeight"
Visible=true
Group="Behavior"
InitialValue="400"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="MinimumWidth"
Visible=true
Group="Behavior"
InitialValue="600"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Title"
Visible=true
Group="Behavior"
InitialValue="Untitled"
Type="String"
EditorType="MultiLineEditor"
#tag EndViewProperty
#tag ViewProperty
Name="Visible"
Visible=false
Group="Behavior"
InitialValue="True"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Width"
Visible=true
Group="Behavior"
InitialValue="600"
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="_ImplicitInstance"
Visible=false
Group="Behavior"
InitialValue=""
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="_mDesignHeight"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="_mDesignWidth"
Visible=false
Group="Behavior"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="_mName"
Visible=false
Group="Behavior"
InitialValue=""
Type="String"
EditorType="MultiLineEditor"
#tag EndViewProperty
#tag ViewProperty
Name="IsImplicitInstance"
Visible=false
Group="Behavior"
InitialValue=""
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="AllowTabOrderWrap"
Visible=false
Group="Behavior"
InitialValue="True"
Type="Boolean"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="TabIndex"
Visible=true
Group="Visual Controls"
InitialValue=""
Type="Integer"
EditorType=""
#tag EndViewProperty
#tag ViewProperty
Name="Indicator"
Visible=false
Group="Visual Controls"
InitialValue=""
Type="WebUIControl.Indicators"
EditorType="Enum"
#tag EnumValues
"0 - Default"
"1 - Primary"
"2 - Secondary"
"3 - Success"
"4 - Danger"
"5 - Warning"
"6 - Info"
"7 - Light"
"8 - Dark"
"9 - Link"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="LayoutDirection"
Visible=true
Group="WebView"
InitialValue="LayoutDirections.LeftToRight"
Type="LayoutDirections"
EditorType="Enum"
#tag EnumValues
"0 - LeftToRight"
"1 - RightToLeft"
"2 - TopToBottom"
"3 - BottomToTop"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="ScaleFactor"
Visible=false
Group="Behavior"
InitialValue=""
Type="Double"
EditorType=""
#tag EndViewProperty
#tag EndViewBehavior