Commit 8d340ec58c16b97556054c21170120003e01244a

Authored by Kingsley Stephens
1 parent f6dac5b4

Size negotiation patch 2: Fix builder example scripts

Change-Id: I6f9e0583cb67a3297039d76759db5ab0ddec18b6
demo/dali-demo.cpp
... ... @@ -39,7 +39,7 @@ int main(int argc, char **argv)
39 39 demo.AddExample(Example("refraction-effect.example", "Refraction"));
40 40 demo.AddExample(Example("scroll-view.example", "Scroll View"));
41 41 demo.AddExample(Example("shadow-bone-lighting.example", "Lights and shadows"));
42   -// demo.AddExample(Example("builder.example", "Script Based UI"));
  42 + demo.AddExample(Example("builder.example", "Script Based UI"));
43 43 demo.AddExample(Example("image-scaling-irregular-grid.example", "Image Scaling Modes"));
44 44 demo.AddExample(Example("text-view.example", "Text View"));
45 45 demo.AddExample(Example("animated-shapes.example", "Animated Shapes"));
... ...
examples/size-negotiation/size-negotiation-example.cpp
... ... @@ -341,9 +341,6 @@ public:
341 341 {
342 342 mPopup = CreatePopup();
343 343  
344   - // The popup is not yet on the stage so needs to be flaged as dirty
345   - mPopup.MarkDirtyForRelayout();
346   -
347 344 mPopup.Show();
348 345 }
349 346 else if( button.GetName() == POPUP_BUTTON_TITLE_ID )
... ... @@ -351,9 +348,6 @@ public:
351 348 mPopup = CreatePopup();
352 349 mPopup.SetTitle( "Popup!" );
353 350  
354   - // The popup is not yet on the stage so needs to be flaged as dirty
355   - mPopup.MarkDirtyForRelayout();
356   -
357 351 mPopup.Show();
358 352 }
359 353 else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID )
... ... @@ -370,9 +364,6 @@ public:
370 364  
371 365 mPopup.AddButton( okayButton );
372 366  
373   - // The popup is not yet on the stage so needs to be flaged as dirty
374   - mPopup.MarkDirtyForRelayout();
375   -
376 367 mPopup.Show();
377 368 }
378 369 else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID )
... ... @@ -399,9 +390,6 @@ public:
399 390  
400 391 mPopup.AddButton( okayButton );
401 392  
402   - // The popup is not yet on the stage so needs to be flaged as dirty
403   - mPopup.MarkDirtyForRelayout();
404   -
405 393 mPopup.Show();
406 394 }
407 395 else if( button.GetName() == POPUP_BUTTON_TITLE_BUTTONS_ID )
... ... @@ -429,9 +417,6 @@ public:
429 417  
430 418 mPopup.AddButton( okayButton );
431 419  
432   - // The popup is not yet on the stage so needs to be flaged as dirty
433   - mPopup.MarkDirtyForRelayout();
434   -
435 420 mPopup.Show();
436 421 }
437 422 else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID )
... ... @@ -450,9 +435,6 @@ public:
450 435  
451 436 mPopup.Add( text );
452 437  
453   - // The popup is not yet on the stage so needs to be flaged as dirty
454   - mPopup.MarkDirtyForRelayout();
455   -
456 438 mPopup.Show();
457 439 }
458 440 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID )
... ... @@ -466,9 +448,6 @@ public:
466 448  
467 449 mPopup.Add( image );
468 450  
469   - // The popup is not yet on the stage so needs to be flaged as dirty
470   - mPopup.MarkDirtyForRelayout();
471   -
472 451 mPopup.Show();
473 452 }
474 453 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
... ... @@ -483,9 +462,6 @@ public:
483 462  
484 463 mPopup.Add( image );
485 464  
486   - // The popup is not yet on the stage so needs to be flaged as dirty
487   - mPopup.MarkDirtyForRelayout();
488   -
489 465 mPopup.Show();
490 466 }
491 467 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
... ... @@ -501,9 +477,6 @@ public:
501 477  
502 478 mPopup.Add( image );
503 479  
504   - // The popup is not yet on the stage so needs to be flaged as dirty
505   - mPopup.MarkDirtyForRelayout();
506   -
507 480 mPopup.Show();
508 481 }
509 482 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
... ... @@ -519,9 +492,6 @@ public:
519 492  
520 493 mPopup.Add( image );
521 494  
522   - // The popup is not yet on the stage so needs to be flaged as dirty
523   - mPopup.MarkDirtyForRelayout();
524   -
525 495 mPopup.Show();
526 496 }
527 497 else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID )
... ... @@ -541,9 +511,6 @@ public:
541 511  
542 512 mPopup.Add( text );
543 513  
544   - // The popup is not yet on the stage so needs to be flaged as dirty
545   - mPopup.MarkDirtyForRelayout();
546   -
547 514 mPopup.Show();
548 515 }
549 516 else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID )
... ... @@ -583,9 +550,6 @@ public:
583 550  
584 551 mPopup.AddButton( okayButton );
585 552  
586   - // The popup is not yet on the stage so needs to be flaged as dirty
587   - mPopup.MarkDirtyForRelayout();
588   -
589 553 mPopup.Show();
590 554 }
591 555 else if( button.GetName() == POPUP_BUTTON_COMPLEX_ID )
... ... @@ -651,7 +615,7 @@ public:
651 615  
652 616 root.AddChild( text, Toolkit::TableView::CellPosition( 0, 1 ) );
653 617  
654   - content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0, 0, 2 ) ); // Column span 2
  618 + content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0 ) );
655 619 }
656 620  
657 621 mPopup.Add( content );
... ... @@ -677,9 +641,6 @@ public:
677 641  
678 642 mPopup.AddButton( okayButton );
679 643  
680   - // The popup is not yet on the stage so needs to be flaged as dirty
681   - mPopup.MarkDirtyForRelayout();
682   -
683 644 mPopup.Show();
684 645 }
685 646 else if( button.GetName() == TABLEVIEW_BUTTON_EMPTY_ID )
... ... @@ -694,9 +655,6 @@ public:
694 655  
695 656 mPopup.Add( table );
696 657  
697   - // The popup is not yet on the stage so needs to be flaged as dirty
698   - mPopup.MarkDirtyForRelayout();
699   -
700 658 mPopup.Show();
701 659 }
702 660 else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
... ... @@ -716,9 +674,6 @@ public:
716 674  
717 675 mPopup.Add( table );
718 676  
719   - // The popup is not yet on the stage so needs to be flaged as dirty
720   - mPopup.MarkDirtyForRelayout();
721   -
722 677 mPopup.Show();
723 678 }
724 679 else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
... ... @@ -749,9 +704,6 @@ public:
749 704  
750 705 mPopup.Add( table );
751 706  
752   - // The popup is not yet on the stage so needs to be flaged as dirty
753   - mPopup.MarkDirtyForRelayout();
754   -
755 707 mPopup.Show();
756 708 }
757 709 else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
... ... @@ -817,9 +769,6 @@ public:
817 769  
818 770 mPopup.Add( table );
819 771  
820   - // The popup is not yet on the stage so needs to be flaged as dirty
821   - mPopup.MarkDirtyForRelayout();
822   -
823 772 mPopup.Show();
824 773 }
825 774 else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
... ... @@ -863,9 +812,6 @@ public:
863 812  
864 813 mPopup.Add( table );
865 814  
866   - // The popup is not yet on the stage so needs to be flaged as dirty
867   - mPopup.MarkDirtyForRelayout();
868   -
869 815 mPopup.Show();
870 816 }
871 817 else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
... ... @@ -910,9 +856,6 @@ public:
910 856  
911 857 mPopup.Add( table );
912 858  
913   - // The popup is not yet on the stage so needs to be flaged as dirty
914   - mPopup.MarkDirtyForRelayout();
915   -
916 859 mPopup.Show();
917 860 }
918 861 else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
... ... @@ -965,9 +908,6 @@ public:
965 908  
966 909 mPopup.Add( table );
967 910  
968   - // The popup is not yet on the stage so needs to be flaged as dirty
969   - mPopup.MarkDirtyForRelayout();
970   -
971 911 mPopup.Show();
972 912 }
973 913 else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
... ... @@ -1017,9 +957,6 @@ public:
1017 957  
1018 958 mPopup.Add( table );
1019 959  
1020   - // The popup is not yet on the stage so needs to be flaged as dirty
1021   - mPopup.MarkDirtyForRelayout();
1022   -
1023 960 mPopup.Show();
1024 961 }
1025 962 else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
... ... @@ -1075,9 +1012,6 @@ public:
1075 1012  
1076 1013 mPopup.Add( table );
1077 1014  
1078   - // The popup is not yet on the stage so needs to be flaged as dirty
1079   - mPopup.MarkDirtyForRelayout();
1080   -
1081 1015 mPopup.Show();
1082 1016 }
1083 1017 else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
... ... @@ -1121,9 +1055,6 @@ public:
1121 1055  
1122 1056 mPopup.Add( table );
1123 1057  
1124   - // The popup is not yet on the stage so needs to be flaged as dirty
1125   - mPopup.MarkDirtyForRelayout();
1126   -
1127 1058 mPopup.Show();
1128 1059 }
1129 1060 else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
... ... @@ -1165,9 +1096,6 @@ public:
1165 1096  
1166 1097 mPopup.Add( table );
1167 1098  
1168   - // The popup is not yet on the stage so needs to be flaged as dirty
1169   - mPopup.MarkDirtyForRelayout();
1170   -
1171 1099 mPopup.Show();
1172 1100 }
1173 1101 else if( button.GetName() == OKAY_BUTTON_ID || button.GetName() == CANCEL_BUTTON_ID )
... ...
resources/scripts/button.json
... ... @@ -25,7 +25,7 @@
25 25 "parent-origin": "TOP_CENTER",
26 26 "anchor-point": "TOP_CENTER",
27 27 "position": [0, 0, 0],
28   - "size": [0, 200, 0],
  28 + "size": [400, 200, 0],
29 29 "normal-state-actor": {
30 30 "type": "ImageActor",
31 31 "image": {
... ... @@ -50,7 +50,7 @@
50 50 "parent-origin": "CENTER",
51 51 "anchor-point": "CENTER",
52 52 "position": [0, 0, 0],
53   - "size": [0, 200, 0],
  53 + "size": [400, 200, 0],
54 54 "label-actor": {
55 55 "type": "TextView",
56 56 "text": "Disabled"
... ... @@ -83,7 +83,7 @@
83 83 "parent-origin": "BOTTOM_CENTER",
84 84 "anchor-point": "BOTTOM_CENTER",
85 85 "position": [0, 0, 0],
86   - "size": [0, 200, 0],
  86 + "size": [400, 200, 0],
87 87 "label-actor": {
88 88 "type": "TextView",
89 89 "text": "Toggle"
... ...
resources/scripts/super-blur-view.json
... ... @@ -65,7 +65,7 @@
65 65 "parent-origin": "BOTTOM_CENTER",
66 66 "anchor-point": "BOTTOM_CENTER",
67 67 "position": [0, 0, 0],
68   - "size": [0, 100, 0],
  68 + "size": [200, 100, 0],
69 69 "label-actor": {
70 70 "type": "TextView",
71 71 "text": "Blur"
... ...
resources/scripts/table-view.json
... ... @@ -22,8 +22,6 @@
22 22 "background-color": [0.5,0.5,0,1],
23 23 "parent-origin": "CENTER",
24 24 "size":[400,500,1],
25   - "rows": 4,
26   - "columns":4,
27 25 "cell-padding": [10, 5],
28 26 "layout-rows": { // set the height of the rows
29 27 "0": { "policy": "fixed", "value": 40 },
... ... @@ -38,17 +36,21 @@
38 36 "actors": [{
39 37 "name":"gallery-1",
40 38 "type":"ImageActor",
  39 + "width-resize-policy":"FILL_TO_PARENT",
  40 + "height-resize-policy":"FILL_TO_PARENT",
41 41 "image": {
42 42 "filename": "{DALI_IMAGE_DIR}gallery-large-1.jpg"
43 43 },
44 44 "custom-properties": { // properties registered dynamically
45   - "cell-indices": [0,0],// property to specify the top-left cell this child occupies
  45 + "cell-indices": [0,0], // property to specify the top-left cell this child occupies
46 46 "row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1
47   - "column-spam":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
  47 + "column-span":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1
48 48 }
49 49 },{
50 50 "name":"gallery-2",
51 51 "type":"ImageActor",
  52 + "width-resize-policy":"FILL_TO_PARENT",
  53 + "height-resize-policy":"FILL_TO_PARENT",
52 54 "image": {
53 55 "filename": "{DALI_IMAGE_DIR}gallery-large-2.jpg"
54 56 },
... ... @@ -59,6 +61,8 @@
59 61 }, {
60 62 "name":"gallery-3",
61 63 "type":"ImageActor",
  64 + "width-resize-policy":"FILL_TO_PARENT",
  65 + "height-resize-policy":"FILL_TO_PARENT",
62 66 "image": {
63 67 "filename": "{DALI_IMAGE_DIR}gallery-large-3.jpg"
64 68 },
... ... @@ -68,6 +72,8 @@
68 72 }, {
69 73 "name":"gallery-4",
70 74 "type":"ImageActor",
  75 + "width-resize-policy":"FILL_TO_PARENT",
  76 + "height-resize-policy":"FILL_TO_PARENT",
71 77 "image": {
72 78 "filename": "{DALI_IMAGE_DIR}gallery-large-4.jpg"
73 79 },
... ...
resources/scripts/timing.json
... ... @@ -91,6 +91,8 @@
91 91 "name": "ControlBack",
92 92 "parent-origin": "CENTER",
93 93 "anchor-point": "CENTER",
  94 + "width-resize-policy": "FILL_TO_PARENT",
  95 + "height-resize-policy": "FILL_TO_PARENT",
94 96 "position": [
95 97 0,
96 98 0,
... ...