Remove V8 plugin
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / flex-container.md
@@ -12,7 +12,6 @@ The container expands items to fill available free space, or shrinks them to pre
  
 Below is an illustration of the various directions and terms as applied to a flex container with the "flex direction" defined as "row".
  
-![ ](../assets/img/flex-container/flex-container.jpg)
 ![ ](flex-container/flex-container.jpg)
  
 DALi supports the following subset of Flexbox properties.
@@ -34,7 +33,7 @@ contentDirection specifies the primary direction in which content is ordered on
  
 | LTR (left-to-right) | RTL (right-to-left) |
 |--------|--------|
-| ![ ](../assets/img/flex-container/content-direction-ltr.jpg) ![ ](flex-container/content-direction-ltr.jpg) | ![ ](../assets/img/flex-container/content-direction-rtl.jpg) ![ ](flex-container/content-direction-rtl.jpg) |
+| ![ ](flex-container/content-direction-ltr.jpg) | ![ ](flex-container/content-direction-rtl.jpg) |
  
 The possible values for this property are:
  
@@ -52,18 +51,12 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::CONTENT_DIRECTION, Dali::Toolkit::FlexContainer::RTL );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.contentDirection = "RTL";
-~~~
 ___________________________________________________________________________________________________
 
 ## flexDirection {#flex-direction}
  
 flexDirection specifies the direction of the main axis which determines the direction that flex items are laid out.
  
-![ ](../assets/img/flex-container/flex-direction.jpg)
 ![ ](flex-container/flex-direction.jpg)
  
 The possible values for this property are:
@@ -83,18 +76,12 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_DIRECTION, Dali::Toolkit::FlexContainer::ROW_REVERSE );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.flexDirection = "rowReverse";
-~~~
 ___________________________________________________________________________________________________
 
 ## flexWrap {#flex-wrap}
  
 flexWrap specifies whether the flex items should wrap or not if there is no enough room for them on one flex line.
  
-![ ](../assets/img/flex-container/flex-wrap.jpg)
 ![ ](flex-container/flex-wrap.jpg)
  
 The possible values for this property are:
@@ -112,18 +99,12 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_WRAP, Dali::Toolkit::FlexContainer::NO_WRAP );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.flexWrap = "noWrap";
-~~~
 ___________________________________________________________________________________________________
 
 ## justifyContent {#justify-content}
  
 justifyContent specifies the alignment of flex items when they do not use all available space on the main axis.
  
-![ ](../assets/img/flex-container/justify-content.jpg)
 ![ ](flex-container/justify-content.jpg)
  
 The possible values for this property are:
@@ -144,18 +125,12 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::JUSTIFY_CONTENT, Dali::Toolkit::FlexContainer::JUSTIFY_SPACE_BETWEEN );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.justifyContent = "spaceBetween";
-~~~
 ___________________________________________________________________________________________________
 
 ## alignItems {#align-items}
  
 alignItems specifies the alignment of flex items when they do not use all available space on the cross axis.
  
-![ ](../assets/img/flex-container/align-items.jpg)
 ![ ](flex-container/align-items.jpg)
  
 The possible values for this property are:
@@ -175,18 +150,12 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_ITEMS, Dali::Toolkit::FlexContainer::ALIGN_FLEX_START );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.alignItems = "flexStart";
-~~~
 ___________________________________________________________________________________________________
 
 ## alignContent {#align-content}
  
 alignContent specifies the alignment of flex lines when they do not use all available space on the cross axis, so only works when there are multiple lines.
  
-![ ](../assets/img/flex-container/align-content.jpg)
 ![ ](flex-container/align-content.jpg)
  
 The possible values for this property are:
@@ -205,11 +174,6 @@ Dali::Toolkit::FlexContainer flexContainer = Dali::Toolkit::FlexContainer::New()
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_CONTENT, Dali::Toolkit::FlexContainer::ALIGN_FLEX_END );
 ~~~
 
-~~~{.js}
-// JavaScript
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.alignContent = "flexEnd";
-~~~
 ___________________________________________________________________________________________________
 
 ## Custom properties supported by flex item:
@@ -230,7 +194,6 @@ By default, the items in the flex container are not flexible. If set, this prope
 If all items in the flex container use this pattern, their sizes will be proportional to the specified flex factor.
 Flex items will not shrink below their minimum size (if set using Dali::Actor::SetMinimumSize).
  
-![ ](../assets/img/flex-container/flex.jpg)
 ![ ](flex-container/flex.jpg)
  
 
@@ -270,44 +233,12 @@ flexContainer.Add( item5 );
 
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the flex container
-var flexContainer = new dali.Control("FlexContainer");
-
-// Set the flex direction to lay out the items horizontally
-flexContainer.flexDirection = "row";
-
-// Create flex items and set the proportion
-var item1 = new dali.Control();
-item1.flex = 1.0;
-flexContainer.add(item1);
-
-var item2 = new dali.Control();
-item2.flex = 3.0;
-flexContainer.add(item2);
-
-var item3 = new dali.Control();
-item3.flex = 1.0;
-flexContainer.add(item3);
-
-var item4 = new dali.Control();
-item4.flex = 2.0;
-flexContainer.add(item4);
-
-var item5 = new dali.Control();
-item5.flex = 1.0;
-flexContainer.add(item5);
-
-~~~
 ___________________________________________________________________________________________________
 
 ## alignSelf {#align-self}
  
 alignSelf specifies how the item will align along the cross axis, if set, this overrides the default alignment for all items defined by the container’s [alignItems](@ref align-items) property.
  
-![ ](../assets/img/flex-container/align-self.jpg)
 ![ ](flex-container/align-self.jpg)
  
 The possible values for this property are:
@@ -353,34 +284,6 @@ flexContainer.Add( item4 ); // item4 is aligned at the beginning of the containe
 
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the flex container
-var flexContainer = new dali.Control("FlexContainer");
-
-// Set the flex direction to lay out the items horizontally
-flexContainer.flexDirection = "row";
-
-// Set the items to be aligned at the beginning of the container on the cross axis by default
-flexContainer.alignItems = "flexStart";
-
-// Create flex items and add them to the flex container
-var item1 = new dali.Control();
-item1.alignSelf = "center"; // Align item1 at the center of the container
-flexContainer.add(item1);
-
-var item2 = new dali.Control();
-flexContainer.add(item2); // item2 is aligned at the beginning of the container
-
-var item3 = new dali.Control();
-item1.alignSelf = "flexEnd"; // Align item3 at the bottom of the container
-flexContainer.add(item3);
-
-var item4 = new dali.Control();
-flexContainer.add(item4); // item4 is aligned at the beginning of the container
-
-~~~
 ___________________________________________________________________________________________________
 
 ## flexMargin {#flex-margin}
@@ -392,7 +295,6 @@ Each flex item inside the flex container is treated as a box (in CSS term) which
  + border: The border that goes around the padding and the content of the item.
  + flexMargin: The space outside the border.
  
-![ ](../assets/img/flex-container/flex-margin.jpg)
 ![ ](flex-container/flex-margin.jpg)
  
 In DALi, the size of the flex item = content size + padding + border.
@@ -417,29 +319,12 @@ item.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX_MARGIN, Vect
 flexContainer.Add( item );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the flex container
-var flexContainer = new dali.Control("FlexContainer");
-
-// Create flex items
-var item = new dali.Control();
-
-// Add the margin around the item
-item.flexMargin = [10.0, 10.0, 10.0, 10.0];
-
-// Add the item to the container
-flexContainer.add(item);
-~~~
-
 ___________________________________________________________________________________________________
 
 ## Example of creating Flexbox layout using FlexContainer
 
 Now let's see how to create a Gallery like layout (as shown below) using FlexContainer.
 
-![ ](../assets/img/flex-container/flexbox-demo.jpg)
 ![ ](flex-container/flexbox-demo.jpg)
  
 Firstly, we create a flex container as the whole view and set its resize policy to fill its parent (i.e. the stage).
@@ -458,20 +343,6 @@ flexContainer.SetBackgroundColor( Dali::Color::WHITE ); // set the background co
 Dali::Stage::GetCurrent().Add( flexContainer );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the main flex container
-var flexContainer = new dali.Control("FlexContainer");
-flexContainer.parentOrigin = dali.TOP_LEFT;
-flexContainer.anchorPoint = dali.TOP_LEFT;
-flexContainer.widthResizePolicy = "FILL_TO_PARENT";
-flexContainer.heightResizePolicy = "FILL_TO_PARENT";
-flexContainer.backgroundColor = dali.COLOR_WHITE; // set the background color to be white
-
-// Add it to the stage
-dali.stage.add( flexContainer );
-~~~
  
 We want to set the flex direction of this main container to column, as we want the toolbar and the actual content to be displayed vertically.
  
@@ -482,13 +353,6 @@ We want to set the flex direction of this main container to column, as we want t
 flexContainer.SetProperty( Dali::Toolkit::FlexContainer::Property::FLEX_DIRECTION, Dali::Toolkit::FlexContainer::COLUMN );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Display toolbar and content vertically
-flexContainer.flexDirection = "column";
-~~~
 Now we create a flex container as the toolbar and add it to the main container. Because the flex direction in the main container is column, the toolbar will be arranged on the top of the main container.
  
 ~~~{.cpp}
@@ -504,19 +368,6 @@ toolBar.SetBackgroundColor( Dali::Color::CYAN ); // Set the background color for
 flexContainer.Add( toolBar );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the toolbar area
-var toolBar = new dali.Control("FlexContainer");
-toolBar.parentOrigin = dali.TOP_LEFT;
-toolBar.anchorPoint = dali.TOP_LEFT;
-toolBar.backgroundColor = dali.COLOR_CYAN; // Set the background color for the toolbar
-
-// Add it to the main container
-flexContainer.add(toolBar);
-~~~
 We want the buttons and title to be displayed horizontally and vertically aligned to the center of the toolbar, so we set its flex direction to row and set its alignItems property to center.
 We also want the toolbar and the actual content to share the height of the main container, so that the toolbar will occupy 10 percent of the whole vertical space and the content will occupy the rest of the vertical space.
 This can be achieved by setting the flex property.
@@ -529,14 +380,6 @@ toolBar.SetProperty( Dali::Toolkit::FlexContainer::Property::ALIGN_ITEMS, Dali::
 toolBar.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 0.1f ); // 10 percent of available space in the cross axis
 ~~~
 
-~~~{.js}
-// JavaScript
-
-toolBar.flexDirection = "row"; // display toolbar items horizontally
-toolBar.alignItems = "center"; // align toolbar items vertically center
-toolBar.flex = 0.1; // 10 percent of available space in the cross axis
-~~~
 Then we create another flex container as the content area to display the image, and it will be displayed in the bottom of the main container.
 We want the item inside it to be horizontally and vertically centered, so that the image will always be in the center of the content area.
 
@@ -556,22 +399,6 @@ content.SetProperty( Dali::Toolkit::FlexContainer::ChildProperty::FLEX, 0.9f );
 flexContainer.Add( content );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Create the content area
-var content = new dali.Control("FlexContainer");
-content.parentOrigin = dali.TOP_LEFT;
-content.anchorPoint = dali.TOP_LEFT;
-content.flexDirection = "row";
-content.alignItems = "center"; // align items vertically center
-content.justifyContent = "center"; // align items horizontally center
-content.flex = 0.9; // 90 percent of available space in the cross axis
-
-// Add it to the main container
-flexContainer.add(content);
-~~~
 Now we start to add items to the toolbar. The toolbar will have one button on the left, one button on the right, and a title always in the center (regardless of the screen size).
 To achieve that, we can simply make the title flexible so that it will automatically take all the available horizontal space left.
 We will also add some space around the items so that the layout looks nicer.
@@ -617,46 +444,6 @@ labelMap[ "text" ] = "Next";
 nextButton.SetProperty( Dali::Toolkit::Button::Property::LABEL, labelMap );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Add a button to the left of the toolbar
-var prevButton = new dali.Control("PushButton");
-prevButton.name = "Prev";
-prevButton.parentOrigin = dali.TOP_LEFT;
-prevButton.anchorPoint = dali.TOP_LEFT;
-prevButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
-prevButton.labelText = "Prev";
-prevButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
-
-toolBar.add( prevButton );
-
-// Add a title to the center of the toolbar
-var title = new dali.Control("TextLabel");
-title.parentOrigin = dali.TOP_LEFT;
-title.anchorPoint = dali.TOP_LEFT;
-title.widthResizePolicy = "USE_NATURAL_SIZE";
-title.heightResizePolicy = "USE_NATURAL_SIZE";
-title.horizontalAlignment = "CENTER";
-title.verticalAlignment = "CENTER";
-title.text = "Gallery";
-title.flex = 1.0; // take all the available space left apart from the two buttons
-title.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the title
-
-toolBar.add( title );
-
-// Add a button to the right of the toolbar
-var nextButton = new dali.Control("PushButton");
-nextButton.name = "Next";
-nextButton.parentOrigin = dali.TOP_LEFT;
-nextButton.anchorPoint = dali.TOP_LEFT;
-nextButton.minimumSize = [100.0, 60.0]; // this is the minimum size the button should keep
-nextButton.labelText = "Next";
-nextButton.flexMargin = [10, 10, 10, 10]; // set 10 pixel margin around the button
-
-toolBar.add( nextButton );
-~~~
 This is really neat when running on devices with different size or changing from different orientation, because the toolbar will expand or shrink based on the available space and the title will always be in the center, therefore the layout of the toolbar will keep the same.
  
 Finally, we will add the image to the content area.
@@ -671,19 +458,7 @@ imageView.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
 content.Add( imageView );
 ~~~
 
-~~~{.js}
-// JavaScript
-
-// Add an image to the center of the content area
-imageView = new dali.Control("ImageView");
-imageView.image = "image.jpg";
-imageView.parentOrigin = dali.TOP_LEFT;
-imageView.anchorPoint = dali.TOP_LEFT;
-content.add( imageView );
-~~~
 As you can see, it is easy to make flexible containers in DALi. We can use these concepts to create responsive layouts.
  
-@class _Guide_Flex_Container
 
 */