| 37 #include <QVBoxLayout> |
38 #include <QVBoxLayout> |
| 38 #include <QFileDialog> |
39 #include <QFileDialog> |
| 39 #include <QPushButton> |
40 #include <QPushButton> |
| 40 |
41 |
| 41 static UiObject* create_window(const char *title, void *window_data, bool simple) { |
42 static UiObject* create_window(const char *title, void *window_data, bool simple) { |
| 42 CxMempool *mp = cxMempoolCreateSimple(256); |
43 UiObject *obj = uic_object_new_toplevel(); |
| 43 UiObject *obj = (UiObject*)cxCalloc(mp->allocator, 1, sizeof(UiObject)); |
|
| 44 obj->ctx = uic_context(obj, mp); |
|
| 45 obj->window = window_data; |
44 obj->window = window_data; |
| 46 obj->next = NULL; |
45 obj->next = NULL; |
| 47 |
46 |
| 48 QMainWindow *window = new QMainWindow(); |
47 QMainWindow *window = new QMainWindow(); |
| 49 window->setWindowTitle(title); |
48 window->setWindowTitle(title); |
| 50 obj->widget = window; |
49 obj->widget = window; |
| 51 |
50 |
| 52 if(!simple) { |
51 if(!simple) { |
| 53 ui_add_menus(obj, window); |
52 ui_add_menus(obj, window); |
| 54 //QToolBar *toolbar = ui_create_toolbar(obj); |
53 QToolBar *toolbar = ui_create_toolbar(obj); |
| 55 //window->addToolBar(Qt::TopToolBarArea, toolbar); |
54 if(toolbar) { |
| |
55 window->addToolBar(Qt::TopToolBarArea, toolbar); |
| |
56 } |
| 56 } |
57 } |
| 57 |
58 |
| 58 QBoxLayout *box = new QVBoxLayout(); |
59 QBoxLayout *box = new QVBoxLayout(); |
| 59 QWidget *boxWidget = new QWidget(); |
60 QWidget *boxWidget = new QWidget(); |
| 60 boxWidget->setLayout(box); |
61 boxWidget->setLayout(box); |