166 w2 = XmNrightWidget; |
166 w2 = XmNrightWidget; |
167 } |
167 } |
168 |
168 |
169 if(bc->prev_widget) { |
169 if(bc->prev_widget) { |
170 int v = 0; |
170 int v = 0; |
171 XtVaGetValues(bc->prev_widget, d2, &v, 0); |
171 XtVaGetValues(bc->prev_widget, d2, &v, NULL); |
172 if(v == XmATTACH_FORM) { |
172 if(v == XmATTACH_FORM) { |
173 XtVaSetValues( |
173 XtVaSetValues( |
174 bc->prev_widget, |
174 bc->prev_widget, |
175 d2, |
175 d2, |
176 XmATTACH_WIDGET, |
176 XmATTACH_WIDGET, |
177 w2, |
177 w2, |
178 widget, |
178 widget, |
179 0); |
179 NULL); |
180 XtVaSetValues( |
180 XtVaSetValues( |
181 widget, |
181 widget, |
182 d1, |
182 d1, |
183 XmATTACH_NONE, |
183 XmATTACH_NONE, |
184 d2, |
184 d2, |
185 XmATTACH_FORM, |
185 XmATTACH_FORM, |
186 0); |
186 NULL); |
187 } |
187 } |
188 } |
188 } |
189 bc->prev_widget = widget; |
189 bc->prev_widget = widget; |
190 |
190 |
191 ui_reset_layout(ct->layout); |
191 ui_reset_layout(ct->layout); |
665 |
665 |
666 UiObject *content = ui_malloc(view->ctx, sizeof(UiObject)); |
666 UiObject *content = ui_malloc(view->ctx, sizeof(UiObject)); |
667 content->widget = NULL; // initialization for uic_context() |
667 content->widget = NULL; // initialization for uic_context() |
668 content->ctx = uic_context(content, view->ctx->mempool); |
668 content->ctx = uic_context(content, view->ctx->mempool); |
669 content->ctx->parent = view->ctx; |
669 content->ctx->parent = view->ctx; |
670 content->ctx->set_document = ui_tab_set_document; |
670 content->ctx->attach_document = uic_context_attach_document; |
671 content->ctx->detach_document = ui_tab_detach_document; |
671 content->ctx->detach_document2 = uic_context_detach_document2; |
672 content->widget = frame; |
672 content->widget = frame; |
673 content->window = view->ctx->obj->window; |
673 content->window = view->ctx->obj->window; |
674 content->container = ui_frame_container(content, frame); |
674 content->container = ui_frame_container(content, frame); |
675 content->next = NULL; |
675 content->next = NULL; |
676 |
676 |
724 |
724 |
725 } |
725 } |
726 |
726 |
727 void ui_change_tab(MotifTabbedPane *pane, UiTab *tab) { |
727 void ui_change_tab(MotifTabbedPane *pane, UiTab *tab) { |
728 UiContext *ctx = tab->content->ctx; |
728 UiContext *ctx = tab->content->ctx; |
729 ctx->parent->set_document(ctx->parent, ctx->document); |
729 ctx->parent->detach_document2(ctx->parent, pane->current->content->ctx->document); |
|
730 ctx->parent->attach_document(ctx->parent, ctx->document); |
730 |
731 |
731 if(pane->current) { |
732 if(pane->current) { |
732 XtVaSetValues(pane->current->tab_button, XmNshadowThickness, 0, XmNbackground, pane->bg1, NULL); |
733 XtVaSetValues(pane->current->tab_button, XmNshadowThickness, 0, XmNbackground, pane->bg1, NULL); |
733 } |
734 } |
734 XtVaSetValues(tab->tab_button, XmNshadowThickness, 1, XmNbackground, pane->bg2, NULL); |
735 XtVaSetValues(tab->tab_button, XmNshadowThickness, 1, XmNbackground, pane->bg2, NULL); |
748 |
749 |
749 void ui_tab_set_document(UiContext *ctx, void *document) { |
750 void ui_tab_set_document(UiContext *ctx, void *document) { |
750 if(ctx->parent->document) { |
751 if(ctx->parent->document) { |
751 //ctx->parent->detach_document(ctx->parent, ctx->parent->document); |
752 //ctx->parent->detach_document(ctx->parent, ctx->parent->document); |
752 } |
753 } |
753 uic_context_set_document(ctx, document); |
754 uic_context_attach_document(ctx, document); |
754 //uic_context_set_document(ctx->parent, document); |
755 //uic_context_set_document(ctx->parent, document); |
755 //ctx->parent->document = document; |
756 //ctx->parent->document = document; |
756 |
757 |
757 UiTab *tab = NULL; |
758 UiTab *tab = NULL; |
758 XtVaGetValues( |
759 XtVaGetValues( |
760 XmNuserData, |
761 XmNuserData, |
761 &tab, |
762 &tab, |
762 NULL); |
763 NULL); |
763 if(tab) { |
764 if(tab) { |
764 if(tab->tabbedpane->current == tab) { |
765 if(tab->tabbedpane->current == tab) { |
765 ctx->parent->set_document(ctx->parent, ctx->document); |
766 ctx->parent->attach_document(ctx->parent, ctx->document); |
766 } |
767 } |
767 } else { |
768 } else { |
768 fprintf(stderr, "UiError: ui_bar_set_document: Cannot set document"); |
769 fprintf(stderr, "UiError: ui_bar_set_document: Cannot set document"); |
769 } |
770 } |
770 } |
771 } |
771 |
772 |
772 void ui_tab_detach_document(UiContext *ctx) { |
|
773 uic_context_detach_document(ctx->parent); |
|
774 } |
|
775 |
773 |
776 |
774 |
777 /* |
775 /* |
778 * -------------------- Layout Functions -------------------- |
776 * -------------------- Layout Functions -------------------- |
779 * |
777 * |