~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/ui/textviewdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//------------------------------------------------------------------------------
 
2
//
 
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
4
// (c) copyright 1997, Vrije Universiteit Amsterdam.
 
5
// Author: Frank Dehne (frank@cs.vu.nl).
 
6
//
 
7
// TCM is free software; you can redistribute it and/or modify
 
8
// it under the terms of the GNU General Public License as published by
 
9
// the Free Software Foundation; either version 2 of the License, or
 
10
// (at your option) any later version.
 
11
//
 
12
// TCM is distributed in the hope that it will be useful,
 
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
// GNU General Public License for more details.
 
16
//
 
17
// You should have received a copy of the GNU General Public License
 
18
// along with TCM; if not, write to the Free Software
 
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
20
// 02111-1307, USA.
 
21
//-----------------------------------------------------------------------------
 
22
#ifndef _TEXTVIEWDIALOG_H
 
23
#define _TEXTVIEWDIALOG_H
 
24
 
 
25
#include "dialog.h"
 
26
#include "util.h"
 
27
class Menu;
 
28
class MenuItem;
 
29
class FileSelectionDialog;
 
30
class FindDialog;
 
31
class ReplaceDialog;
 
32
class PrinterOptions;
 
33
 
 
34
/// manages text editor dialogs.
 
35
class TextViewDialog: public Dialog {
 
36
/*@Doc: {\large {\bf scope:} GUI} */
 
37
public:
 
38
        ///
 
39
        TextViewDialog(Widget parent);
 
40
        ///
 
41
        virtual ~TextViewDialog();
 
42
        ///
 
43
        const char *GetClassName() { return "TextViewDialog";}
 
44
        ///
 
45
        void Popup();
 
46
 
 
47
        ///
 
48
        void SetTextSize(int nrOfRows, int nrOfColumns);
 
49
        ///
 
50
        void SetTextRows(int nrOfRows);
 
51
        ///
 
52
        void SetTextColumns(int nrOfColumns);
 
53
        ///
 
54
        void SetTextMaxSize(int nrOfRows, int nrOfColumns);
 
55
        ///
 
56
        void SetTextString(const string *text);
 
57
        ///
 
58
        void GetTextString(string *t);
 
59
 
 
60
        ///
 
61
        void SetStatus(const char *s);
 
62
        ///
 
63
        void SetStatus(const string *s);
 
64
 
 
65
        ///
 
66
        void SetDirectory(const char *d);
 
67
        ///
 
68
        void SetDirectory(const string *d);
 
69
        ///
 
70
        void Save();
 
71
        ///
 
72
        void Print();
 
73
        ///
 
74
        bool SaveFile(const char *file);
 
75
        ///
 
76
        bool SaveFile(const string *file);
 
77
        ///
 
78
        bool LoadFile(const char *file);
 
79
        ///
 
80
        bool LoadFile(const string *file);
 
81
        
 
82
        ///
 
83
        void DeleteAll();
 
84
        ///
 
85
        void Cut();
 
86
        ///
 
87
        void Copy();
 
88
        ///
 
89
        void Paste();
 
90
        ///
 
91
        void ClearSelection();
 
92
        ///
 
93
        void Find();
 
94
        ///
 
95
        void ClearFind();
 
96
        ///
 
97
        void DoFind(int n);
 
98
 
 
99
        ///
 
100
        FileSelectionDialog *GetFileSelectionDialog() {return fileSelector;}
 
101
protected:
 
102
        ///
 
103
        void Configure();
 
104
        ///
 
105
        void CreateWidget();
 
106
        ///
 
107
        Widget GetTextWidget() {return textWidget;}
 
108
        ///
 
109
        ReplaceDialog *GetReplaceDialog() {return replaceDialog;}
 
110
        ///
 
111
        void SetReplaceDialog(ReplaceDialog *r) {replaceDialog=r;}
 
112
        ///
 
113
        virtual void InitMenuItems();
 
114
        ///
 
115
        static void PrintCB(Widget, XtPointer, XtPointer);
 
116
        ///
 
117
        static void SaveAsCB(Widget, XtPointer, XtPointer);
 
118
        ///
 
119
        static void SaveOKCB(Widget, XtPointer, XtPointer);
 
120
        ///
 
121
        static void CopyCB(Widget, XtPointer, XtPointer);
 
122
        ///
 
123
        static void FindCB(Widget, XtPointer, XtPointer);
 
124
        ///
 
125
        static void FindNextCB(Widget, XtPointer, XtPointer);
 
126
        ///
 
127
        static void FindAllCB(Widget, XtPointer, XtPointer);
 
128
        ///
 
129
        static void ClearSelectionCB(Widget, XtPointer, XtPointer);
 
130
        ///
 
131
        static void ClearFindCB(Widget, XtPointer, XtPointer);
 
132
        ///
 
133
        MenuItem *fileItems;
 
134
        ///
 
135
        MenuItem *editItems;
 
136
        ///
 
137
        MenuItem *searchItems;
 
138
private:
 
139
        ///
 
140
        Widget textWidget;
 
141
        ///
 
142
        Widget menuBar;
 
143
        ///
 
144
        Widget textStatus;
 
145
        ///
 
146
        FileSelectionDialog *fileSelector;
 
147
        ///
 
148
        PrinterOptions *printerOptions;
 
149
        ///
 
150
        FindDialog *findDialog;
 
151
        ///
 
152
        ReplaceDialog *replaceDialog;
 
153
        
 
154
        ///
 
155
        Menu *fileMenu;
 
156
        ///
 
157
        Menu *editMenu;
 
158
        ///
 
159
        Menu *searchMenu;
 
160
        ///
 
161
        string directory;
 
162
        ///
 
163
        string saveFile;
 
164
        ///
 
165
        string loadFile;
 
166
 
 
167
        ///
 
168
        int maxRows;
 
169
        ///
 
170
        int maxColumns;
 
171
};
 
172
#endif