This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathrevStartCenterBehavior.livecodescript
More file actions
978 lines (869 loc) · 32.5 KB
/
revStartCenterBehavior.livecodescript
File metadata and controls
978 lines (869 loc) · 32.5 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
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
script "revStartCenterBehavior"
constant kAllSocialMedia = "facebook,twitter,github,linkedin,youtube,stackoverflow"
constant kSocialMedia = "github,stackoverflow,youtube,facebook,twitter,linkedin"
on openStack
revIDESubscribe "ideDesktopChanged"
## Set up the Start Center UI
initialiseInterface
## Logo
logoInitialise
## Social Media
socialMediaInitialise
socialMediaSet
## Recent Files
recentFilesInitialise
recentFilesSet
set the dgHilitedLine of group "recentFiles" to 1
## Tiles
tilesInitialise
## First Run Controls
set the backgroundColor of button "startTour" to uiColor("edition")
set the filename of image "firstRunImage" of group "firstRun" to resourcesPath("images/firstRunImage.PNG")
set the itemdelimiter to "."
get item 1 to 2 of the version
put merge("Welcome to LiveCode [[it]]!") into field "firstRunTitle" of me
## Set folder icon
set the foregroundColor of widget "openIcon" to uiColor("dark grey")
set the iconPresetName of widget "openIcon" to "folder open alt"
## Show the banner
--bannerInitialise
## Show at startup preference
set the foregroundColor of widget "startupCheckbox" to uiColor("dark grey")
if revIDEGetPreference("cStartPageShow") is true then
set the iconPresetName of widget "startupCheckbox" to "lc-checkbox-checked"
else
set the iconPresetName of widget "startupCheckbox" to "lc-checkbox-unchecked"
end if
end openStack
command initialiseInterface
hide group "Upgrade" of me
## First run
if revIDEGetPreference("StartCenterClassic") is true then
## Not first run
hide group "firstRun"
show group "topPanel"
--show group "tiles"
set the top of group "recentFiles" to 0
showUpgradeMini
else
## First run
hide group "banner"
hide group "topPanel"
--hide group "tiles"
set the top of group "recentFiles" to 0
set the layer of group "firstRun" to top
show group "firstRun"
hide group "UpgradeMini" of me
if there is a widget "UpgradeMini" of me then
hide widget "UpgradeMini" of me
end if
end if
end initialiseInterface
on firstRunVisible pVisible
revIDESetPreference "StartCenterClassic", not pVisible
initialiseInterface
end firstRunVisible
on ideDesktopChanged
set the loc of me to revIDEStackScreenLoc(the short name of me)
end ideDesktopChanged
on ideNewStack
startCenterClose
end ideNewStack
on ideOpenStack pTarget
if not exists(pTarget) then
exit ideOpenStack
end if
local tTargetStack
put the short name of ideStackOfObject(pTarget) into tTargetStack
if the filename of stack (the mainstack of stack tTargetStack) is among the lines of revIDEGetAllPlugins() then
exit ideOpenStack
end if
if tTargetStack is not the short name of me then
startCenterClose
end if
end ideOpenStack
command startCenterClose
close me
end startCenterClose
command logoInitialise
## Set the logo to the correct logo for the version
set the iconPresetName of widget "logo" of me to "lc-logo"
set the foregroundColor of widget "logo" of me to uiColor("logo")
## Set the title to contain the correct version string
local tMajorVersion
set the itemDelimiter to "."
put item 1 to 2 of the version into tMajorVersion
put merge("Welcome to LiveCode [[tMajorVersion]]") into field "title" of me
end logoInitialise
command socialMediaInitialise
## Set the images
local tWidget
repeat for each item tMedia in kAllSocialMedia
put the long id of widget tMedia of group "socialMedia" into tWidget
hide tWidget
set the iconPresetName of tWidget to ("lc-" & tMedia)
set the foregroundColor of tWidget to uiColor(tMedia)
set the fillrule of tWidget to "even odd"
set the blendLevel of tWidget to 50
set the behavior of tWidget to the long id of button "socialBehavior" of me
end repeat
end socialMediaInitialise
command socialMediaSet
local tCenterLoc, tMediaCount, tPadding, tWidth, tTotalWidth, tLeft
## Show the chosen social media
put item 1 of the loc of group "socialMedia" into tCenterLoc
put the number of items in kSocialMedia into tMediaCount
put 20 into tPadding
put 20 into tWidth
put (tWidth * tMediaCount) + (tMediaCount - 1) * tPadding into tTotalWidth
put tCenterLoc - round(tTotalWidth / 2) into tLeft
repeat with x = 1 to tMediaCount
show widget (item x of kSocialMedia)
set the left of widget (item x of kSocialMedia) to tLeft
add tWidth + tPadding to tLeft
end repeat
end socialMediaSet
command socialMediaHilite pName, pValue
if pValue is true then
set the blendLevel of widget pName of group "socialMedia" to 0
else
set the blendLevel of widget pName of group "socialMedia" to 50
end if
end socialMediaHilite
command socialMediaUnhiliteAll
repeat with x = 1 to the number of widgets of group "socialMedia"
set the blendLevel of widget x of group "socialMedia" to 50
end repeat
end socialMediaUnhiliteAll
command recentFilesInitialise
set the dgProps["hilite color"] of group "recentFiles" to uiColor("edition")
set the linkColor of this stack to uiColor("edition")
set the underlineLinks of this stack to false
end recentFilesInitialise
command recentFilesSet
local tRecentStacks
put revIDERecentStacks() into tRecentStacks
set the dgData of group "recentFiles" to tRecentStacks
end recentFilesSet
command recentFileOpen
local tLine, tFileData
put the dgHilitedLine of group "recentFiles" into tLine
put the dgDataOfLine[tLine] of group "recentFiles" into tFileData
revIDEOpenStack tFileData["filename"]
end recentFileOpen
command tilesInitialise
local tArray, tSourceColor, tColorStep, tTileNumber
## Set the colors of the tiles
put uiColor("edition") into tSourceColor
put revEnvironmentEditionProperty("start_center_tile_color_step") into tColorStep
repeat with tTileNumber = 1 to 8
add 1 to tColorStep
set the bgColor of widget ("tile" & tTileNumber) to tileColor(tSourceColor,tColorStep)
set the bgHoverColor of widget ("tile" & tTileNumber) to uiColor("tileBGHover")
set the fgColor of widget ("tile" & tTileNumber) to uiColor("tileFG")
set the fgHoverColor of widget ("tile" & tTileNumber) to uiColor("tileFGHover")
set the hoverState of widget ("tile" & tTileNumber) to false
set the behavior of widget ("tile" & tTileNumber) to the long id of button "tileBehavior"
end repeat
## Breadcrumb
put empty into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to empty
put tilesArray("home") into tArray
repeat with x = 1 to 8
show widget ("tile" & x)
end repeat
tilesSet tArray
end tilesInitialise
command tilesSet pArray
local tArray
put pArray into tArray
repeat with x = 1 to 8
if tArray[x]["tag"] is not empty then
set the tileLabel of widget ("tile" & x) of me to tArray[x]["label"]
set the iconName of widget ("tile" & x) of me to tArray[x]["icon"]
set the hoverIconName of widget ("tile" & x) of me to tArray[x]["hoverIcon"]
set the cTag of widget ("tile" & x) of me to tArray[x]["tag"]
set the hoverState of widget ("tile" & x) of me to false
else
set the tileLabel of widget ("tile" & x) of me to empty
set the tileIcon of widget ("tile" & x) of me to empty
set the cTag of widget ("tile" & x) of me to empty
end if
end repeat
end tilesSet
function resourcesPath pFileName
return revIDEPaletteResourcePath(pFileName)
end resourcesPath
function tilesArray pState
local tArray
switch pState
case "home"
put "Interactive Welcome" into tArray[1]["label"]
put "interactive_welcome" into tArray[1]["tag"]
put "lc-location" into tArray[1]["icon"]
put "lc-location-filled" into tArray[1]["hoverIcon"]
put "New" into tArray[2]["label"]
put "new" into tArray[2]["tag"]
put "lc-add" into tArray[2]["icon"]
put "lc-add-filled" into tArray[2]["hoverIcon"]
put "Sample Projects" into tArray[3]["label"]
put "samples" into tArray[3]["tag"]
put "lc-window" into tArray[3]["icon"]
put "lc-window-filled" into tArray[3]["hoverIcon"]
put "Tutorials" into tArray[4]["label"]
put "tutorials" into tArray[4]["tag"]
put "lc-book" into tArray[4]["icon"]
put "lc-book-filled" into tArray[4]["hoverIcon"]
put "In Depth Guides" into tArray[5]["label"]
put "guides" into tArray[5]["tag"]
put "lc-learner" into tArray[5]["icon"]
put "lc-learner-filled" into tArray[5]["hoverIcon"]
put "Forums" into tArray[6]["label"]
put "forum" into tArray[6]["tag"]
put "lc-talk" into tArray[6]["icon"]
put "lc-talk-filled" into tArray[6]["hoverIcon"]
put "Blog" into tArray[7]["label"]
put "blog" into tArray[7]["tag"]
put "lc-microphone" into tArray[7]["icon"]
put "lc-microphone-filled" into tArray[7]["hoverIcon"]
put "Account" into tArray[8]["label"]
put "account" into tArray[8]["tag"]
put "lc-person" into tArray[8]["icon"]
put "lc-person-filled" into tArray[8]["hoverIcon"]
break
case "interactive_welcome"
put "1. User Interface" into tArray[1]["label"]
put "tutorial_list_ui" into tArray[1]["tag"]
put "tablet" into tArray[1]["icon"]
put "tablet" into tArray[1]["hoverIcon"]
put "2. Coding" into tArray[2]["label"]
put "tutorial_list_coding" into tArray[2]["tag"]
put "terminal" into tArray[2]["icon"]
put "terminal" into tArray[2]["hoverIcon"]
break
case "tutorial_list_ui"
put "1. Hello World" into tArray[1]["label"]
put "tutorial_hello_world" into tArray[1]["tag"]
put "lc-hello-world" into tArray[1]["icon"]
put "lc-hello-world-filled" into tArray[1]["hoverIcon"]
put "2. To Do List" into tArray[2]["label"]
put "tutorial_todo_list" into tArray[2]["tag"]
put "lc-todo-list" into tArray[2]["icon"]
put "lc-todo-list-filled" into tArray[2]["hoverIcon"]
put "3. BMI Calculator" into tArray[3]["label"]
put "tutorial_bmi_calculator" into tArray[3]["tag"]
put "lc-bmi-calculator" into tArray[3]["icon"]
put "lc-bmi-calculator-filled" into tArray[3]["hoverIcon"]
put "1. Hello World" into tArray[1]["label"]
put "tutorial_hello_world" into tArray[1]["tag"]
put "lc-hello-world" into tArray[1]["icon"]
put "lc-hello-world-filled" into tArray[1]["hoverIcon"]
put "2. To Do List" into tArray[2]["label"]
put "tutorial_todo_list" into tArray[2]["tag"]
put "lc-todo-list" into tArray[2]["icon"]
put "lc-todo-list-filled" into tArray[2]["hoverIcon"]
break
case "tutorial_list_coding"
put "1. Combining Text" into tArray[1]["label"]
put "tutorial_combining_text" into tArray[1]["tag"]
put "font" into tArray[1]["icon"]
put "font" into tArray[1]["hoverIcon"]
put "2. Timers" into tArray[2]["label"]
put "tutorial_timers" into tArray[2]["tag"]
put "hourglass" into tArray[2]["icon"]
put "hourglass" into tArray[2]["hoverIcon"]
break
case "new"
put "New Stack" into tArray[1]["label"]
put "newStackDefault" into tArray[1]["tag"]
put "lc-window" into tArray[1]["icon"]
put "lc-window-filled" into tArray[1]["hoverIcon"]
put "Script Only Stack" into tArray[2]["label"]
put "newScriptOnlyStack" into tArray[2]["tag"]
put "lc-filetype-lcs" into tArray[2]["icon"]
put "lc-filetype-lcs-filled" into tArray[2]["hoverIcon"]
put "Tablet Portrait" into tArray[3]["label"]
put "newTabletPortrait" into tArray[3]["tag"]
put "lc-ipad-portrait" into tArray[3]["icon"]
put "lc-ipad-portrait-filled" into tArray[3]["hoverIcon"]
put "Tablet Landscape" into tArray[4]["label"]
put "newTabletLandscape" into tArray[4]["tag"]
put "lc-ipad-landscape" into tArray[4]["icon"]
put "lc-ipad-landscape-filled" into tArray[4]["hoverIcon"]
put "Phone" into tArray[5]["label"]
put "newphone" into tArray[5]["tag"]
put "lc-iphone" into tArray[5]["icon"]
put "lc-iphone-filled" into tArray[5]["hoverIcon"]
break
case "newPhone"
put "SE" into tArray[1]["label"]
put "newIphoneSE" into tArray[1]["tag"]
put "lc-iphone" into tArray[1]["icon"]
put "lc-iphone-filled" into tArray[1]["hoverIcon"]
put "6s/7/8" into tArray[2]["label"]
put "newIphone6s78" into tArray[2]["tag"]
put "lc-iphone" into tArray[2]["icon"]
put "lc-iphone-filled" into tArray[2]["hoverIcon"]
put "6s+/7+/8+" into tArray[3]["label"]
put "newIphone6sPlus7Plus8Plus" into tArray[3]["tag"]
put "lc-iphone" into tArray[3]["icon"]
put "lc-iphone-filled" into tArray[3]["hoverIcon"]
put "X/XS/11 Pro" into tArray[4]["label"]
put "newIphoneXXS11Pro" into tArray[4]["tag"]
put "lc-iphone" into tArray[4]["icon"]
put "lc-iphone-filled" into tArray[4]["hoverIcon"]
put "XR/11" into tArray[5]["label"]
put "newIphoneXR11" into tArray[5]["tag"]
put "lc-iphone" into tArray[5]["icon"]
put "lc-iphone-filled" into tArray[5]["hoverIcon"]
put "XS Max/11 Pro Max" into tArray[6]["label"]
put "newIphoneXSMax11ProMax" into tArray[6]["tag"]
put "lc-iphone" into tArray[6]["icon"]
put "lc-iphone-filled" into tArray[6]["hoverIcon"]
put "Android 6-inch generic" into tArray[7]["label"]
put "android6inchgeneric" into tArray[7]["tag"]
put "lc-iphone" into tArray[7]["icon"]
put "lc-iphone-filled" into tArray[7]["hoverIcon"]
break
case "newTabletPortrait"
put "9.7-inch" into tArray[1]["label"]
put "newTablet9.7portrait" into tArray[1]["tag"]
put "lc-ipad-portrait" into tArray[1]["icon"]
put "lc-ipad-portrait-filled" into tArray[1]["hoverIcon"]
put "10.2-inch" into tArray[2]["label"]
put "newTablet10.2portrait" into tArray[2]["tag"]
put "lc-ipad-portrait" into tArray[2]["icon"]
put "lc-ipad-portrait-filled" into tArray[2]["hoverIcon"]
put "10.5-inch" into tArray[3]["label"]
put "newTablet10.5portrait" into tArray[3]["tag"]
put "lc-ipad-portrait" into tArray[3]["icon"]
put "lc-ipad-portrait-filled" into tArray[3]["hoverIcon"]
put "11-inch" into tArray[4]["label"]
put "newTablet11portrait" into tArray[4]["tag"]
put "lc-ipad-portrait" into tArray[4]["icon"]
put "lc-ipad-portrait-filled" into tArray[4]["hoverIcon"]
put "12.9-inch" into tArray[5]["label"]
put "newTablet12.9portrait" into tArray[5]["tag"]
put "lc-ipad-portrait" into tArray[5]["icon"]
put "lc-ipad-portrait-filled" into tArray[5]["hoverIcon"]
put "10-inch" into tArray[6]["label"]
put "newTablet10portrait" into tArray[6]["tag"]
put "lc-ipad-portrait" into tArray[6]["icon"]
put "lc-ipad-portrait-filled" into tArray[6]["hoverIcon"]
put "7-inch" into tArray[7]["label"]
put "newTablet7portrait" into tArray[7]["tag"]
put "lc-ipad-portrait" into tArray[7]["icon"]
put "lc-ipad-portrait-filled" into tArray[7]["hoverIcon"]
break
case "newTabletLandscape"
put "9.7-inch" into tArray[1]["label"]
put "newTablet9.7landscape" into tArray[1]["tag"]
put "lc-ipad-landscape" into tArray[1]["icon"]
put "lc-ipad-landscape-filled" into tArray[1]["hoverIcon"]
put "10.2-inch" into tArray[2]["label"]
put "newTablet10.2landscape" into tArray[2]["tag"]
put "lc-ipad-landscape" into tArray[2]["icon"]
put "lc-ipad-landscape-filled" into tArray[2]["hoverIcon"]
put "10.5-inch" into tArray[3]["label"]
put "newTablet10.5landscape" into tArray[3]["tag"]
put "lc-ipad-landscape" into tArray[3]["icon"]
put "lc-ipad-landscape-filled" into tArray[3]["hoverIcon"]
put "11-inch" into tArray[4]["label"]
put "newTablet11landscape" into tArray[4]["tag"]
put "lc-ipad-landscape" into tArray[4]["icon"]
put "lc-ipad-landscape-filled" into tArray[4]["hoverIcon"]
put "12.9-inch" into tArray[5]["label"]
put "newTablet12.9landscape" into tArray[5]["tag"]
put "lc-ipad-landscape" into tArray[5]["icon"]
put "lc-ipad-landscape-filled" into tArray[5]["hoverIcon"]
put "10-inch" into tArray[6]["label"]
put "newTablet10landscape" into tArray[6]["tag"]
put "lc-ipad-landscape" into tArray[6]["icon"]
put "lc-ipad-landscape-filled" into tArray[6]["hoverIcon"]
put "7-inch" into tArray[7]["label"]
put "newTablet7landscape" into tArray[7]["tag"]
put "lc-ipad-landscape" into tArray[7]["icon"]
put "lc-ipad-landscape-filled" into tArray[7]["hoverIcon"]
break
end switch
return tArray
end tilesArray
command startCenterSetState pStateID, pArray
switch pStateID
case 1
hide widget "tile8"
break
case 2
hide widget "tile7"
break
case 3
hide widget "tile6"
break
case 4
hide widget "tile5"
break
case 5
hide widget "tile4"
break
case 6
hide widget "tile3"
break
case 7
hide widget "tile2"
break
case 8
hide widget "tile1"
break
case 9
tilesSet pArray
break
case 10
if 1 is among the keys of pArray then
show widget "tile1"
end if
break
case 11
if 2 is among the keys of pArray then
show widget "tile2"
end if
break
case 12
if 3 is among the keys of pArray then
show widget "tile3"
end if
break
case 13
if 4 is among the keys of pArray then
show widget "tile4"
end if
break
case 14
if 5 is among the keys of pArray then
show widget "tile5"
end if
break
case 15
if 6 is among the keys of pArray then
show widget "tile6"
end if
break
case 16
if 7 is among the keys of pArray then
show widget "tile7"
end if
break
case 17
if 8 is among the keys of pArray then
show widget "tile8"
end if
break
end switch
if pStateID < 17 then
send "startCenterSetState pStateID+1, pArray" to me in 25 milliseconds
end if
end startCenterSetState
command tilesUpdate pArray
send "startCenterSetState 1, pArray" to me in 0 milliseconds
end tilesUpdate
on breadcrumbLinkClicked pLink
if pLink is "home" then
setState "home"
else if pLink is "Interactive Welcome" then
setState "interactive_welcome"
end if
end breadcrumbLinkClicked
on startCenterAction pAction
local tStackName, tArray
switch pAction
case "interactive_welcome"
--tourStart
put "Home / Interactive Welcome" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
hideUpgradeBrowser
break
case "tutorial_list_ui"
put "Home / Interactive Welcome / User Interface" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
set the textStyle of word 3 to 4 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
hideUpgradeBrowser
break
case "tutorial_list_coding"
put "Home / Interactive Welcome / Coding" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
set the textStyle of word 3 to 4 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
hideUpgradeBrowser
break
case "tutorial_hello_world"
tutorialStart "Hello World"
break
case "tutorial_todo_list"
tutorialStart "To Do List"
break
case "tutorial_bmi_calculator"
tutorialStart "BMI Calculator"
break
case "tutorial_combining_text"
tutorialStart "Combining Text"
break
case "tutorial_timers"
tutorialStart "Timers"
break
case "new"
put "Home / New" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
break
case "newphone"
put "Home / New / Phone" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
break
case "newTabletPortrait"
case "newTabletLandscape"
put "Home / New / Tablet" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
put tilesArray(pAction) into tArray
tilesUpdate tArray
break
case "samples"
revIDELaunchResource "sample stacks"
break
case "guides"
revIDEDocumentationLoad "API", "LiveCode Script"
break
case "tutorials"
launch url "http://livecode.com/links/livecode/tutorials"
break
case "forum"
launch url "http://livecode.com/links/livecode/forum"
break
case "dictionary"
revIDEDocumentationLoad "API", "Guide"
break
case "blog"
launch url "http://livecode.com/links/livecode/blog"
break
case "upgrade"
--launch url "https://livecode.com/about/contact/"
break
case "account"
launch url "http://livecode.com/links/livecode/account"
break
case "contact"
--launch url "https://livecode.com/about/contact/"
break
case "website"
launch url "http://livecode.com"
break
case "facebook"
launch url "http://livecode.com/links/livecode/facebook"
break
case "twitter"
launch url "http://livecode.com/links/livecode/twitter"
break
case "github"
launch url "http://livecode.com/links/livecode/github"
break
case "linkedin"
launch url "http://livecode.com/links/livecode/linkedin"
break
case "youtube"
launch url "http://livecode.com/links/livecode/youtube"
break
case "stackoverflow"
launch url "http://livecode.com/links/livecode/stackoverflow"
break
case "newStackDefault"
revIDEActionNewMainstack "default"
break
case "newScriptOnlyStack"
revIDEActionNewScriptOnlyStack
break
case "newIphoneSE"
revIDEActionNewMainstack "iPhone SE (320x568)"
break
case "newIphone6s78"
revIDEActionNewMainstack "iPhone 6s/7/8 (375x667)"
break
case "newIphone6sPlus7Plus8Plus"
revIDEActionNewMainstack "iPhone 6s+/7+/8+ (414x736)"
break
case "newIphoneXXS11Pro"
revIDEActionNewMainstack "iPhone X/XS/11 Pro (375x812)"
break
case "newIphoneXR11"
revIDEActionNewMainstack "iPhone XR/11 (414x896)"
break
case "newIphoneXSMax11ProMax"
revIDEActionNewMainstack "iPhone XS Max / 11 Pro Max (414x896)"
break
case "android6inchgeneric"
revIDEActionNewMainstack "Generic Android 6-inch Phone (412,775)"
break
case "newTablet9.7portrait"
revIDEActionNewMainstack "iPad/Tablet Portrait (768x1024)"
break
case "newTablet10.2portrait"
revIDEActionNewMainstack "iPad/Tablet Portrait (810x1080)"
break
case "newTablet10.5portrait"
revIDEActionNewMainstack "iPad/Tablet Portrait (834x1112)"
break
case "newTablet11portrait"
revIDEActionNewMainstack "iPad/Tablet Portrait (834x1194)"
break
case "newTablet12.9portrait"
revIDEActionNewMainstack "iPad 12.9-inch/Tablet Portrait (1024x1366)"
break
case "newTablet10portrait"
revIDEActionNewMainstack "Generic Android 10-inch Tablet Portrait (720x1280)"
break
case "newTablet7portrait"
revIDEActionNewMainstack "Generic Android 7-inch Tablet Portrait (600x1024)"
break
case "newTablet9.7landscape"
revIDEActionNewMainstack "iPad/Tablet Landscape (1024x768)"
break
case "newTablet10.2landscape"
revIDEActionNewMainstack "iPad/Tablet Landscape (1080x810)"
break
case "newTablet10.5landscape"
revIDEActionNewMainstack "iPad/Tablet Landscape (1112x834)"
break
case "newTablet11landscape"
revIDEActionNewMainstack "iPad/Tablet Landscape (1194x834)"
break
case "newTablet12.9landscape"
revIDEActionNewMainstack "iPad 12.9-inch/Tablet Landscape (1366x1024)"
break
case "newTablet10landscape"
revIDEActionNewMainstack "Generic Android 10-inch Tablet Landscape (1280x720)"
break
case "newTablet7landscape"
revIDEActionNewMainstack "Generic Android 7-inch Tablet Landscape (1024x600)"
break
end switch
end startCenterAction
command setState pState
local tArray
put tilesArray(pState) into tArray
put empty into field "breadcrumb"
if pState is "home" then
set the textStyle of word 1 of field "breadcrumb" to empty
showUpgradeMini
else if pState is "interactive_welcome" then
hideUpgradeBrowser
put "Home / Interactive Welcome" into field "breadcrumb"
set the textStyle of word 1 of field "breadcrumb" to "link"
end if
tilesUpdate tArray
end setState
command tourStart
lock screen
tutorialStart "Hello World", "App Lesson"
unlock screen
end tourStart
command tutorialStart pTutorial
lock screen
set the cTutorialOverride of me to true
revIDEStartTutorial "First Run", pTutorial, "App Lesson"
revIDESetPreference "StartCenterClassic", "true"
revIDESubscribe "ideTutorialProgressChanged"
startCenterClose
unlock screen
end tutorialStart
on ideTutorialProgressChanged
if revIDETutorialInProgress() is empty then
revIDEUnsubscribe "ideTutorialProgressChanged"
lock screen
revIDEOpenPalette "start center"
startCenterAction "interactive_welcome"
unlock screen
end if
end ideTutorialProgressChanged
## Banner
command bannerInitialise
set the top of group "recentFiles" to 0
hide group "banner"
--load url "http://elanorb.on-rev.com/startcenter/banner2.txt" with message "bannerComplete"
end bannerInitialise
## Social Media
command startupPreferenceSet
if the iconPresetName of widget "startupCheckbox" is "lc-checkbox-unchecked" then
set the iconPresetName of widget "startupCheckbox" to "lc-checkbox-checked"
revIDESetPreference "cStartPageShow", true
else
set the iconPresetName of widget "startupCheckbox" to "lc-checkbox-unchecked"
revIDESetPreference "cStartPageShow", false
end if
end startupPreferenceSet
function uiColor pColor
local tEdition
put revLicenseType() into tEdition
switch pColor
case "edition"
return revIDEColor("edition_color")
--return 82,82,82
break
case "dark grey"
return 128,128,128
break
case "mid grey"
return "150,150,150"
break
case "logo"
return revIDEColor("edition_color")
break
case "facebook"
return "58,88,155"
break
case "twitter"
return "0,122,185"
break
case "linkedin"
return "0,122,185"
break
case "youtube"
return "207,52,39"sa
break
case "stackoverflow"
return "206,111,45"
break
case "github"
return "0,0,0"
break
case "folder"
return "128,128,128"
break
case "recentFilesBackground"
return "247,247,247"
break
case "recentFilesHover"
return "222,222,222"
break
case "tileBGHover"
return "255,255,255"
break
case "tileFG"
return "255,255,255"
break
case "tileFGHover"
local tColorStep
put revEnvironmentEditionProperty("start_center_tile_color_step") into tColorStep
return tileColor(revIDEColor("edition_color"), tColorStep)
break
end switch
end uiColor
function tileColor pSourceColor, pTileNumber
local tRed, tGreen, tBlue, tColor
put item 1 of pSourceColor into tRed
put item 2 of pSourceColor into tGreen
put item 3 of pSourceColor into tBlue
put tRed + (pTileNumber*5), tGreen+(pTileNumber*5), tBlue+(pTileNumber*5) into tColor
return tColor
end tileColor
function textProperty pType, pStyle
switch pType
case "title"
if pStyle is "font" then
else if pStyle is "size" then
end if
break
case "tile"
if pStyle is "font" then
else if pStyle is "size" then
end if
break
case "stackLabel"
if pStyle is "font" then
else if pStyle is "size" then
end if
break
case "stackPath"
break
case "option"
break
end switch
end textProperty
-- Actions triggered by the browser widgets related to upgrade
on ideAction pAction, pUrl
switch pAction
case "launchAdWithUrl"
launchUpgradeBrowserWithUrl revEnvironmentEditionProperty("upgrade_url")
break
case "closeBrowser"
hide widget "Upgrade" of me
hide group "Upgrade" of me
showBrowser "UpgradeMini", \
revEnvironmentEditionProperty("upgrade_mini_url")
break
case "launchExternalUrl"
launch url pUrl
break
end switch
end ideAction
private command showUpgradeMini
if ideCanShowUpgradeOptions() and \
the cTutorialOverride of me is not true then
showBrowser "UpgradeMini", \
revEnvironmentEditionProperty("upgrade_mini_url")
else
set the cTutorialOverride of me to false
hide group "UpgradeMini" of me
if there is a widget "UpgradeMini" of me then
hide widget "UpgradeMini" of me
end if
end if
end showUpgradeMini
command showBrowser pBrowserName, pUrl
local tBrowser
if there is no widget pBrowserName then
create invisible widget pBrowserName as "com.livecode.widget.browser"
end if
put the long id of widget pBrowserName of me into tBrowser
if the url of tBrowser is empty then
-- show the browser's loading placeholder
show group pBrowserName of me
hide tBrowser
if pBrowserName is "UpgradeMini" then
set the rect of tBrowser to "-1,-1,504,320"
else
set the rect of tBrowser to "-1,0,800,572"
end if
set the javascripthandlers of tBrowser to "ideAction"
set the cLoading of tBrowser to true
set the url of tBrowser to pUrl
else
show tBrowser
end if
end showBrowser
command launchUpgradeBrowserWithUrl pUrl
hideUpgradeBrowser
showBrowser "Upgrade", pUrl
end launchUpgradeBrowserWithUrl
on browserNavigateComplete
if the cLoading of the target is true then
show the target
set the cLoading of the target to false
end if
end browserNavigateComplete
on browserLoadFailed
set the cLoading of the target to false
hide group "Upgrade" of me
hide group "UpgradeMini" of me
end browserLoadFailed
private command hideUpgradeBrowser
-- Don't auto-show the mini upgrade browser when the
-- upgrade browser is launched from elsewhere
hide widget "UpgradeMini" of me
hide group "UpgradeMini" of me
set the cLoading of widget "UpgradeMini" of me to false
end hideUpgradeBrowser