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

« back to all changes in this revision

Viewing changes to src/ed/startupwindow.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 1995, Vrije Universiteit Amsterdam.
 
5
// (c) copyright 1999, University of Twente.
 
6
// Author: Frank Dehne (frank@cs.vu.nl).
 
7
// Author: Henk van de Zandschulp (henkz@cs.utwente.nl)
 
8
//
 
9
// TCM is free software; you can redistribute it and/or modify
 
10
// it under the terms of the GNU General Public License as published by
 
11
// the Free Software Foundation; either version 2 of the License, or
 
12
// (at your option) any later version.
 
13
//
 
14
// TCM is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
// GNU General Public License for more details.
 
18
//
 
19
// You should have received a copy of the GNU General Public License
 
20
// along with TCM; if not, write to the Free Software Foundation, Inc.,
 
21
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
22
//-----------------------------------------------------------------------------
 
23
 
 
24
#ifndef _STARTUPWINDOW_H
 
25
#define _STARTUPWINDOW_H
 
26
 
 
27
#include "llist.h"
 
28
#include "util.h"
 
29
#include "mainwindow.h"
 
30
class Helper;
 
31
class Menu;
 
32
class MenuItem;
 
33
class Config;
 
34
class FileSelectionDialog;
 
35
class TextFieldListDialog;
 
36
 
 
37
/// Main window of the startup program.
 
38
class StartupWindow: public MainWindow {
 
39
/*@Doc: {\large {\bf scope:} general startup tool} */
 
40
public:
 
41
        ///
 
42
        StartupWindow(const char *name);
 
43
        ///
 
44
        virtual ~StartupWindow();
 
45
        ///
 
46
        const char *GetClassName() { return "StartupWindow";}
 
47
        ///
 
48
        void Quit();
 
49
        ///
 
50
        void Project();
 
51
        ///
 
52
        void OpenDocument();
 
53
        ///
 
54
        void DrawingArea();
 
55
        ///
 
56
        void StartEditor(int editor, const string *filename = 0);
 
57
        ///
 
58
        void StartTableEditor(unsigned rows, unsigned columns, 
 
59
                         unsigned cellwidth, unsigned cellheight);
 
60
        ///
 
61
        void SetDrawingArea(unsigned idw, unsigned idh, 
 
62
                        unsigned mdw, unsigned mdh);
 
63
        ///
 
64
        void SetProject(const string *s);
 
65
        ///
 
66
        void OpenDocument(const string *s);
 
67
        ///
 
68
        void SetStatus(const char *s);
 
69
        ///
 
70
        void SetStatus(const string *s);
 
71
        ///
 
72
        FileSelectionDialog *GetFileSelectionDialog() {
 
73
                return fileSelectionDialog;}
 
74
        ///
 
75
        FileSelectionDialog *GetDirSelectionDialog() {
 
76
                return dirSelectionDialog;}
 
77
        ///
 
78
        TextFieldListDialog *GetTableOptionsDialog() {
 
79
                return tableOptionsDialog;}
 
80
        ///
 
81
        TextFieldListDialog *GetDrawingOptionsDialog() {
 
82
                return drawingOptionsDialog;}
 
83
        ///
 
84
        static void QuitCB(Widget, XtPointer, XtPointer);
 
85
        ///
 
86
        static void HelpCB(Widget, XtPointer, XtPointer);
 
87
        ///
 
88
        static void ProjectCB(Widget, XtPointer, XtPointer);
 
89
        ///
 
90
        static void DocumentCB(Widget, XtPointer, XtPointer);
 
91
        ///
 
92
        static void OpenDocumentCB(Widget, XtPointer, XtPointer);
 
93
        ///
 
94
        static void DrawingAreaCB(Widget, XtPointer, XtPointer);
 
95
        ///
 
96
        static void StartEditorCB(Widget, XtPointer, XtPointer);
 
97
        ///
 
98
        static void StartTableEditorCB(Widget, XtPointer, XtPointer);
 
99
        ///
 
100
        static void SetProjectCB(Widget, XtPointer, XtPointer);
 
101
        ///
 
102
        static void SetDrawingAreaCB(Widget, XtPointer, XtPointer);
 
103
private:
 
104
        ///
 
105
        Config *config;
 
106
        ///
 
107
        Helper *helper;
 
108
        ///
 
109
        Widget statusBar;
 
110
        ///
 
111
        FileSelectionDialog *fileSelectionDialog;
 
112
        ///
 
113
        FileSelectionDialog *dirSelectionDialog;
 
114
        ///
 
115
        TextFieldListDialog *tableOptionsDialog;
 
116
        ///
 
117
        TextFieldListDialog *drawingOptionsDialog;
 
118
        ///
 
119
        string projDir;
 
120
        ///
 
121
        unsigned initDrawingWidth;
 
122
        ///
 
123
        unsigned initDrawingHeight;
 
124
        ///
 
125
        unsigned maxDrawingWidth;
 
126
        ///
 
127
        unsigned maxDrawingHeight;
 
128
        /// the directory where the binaries are.
 
129
        string binDir;  
 
130
 
 
131
        ///
 
132
        void InitMenuItems();
 
133
        ///
 
134
        Widget CreateWorkArea(Widget w, int argc, char **argv);
 
135
        ///
 
136
        void ParseUserOptions(int argc, char **argv);
 
137
        ///
 
138
        void CreateComponents(Widget parent);
 
139
        ///
 
140
        Widget CreateMenuBar(Widget parent);
 
141
        ///
 
142
        Menu *fileMenu;
 
143
        ///
 
144
        Menu *viewMenu;
 
145
        ///
 
146
        Menu *helpMenu;
 
147
        ///
 
148
        MenuItem *fileItems;
 
149
        ///
 
150
        MenuItem *viewItems;
 
151
        ///
 
152
        MenuItem *helpItems;
 
153
        ///
 
154
        void AddToolEntry(Widget parent, int i);
 
155
        ///
 
156
        void StartDocumentEditor(int editor, const string *filename = 0);
 
157
        ///
 
158
        void ShowTableDialog(int editor);
 
159
        ///
 
160
        void AppendExec(string *s, int editor);
 
161
        ///
 
162
        void AppendProjDir(string *s);
 
163
        ///
 
164
        void AppendDrawingArea(string *s);
 
165
        ///
 
166
        void ExecCommand(string *s);
 
167
        ///
 
168
        void InitTextFields();
 
169
        ///
 
170
        void Finalize();
 
171
        ///
 
172
        List<string *> tableFields;
 
173
        ///
 
174
        List<string *> tableDefaults;
 
175
        ///
 
176
        List<string *> fetDefaults;
 
177
        ///
 
178
        List<string *> tutDefaults;
 
179
        ///
 
180
        List<string *> drawingFields;
 
181
        ///
 
182
        List<string *> drawingDefaults;
 
183
        ///
 
184
        int tmpEditor;
 
185
        ///
 
186
        static const int MIN_DRAWING_SIZE;
 
187
        ///
 
188
        string welcomeLabel;
 
189
        ///
 
190
        Widget mainForm;
 
191
        ///
 
192
        Widget scrolledWindow;
 
193
};
 
194
#endif