34 #include "toolbar.h" |
34 #include "toolbar.h" |
35 #include "container.h" |
35 #include "container.h" |
36 |
36 |
37 #include <QVBoxLayout> |
37 #include <QVBoxLayout> |
38 #include <QFileDialog> |
38 #include <QFileDialog> |
|
39 #include <QPushButton> |
39 |
40 |
40 static UiObject* create_window(char *title, void *window_data, bool simple) { |
41 static UiObject* create_window(const char *title, void *window_data, bool simple) { |
41 CxMempool *mp = cxMempoolCreateSimple(256); |
42 CxMempool *mp = cxMempoolCreateSimple(256); |
42 UiObject *obj = (UiObject*)cxCalloc(mp->allocator, 1, sizeof(UiObject)); |
43 UiObject *obj = (UiObject*)cxCalloc(mp->allocator, 1, sizeof(UiObject)); |
43 obj->ctx = uic_context(obj, mp); |
44 obj->ctx = uic_context(obj, mp); |
44 obj->window = window_data; |
45 obj->window = window_data; |
45 obj->next = NULL; |
46 obj->next = NULL; |
46 |
47 |
47 QMainWindow *window = new QMainWindow(); |
48 QMainWindow *window = new QMainWindow(); |
|
49 window->setWindowTitle(title); |
48 obj->widget = window; |
50 obj->widget = window; |
49 |
51 |
50 /* |
52 /* |
51 if(!simple) { |
53 if(!simple) { |
52 QToolBar *toolbar = ui_create_toolbar(obj); |
54 QToolBar *toolbar = ui_create_toolbar(obj); |
62 |
64 |
63 obj->widget = window; |
65 obj->widget = window; |
64 return obj; |
66 return obj; |
65 } |
67 } |
66 |
68 |
67 UiObject* ui_window(char *title, void *window_data) { |
69 UiObject* ui_window(const char *title, void *window_data) { |
68 return create_window(title, window_data, FALSE); |
70 return create_window(title, window_data, FALSE); |
69 } |
71 } |
70 |
72 |
71 UiObject* ui_simplewindow(char *title, void *window_data) { |
73 UiObject* ui_simplewindow(char *title, void *window_data) { |
72 return create_window(title, window_data, TRUE); |
74 return create_window(title, window_data, TRUE); |