74 void action_doc1(UiEvent *event, void *data) { |
74 void action_doc1(UiEvent *event, void *data) { |
75 TestWindowData *wdata = event->window; |
75 TestWindowData *wdata = event->window; |
76 if(event->obj->document != wdata->doc1) { |
76 if(event->obj->document != wdata->doc1) { |
77 ui_set_document(event->obj, wdata->doc1); |
77 ui_set_document(event->obj, wdata->doc1); |
78 } |
78 } |
|
79 ui_unset_group(event->obj->ctx, 1); |
79 } |
80 } |
80 |
81 |
81 void action_doc2(UiEvent *event, void *data) { |
82 void action_doc2(UiEvent *event, void *data) { |
82 TestWindowData *wdata = event->window; |
83 TestWindowData *wdata = event->window; |
83 if(event->obj->document != wdata->doc2) { |
84 if(event->obj->document != wdata->doc2) { |
84 ui_set_document(event->obj, wdata->doc2); |
85 ui_set_document(event->obj, wdata->doc2); |
85 } |
86 } |
|
87 ui_set_group(event->obj->ctx, 1); |
86 } |
88 } |
87 |
89 |
88 void action_undo(UiEvent *event, void *data) { |
90 void action_undo(UiEvent *event, void *data) { |
89 printf("undo\n"); |
91 printf("undo\n"); |
90 TestWindowData *wd = event->window; |
92 TestWindowData *wd = event->window; |
114 ui_menu("File"); |
116 ui_menu("File"); |
115 ui_menuitem_st(UI_STOCK_NEW, action_new, NULL); |
117 ui_menuitem_st(UI_STOCK_NEW, action_new, NULL); |
116 ui_menuitem_st(UI_STOCK_OPEN, action_open, NULL); |
118 ui_menuitem_st(UI_STOCK_OPEN, action_open, NULL); |
117 ui_menuitem_stgr(UI_STOCK_SAVE, action_save, NULL, 1, -1); |
119 ui_menuitem_stgr(UI_STOCK_SAVE, action_save, NULL, 1, -1); |
118 ui_menuseparator(); |
120 ui_menuseparator(); |
|
121 |
119 ui_menuitem("Dokument 1", action_doc1, NULL); |
122 ui_menuitem("Dokument 1", action_doc1, NULL); |
120 ui_menuitem("Dokument 2", action_doc2, NULL); |
123 ui_menuitem("Dokument 2", action_doc2, NULL); |
121 void ui_menuseparator(); |
124 |
|
125 ui_menuseparator(); |
122 |
126 |
123 ui_checkitem_nv("Check", "check1"); |
127 ui_checkitem_nv("Check", "check1"); |
124 //ui_checkitem("Check", action_open, NULL); |
128 //ui_checkitem("Check", action_open, NULL); |
125 |
129 |
126 void ui_menuseparator(); |
130 void ui_menuseparator(); |