-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.ewu
9012 lines (7505 loc) · 233 KB
/
Application.ewu
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
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$version 12.00
$rect <40,300,220,340>
$output false
$multilingual true
class ContactsPage : Core::Group
{
$rect <310,40,480,80>
inherited method Init()
{
attachobserver onListItemsUpdate, ^Device::Device.Contacts.NoOfItems;
postsignal onListItemsUpdate;
attachobserver onListItemsUpdate, ^Device::Device.Contacts.Sorting;
postsignal onListItemsUpdate;
attachobserver onListItemsUpdate, ^Device::Device.MyContact;
postsignal onListItemsUpdate;
}
$rect <310,80,480,120>
inherited property Bounds = <0,0,272,440>;
$rect <830,60,1030,100>
slot onCreateNewContact
{
createContact = new Application::AddContactPage;
createContact.OnSave = onSaveAdd;
createContact.OnClose = onCancelAdd;
createContact.Contact = new Device::Contact;
SwitchToDialog( createContact, Res::SlideUpCentered, null, null, null, null, null,
null, null, null, false );
}
$rect <680,60,830,100>
var Application::AddContactPage createContact = null;
$rect <850,100,1030,140>
slot onSaveAdd
{
Device::Device.Contacts.AddLast( createContact.Contact );
DismissDialog( createContact, Res::SlideDownCentered, null, null, null, null, false);
createContact = null;
}
$rect <850,140,1030,180>
slot onCancelAdd
{
DismissDialog( createContact, Res::SlideDownCentered, null, null, null, null, false);
createContact = null;
}
// Initialization
note group Note2
{
attr Bounds = <290,0,660,140>;
}
$rect <850,270,1030,310>
slot onDelete
{
DismissDialog( detailsPage, Res::SlideRightCentered, null, null, null, null, false);
postsignal onListItemsUpdate;
detailsPage = null;
}
$rect <309,389,509,429>
slot onSearch
{
if ( SearchExt.String != "" )
{
Device::Device.Contacts.Search( SearchExt.String );
ContactsInsideSearch.Bounds.origin = <0,0>;
SearchExt.Icon = Res::XIcon;
}
else
{
postsignal onCancelSearch;
}
}
$rect <680,190,830,230>
var Application::DetailsPage detailsPage;
$rect <850,230,1030,270>
slot onClose
{
DismissDialog( detailsPage, Res::SlideRightCentered, null, null, null, null, false);
postsignal onListItemsUpdate;
detailsPage = null;
}
// Touch screen events
note group Note
{
attr Bounds = <669,0,1229,440>;
}
$rect <300,240,500,280>
slot onUpPress
{
Device::Device.Contacts.Sorting = Device::Sorting.Ascending;
postsignal onListItemsUpdate;
}
$rect <300,280,500,320>
slot onDownPress
{
Device::Device.Contacts.Sorting = Device::Sorting.Descending;
postsignal onListItemsUpdate;
}
// This method is called by 'VerticalList' every time the list loads or updates \
// an item.
$rect <296,189,496,229>
slot OnLoadItem
{
var int32 itemNo = VerticalList.Item;
var Device::Contact contact = Device::Device.Contacts.GetContactAtIndex( itemNo );
var Application::ContactItem itemView = (Application::ContactItem)VerticalList.View;
if ( itemView == null )
return;
itemView.Contact = contact;
itemView.OnActivate = onContactPressed;
itemView.Bounds.size = point( VerticalList.Bounds.w, VerticalList.ItemHeight );
}
// Vertical list
note group Note1
{
attr Bounds = <289,149,660,329>;
}
$rect <20,20,160,60>
object Views::Rectangle Background
{
preset Layout = Core::Layout[AlignToBottom, AlignToLeft, AlignToRight, AlignToTop, ResizeHorz, ResizeVert];
preset Bounds = <0,0,272,440>;
preset Color = Res::WhiteComponents;
}
$rect <20,20,160,60>
object Core::VerticalList VerticalList
{
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Bounds = <11,167,261,440>;
preset OnLoadItem = OnLoadItem;
preset SlideHandler = SlideTouchHandler;
preset ItemHeight = 32;
preset ItemClass = Application::ContactItem;
}
$rect <20,20,160,60>
object Core::SlideTouchHandler SlideTouchHandler
{
preset StackingPriority = -1;
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Bounds = <12,167,261,440>;
preset SnapNext = <0,35>;
preset SlideHorz = false;
}
$rect <20,20,160,60>
object Components::SButton25x25 UpButton
{
preset Layout = Core::Layout[AlignToRight, AlignToTop];
preset Bounds = <236,141,262,167>;
preset Icon = Res::UpIcon;
preset OnActivate = onUpPress;
preset IconColor = Res::Blue;
preset BackgoundColor = Res::Transparent;
preset BackgoundColorPressed = Res::Transparent;
preset IconFont = Res::IconsFont25;
preset Backgound = Res::ButtonRoundSmall;
preset BackgroundColorEnabled = Res::Transparent;
}
$rect <20,20,160,60>
object Components::SButton25x25 DownButton
{
preset Layout = Core::Layout[AlignToRight, AlignToTop];
preset Bounds = <210,141,236,167>;
preset Enabled = true;
preset Icon = Res::DownIcon;
preset OnActivate = onDownPress;
preset IconColor = Res::Blue;
preset BackgoundColor = Res::Transparent;
preset BackgoundColorPressed = Res::Transparent;
preset IconFont = Res::IconsFont25;
preset Backgound = Res::ButtonRoundSmall;
preset BackgroundColorEnabled = Res::Transparent;
}
$rect <20,20,160,60>
object Components::InputBtnEtxt SearchExt
{
preset Layout = Core::Layout[AlignToLeft, AlignToRight, AlignToTop, ResizeHorz];
preset Bounds = <3,67,269,99>;
preset OnChange = onSearch;
preset String = "";
preset Color = Res::BlackComponents;
preset Placeholder = Strings::SearchTxt;
preset OnIcon = onCancelSearch;
}
$rect <20,20,160,60>
object Views::Text TitleTxt
{
preset Bounds = <11,27,261,61>;
preset Alignment = Views::TextAlignment[AlignHorzLeft, AlignVertCenter];
preset String = Strings::ContactsTxtx;
preset Font = Res::TitileFont32;
preset Color = Res::BlackComponents;
}
$rect <20,20,160,60>
object Components::SButton25x25 PlusButton
{
preset Bounds = <242,12,272,42>;
preset Enabled = true;
preset Icon = Res::PlusIcon;
preset OnActivate = onCreateNewContact;
preset IconColor = Res::Blue;
preset BackgoundColor = Res::Transparent;
preset BackgoundColorPressed = Res::Transparent;
preset IconFont = Res::IconsFont25;
preset Backgound = Res::ButtonRoundSmall;
preset BackgroundColorEnabled = Res::Transparent;
}
$rect <830,190,1030,230>
slot onContactPressed
{
var Application::ContactItem itemView = (Application::ContactItem)sender;
if ( itemView != null )
{
detailsPage = new Application::DetailsPage;
detailsPage.OnBack = onClose;
detailsPage.OnDelete = onDelete;
detailsPage.Contact = itemView.Contact;
SwitchToDialog( detailsPage, Res::SlideLeftCentered, null, null, null, null, null,
null, null, null, false );
}
}
$rect <487,190,657,230>
slot onListItemsUpdate
{
VerticalList.NoOfItems = Device::Device.Contacts.NoOfItems;
VerticalList.InvalidateItems ( 0, VerticalList.NoOfItems -1 );
}
$rect <20,20,160,60>
object Application::MyCardItem MyCardItem
{
preset Bounds = <6,99,266,144>;
preset Text = "";
preset OnActivate = onMyCardPress;
}
$rect <849,389,1029,429>
slot onMyCardPress
{
if ( Device::Device.MyContact != null )
{
var Device::Contact contact = Device::Device.Contacts.FindMatchingIDContact( Device::Device.MyContact );
if ( contact != null ){
detailsPage = new Application::DetailsPage;
detailsPage.OnBack = onClose;
detailsPage.Contact = contact;
SwitchToDialog( detailsPage, Res::SlideLeftCentered, null, null, null, null, null,
null, null, null, false );
}
}
}
$rect <849,329,1029,369>
slot onTapMessage
{
postsignal OnMessage;
}
$rect <689,329,849,369>
property slot OnMessage;
$rect <309,429,509,469>
slot onCancelSearch
{
Device::Device.Contacts.CancelSearch();
ContactsInsideSearch.Bounds.origin.y = Bounds.y2;
SearchExt.Text.String = " ";
SearchExt.Icon = Res::SerachIcon;
}
$rect <20,20,160,60>
object Application::ContactsInsideSearch ContactsInsideSearch
{
preset Bounds = <1,457,273,937>;
preset OnSelectedContact = onFilteredContactPressed;
}
// Search
note group Note3
{
attr Bounds = <291,340,660,520>;
}
$rect <1029,189,1229,229>
slot onFilteredContactPressed
{
detailsPage = new Application::DetailsPage;
detailsPage.OnBack = onClose;
detailsPage.OnDelete = onDelete;
detailsPage.Contact = ContactsInsideSearch.Contact;
SwitchToDialog( detailsPage, Res::SlideLeftCentered, null, null, null, null, null,
null, null, null, false );
}
}
// Contacts
note group Note
{
attr Bounds = <0,220,429,789>;
}
$rect <70,340,220,380>
$output false
$multilingual true
class ContactItem : Core::Group
{
$rect <503,147,683,187>
inherited method Init()
{
$if $composer
FirstNameTxt.String = "Firstname";
LastNameTxt.String = "Lastname";
$endif
attachobserver onContactUpdated, ^Device::Device.MyContact;
postsignal onContactUpdated;
}
$rect <10,500,210,540>
inherited property Bounds = <0,0,250,32>;
$rect <10,100,210,140>
inherited method UpdateViewState()
{
// Always invoke the inherited method.
super( aState );
var bool isEnabled = aState.contains( Core::ViewState[ Enabled ]);
var bool isSelected = aState.contains( Core::ViewState[ Selected ]);
var bool isPressed = ( TouchHandler.Down && TouchHandler.Inside ) ||
FlashTimer.Enabled;
if ( !isEnabled )
{
Background.Color = ButtonColor;
LastNameTxt.Color = Res::Grey;
FirstNameTxt.Color = Res::Grey;
MeTxt.Color = Res::Transparent;
MeTxt.String = MeText;
}
else if ( isPressed )
{
Background.Color = Res::PressColor;
}
else if ( isSelected )
{
Background.Color = Res::GreyLight;
}
// Enabled but not pressed nor selected.
else
{
Background.Color = ButtonColor;
LastNameTxt.Color = TextColor;
FirstNameTxt.Color = TextColor;
MeTxt.String = MeText;
MeTxt.Color = Res::Transparent;
}
enabled = isEnabled;
selected = isSelected;
pressed = isPressed;
}
$rect <230,110,430,150>
property Device::Contact Contact = null;
$rect <230,150,430,190>
onset Contact
{
// The value doesn't change - nothing to do.
if ( pure Contact == value )
return;
if ( pure Contact != null )
{
detachobserver onContactUpdated, pure Contact;
}
// Remember the property's new value.
pure Contact = value;
if ( pure Contact != null )
{
attachobserver onContactUpdated, pure Contact;
}
postsignal onContactUpdated;
}
$rect <230,190,430,230>
slot onContactUpdated
{
if ( Contact == null ){
FirstNameTxt.String = "";
LastNameTxt.String = "";
PrfofilButton.Icon = "";
}else{
if ( pure Contact.LastName == "")
LastNameTxt.String = pure Contact.FirstName;
else{
FirstNameTxt.String = pure Contact.FirstName;
LastNameTxt.String = pure Contact.LastName;
}
PrfofilButton.Icon = pure Contact.NameInitials;
if ( Device::Device.MyContact != null )
{
if ( pure Contact.ID == Device::Device.MyContact.ID ){
MeTxt.Color = Res::Grey;
}
else
MeText = "";
}
}
}
// Contact data
note group Note4
{
attr Bounds = <220,60,440,270>;
}
// State management
note group Note5
{
attr Bounds = <0,60,220,310>;
}
$rect <10,260,210,300>
var Views::Text textView;
// This variable stores the current state of the button.
$rect <10,220,210,260>
var bool pressed;
// This variable stores the current state of the button.
$rect <10,180,210,220>
var bool selected;
// This variable stores the current state of the button.
$rect <10,140,210,180>
var bool enabled;
// The property 'Label' specifies the text to display as label in this push button \
// widget. The desired font as well as the colors for all individual button states \
// have to be specified in the configuration object assigned to the property @Appearance. \
// If there is no configuration object associated to this push button widget (the \
// property @Appearance is 'null'), no label is displayed.
// Per default, the label is displayed centered within the push button area. You \
// can modify the alignment of the label as well as its margins by specifying them \
// in the configuration object.
$rect <580,0,780,40>
property string Icon;
$rect <790,0,990,40>
property string MeText = Strings::meTxt;
$rect <790,40,990,80>
onset MeText
{
// The value doesn't change - nothing to do.
if ( pure MeText == value )
return;
// Remember the property's new value.
pure MeText = value;
// ... and trigger the component to update its actual state.
InvalidateViewState();
}
$rect <990,0,1190,40>
property color ButtonColor = Res::WhiteComponents;
$rect <990,40,1190,80>
onset ButtonColor
{
// The value doesn't change - nothing to do.
if ( pure ButtonColor == value )
return;
// Remember the property's new value.
pure ButtonColor = value;
// ... and trigger the component to update its actual state.
InvalidateViewState();
}
// Feedback flash effect
note group Note3
{
attr Bounds = <460,320,680,450>;
}
// Keyboard events
note group Note2
{
attr Bounds = <230,320,450,450>;
}
// Touch screen events
note group Note1
{
attr Bounds = <0,320,220,490>;
}
// This timer object is used to flash the button when the user has tapped it very \
// quickly or the button has been activated with the keyboard. This is just a visual \
// feedback effect.
$rect <470,360,670,400>
object Core::Timer FlashTimer
{
preset OnTrigger = onFlashTimer;
preset Period = 0;
preset Begin = 50;
}
// This key handler reacts to key press events. When the user presses the key specified \
// in the property 'Filter' of the key handler, the handler is activated and the \
// method '@onPressKey' is called.
$rect <240,360,440,400>
object Core::KeyPressHandler KeyHandler
{
preset OnPress = onPressKey;
preset Filter = Core::KeyCode.Enter;
}
// This internal slot method is called when the '@FlashTimer' is expired. It ends \
// the short flash feedback effect.
$rect <470,400,670,440>
slot onFlashTimer
{
// The feedback flash timer is finished. Request the button to update its
// appearance. The update will occur in the UpdateViewState() method.
InvalidateViewState();
// With the end of the feedback flash effect the button is activated.
postsignal OnActivate;
}
// This internal slot method is called when the '@KeyHandler' is activated (when \
// the user has pressed the key specified in the property 'Filter' of the key handler).
$rect <240,400,440,440>
slot onPressKey
{
// Ignore keyboard events when the user is interacting with the button via the
// touch screen.
if ( TouchHandler.Down )
return;
// Ignore repetitions of key events (e.g. when the user holds the key pressed)
if ( KeyHandler.Repetition )
return;
// Pressing the key flashes the button for a short period. This is a kind of
// feedback effect. Request the button to update its appearance accordingly.
// The update will occur in the UpdateViewState() method.
InvalidateViewState();
// The button is still performing the feedback flash effect from the preceding
// tap/key event. This can occur when the user taps the button or presses the
// key in a very rapid succession. Thus complete this preceding tap (simulate
// the timer expiration) before starting a new button interaction.
if ( FlashTimer.Enabled )
{
postsignal OnActivate;
FlashTimer.Enabled = false;
}
// Start the feedback flash effect.
FlashTimer.Enabled = true;
}
$rect <580,40,780,80>
onset Icon
{
// The value doesn't change - nothing to do.
if ( pure Icon == value )
return;
// Remember the property's new value.
pure Icon = value;
// ... and trigger the component to update its actual state.
InvalidateViewState();
}
// This internal slot method is called when the user drags the finger while pressing \
// the button. This only updates the button to appear pressed or released.
$rect <10,440,210,480>
slot onEnterLeaveTouch
{
// Every time the user touches the button or drags the finger inside/outside
// the button's area request the button update its appearance. The update will
// occur in the UpdateViewState() method.
InvalidateViewState();
}
// This internal slot method is called when the user releases the touch screen \
// after touching the button's area. This activates the button.
$rect <10,400,210,440>
slot onReleaseTouch
{
// Did the user moved the finger outside the button's area? In such case
// the button is not activated.
if ( !TouchHandler.Inside )
return;
// The user interaction has been passed over to the another touch handler
if ( TouchHandler.AutoDeflected )
return;
// The user has pressed and held the button for longer time. This was enough
// long to give a visual 'press' feedback to the user. The button can be
// activated immediately.
if ( TouchHandler.HoldPeriod >= FlashTimer.Begin )
postsignal OnActivate;
// The user has tapped the button very quickly. Defer the button activation
// to give the user first a short visual feedback that the button has been
// pressed.
else
FlashTimer.Enabled = true;
}
// The property 'OnActivate' can refer to a slot method, which will receive a signal \
// as soon as the user has activated the button. Thereupon the method's logic will \
// be executed.
$rect <370,0,570,40>
property slot OnActivate = null;
// This internal slot method is called when the user touches the button's area.
$rect <10,360,210,400>
slot onPressTouch
{
// The button is still performing the feedback flash effect from the preceding
// tap. This can occur when the user taps the button in a very rapid succession.
// Thus complete this preceding tap (simulate the timer expiration) before
// starting a new button interaction.
if ( FlashTimer.Enabled )
{
postsignal OnActivate;
FlashTimer.Enabled = false;
}
}
$rect <1200,0,1400,40>
property color TextColor = Res::BlackComponents;
$rect <20,20,160,60>
object Core::SimpleTouchHandler TouchHandler
{
preset Layout = Core::Layout[AlignToBottom, AlignToLeft, AlignToRight, AlignToTop, ResizeHorz, ResizeVert];
preset Point4 = <0,32>;
preset Point3 = <250,32>;
preset Point2 = <250,0>;
preset Point1 = <0,0>;
preset OnLeave = onEnterLeaveTouch;
preset OnEnter = onEnterLeaveTouch;
preset OnRelease = onReleaseTouch;
preset OnPress = onPressTouch;
preset RetargetCondition = Core::RetargetReason[WipeDown, WipeLeft, WipeRight, WipeUp];
preset MaxStrikeCount = 100;
}
$rect <20,20,160,60>
object Views::Rectangle Background
{
preset Bounds = <0,0,250,32>;
preset ColorBL = #FDFDFDC8;
preset ColorBR = #FDFDFDC8;
preset Color = Res::WhiteComponents;
}
$rect <20,20,160,60>
object Views::Text LastNameTxt
{
preset Bounds = <39,3,130,33>;
preset Alignment = Views::TextAlignment[AlignHorzLeft, AlignVertCenter];
preset String = "";
preset Font = Res::ContactFontBold15;
preset Color = Res::BlackComponents;
}
$rect <20,20,160,60>
object Views::Text FirstNameTxt
{
preset StackingPriority = 0;
preset Layout = Core::Layout[AlignToLeft, ResizeHorz];
preset Bounds = <129,3,244,33>;
preset Alignment = Views::TextAlignment[AlignHorzLeft, AlignVertCenter];
preset String = "";
preset Font = Res::ContactFont15;
preset Color = Res::BlackComponents;
}
$rect <20,20,160,60>
object Views::Line Line
{
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Point2 = <250,32>;
preset Point1 = <0,32>;
preset Width = 2;
preset Color = Res::GreyLight;
}
$rect <20,20,160,60>
object Components::SButton25x25 PrfofilButton
{
preset Bounds = <6,4,31,29>;
preset DescriptColor = Res::WhiteComponents;
preset DescriptFont = Res::ContactFont15;
preset IconFont = Res::ContactFont15;
preset Backgound = Res::ButtonRoundSmall;
}
$rect <20,20,160,60>
object Views::Line Line1
{
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Point2 = <250,0>;
preset Point1 = <0,0>;
preset Width = 2;
preset Color = Res::GreyLight;
}
$rect <20,20,160,60>
object Views::Text MeTxt
{
preset Bounds = <231,10,244,22>;
preset AutoSize = true;
preset Alignment = Views::TextAlignment[AlignHorzRight, AlignVertCenter];
preset Font = Res::ContactFont12;
preset Color = Res::Transparent;
preset Visible = true;
}
}
$rect <50,421,220,460>
$output false
$multilingual true
class DetailsPage : Core::Group
{
$rect <-10,510,190,550>
inherited property Bounds = <0,0,272,440>;
$rect <450,50,630,90>
slot onTapEdit
{
editPage = new Application::EditPage;
editPage.OnSave = onSaveEdit;
editPage.OnClose = onCancelEdit;
editPage.Contact = Contact;
editPage.OnDelete = onDelete;
SwitchToDialog( editPage, Res::SlideLeftCentered, null, null, null, null, null,
null, null, null, false );
}
// Displayed contact info
note group Note1
{
attr Bounds = <770,0,1020,200>;
}
$rect <300,220,460,260>
slot onDelete
{
signal OnDelete;
DismissDialog( editPage, Res::FadeInOutCentered, null, null, null, null, false);
editPage = null;
}
$rect <460,220,620,260>
property slot OnDelete;
$rect <300,50,450,90>
var Application::EditPage editPage;
$rect <300,280,480,320>
slot onCall
{
Device::Device.SendCallFromContact( Contact );
}
$rect <460,90,620,130>
slot onSaveEdit
{
DismissDialog( editPage, Res::FadeInOutCentered, null, null, null, null, false);
editPage = null;
}
$rect <460,130,620,170>
slot onCancelEdit
{
DismissDialog( editPage, Res::FadeInOutCentered, null, null, null, null, false);
editPage = null;
}
// Touch screen events
note group Note
{
attr Bounds = <290,0,760,430>;
}
$rect <460,180,620,220>
property slot OnBack;
$rect <300,180,460,220>
slot onBackHome
{
signal OnBack;
}
$rect <790,90,980,130>
onset Contact
{
if ( pure Contact == value )
return;
if ( pure Contact != null )
{
detachobserver onContactUpdated, pure Contact;
}
pure Contact = value;
if ( pure Contact != null )
{
attachobserver onContactUpdated, pure Contact;
postsignal onContactUpdated;
}
}
$rect <790,130,980,170>
slot onContactUpdated
{
if ( pure Contact != null )
{
ContactName.String = pure Contact.LastName + " " + pure Contact.FirstName;
NumberTxt.String = pure Contact.PhoneNumber;
UserInitialsBtn.Icon = pure Contact.NameInitials;
FavoritTxt.Visible = pure Contact.IsFavorite ? true : false;
}
}
$rect <790,50,980,90>
property Device::Contact Contact;
$rect <20,20,160,60>
object Views::Rectangle Background
{
preset Bounds = <0,0,272,440>;
preset Color = Res::WhiteComponents;
}
$rect <20,20,160,60>
object Views::Line Line2
{
preset Point2 = <266,287>;
preset Point1 = <8,287>;
preset Color = #E2E2E2FD;
}
$rect <20,20,160,60>
object Views::Text NumberTxt
{
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Bounds = <20,258,264,287>;
preset ColorBR = #FFFFFF00;
preset Alignment = Views::TextAlignment[AlignHorzLeft, AlignVertCenter];
preset String = " +0749320298";
preset Font = Res::ContactFont15;
preset Color = Res::Blue;
}
$rect <20,20,160,60>
object Views::Text MobileTxt
{
preset Layout = Core::Layout[AlignToLeft, AlignToTop];
preset Bounds = <8,232,266,265>;
preset Alignment = Views::TextAlignment[AlignHorzLeft, AlignVertCenter];
preset String = Strings::MobileTxt;
preset Font = Res::ContactFont15;
preset Color = Res::BlackComponents;
}
$rect <20,20,160,60>
object Views::Line Line1
{
preset Point2 = <266,232>;
preset Point1 = <8,232>;
preset Color = #E2E2E2FD;
}
$rect <20,20,160,60>
object Components::Button50x75 CallBtn
{
preset Bounds = <51,145,101,220>;
preset Icon = Res::CallIcon;
preset OnActivate = onCall;
preset Descript = Strings::callTxt;
preset BackgoundColor = Res::Blue;
preset BackgoundColorPressed = Res::BlueLight;
preset IconFont = Res::IconsFont20;
preset Backgound = Res::ButtonRoundMedium;
}
$rect <20,20,160,60>
object Components::Button50x75 VideoCallBtn
{
preset Bounds = <111,145,161,220>;
preset Enabled = false;
preset Icon = Res::VideoCallIcon;
preset Descript = Strings::VideoTxt;
preset BackgoundColor = Res::Blue;