1 /* $XConsortium: optionsCB.c /main/3 1995/11/01 10:39:09 rswiston $ */
2 /**********************************<+>*************************************
3 ***************************************************************************
7 ** Project: DT dtpad, a memo maker type editor based on the Dt Editor
13 ** This file contains the callbacks for the [Options] menu items.
15 *******************************************************************
16 ** (c) Copyright Hewlett-Packard Company, 1991, 1992. All rights are
17 ** reserved. Copying or other reproduction of this program
18 ** except for archival purposes is prohibited without prior
19 ** written consent of Hewlett-Packard Company.
20 ********************************************************************
22 ********************************************************************
23 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
24 ** (c) Copyright 1993, 1994 International Business Machines Corp.
25 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
26 ** (c) Copyright 1993, 1994 Novell, Inc.
27 ********************************************************************
30 **************************************************************************
31 **********************************<+>*************************************/
33 #include <Dt/HourGlass.h>
36 /************************************************************************
37 * OverstrikeCB - set Editor widget overstike and "Options" menu
38 * "Overstrike" radio button state based on value passed in
41 * NOTE: The default overstrike state for the entire (pPad) edit
42 * session is also reset.
43 ************************************************************************/
52 Editor *pPad = (Editor *)client_data;
53 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
56 XtSetArg(al[0], DtNoverstrike, (Boolean) cb->set);
57 XtSetValues(pPad->editor, al, 1);
58 pPad->xrdb.overstrike = (Boolean) cb->set; /* reset edit session default */
63 /************************************************************************
64 * WordWrapCB - set Editor widget word wrap state and the default state
65 * for the new line radio button in the "Save As" File menu dialog
66 * based on value passed in call_data->set.
68 * NOTE: The default word wrap state for the entire (pPad) edit
69 * session is also reset.
70 ************************************************************************/
79 Editor *pPad = (Editor *)client_data;
80 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
82 SaveAs *pSaveAs = &pPad->fileStuff.fileWidgets.saveAs;
83 Select *pSelect = &pPad->fileStuff.fileWidgets.select;
85 XtSetArg(al[0], DtNwordWrap, (Boolean) cb->set);
86 XtSetValues(pPad->editor, al, 1);
88 pPad->xrdb.wordWrap = (Boolean) cb->set; /* reset edit session default */
90 /* -----> set the default state for the "add new lines?" radio boxes in the
91 * "Save As" file selection box and the "Save" prompt dialog
92 * (these radio boxes are included only if word wrap is on) */
93 if (pSaveAs->toggleWidgets.newl_radio != (Widget) 0) {
94 if (pPad->xrdb.wordWrap == True) {
95 XtManageChild(pSaveAs->toggleWidgets.newl_radio);
97 XtUnmanageChild(pSaveAs->toggleWidgets.newl_radio);
100 if (pSelect->toggleWidgets.newl_radio != (Widget) 0) {
101 if (pPad->xrdb.wordWrap == True) {
102 XtManageChild(pSelect->separator);
103 XtManageChild(pSelect->toggleWidgets.newl_radio);
105 XtUnmanageChild(pSelect->separator);
106 XtUnmanageChild(pSelect->toggleWidgets.newl_radio);
113 /************************************************************************
114 * StatusLineCB - set Editor widget statusLine based on value passed in
117 * NOTE: The default statusLine state for the entire (pPad) edit
118 * session is also reset.
119 ************************************************************************/
128 Editor *pPad = (Editor *)client_data;
129 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
132 XtSetArg(al[0], DtNshowStatusLine, (Boolean) cb->set);
133 XtSetValues(pPad->editor, al, 1);
134 pPad->xrdb.statusLine = (Boolean) cb->set; /* reset edit session default */
136 /* Reset the resize increment and minimum window size properties. */
137 SetAppShellResizeHints(pPad);