/***********************************************************************/ /* Open Visualization Data Explorer */ /* (C) Copyright IBM Corp. 1989,1999 */ /* ALL RIGHTS RESERVED */ /* This code licensed under the */ /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ /***********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "defines.h" #include "GridDialog.h" #include "Application.h" #include "WorkSpace.h" #include "WorkSpaceInfo.h" #include "WorkSpaceGrid.h" #include "../widgets/Number.h" #include "../widgets/Stepper.h" boolean GridDialog::ClassInitialized = FALSE; String GridDialog::DefaultResources[] = { "*cancelButton.labelString: Cancel", "*okButton.labelString: OK", "*okButton.width: 60", "*cancelButton.width: 60", "*llButton.labelString: Lower Left", "*lrButton.labelString: Lower Right", "*ctButton.labelString: Center", "*ulButton.labelString: Upper Left", "*urButton.labelString: Upper Right", "*leftButton.labelString: Left", "*rightButton.labelString: Right", "*upperButton.labelString: Upper", "*lowerButton.labelString: Lower", "*alignLabel.labelString: Alignment:", "*spaceLabel.labelString: Grid Spacing", "*typeLabel.labelString: Grid Type", "*hLabel.labelString: Horizontal:", "*hLabel.alignment: XmALIGNMENT_BEGINNING", "*vLabel.labelString: Vertical:", "*vLabel.alignment: XmALIGNMENT_BEGINNING", "*noneTButton.labelString: None", "*oneDhTButton.labelString: 1D Horizontal", "*oneDvTButton.labelString: 1D Vertical", "*twoDTButton.labelString: 2D", "*accelerators: #augment\n" "Return: BulletinBoardReturn()", NULL }; GridDialog::GridDialog(Widget parent, WorkSpace *workSpace) : Dialog("gridDialog", parent) { this->workSpace = workSpace; if (NOT GridDialog::ClassInitialized) { GridDialog::ClassInitialized = TRUE; this->installDefaultResources(theApplication->getRootWidget()); } } GridDialog::GridDialog(char *name, Widget parent, WorkSpace *workSpace) : Dialog(name, parent) { this->workSpace = workSpace; } GridDialog::~GridDialog() { } // // Install the default resources for this class. // void GridDialog::installDefaultResources(Widget baseWidget) { this->setDefaultResources(baseWidget, GridDialog::DefaultResources); this->Dialog::installDefaultResources( baseWidget); } Widget GridDialog::createDialog(Widget parent) { Arg arg[20]; int n = 0; Widget form,frame; XtSetArg(arg[n], XmNheight, 400); n++; XtSetArg(arg[n], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); n++; form = this->CreateMainForm(parent, this->name, arg, n); XtVaSetValues(XtParent(form), XmNminWidth, 250, XmNtitle, " Grid...", NULL); this->cancel = XtVaCreateManagedWidget("cancelButton", xmPushButtonWidgetClass, form, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, NULL); this->ok = XtVaCreateManagedWidget("okButton", xmPushButtonWidgetClass, form, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, NULL); this->separator1 = XtVaCreateManagedWidget("separator1", xmSeparatorGadgetClass, form, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->ok, XmNbottomOffset, 10, NULL); this->align_form = XtVaCreateManagedWidget("alignForm", xmFormWidgetClass, form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, separator1, XmNbottomOffset, 10, XmNrightAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightOffset, 5, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 252, NULL); this->llbtn = XtVaCreateManagedWidget("llButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->lrbtn = XtVaCreateManagedWidget("lrButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, this->llbtn, XmNleftOffset, 30, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->ctbtn = XtVaCreateManagedWidget("ctButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomOffset, 10, XmNbottomWidget, this->llbtn, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 50, XmNleftOffset, -35, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->upperbtn = XtVaCreateWidget("upperButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->ctbtn, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 50, XmNleftOffset, -35, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->lowerbtn = XtVaCreateWidget("lowerButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 50, XmNleftOffset, -35, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->leftbtn = XtVaCreateWidget("leftButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomOffset, 0, XmNbottomWidget, this->ctbtn, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->rightbtn = XtVaCreateWidget("rightButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomOffset, 0, XmNbottomWidget, this->ctbtn, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->ulbtn = XtVaCreateManagedWidget("ulButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->ctbtn, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->urbtn = XtVaCreateManagedWidget("urButton", xmToggleButtonWidgetClass, this->align_form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->ctbtn, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET, XmNleftWidget, this->lrbtn, XmNleftOffset, 0, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNindicatorType, XmONE_OF_MANY, XmNshadowThickness, 0, XmNset, False, NULL); this->alignLabel = XtVaCreateManagedWidget("alignLabel", xmLabelWidgetClass,this->align_form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->urbtn, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, NULL); this->separator2 = XtVaCreateManagedWidget("separator2", xmSeparatorGadgetClass, form, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->align_form, XmNbottomOffset, 10, NULL); this->hLabel = XtVaCreateManagedWidget("hLabel", xmLabelWidgetClass,form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->separator2, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 100, XmNleftOffset, 5, XmNshadowThickness, 0, XmNset, True, NULL); this->hspacing = XtVaCreateManagedWidget("hNumber", xmStepperWidgetClass,form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->separator2, XmNbottomOffset, 10, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNdataType, INTEGER, XmNdigits, 3, XmNrecomputeSize, False, XmNiMinimum, 5, XmNiMaximum, 100, XmNiValue, 50, NULL); this->vLabel = XtVaCreateManagedWidget("vLabel", xmLabelWidgetClass,form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->hLabel, XmNbottomOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 100, XmNshadowThickness, 0, XmNset, True, NULL); this->vspacing = XtVaCreateManagedWidget("vNumber", xmStepperWidgetClass,form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->hLabel, XmNbottomOffset, 10, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNdataType, INTEGER, XmNdigits, 3, XmNrecomputeSize, False, XmNiMinimum, 5, XmNiMaximum, 100, XmNiValue, 50, NULL); this->spaceLabel = XtVaCreateManagedWidget("spaceLabel", xmLabelWidgetClass, form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->vLabel, XmNbottomOffset, 5, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNalignment, XmALIGNMENT_CENTER, NULL); this->separator3 = XtVaCreateManagedWidget("separator3", xmSeparatorGadgetClass, form, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->spaceLabel, XmNbottomOffset, 10, NULL); n = 0; XtSetArg(arg[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(arg[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(arg[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg(arg[n], XmNbottomWidget, this->separator3); n++; XtSetArg(arg[n], XmNleftOffset, 3); n++; XtSetArg(arg[n], XmNrightOffset, 3); n++; XtSetArg(arg[n], XmNbottomOffset, 10); n++; this->gc_rc = XmCreateRadioBox(form, "gridType", arg, n); XtManageChild(this->gc_rc); this->noneTButton = XtVaCreateManagedWidget("noneTButton", xmToggleButtonWidgetClass, this->gc_rc, XmNshadowThickness, 0, NULL); this->oneDhTButton = XtVaCreateManagedWidget("oneDhTButton", xmToggleButtonWidgetClass, this->gc_rc, XmNshadowThickness, 0, NULL); this->oneDvTButton = XtVaCreateManagedWidget("oneDvTButton", xmToggleButtonWidgetClass, this->gc_rc, XmNshadowThickness, 0, NULL); this->twoDTButton = XtVaCreateManagedWidget("twoDTButton", xmToggleButtonWidgetClass, this->gc_rc, XmNshadowThickness, 0, NULL); Widget label = XtVaCreateManagedWidget("typeLabel", xmLabelWidgetClass, form, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, this->gc_rc, XmNbottomOffset, 5, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 5, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 5, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 5, XmNalignment, XmALIGNMENT_CENTER, NULL); XtAddCallback(this->noneTButton, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_DimensionCB, (XtPointer)this); XtAddCallback(this->oneDvTButton, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_DimensionCB, (XtPointer)this); XtAddCallback(this->oneDhTButton, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_DimensionCB, (XtPointer)this); XtAddCallback(this->twoDTButton, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_DimensionCB, (XtPointer)this); XtAddCallback(this->urbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->llbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->lrbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->ulbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->ctbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->leftbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->rightbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->upperbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtAddCallback(this->lowerbtn, XmNvalueChangedCallback, (XtCallbackProc)GridDialog_AlignmentCB, (XtPointer)this); XtManageChild(form); return form; } void GridDialog::manage() { WorkSpaceInfo *wsinfo = this->workSpace->getInfo(); unsigned int x_align = wsinfo->getGridXAlignment(); unsigned int y_align = wsinfo->getGridYAlignment(); int width, height; this->Dialog::manage(); wsinfo->getGridSpacing(width, height); XtVaSetValues(this->hspacing, XmNiValue, width, NULL); XtVaSetValues(this->vspacing, XmNiValue, height, NULL); XtSetSensitive(this->hspacing, x_align != XmALIGNMENT_NONE); XtSetSensitive(this->vspacing, y_align != XmALIGNMENT_NONE); if ((!wsinfo->grid.isActive())|| ((x_align == XmALIGNMENT_NONE) && (y_align == XmALIGNMENT_NONE))) XmToggleButtonSetState(this->noneTButton, True, True); else if (y_align == XmALIGNMENT_NONE) XmToggleButtonSetState(this->oneDhTButton, True, True); else if (x_align == XmALIGNMENT_NONE) XmToggleButtonSetState(this->oneDvTButton, True, True); else XmToggleButtonSetState(this->twoDTButton, True, True); this->resetToggleBtn(); switch(x_align) { case XmALIGNMENT_BEGINNING: switch(y_align) { case XmALIGNMENT_BEGINNING: XtVaSetValues(this->ulbtn, XmNset, True, NULL); break; case XmALIGNMENT_CENTER: break; case XmALIGNMENT_END: XtVaSetValues(this->llbtn, XmNset, True, NULL); break; case XmALIGNMENT_NONE: XtVaSetValues(this->leftbtn, XmNset, True, NULL); break; } break; case XmALIGNMENT_CENTER: switch(y_align) { case XmALIGNMENT_BEGINNING: break; case XmALIGNMENT_CENTER: XtVaSetValues(this->ctbtn, XmNset, True, NULL); break; case XmALIGNMENT_END: break; case XmALIGNMENT_NONE: XtVaSetValues(this->ctbtn, XmNset, True, NULL); break; } break; case XmALIGNMENT_END: switch(y_align) { case XmALIGNMENT_BEGINNING: XtVaSetValues(this->urbtn, XmNset, True, NULL); break; case XmALIGNMENT_CENTER: break; case XmALIGNMENT_END: XtVaSetValues(this->lrbtn, XmNset, True, NULL); break; case XmALIGNMENT_NONE: XtVaSetValues(this->rightbtn, XmNset, True, NULL); break; } break; case XmALIGNMENT_NONE: switch(y_align) { case XmALIGNMENT_BEGINNING: XtVaSetValues(this->upperbtn, XmNset, True, NULL); break; case XmALIGNMENT_CENTER: XtVaSetValues(this->ctbtn, XmNset, True, NULL); break; case XmALIGNMENT_END: XtVaSetValues(this->lowerbtn, XmNset, True, NULL); break; case XmALIGNMENT_NONE: break; } break; } } extern "C" void GridDialog_AlignmentCB(Widget widget, XtPointer clientData, XtPointer callData) { Boolean setting; GridDialog *dialog = (GridDialog*) clientData; XtVaGetValues(widget, XmNset, &setting, NULL); if (setting) dialog->resetToggleBtn(); XtVaSetValues(widget, XmNset, True, NULL); } extern "C" void GridDialog_DimensionCB(Widget widget, XtPointer clientData, XtPointer callData) { Boolean right, lower, center; GridDialog *dialog = (GridDialog*) clientData; if(!XmToggleButtonGetState(widget)) return; lower = right = center = False; if(XmToggleButtonGetState(dialog->lowerbtn)) {lower = True;}; if(XmToggleButtonGetState(dialog->rightbtn)) {right = True;}; if(XmToggleButtonGetState(dialog->lrbtn)) {lower = True; right = True;} if(XmToggleButtonGetState(dialog->llbtn)) {lower = True;} if(XmToggleButtonGetState(dialog->urbtn)) {right = True;}; if(XmToggleButtonGetState(dialog->ctbtn)) {center = True;}; dialog->resetToggleBtn(); if(widget == dialog->noneTButton) { XtSetSensitive(dialog->hspacing, False); XtSetSensitive(dialog->vspacing, False); XtVaSetValues(dialog->separator2, XmNbottomWidget, dialog->ok, NULL); XtUnmanageChild(dialog->align_form); } else if(widget == dialog->oneDvTButton) { XtSetSensitive(dialog->hspacing, False); XtSetSensitive(dialog->vspacing, True); XtManageChild(dialog->upperbtn); XtManageChild(dialog->lowerbtn); XtVaSetValues(dialog->alignLabel, XmNbottomWidget, dialog->upperbtn, NULL); XtVaSetValues(dialog->ctbtn, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, dialog->lowerbtn, NULL); XtUnmanageChild(dialog->ulbtn); XtUnmanageChild(dialog->urbtn); XtUnmanageChild(dialog->llbtn); XtUnmanageChild(dialog->lrbtn); XtUnmanageChild(dialog->leftbtn); XtUnmanageChild(dialog->rightbtn); XtManageChild(dialog->align_form); XtVaSetValues(dialog->separator2, XmNbottomWidget, dialog->align_form,NULL); if(lower) XmToggleButtonSetState(dialog->lowerbtn, True, False); else if(center) XmToggleButtonSetState(dialog->ctbtn, True, False); else XmToggleButtonSetState(dialog->upperbtn, True, False); XtVaSetValues (dialog->align_form, XmNheight, 0, NULL); } else if(widget == dialog->oneDhTButton) { XtSetSensitive(dialog->hspacing, True); XtSetSensitive(dialog->vspacing, False); XtManageChild(dialog->leftbtn); XtManageChild(dialog->rightbtn); XtVaSetValues(dialog->alignLabel, XmNbottomWidget, dialog->ctbtn, NULL); XtVaSetValues(dialog->ctbtn, XmNbottomAttachment, XmATTACH_FORM, NULL); XtUnmanageChild(dialog->ulbtn); XtUnmanageChild(dialog->urbtn); XtUnmanageChild(dialog->llbtn); XtUnmanageChild(dialog->lrbtn); XtUnmanageChild(dialog->upperbtn); XtUnmanageChild(dialog->lowerbtn); XtManageChild(dialog->align_form); XtVaSetValues(dialog->separator2, XmNbottomWidget, dialog->align_form,NULL); if(right) XmToggleButtonSetState(dialog->rightbtn, True, False); else if(center) XmToggleButtonSetState(dialog->ctbtn, True, False); else XmToggleButtonSetState(dialog->leftbtn, True, False); // make the form widget recalc its height requirement. In the 1dH case, // the align_form widget is getting too tall. Changing from 1dH to either // 2d or 1dV, then makes a mess on the screen. XtVaSetValues (dialog->align_form, XmNheight, 0, NULL); } else if(widget == dialog->twoDTButton) { XtSetSensitive(dialog->hspacing, True); XtSetSensitive(dialog->vspacing, True); XtManageChild(dialog->ulbtn); XtManageChild(dialog->urbtn); XtManageChild(dialog->llbtn); XtManageChild(dialog->lrbtn); XtVaSetValues(dialog->alignLabel, XmNbottomWidget, dialog->ulbtn, NULL); XtVaSetValues(dialog->ctbtn, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, dialog->llbtn, NULL); XtUnmanageChild(dialog->leftbtn); XtUnmanageChild(dialog->rightbtn); XtUnmanageChild(dialog->upperbtn); XtUnmanageChild(dialog->lowerbtn); XtManageChild(dialog->align_form); XtVaSetValues(dialog->separator2, XmNbottomWidget, dialog->align_form,NULL); if(lower) if(right) XmToggleButtonSetState(dialog->lrbtn, True, False); else XmToggleButtonSetState(dialog->llbtn, True, False); else if(center) XmToggleButtonSetState(dialog->ctbtn, True, False); else if(right) XmToggleButtonSetState(dialog->urbtn, True, False); else XmToggleButtonSetState(dialog->ulbtn, True, False); XtVaSetValues (dialog->align_form, XmNheight, 0, NULL); } } boolean GridDialog::okCallback(Dialog *d) { int width, height; Boolean upper_left, upper_right, center, lower_left, lower_right, snap; Boolean upper, lower, right, left; unsigned int x_align; unsigned int y_align; WorkSpaceInfo *wsinfo = this->workSpace->getInfo(); Boolean align_horizontal; Boolean align_vertical; align_horizontal = align_vertical = False; if(XmToggleButtonGetState(this->twoDTButton)) align_horizontal = align_vertical = True; else if(XmToggleButtonGetState(this->oneDvTButton)) align_vertical = True; else if(XmToggleButtonGetState(this->oneDhTButton)) align_horizontal = True; XtVaGetValues(this->ulbtn, XmNset, &upper_left, NULL); XtVaGetValues(this->urbtn, XmNset, &upper_right, NULL); XtVaGetValues(this->ctbtn, XmNset, ¢er, NULL); XtVaGetValues(this->llbtn, XmNset, &lower_left, NULL); XtVaGetValues(this->lrbtn, XmNset, &lower_right, NULL); XtVaGetValues(this->rightbtn, XmNset, &right, NULL); XtVaGetValues(this->leftbtn, XmNset, &left, NULL); XtVaGetValues(this->upperbtn, XmNset, &upper, NULL); XtVaGetValues(this->lowerbtn, XmNset, &lower, NULL); if(align_horizontal) { if (upper_left || lower_left || left) x_align = XmALIGNMENT_BEGINNING; else if (center) x_align = XmALIGNMENT_CENTER; else x_align = XmALIGNMENT_END; } else x_align = XmALIGNMENT_NONE; if(align_vertical) { if (upper_left || upper_right || upper) y_align = XmALIGNMENT_BEGINNING; else if (center) y_align = XmALIGNMENT_CENTER; else y_align = XmALIGNMENT_END; } else y_align = XmALIGNMENT_NONE; wsinfo->setGridAlignment(x_align, y_align); wsinfo->setGridActive(align_horizontal || align_vertical); XtVaGetValues(this->hspacing, XmNiValue, &width, NULL); XtVaGetValues(this->vspacing, XmNiValue, &height, NULL); wsinfo->setGridSpacing(width, height); this->workSpace->installInfo(NULL); return TRUE; } void GridDialog::resetToggleBtn() { XtVaSetValues(this->ulbtn, XmNset, False, NULL); XtVaSetValues(this->urbtn, XmNset, False, NULL); XtVaSetValues(this->llbtn, XmNset, False, NULL); XtVaSetValues(this->lrbtn, XmNset, False, NULL); XtVaSetValues(this->ctbtn, XmNset, False, NULL); XtVaSetValues(this->leftbtn, XmNset, False, NULL); XtVaSetValues(this->rightbtn, XmNset, False, NULL); XtVaSetValues(this->upperbtn, XmNset, False, NULL); XtVaSetValues(this->lowerbtn, XmNset, False, NULL); }