195 MenuFlyoutItem mi = MenuFlyoutItem(); |
196 MenuFlyoutItem mi = MenuFlyoutItem(); |
196 wchar_t* wlabel = str2wstr(menuItemLabel ? menuItemLabel : "", NULL); |
197 wchar_t* wlabel = str2wstr(menuItemLabel ? menuItemLabel : "", NULL); |
197 mi.Text(wlabel); |
198 mi.Text(wlabel); |
198 free(wlabel); |
199 free(wlabel); |
199 |
200 |
|
201 if (callback) { |
|
202 mi.Click([this, elm, count](Windows::Foundation::IInspectable const& sender, RoutedEventArgs const& e) |
|
203 { |
|
204 UiEvent evt; |
|
205 evt.obj = obj; |
|
206 evt.window = obj->window; |
|
207 evt.document = obj->ctx->document; |
|
208 evt.eventdata = elm; |
|
209 evt.intval = count; |
|
210 callback(&evt, userdata); |
|
211 }); |
|
212 } |
|
213 |
200 parent.InsertAt(insertPos + count, mi); |
214 parent.InsertAt(insertPos + count, mi); |
201 |
215 |
202 elm = list->next(list); |
216 elm = list->next(list); |
203 count++; |
217 count++; |
204 } |
218 } |
235 uint32_t size = parent.Size(); |
249 uint32_t size = parent.Size(); |
236 |
250 |
237 UiVar* var = uic_create_var(ui_global_context(), it->varname, UI_VAR_LIST); |
251 UiVar* var = uic_create_var(ui_global_context(), it->varname, UI_VAR_LIST); |
238 |
252 |
239 UiMenuList* mlist = new UiMenuList(); |
253 UiMenuList* mlist = new UiMenuList(); |
|
254 mlist->obj = obj; |
240 mlist->parent = parent; |
255 mlist->parent = parent; |
241 mlist->getvalue = it->getvalue; |
256 mlist->getvalue = it->getvalue; |
242 mlist->callback = it->callback; |
257 mlist->callback = it->callback; |
243 mlist->userdata = it->userdata; |
258 mlist->userdata = it->userdata; |
244 mlist->prevSize = 0; |
259 mlist->prevSize = 0; |