ui/winui/window.cpp

changeset 21
3060a5a1d5fd
parent 18
af411868ab9b
child 27
c254ed644edf
equal deleted inserted replaced
20:db263186edf3 21:3060a5a1d5fd
169 169
170 obj->wobj = new UiWindow(window); 170 obj->wobj = new UiWindow(window);
171 ui_context_add_window_destructor(obj->ctx, obj->wobj); 171 ui_context_add_window_destructor(obj->ctx, obj->wobj);
172 172
173 window.Closed([obj](IInspectable const& sender, WindowEventArgs) { 173 window.Closed([obj](IInspectable const& sender, WindowEventArgs) {
174 cxMempoolDestroy(obj->ctx->mp); 174 if (obj->ctx->close_callback) {
175 UiEvent evt;
176 evt.obj = obj;
177 evt.document = obj->ctx->document;
178 evt.window = obj->window;
179 evt.eventdata = NULL;
180 evt.intval = 0;
181 obj->ctx->close_callback(&evt, obj->ctx->close_data);
182 } else {
183 ui_context_destroy(obj->ctx);
184 }
175 }); 185 });
176 186
177 obj->container = new UiBoxContainer(grid, UI_BOX_CONTAINER_VBOX, 0, 0); 187 obj->container = new UiBoxContainer(grid, UI_BOX_CONTAINER_VBOX, 0, 0);
178 188
179 titleBar.VerticalAlignment(VerticalAlignment::Top); 189 titleBar.VerticalAlignment(VerticalAlignment::Top);

mercurial