1
//------------------------------------------------------------------------------
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
4
// (c) copyright 1995, Vrije Universiteit Amsterdam.
5
// Author: Frank Dehne (frank@cs.vu.nl).
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.
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.
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
21
//-----------------------------------------------------------------------------
25
#include "editwindow.h"
29
/// (abstract) main window class common to all drawing editors.
30
class DrawWindow: public EditWindow {
31
/*@Doc: {\large {\bf scope:} editor} */
33
friend class DrawingArea;
35
DrawWindow(const char *name);
37
virtual ~DrawWindow();
40
const char *GetClassName() { return "DrawWindow";}
42
void SetAutoResize(bool set);
44
void SetInlineEdit(bool set);
46
virtual void SetHierarchic(bool set);
48
/// set scale value string.
49
void SetScaleValue(const char *s);
52
DrawingArea *GetDrawingArea() {return drawingArea;}
56
void FitDocument(int wd, int ht);
58
void ShowPosition(int x, int y);
60
/// sets name of edit undo menu item.
61
void SetUndoName(const char *s);
62
/// sets name of edit redo menu item.
63
void SetRedoName(const char *s);
65
/// enables edit undo menu item.
66
void EnableUndo(bool flag);
67
/// enables edit redo menu item.
68
void EnableRedo(bool flag);
71
void EnableDocumentSource(bool flag);
74
virtual void WriteUsage(const char *s);
76
/// parse user options.
77
void ParseUserOptions(int argc, char **argv);
80
Widget GetArrowButtons() {return arrowButtons;}
82
void SetArrowButtons(Widget w) {arrowButtons=w;}
84
Widget GetScrolledWindow() {return scrolledWindow;}
86
void SetScrolledWindow(Widget w) {scrolledWindow = w;}
88
Widget GetScaleValue() {return scaleValue;}
90
void SetScaleValue(Widget w) {scaleValue=w;}
93
void SetScrolledWindowWidth(int n) {scrollWidth=n;}
95
int GetScrolledWindowWidth() {return scrollWidth;}
98
void SetScrolledWindowHeight(int n) {scrollHeight=n;}
100
int GetScrolledWindowHeight() {return scrollHeight;}
103
void CreateDrawingArea();
109
Widget CreateControlArea(Widget parent);
112
Widget CreateScrolledWindow(Widget parent);
115
Widget CreateScaleValue(Widget parent);
118
Widget CreateArrowButtonSquare(Widget parent);
121
virtual void InitMenuItems();
123
/// DrawingArea part of main window.
124
DrawingArea *drawingArea;
126
/// Motif ScrolledWindow widget.
127
Widget scrolledWindow;
129
/// Horiz. scrollbar of scrollwin.
130
Widget horizontalScrollBar;
132
/// Vert. scrollbar of scrollwin.
133
Widget verticalScrollBar;
135
/// Motif Label for scale value.
138
/// Motif ToggleButton for inline edit.
139
Widget inlineEditToggle;
141
/// Motif ToggleButton for recomputing sizes.
142
Widget autoResizeToggle;
144
/// Motif ToggleButton for hierarchic documents.
145
Widget hierarchicToggle;
147
/// Motif Frame Widget for arrow buttons.
151
int initDrawingWidth;
153
int initDrawingHeight;
157
int maxDrawingHeight;
159
static const int MIN_DRAWING_SIZE;
161
/// width of the scrolled part in pixels.
164
/// height of the scrolled part in pixels.
167
/// Determine scrolled window size from X screen.
168
void DetermineScrollSize(ScreenType);
171
string toolIntroMenuLabel;