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 /* $TOG: formatCB.c /main/5 1999/09/15 14:29:27 mgreess $ */
24 /**********************************<+>*************************************
25 ***************************************************************************
29 ** Project: DT dtpad, a memo maker type editor based on the Dt Editor
35 ** This file contains the callbacks for the [Format] 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> */
57 /************************************************************************
58 * FormatCB - [Format] menu, [Settings...] button
59 ************************************************************************/
67 Editor *pPad = (Editor *) client_data;
68 DtEditorInvokeFormatDialog(pPad->editor);
72 /************************************************************************
73 * FormatParaCB - [Format] menu, [Paragraph] button
74 ************************************************************************/
82 Editor *pPad = (Editor *) client_data;
83 DtEditorErrorCode error = DtEDITOR_NO_ERRORS;
85 error = DtEditorFormat(pPad->editor, NULL, DtEDITOR_FORMAT_PARAGRAPH);
86 if (DtEDITOR_NO_ERRORS != error)
90 case DtEDITOR_INSUFFICIENT_MEMORY:
93 (char *) GETMESSAGE(5, 47, "Operation failed due to insufficient memory.\nTry increasing swap space."),
99 (char *) GETMESSAGE(5, 48, "Format operation failed."),
107 /************************************************************************
108 * FormatAllCB - [Format] menu, [All] button
109 ************************************************************************/
117 Editor *pPad = (Editor *)client_data;
118 DtEditorErrorCode error = DtEDITOR_NO_ERRORS;
120 error = DtEditorFormat(pPad->editor, NULL, DtEDITOR_FORMAT_ALL);
121 if (DtEDITOR_NO_ERRORS != error)
125 case DtEDITOR_INSUFFICIENT_MEMORY:
128 (char *) GETMESSAGE(5, 47, "Operation failed due to insufficient memory.\nTry increasing swap space."),
134 (char *) GETMESSAGE(5, 48, "Format operation failed."),