-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathfrmUIEditor.rbfrm
More file actions
908 lines (784 loc) · 29 KB
/
frmUIEditor.rbfrm
File metadata and controls
908 lines (784 loc) · 29 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
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
#tag Window
Begin Window frmUIEditor
BackColor = 0
Backdrop = ""
CloseButton = True
Composite = False
Frame = 1
FullScreen = False
HasBackColor = False
Height = 424
ImplicitInstance= True
LiveResize = True
MacProcID = 0
MaxHeight = 32000
MaximizeButton = False
MaxWidth = 32000
MenuBar = 275582975
MenuBarVisible = True
MinHeight = 424
MinimizeButton = True
MinWidth = 794
Placement = 0
Resizeable = True
Title = "Illumination Window Editor"
Visible = True
Width = 794
Begin bunChart chartUI
AcceptFocus = ""
AcceptTabs = ""
AutoDeactivate = True
BackColor = 16777215
Backdrop = ""
ChartBackgroundColor= 0
Enabled = True
EraseBackground = True
HasBackColor = False
Height = 369
HelpTag = ""
Index = -2147483648
InitialParent = ""
Left = 161
LockBottom = True
LockedInPosition= False
LockLeft = True
LockRight = True
LockTop = True
myChartBackgroundColor= 0
myChartPic = 0
Scope = 0
SelectionColor = 0
TabIndex = 0
TabPanelIndex = 0
TabStop = True
Top = 35
UseFocusRing = ""
Visible = True
Width = 411
End
Begin Listbox listControls
AutoDeactivate = True
AutoHideScrollbars= True
Bold = ""
Border = True
ColumnCount = 1
ColumnsResizable= ""
ColumnWidths = ""
DataField = ""
DataSource = ""
DefaultRowHeight= -1
Enabled = True
EnableDrag = True
EnableDragReorder= ""
GridLinesHorizontal= 0
GridLinesVertical= 0
HasHeading = ""
HeadingIndex = -1
Height = 369
HelpTag = ""
Hierarchical = ""
Index = -2147483648
InitialParent = ""
InitialValue = "Button\rLabel\rTextBox\rTextField\rCanvas\rProgressBar\rWebBrowser\rListBox\rCheckBox"
Italic = ""
Left = 0
LockBottom = True
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
RequiresSelection= ""
Scope = 0
ScrollbarHorizontal= ""
ScrollBarVertical= True
SelectionType = 0
TabIndex = 1
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 35
Underline = ""
UseFocusRing = False
Visible = True
Width = 149
_ScrollWidth = -1
End
Begin Listbox listProperties
AutoDeactivate = True
AutoHideScrollbars= True
Bold = ""
Border = True
ColumnCount = 2
ColumnsResizable= ""
ColumnWidths = "110, 80"
DataField = ""
DataSource = ""
DefaultRowHeight= -1
Enabled = True
EnableDrag = ""
EnableDragReorder= ""
GridLinesHorizontal= 0
GridLinesVertical= 0
HasHeading = True
HeadingIndex = -1
Height = 329
HelpTag = ""
Hierarchical = ""
Index = -2147483648
InitialParent = ""
InitialValue = "Property Value"
Italic = ""
Left = 584
LockBottom = True
LockedInPosition= False
LockLeft = False
LockRight = True
LockTop = True
RequiresSelection= ""
Scope = 0
ScrollbarHorizontal= ""
ScrollBarVertical= True
SelectionType = 0
TabIndex = 2
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 35
Underline = ""
UseFocusRing = True
Visible = True
Width = 190
_ScrollWidth = -1
End
Begin PopupMenu popTarget
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 30
HelpTag = ""
Index = -2147483648
InitialParent = ""
InitialValue = "Python/GTK - Desktop\rPython/GTK - Maemo Tablet\rAdobe Flex - Web\rAndroid\riOS - iPhone\riOS - iPad\rHTML5 - Web"
Italic = ""
Left = 253
ListIndex = 6
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Scope = 0
TabIndex = 3
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 0
Underline = ""
Visible = True
Width = 274
End
Begin Label StaticText1
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 161
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = ""
Scope = 0
Selectable = False
TabIndex = 4
TabPanelIndex = 0
TabStop = True
Text = "Design For:"
TextAlign = 0
TextColor = 0
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 8
Transparent = False
Underline = ""
Visible = True
Width = 86
End
Begin Label StaticText2
AutoDeactivate = True
Bold = ""
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 0
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Multiline = ""
Scope = 0
Selectable = False
TabIndex = 5
TabPanelIndex = 0
TabStop = True
Text = "Controls:"
TextAlign = 0
TextColor = 0
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 8
Transparent = False
Underline = ""
Visible = True
Width = 100
End
Begin CheckBox chkApplyToAll
AutoDeactivate = True
Bold = ""
Caption = "Apply To All Platforms"
DataField = ""
DataSource = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 539
LockBottom = ""
LockedInPosition= False
LockLeft = True
LockRight = ""
LockTop = True
Scope = 0
State = 0
TabIndex = 7
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 6
Underline = ""
Value = False
Visible = True
Width = 235
End
Begin PushButton btnOK
AutoDeactivate = True
Bold = ""
ButtonStyle = 0
Cancel = ""
Caption = "OK"
Default = ""
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = ""
Left = 694
LockBottom = True
LockedInPosition= False
LockLeft = False
LockRight = True
LockTop = False
Scope = 0
TabIndex = 8
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0
TextUnit = 0
Top = 384
Underline = ""
Visible = True
Width = 80
End
End
#tag EndWindow
#tag WindowCode
#tag Event
Sub Close()
prefLastUIEdited = popTarget.ListIndex
modPrefs.WriteAllPrefs
End Sub
#tag EndEvent
#tag Event
Sub EnableMenuItems()
'CopyLayoutFromAdobeFlexAIRDesktop.Enabled = true
CopyLayoutFromHaikuDesktop.Enabled = True
CopyLayoutFromAdobeFlexWeb.Enabled = true
CopyLayoutFromPythonGTKMaemoTablet.Enabled = true
PythonGTKDesktopPythonGTKDesktop.Enabled = true
LayoutMenu.Enabled = true
CopyLayoutFrom.Enabled = true
End Sub
#tag EndEvent
#tag Event
Sub Open()
if TargetMacOS = true then
popTarget.Top = 6
end if
chartUI.myChartBackgroundColor = rgb(165,165,165)
'ilObjectSelected.AddNewUIObject("Button")
chartUI.AcceptRawDataDrop("text")
popTarget.ListIndex = prefLastUIEdited
RefreshUILayoutFromSelectedFrame
'CopyLayoutFromAdobeFlexAIRDesktop.Enabled = true
CopyLayoutFromHaikuDesktop.Enabled = True
CopyLayoutFromAdobeFlexWeb.Enabled = true
CopyLayoutFromPythonGTKMaemoTablet.Enabled = true
PythonGTKDesktopPythonGTKDesktop.Enabled = true
LayoutMenu.Enabled = true
CopyLayoutFrom.Enabled = true
'popTarget.ListIndex = prefLastUIEdited
End Sub
#tag EndEvent
#tag MenuHandler
Function CopyLayoutFromAdobeFlexAIRDesktop() As Boolean Handles CopyLayoutFromAdobeFlexAIRDesktop.Action
CopyLayoutFromTo(app.kpFlexAIRDesktop, popTarget.ListIndex)
Return True
End Function
#tag EndMenuHandler
#tag MenuHandler
Function CopyLayoutFromAdobeFlexWeb() As Boolean Handles CopyLayoutFromAdobeFlexWeb.Action
CopyLayoutFromTo(app.kpFlexWeb, popTarget.ListIndex)
Return True
End Function
#tag EndMenuHandler
#tag MenuHandler
Function CopyLayoutFromPythonGTKMaemoTablet() As Boolean Handles CopyLayoutFromPythonGTKMaemoTablet.Action
CopyLayoutFromTo(app.kpPythonMaemo,popTarget.ListIndex)
Return True
End Function
#tag EndMenuHandler
#tag MenuHandler
Function PythonGTKDesktopPythonGTKDesktop() As Boolean Handles PythonGTKDesktopPythonGTKDesktop.Action
CopyLayoutFromTo(app.kpPythonDesktop,popTarget.ListIndex)
Return True
End Function
#tag EndMenuHandler
#tag Method, Flags = &h0
Sub CopyAllUIToAllTargets()
dim i as integer
dim j as integer
if chkApplyToAll.Value = true then
if chartUI.Objects.Ubound > -1 then
for i = 0 to chartUI.Objects.Ubound
for j = 0 to 10
ilUIObject(chartUI.Objects(i).myilUIObject).Text(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Text(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).X(j) = ilUIObject(chartUI.Objects(i).myilUIObject).X(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).Y(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Y(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).Width(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Width(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).Height(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Height(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).LockBottom(j) = ilUIObject(chartUI.Objects(i).myilUIObject).LockBottom(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).LockLeft(j) = ilUIObject(chartUI.Objects(i).myilUIObject).LockLeft(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).LockRight(j) = ilUIObject(chartUI.Objects(i).myilUIObject).LockRight(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).LockTop(j) = ilUIObject(chartUI.Objects(i).myilUIObject).LockTop(popTarget.ListIndex)
ilUIObject(chartUI.Objects(i).myilUIObject).BackgroundColor(j) = ilUIObject(chartUI.Objects(i).myilUIObject).BackgroundColor(popTarget.ListIndex)
// If a Window, don't modify the width/height for iphone, ipad, tablet
if ilUIObject(chartUI.Objects(i).myilUIObject).ControlType = 0 then // It's a window
if j = app.kpiOSiPad or j = app.kpiOSiPad or j = app.kpPythonMaemo then // it's a mobile device
else
'ilUIObject(chartUI.Objects(i).myilUIObject).Width(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Width(popTarget.ListIndex)
'ilUIObject(chartUI.Objects(i).myilUIObject).Height(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Height(popTarget.ListIndex)
end if
else
'ilUIObject(chartUI.Objects(i).myilUIObject).Width(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Width(popTarget.ListIndex)
'ilUIObject(chartUI.Objects(i).myilUIObject).Height(j) = ilUIObject(chartUI.Objects(i).myilUIObject).Height(popTarget.ListIndex)
end if
next
next
end if
end if
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub CopyLayoutFromTo(FromTarget as integer, ToTarget as integer)
dim i as integer
if chartUI.Objects.Ubound > -1 then
for i = 0 to chartUI.Objects.Ubound
ilUIObject(chartUI.Objects(i).myilUIObject).Text(ToTarget) = ilUIObject(chartUI.Objects(i).myilUIObject).Text(FromTarget)
ilUIObject(chartUI.Objects(i).myilUIObject).X(ToTarget) = ilUIObject(chartUI.Objects(i).myilUIObject).X(FromTarget)
ilUIObject(chartUI.Objects(i).myilUIObject).Y(ToTarget) = ilUIObject(chartUI.Objects(i).myilUIObject).Y(FromTarget)
ilUIObject(chartUI.Objects(i).myilUIObject).Width(ToTarget) = ilUIObject(chartUI.Objects(i).myilUIObject).Width(FromTarget)
ilUIObject(chartUI.Objects(i).myilUIObject).Height(ToTarget) = ilUIObject(chartUI.Objects(i).myilUIObject).Height(FromTarget)
next
end if
chartUI.Refresh
chartUI.RedrawChart
End Sub
#tag EndMethod
#tag Method, Flags = &h1000
Function GetObjectPropertyAtIndex(ObjectIndex as Integer, propKey as string) As string
dim s as string
if propKey = "Text" then
s = ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Text(popTarget.ListIndex)
elseif propKey = "Name" then
s = ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Name
elseif propKey = "X" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).X(popTarget.ListIndex))
elseif propKey = "Y" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Y(popTarget.ListIndex))
elseif propKey = "Width" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Width(popTarget.ListIndex))
elseif propKey = "Height" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Height(popTarget.ListIndex))
elseif propKey = "Lock Left" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockLeft(popTarget.ListIndex))
elseif propKey = "Lock Right" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockRight(popTarget.ListIndex))
elseif propKey = "Lock Top" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockTop(popTarget.ListIndex))
elseif propKey = "Lock Bottom" then
s = str(ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockBottom(popTarget.ListIndex))
elseif propKey = "Color" then
s = ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).BackgroundColor(popTarget.ListIndex).stringvalue
end if
Return s
End Function
#tag EndMethod
#tag Method, Flags = &h0
Function ilObjectSelected() As ilObjectWindow
if frmProject.chartProject.selectedFrame.tag isa ilObjectWindow then
Return ilObjectWindow(frmProject.chartProject.selectedFrame.tag)
else
Return nil
end if
End Function
#tag EndMethod
#tag Method, Flags = &h0
Sub RefreshPropertyListforIndex(ObjectIndex as integer)
listProperties.DeleteAllRows
if ObjectIndex > -1 then
listProperties.AddRow("Name")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Name")
listProperties.RowTag(0) = ObjectIndex
listProperties.AddRow("Text")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Text")
listProperties.AddRow("X")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "X")
listProperties.AddRow("Y")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Y")
listProperties.AddRow("Height")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Height")
listProperties.AddRow("Width")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Width")
// If a Window, background color
if ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).ControlType = ilUIObject.kcWindow then
listProperties.AddRow("Color")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Color")
end if
// if not a window, then congrol locking
if ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).ControlType <> ilUIObject.kcWindow then
listProperties.AddRow("Lock Left")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Lock Left")
listProperties.AddRow("Lock Right")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Lock Right")
listProperties.AddRow("Lock Top")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Lock Top")
listProperties.AddRow("Lock Bottom")
listProperties.Cell(listProperties.LastIndex,1) = GetObjectPropertyAtIndex(ObjectIndex, "Lock Bottom")
end if
end if
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub RefreshUILayoutFromSelectedFrame()
chartUI.RemoveAllObjects
dim i as integer
if ilObjectSelected <> nil then
if ilObjectSelected.theWindowObject <> nil then
chartUI.AddObjectUI(ilObjectSelected.theWindowObject)
end if
if ilObjectSelected.theUIObjects.Ubound > -1 then
for i = 0 to ilObjectSelected.theUIObjects.Ubound
chartUI.AddObjectUI(ilObjectSelected.theUIObjects(i))
next
end if
end if
chartUI.RedrawChart
ilObjectSelected.UpdateControlBlockItems
CopyAllUIToAllTargets
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub RemoveControlObject(ObjectIndex as integer)
'ilObjectSelected.theUIObjects.Remove(ObjectIndex)
End Sub
#tag EndMethod
#tag Method, Flags = &h0
Sub UpdateObjectPropertyAtIndex(ObjectIndex as Integer, propKey as string, propValue as string)
dim tempBool as Boolean
if propValue = "True" then
tempBool = True
ElseIf propValue = "False" then
tempBool = false
end if
if propKey = "Text" then
ilUIObject(chartUI.Objects(objectindex).myilUIObject).Text(popTarget.ListIndex) = propValue
elseif propKey = "Name" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Name = propValue
elseif propKey = "X" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).X(popTarget.ListIndex) = Val(propValue)
elseif propKey = "Y" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Y(popTarget.ListIndex) = Val(propValue)
elseif propKey = "Width" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Width(popTarget.ListIndex) = Val(propValue)
elseif propKey = "Height" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).Height(popTarget.ListIndex) = Val(propValue)
elseif propKey = "Lock Left" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockLeft(popTarget.ListIndex) = tempBool
elseif propKey = "Lock Right" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockRight(popTarget.ListIndex) = tempBool
elseif propKey = "Lock Top" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockTop(popTarget.ListIndex) = tempBool
elseif propKey = "Lock Bottom" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).LockBottom(popTarget.ListIndex) = tempBool
elseif propKey = "Color" then
ilUIObject(chartUI.Objects(ObjectIndex).myilUIObject).BackgroundColor(popTarget.ListIndex) = propValue.ColorValue
end if
ilObjectSelected.UpdateControlBlockItems
CopyAllUIToAllTargets
End Sub
#tag EndMethod
#tag EndWindowCode
#tag Events chartUI
#tag Event
Sub DropObject(obj As DragItem, action As Integer)
dim theX as integer
dim theY as integer
theX = me.MouseX - me.Left - val(GetObjectPropertyAtIndex(0, "X"))
theY = me.MouseY - me.Top - val(GetObjectPropertyAtIndex(0, "Y"))
ilObjectSelected.AddNewUIObjectWithXY(obj.PrivateRawData("text"), theX, theY)
RefreshUILayoutFromSelectedFrame
End Sub
#tag EndEvent
#tag Event
Sub ObjectSelected(ObjectIndex as integer)
'me.Objects(ObjectIndex).myilUIObject
RefreshPropertyListforIndex(ObjectIndex)
CopyAllUIToAllTargets
End Sub
#tag EndEvent
#tag Event
Sub NoObjectSelected()
RefreshPropertyListforIndex(-1)
End Sub
#tag EndEvent
#tag Event
Function ConstructContextualMenu(base as MenuItem, x as Integer, y as Integer) As Boolean
if me.SelectedObject > 0 then
base.append(New MenuItem("Remove Control"))
Return True //display the contextual menu
end if
End Function
#tag EndEvent
#tag Event
Function ContextualMenuAction(hitItem as MenuItem) As Boolean
if me.SelectedObject > -1 then
Select Case hititem.text
case "Remove Control"
ilObjectSelected.DeleteUIObject(chartUI.Objects(me.SelectedObject).myilUIObject)
RefreshUILayoutFromSelectedFrame
ilObjectSelected.UpdateControlBlockItems
RefreshPropertyListforIndex(-1)
end select
end if
End Function
#tag EndEvent
#tag Event
Function KeyDown(Key As String) As Boolean
if asc(key) = 127 or asc(key) = 8 then // Delete
ilObjectSelected.DeleteUIObject(chartUI.Objects(me.SelectedObject).myilUIObject)
RefreshUILayoutFromSelectedFrame
ilObjectSelected.UpdateControlBlockItems
RefreshPropertyListforIndex(-1)
end if
'
'if asc(key) = 30 then // Up arrow
'
'ilUIObject(chartUI.Objects(me.SelectedObject).myilUIObject).Y(popTarget.ListIndex) = ilUIObject(chartUI.Objects(me.SelectedObject).myilUIObject).Y(popTarget.ListIndex) - 1
'RefreshUILayoutFromSelectedFrame
'
'
'end if
End Function
#tag EndEvent
#tag Event
Function MouseDown(X As Integer, Y As Integer) As Boolean
me.SetFocus
if IsContextualClick = true then
Return false
end if
End Function
#tag EndEvent
#tag Event
Sub ObjectMoved(ObjectIndex as integer)
RefreshPropertyListforIndex(ObjectIndex)
CopyAllUIToAllTargets
End Sub
#tag EndEvent
#tag EndEvents
#tag Events listControls
#tag Event
Function DragRow(drag As DragItem, row As Integer) As Boolean
Drag.PrivateRawData("text")=Me.List(Row)
Return true
End Function
#tag EndEvent
#tag Event
Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) As Boolean
dim c as color
c = rgb(15,0,90)
'Black Border
g.ForeColor = RGB(0,0,0)
g.FillRect(0,2,g.Width - 7, g.Height - 4)
'Hilight stripe
g.ForeColor = rgb(c.Red+20,c.Green+20,c.Blue+20)
g.FillRect(1,3,g.Width - 9, 1)
'Main fill
g.ForeColor = c
g.FillRect(1, 4, g.Width - 9, g.Height - 7)
'g.Gradient(1,3,10,26)', colorBlockList, rgb(colorBlockList.Red-20,colorBlockList.Green-20,colorBlockList.Blue-20)
// Draw the text
g.TextSize = 10
g.ForeColor = rgb(0,0,0)
if TargetLinux = true then
g.DrawString(me.List(row), 3, g.Height - 7)
ElseIf TargetWin32 = true then
g.DrawString(me.List(row), 3, g.Height - 5)
ElseIf TargetMacOS = true then
g.DrawString(me.List(row), 3, g.Height - 5)
end if
g.ForeColor = rgb(255,255,255)
if TargetLinux = true then
g.DrawString(me.List(row), 3, g.Height - 6)
ElseIf TargetWin32 = true then
g.DrawString(me.List(row), 3, g.Height - 4)
ElseIf TargetMacOS = true then
g.DrawString(me.List(row), 3, g.Height - 4)
end if
Return true
End Function
#tag EndEvent
#tag EndEvents
#tag Events listProperties
#tag Event
Function CellClick(row as Integer, column as Integer, x as Integer, y as Integer) As Boolean
Dim m as MenuItem
dim mResult as MenuItem
// value column clicked
if column = 1 then
if me.Cell(row,0) = "Lock Top" or me.Cell(row,0) = "Lock Bottom" or me.Cell(row,0) = "Lock Left" or me.Cell(row,0) = "Lock Right" then
m = new MenuItem
m.Append ( new MenuItem ("True"))
m.Append ( new MenuItem ("False"))
mResult=m.Popup
me.Cell(row,1) = mResult.Text
UpdateObjectPropertyAtIndex(me.RowTag(0), me.Cell(row,0), me.Cell(row, column))
elseif me.Cell(row,0) = "Color" then
Dim c as Color
Dim b as Boolean
c=me.Cell(row,column).ColorValue
b=SelectColor(c,"Select a Color")
me.Cell(row,column) = c.stringvalue
UpdateObjectPropertyAtIndex(me.RowTag(0), me.Cell(row,0), me.Cell(row, column))
chartUI.RedrawChart
else
me.EditCell(row, column)
end if
end if
End Function
#tag EndEvent
#tag Event
Sub CellTextChange(row as Integer, column as Integer)
if me.Cell(row,0) = "X" or me.Cell(row,0) = "Y" or me.Cell(row,0) = "Height" or me.Cell(row,0) = "Width" then
me.Cell(row,column) = str(val(me.Cell(row,column)))
end if
UpdateObjectPropertyAtIndex(me.RowTag(0), me.Cell(row,0), me.Cell(row, column))
chartUI.RedrawChart
End Sub
#tag EndEvent
#tag Event
Function CellKeyDown(row as Integer, column as Integer, key as String) As Boolean
if me.Cell(row,0) = "X" or me.Cell(row,0) = "Y" or me.Cell(row,0) = "Height" or me.Cell(row,0) = "Width" then
'if asc(key) < 48 or asc(key) > 57 then
'if asc(key) <> 127 then
'Return true
'end if
'end if
if asc(key) >= 58 and asc(key) <= 126 then
Return true
end if
end if
if me.Cell(row,0) = "Name" then
// Numbers
if asc(key) >= 48 and asc(key) <= 57 then
Return false
end if
// Big Letters
if asc(key) >= 65 and asc(key) <= 90 then
Return false
end if
// Small letters
if asc(key) >= 97 and asc(key) <= 122 then
Return false
end if
if asc(key) = 127 or asc(key) = 8 then // Delete
Return false
end if
Return true
end if
Return false
End Function
#tag EndEvent
#tag Event
Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) As Boolean
if column = 1 then
if me.Cell(row,0) = "Color" then
g.ForeColor = me.Cell(row,column).ColorValue
g.FillRect 0,0,g.Width,g.Height
end if
end if
End Function
#tag EndEvent
#tag EndEvents
#tag Events popTarget
#tag Event
Sub Change()
RefreshUILayoutFromSelectedFrame
End Sub
#tag EndEvent
#tag EndEvents
#tag Events btnOK
#tag Event
Sub Action()
frmUIEditor.Close
End Sub
#tag EndEvent
#tag EndEvents