Lines Matching refs:menu

74   TextMenu menu(false, 10, 20, HEADERS, ITEMS, 0, 20, draw_funcs_);  in TEST_F()  local
75 ASSERT_FALSE(menu.scrollable()); in TEST_F()
76 ASSERT_EQ(HEADERS[0], menu.text_headers()[0]); in TEST_F()
77 ASSERT_EQ(5u, menu.ItemsCount()); in TEST_F()
80 ASSERT_FALSE(menu.ItemsOverflow(&message)); in TEST_F()
81 for (size_t i = 0; i < menu.ItemsCount(); i++) { in TEST_F()
82 ASSERT_EQ(ITEMS[i], menu.TextItem(i)); in TEST_F()
85 ASSERT_EQ(0, menu.selection()); in TEST_F()
89 TextMenu menu(true, 10, 8, HEADERS, ITEMS, 1, 20, draw_funcs_); in TEST_F() local
90 ASSERT_TRUE(menu.scrollable()); in TEST_F()
91 ASSERT_EQ(HEADERS[0], menu.text_headers()[0]); in TEST_F()
92 ASSERT_EQ(5u, menu.ItemsCount()); in TEST_F()
95 ASSERT_FALSE(menu.ItemsOverflow(&message)); in TEST_F()
96 for (size_t i = 0; i < menu.ItemsCount() - 1; i++) { in TEST_F()
97 ASSERT_EQ(ITEMS[i], menu.TextItem(i)); in TEST_F()
100 ASSERT_EQ("12345678", menu.TextItem(4)); in TEST_F()
101 ASSERT_EQ(1, menu.selection()); in TEST_F()
105 TextMenu menu(false, 1, 20, HEADERS, ITEMS, 0, 20, draw_funcs_); in TEST_F() local
106 ASSERT_FALSE(menu.scrollable()); in TEST_F()
107 ASSERT_EQ(1u, menu.ItemsCount()); in TEST_F()
110 ASSERT_FALSE(menu.ItemsOverflow(&message)); in TEST_F()
111 for (size_t i = 0; i < menu.ItemsCount(); i++) { in TEST_F()
112 ASSERT_EQ(ITEMS[i], menu.TextItem(i)); in TEST_F()
115 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
116 ASSERT_EQ(1u, menu.MenuEnd()); in TEST_F()
120 TextMenu menu(true, 1, 20, HEADERS, ITEMS, 0, 20, draw_funcs_); in TEST_F() local
121 ASSERT_TRUE(menu.scrollable()); in TEST_F()
122 ASSERT_EQ(5u, menu.ItemsCount()); in TEST_F()
125 ASSERT_TRUE(menu.ItemsOverflow(&message)); in TEST_F()
128 for (size_t i = 0; i < menu.ItemsCount(); i++) { in TEST_F()
129 ASSERT_EQ(ITEMS[i], menu.TextItem(i)); in TEST_F()
132 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
133 ASSERT_EQ(1u, menu.MenuEnd()); in TEST_F()
138 TextMenu menu(false, 10, 20, HEADERS, ITEMS, sel, 20, draw_funcs_); in TEST_F() local
141 sel = menu.Select(++sel); in TEST_F()
142 ASSERT_EQ(sel, menu.selection()); in TEST_F()
146 ASSERT_EQ(expected, menu.selection()); in TEST_F()
148 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
149 ASSERT_EQ(5u, menu.MenuEnd()); in TEST_F()
154 sel = menu.Select(--sel); in TEST_F()
155 ASSERT_EQ(sel, menu.selection()); in TEST_F()
158 ASSERT_EQ(expected, menu.selection()); in TEST_F()
160 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
161 ASSERT_EQ(5u, menu.MenuEnd()); in TEST_F()
167 TextMenu menu(true, 10, 20, HEADERS, ITEMS, sel, 20, draw_funcs_); in TEST_F() local
170 sel = menu.Select(++sel); in TEST_F()
171 ASSERT_EQ(sel, menu.selection()); in TEST_F()
175 ASSERT_EQ(expected, menu.selection()); in TEST_F()
177 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
178 ASSERT_EQ(5u, menu.MenuEnd()); in TEST_F()
183 sel = menu.Select(--sel); in TEST_F()
184 ASSERT_EQ(sel, menu.selection()); in TEST_F()
187 ASSERT_EQ(expected, menu.selection()); in TEST_F()
189 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
190 ASSERT_EQ(5u, menu.MenuEnd()); in TEST_F()
196 TextMenu menu(true, 3, 20, HEADERS, ITEMS, sel, 20, draw_funcs_); in TEST_F() local
197 ASSERT_EQ(5u, menu.ItemsCount()); in TEST_F()
201 sel = menu.Select(++sel); in TEST_F()
203 ASSERT_EQ(static_cast<size_t>(i), menu.MenuStart()); in TEST_F()
204 ASSERT_EQ(static_cast<size_t>(i + 3), menu.MenuEnd()); in TEST_F()
208 sel = menu.Select(++sel); in TEST_F()
210 ASSERT_EQ(2u, menu.MenuStart()); in TEST_F()
211 ASSERT_EQ(5u, menu.MenuEnd()); in TEST_F()
220 sel = menu.Select(--sel); in TEST_F()
222 ASSERT_EQ(static_cast<size_t>(std::min(3 - i, 2)), menu.MenuStart()); in TEST_F()
223 ASSERT_EQ(static_cast<size_t>(std::min(6 - i, 5)), menu.MenuEnd()); in TEST_F()
227 sel = menu.Select(--sel); in TEST_F()
229 ASSERT_EQ(0u, menu.MenuStart()); in TEST_F()
230 ASSERT_EQ(3u, menu.MenuEnd()); in TEST_F()
241 GraphicMenu menu(header.get(), items, 0, draw_funcs_); in TEST_F() local
243 ASSERT_EQ(0, menu.selection()); in TEST_F()
247 sel = menu.Select(++sel); in TEST_F()
249 ASSERT_EQ(sel, menu.selection()); in TEST_F()
254 sel = menu.Select(--sel); in TEST_F()
256 ASSERT_EQ(sel, menu.selection()); in TEST_F()