2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: optionsCB.c /main/3 1995/11/01 10:39:09 rswiston $ */
24 /**********************************<+>*************************************
25 ***************************************************************************
29 ** Project: DT dtpad, a memo maker type editor based on the Dt Editor
35 ** This file contains the callbacks for the [Options] menu items.
37 *******************************************************************
38 ** (c) Copyright Hewlett-Packard Company, 1991, 1992. All rights are
39 ** reserved. Copying or other reproduction of this program
40 ** except for archival purposes is prohibited without prior
41 ** written consent of Hewlett-Packard Company.
42 ********************************************************************
44 ********************************************************************
45 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
46 ** (c) Copyright 1993, 1994 International Business Machines Corp.
47 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
48 ** (c) Copyright 1993, 1994 Novell, Inc.
49 ********************************************************************
52 **************************************************************************
53 **********************************<+>*************************************/
55 #include <Dt/HourGlass.h>
58 /************************************************************************
59 * OverstrikeCB - set Editor widget overstike and "Options" menu
60 * "Overstrike" radio button state based on value passed in
63 * NOTE: The default overstrike state for the entire (pPad) edit
64 * session is also reset.
65 ************************************************************************/
74 Editor *pPad = (Editor *)client_data;
75 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
78 XtSetArg(al[0], DtNoverstrike, (Boolean) cb->set);
79 XtSetValues(pPad->editor, al, 1);
80 pPad->xrdb.overstrike = (Boolean) cb->set; /* reset edit session default */
85 /************************************************************************
86 * WordWrapCB - set Editor widget word wrap state and the default state
87 * for the new line radio button in the "Save As" File menu dialog
88 * based on value passed in call_data->set.
90 * NOTE: The default word wrap state for the entire (pPad) edit
91 * session is also reset.
92 ************************************************************************/
101 Editor *pPad = (Editor *)client_data;
102 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
104 SaveAs *pSaveAs = &pPad->fileStuff.fileWidgets.saveAs;
105 Select *pSelect = &pPad->fileStuff.fileWidgets.select;
107 XtSetArg(al[0], DtNwordWrap, (Boolean) cb->set);
108 XtSetValues(pPad->editor, al, 1);
110 pPad->xrdb.wordWrap = (Boolean) cb->set; /* reset edit session default */
112 /* -----> set the default state for the "add new lines?" radio boxes in the
113 * "Save As" file selection box and the "Save" prompt dialog
114 * (these radio boxes are included only if word wrap is on) */
115 if (pSaveAs->toggleWidgets.newl_radio != (Widget) 0) {
116 if (pPad->xrdb.wordWrap == True) {
117 XtManageChild(pSaveAs->toggleWidgets.newl_radio);
119 XtUnmanageChild(pSaveAs->toggleWidgets.newl_radio);
122 if (pSelect->toggleWidgets.newl_radio != (Widget) 0) {
123 if (pPad->xrdb.wordWrap == True) {
124 XtManageChild(pSelect->separator);
125 XtManageChild(pSelect->toggleWidgets.newl_radio);
127 XtUnmanageChild(pSelect->separator);
128 XtUnmanageChild(pSelect->toggleWidgets.newl_radio);
135 /************************************************************************
136 * StatusLineCB - set Editor widget statusLine based on value passed in
139 * NOTE: The default statusLine state for the entire (pPad) edit
140 * session is also reset.
141 ************************************************************************/
150 Editor *pPad = (Editor *)client_data;
151 XmToggleButtonCallbackStruct *cb = (XmToggleButtonCallbackStruct *)
154 XtSetArg(al[0], DtNshowStatusLine, (Boolean) cb->set);
155 XtSetValues(pPad->editor, al, 1);
156 pPad->xrdb.statusLine = (Boolean) cb->set; /* reset edit session default */
158 /* Reset the resize increment and minimum window size properties. */
159 SetAppShellResizeHints(pPad);