1
//------------------------------------------------------------------------------
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).
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
//-----------------------------------------------------------------------------
27
/// abstract dialog class.
28
class Dialog: public MWidget {
29
/*@Doc: {\large {\bf scope:} GUI} */
32
Dialog(Widget parent);
36
const char *GetClassName() { return "Dialog";}
42
virtual void SetOKCallback(XtCallbackProc fun, XtPointer clientData);
44
virtual void SetCancelCallback(XtCallbackProc fun,XtPointer clientData);
46
virtual void SetHelpCallback(XtCallbackProc fun, XtPointer clientData);
49
void SetOKButtonLabel(const char *txt);
51
void SetCancelButtonLabel(const char *txt);
53
void SetHelpButtonLabel(const char *txt);
56
void ManageOKButton(bool);
58
void ManageCancelButton(bool);
60
void ManageHelpButton(bool);
62
/// delete itself when unmapped.
63
virtual void SetAutoDestroy(bool b);
68
virtual void Popdown();
71
void SetTitle(const char *title);
73
void SetTitle(const string *title);
76
void GetTitle(char *title);
78
void GetTitle(string *title);
80
/// make dialog application modal.
81
void SetModal(bool b);
84
void SetAutoUnmanage(bool b);
86
bool GetAutoUnmanage() {return autoUnmanage;}
88
void SetCenteredOnPointer(bool b) {centeredOnPointer = b;}
90
static void UnmanageCB(Widget, XtPointer, XtPointer);
92
static void DestroyCB(Widget, XtPointer, XtPointer);
94
static void DestroyWidgetCB(Widget, XtPointer, XtPointer);
96
static void TraverseNextCB(Widget, XtPointer, XtPointer);
98
static void TraverseNextGroupCB(Widget, XtPointer, XtPointer);
101
static const unsigned MAXTITLE;
104
Widget GetParent() {return parent;}
106
void ManageWidget(Widget, bool);
108
virtual void CreateWidget() = 0;
110
virtual void Configure() = 0;
112
void ManageCenteredOnPointer();
121
bool centeredOnPointer;