1 #ifndef DALI_DEMO_GRID_EXAMPLE_H
2 #define DALI_DEMO_GRID_EXAMPLE_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/dali.h>
23 #include <dali-toolkit/dali-toolkit.h>
28 using namespace Dali::Toolkit;
34 * @file grid-example.hcpp
35 * @brief Example of a Grid Layout
37 class GridExample final: public ConnectionTracker, public Example
44 static const unsigned int MAX_NUMBER_OF_IMAGE_VIEWS = 9;
45 static const unsigned int INITIAL_NUMBER_OF_IMAGE_VIEWS = 5;
47 // Create a Grid layout of ImagesViews
48 void Create() override;
50 // Remove created Layout
51 void Remove() override;
55 // Callback for button pressed
56 bool ToggleButtonClicked( Toolkit::Button button );
58 // Actions to perform in this example
59 void ChangeTo3Columns();
60 void AddItemsInteractively();
61 void AddMarginToItems();
62 void RemoveMarginsFromItems();
63 void MatchParentOnWidth();
64 void WrapContentOnWidth();
69 Toolkit::Control mRootLayoutControl;
70 Toolkit::Control mGridContainer;
71 std::vector<Toolkit::ImageView> mImageViews;
72 Toolkit::PushButton mToggleButton;
73 unsigned int mToggleStatus;
78 #endif // DALI_DEMO_GRID_EXAMPLE_H