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

« back to all changes in this revision

Viewing changes to src/ui/mainwindow.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 _MAINWINDOW_H
 
23
#define _MAINWINDOW_H
 
24
 
 
25
#include "mousecursor.h"
 
26
#include "mwidget.h"
 
27
class string;
 
28
class PrinterOptions;
 
29
class Config;
 
30
 
 
31
/// class supporting the main (toplevel) window.
 
32
class MainWindow: public MWidget {
 
33
/*@Doc: {\large {\bf scope:} GUI} */
 
34
public:
 
35
        /// Constructor requires only a name
 
36
        MainWindow(const char *name);
 
37
        ///
 
38
        virtual ~MainWindow();
 
39
 
 
40
        ///
 
41
        const char *GetClassName() { return "MainWindow";}
 
42
 
 
43
        /// create toplevel widget, and other class members. 
 
44
        virtual void Initialize(int argc, char** argv, Config *config);
 
45
 
 
46
        /// initialization to do when window is already managed.
 
47
        virtual void Finalize() {}
 
48
 
 
49
        /// popup the window
 
50
        virtual void Manage();
 
51
 
 
52
        /// pop down the window
 
53
        virtual void Unmanage(); 
 
54
 
 
55
        /// iconify the window
 
56
        virtual void Iconify();
 
57
 
 
58
        ///
 
59
        void ManageUnmapped();
 
60
 
 
61
        /// close the window.
 
62
        void Close();
 
63
 
 
64
        /// Set window title.
 
65
        void SetTitle(const char *title);
 
66
        ///
 
67
        void SetTitle(const string *title);
 
68
 
 
69
        /// Set name of window icon.
 
70
        void SetIconName(const char *name);
 
71
 
 
72
        /// Set pixmap of window icon.
 
73
        void SetIconPixmap(Pixmap px);
 
74
 
 
75
        ///
 
76
        void SetCursor(int cursorNum) {cursor->Set(cursorNum);}
 
77
        ///
 
78
        void SetSizeCursor(int cursorNum) {cursor->SetSize(cursorNum);}
 
79
 
 
80
        ///
 
81
        virtual int GetTool() {return -1;}
 
82
 
 
83
        ///
 
84
        virtual void SetStatus(const char *) {}
 
85
        ///
 
86
        virtual void SetStatus(const string *) {}
 
87
 
 
88
        ///
 
89
        PrinterOptions *GetPrinterOptions();
 
90
protected:
 
91
        /// Derived classes define this to create the appl-specific work area.
 
92
        virtual Widget CreateWorkArea(Widget, int argc, char** argv) = 0;
 
93
 
 
94
        /// Derived classes use this functions to parse argv.
 
95
        virtual void ParseUserOptions(int argc, char** argv) = 0;
 
96
 
 
97
        /// Functions to create the constituting parts of the main window.
 
98
        virtual void CreateComponents(Widget window) = 0;
 
99
 
 
100
        ///
 
101
        MouseCursor *GetCursor() {return cursor;}
 
102
        ///
 
103
        Config *GetConfig() {return config;}
 
104
private:
 
105
        /// The MainWindow widget.
 
106
        Widget main;
 
107
        /// 
 
108
        MouseCursor *cursor;
 
109
        ///
 
110
        Widget workarea;
 
111
        /// the configuration object.
 
112
        Config *config;
 
113
 
 
114
        ///
 
115
        void WidgetDestroyed();
 
116
};
 
117
#endif