ui/winui/container.h

changeset 76
641dcc79e0ef
parent 0
2483f517c562
equal deleted inserted replaced
75:73c8a3780c72 76:641dcc79e0ef
65 UiLayoutBool fill; 65 UiLayoutBool fill;
66 UiBool newline; 66 UiBool newline;
67 char* label; 67 char* label;
68 UiBool hexpand; 68 UiBool hexpand;
69 UiBool vexpand; 69 UiBool vexpand;
70 UiBool hfill;
71 UiBool vfill;
70 int width; 72 int width;
71 int height; 73 int height;
72 int colspan; 74 int colspan;
73 int rowspan; 75 int rowspan;
74 }; 76 };
118 int margin; 120 int margin;
119 int spacing; 121 int spacing;
120 int columnspacing; 122 int columnspacing;
121 int rowspacing; 123 int rowspacing;
122 124
123 virtual UiObject* AddTab(const char* label) = 0; 125 virtual UiObject* AddTab(const char* label, int index = -1) = 0;
124 126 virtual void Remove(int index) = 0;
127 virtual void Select(int index) = 0;
125 virtual FrameworkElement GetFrameworkElement() = 0; 128 virtual FrameworkElement GetFrameworkElement() = 0;
126 }; 129 };
127 130
128 struct UiTabViewContainer : UiContainer { 131 struct UiTabViewContainer : UiContainer {
129 UiTabView* tabview; 132 UiTabView* tabview;
136 struct UiPivotTabView : UiTabView { 139 struct UiPivotTabView : UiTabView {
137 Pivot pivot; 140 Pivot pivot;
138 141
139 UiPivotTabView(UiObject *obj, Pivot pivot, UiTabViewArgs args); 142 UiPivotTabView(UiObject *obj, Pivot pivot, UiTabViewArgs args);
140 143
141 UiObject* AddTab(const char* label); 144 UiObject* AddTab(const char* label, int index = -1);
145 void Remove(int index);
146 void Select(int index);
142 FrameworkElement GetFrameworkElement(); 147 FrameworkElement GetFrameworkElement();
143 }; 148 };
144 149
145 struct UiMainTabView : UiTabView { 150 struct UiMainTabView : UiTabView {
146 TabView tabview; 151 TabView tabview;
147 152
148 UiMainTabView(UiObject* obj, TabView tabview, UiTabViewArgs args); 153 UiMainTabView(UiObject* obj, TabView tabview, UiTabViewArgs args);
149 154
150 UiObject* AddTab(const char* label); 155 UiObject* AddTab(const char* label, int index = -1);
156 void Remove(int index);
157 void Select(int index);
151 FrameworkElement GetFrameworkElement(); 158 FrameworkElement GetFrameworkElement();
152 }; 159 };
153 160
154 struct UiNavigationTabView : UiTabView { 161 struct UiNavigationTabView : UiTabView {
155 NavigationView navigationview; 162 NavigationView navigationview;
156 UiTabViewType type; 163 UiTabViewType type;
157 std::vector<std::tuple<NavigationViewItem, FrameworkElement> > pages; 164 std::vector<std::tuple<NavigationViewItem, FrameworkElement> > pages;
158 165
159 UiNavigationTabView(UiObject* obj, NavigationView navigationview, UiTabViewArgs args, UiTabViewType type); 166 UiNavigationTabView(UiObject* obj, NavigationView navigationview, UiTabViewArgs args, UiTabViewType type);
160 167
161 UiObject* AddTab(const char* label); 168 UiObject* AddTab(const char* label, int index = -1);
169 void Remove(int index);
170 void Select(int index);
162 FrameworkElement GetFrameworkElement(); 171 FrameworkElement GetFrameworkElement();
163 172
164 void SelectionChanged(NavigationView const& sender, NavigationViewSelectionChangedEventArgs const& args); 173 void SelectionChanged(NavigationView const& sender, NavigationViewSelectionChangedEventArgs const& args);
165 }; 174 };
175
176 struct UiInvisibleTabView : UiTabView {
177 Grid container;
178 std::vector<FrameworkElement> pages;
179 int currentIndex;
180
181 UiInvisibleTabView(UiObject *obj, Grid container, UiTabViewArgs args);
182
183 UiObject* AddTab(const char* label, int index = -1);
184 void Remove(int index);
185 void Select(int index);
186 FrameworkElement GetFrameworkElement();
187 };

mercurial