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

« back to all changes in this revision

Viewing changes to src/ed/drawwindow.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
// 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 _DRAWWINDOW_H
 
23
#define _DRAWWINDOW_H
 
24
 
 
25
#include "editwindow.h"
 
26
#include "toolkit.h"
 
27
class DrawingArea;
 
28
 
 
29
/// (abstract) main window class common to all drawing editors.
 
30
class DrawWindow: public EditWindow {
 
31
/*@Doc: {\large {\bf scope:} editor} */
 
32
public:
 
33
        friend class DrawingArea;
 
34
        ///
 
35
        DrawWindow(const char *name);
 
36
        ///
 
37
        virtual ~DrawWindow();
 
38
 
 
39
        ///
 
40
        const char *GetClassName() { return "DrawWindow";}
 
41
        ///
 
42
        void SetAutoResize(bool set);
 
43
        ///
 
44
        void SetInlineEdit(bool set);
 
45
        ///
 
46
        virtual void SetHierarchic(bool set);
 
47
 
 
48
        /// set scale value string.
 
49
        void SetScaleValue(const char *s); 
 
50
 
 
51
        ///
 
52
        DrawingArea *GetDrawingArea() {return drawingArea;}
 
53
        ///
 
54
        void FitDocument();
 
55
        ///
 
56
        void FitDocument(int wd, int ht);
 
57
        ///
 
58
        void ShowPosition(int x, int y);
 
59
 
 
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);
 
64
 
 
65
        /// enables edit undo menu item.
 
66
        void EnableUndo(bool flag); 
 
67
        /// enables edit redo menu item.
 
68
        void EnableRedo(bool flag); 
 
69
 
 
70
        ///
 
71
        void EnableDocumentSource(bool flag);
 
72
protected:
 
73
        ///
 
74
        virtual void WriteUsage(const char *s);
 
75
 
 
76
        /// parse user options.
 
77
        void ParseUserOptions(int argc, char **argv);
 
78
 
 
79
        ///
 
80
        Widget GetArrowButtons() {return arrowButtons;}
 
81
        ///
 
82
        void SetArrowButtons(Widget w) {arrowButtons=w;}
 
83
        ///
 
84
        Widget GetScrolledWindow() {return scrolledWindow;}
 
85
        ///
 
86
        void SetScrolledWindow(Widget w) {scrolledWindow = w;}
 
87
        ///
 
88
        Widget GetScaleValue() {return scaleValue;}
 
89
        ///
 
90
        void SetScaleValue(Widget w) {scaleValue=w;}
 
91
 
 
92
        ///
 
93
        void SetScrolledWindowWidth(int n) {scrollWidth=n;} 
 
94
        ///
 
95
        int GetScrolledWindowWidth() {return scrollWidth;} 
 
96
 
 
97
        ///
 
98
        void SetScrolledWindowHeight(int n) {scrollHeight=n;} 
 
99
        /// 
 
100
        int GetScrolledWindowHeight() {return scrollHeight;}
 
101
 
 
102
        ///
 
103
        void CreateDrawingArea();
 
104
 
 
105
        ///
 
106
        void Finalize();
 
107
 
 
108
        ///
 
109
        Widget CreateControlArea(Widget parent);
 
110
 
 
111
        ///
 
112
        Widget CreateScrolledWindow(Widget parent);
 
113
 
 
114
        ///
 
115
        Widget CreateScaleValue(Widget parent);
 
116
 
 
117
        ///
 
118
        Widget CreateArrowButtonSquare(Widget parent);
 
119
 
 
120
        ///
 
121
        virtual void InitMenuItems();
 
122
private:
 
123
        /// DrawingArea part of main window.
 
124
        DrawingArea *drawingArea; 
 
125
 
 
126
        /// Motif ScrolledWindow widget.
 
127
        Widget scrolledWindow;
 
128
 
 
129
        /// Horiz. scrollbar of scrollwin.
 
130
        Widget horizontalScrollBar;
 
131
 
 
132
        /// Vert. scrollbar of scrollwin.
 
133
        Widget verticalScrollBar;
 
134
 
 
135
        /// Motif Label for scale value.
 
136
        Widget scaleValue;
 
137
 
 
138
        /// Motif ToggleButton for inline edit.
 
139
        Widget inlineEditToggle;
 
140
 
 
141
        /// Motif ToggleButton for recomputing sizes.
 
142
        Widget autoResizeToggle;
 
143
 
 
144
        /// Motif ToggleButton for hierarchic documents.
 
145
        Widget hierarchicToggle;
 
146
 
 
147
        /// Motif Frame Widget for arrow buttons. 
 
148
        Widget arrowButtons;
 
149
 
 
150
        ///
 
151
        int initDrawingWidth;
 
152
        ///
 
153
        int initDrawingHeight;
 
154
        ///
 
155
        int maxDrawingWidth;
 
156
        ///
 
157
        int maxDrawingHeight;
 
158
        ///
 
159
        static const int MIN_DRAWING_SIZE;
 
160
 
 
161
        /// width of the scrolled part in pixels.
 
162
        int scrollWidth; 
 
163
 
 
164
        /// height of the scrolled part in pixels.
 
165
        int scrollHeight;
 
166
 
 
167
        /// Determine scrolled window size from X screen.
 
168
        void DetermineScrollSize(ScreenType); 
 
169
 
 
170
        ///
 
171
        string toolIntroMenuLabel;
 
172
};
 
173
#endif