1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
// $Id: xxDrawable.hh,v 1.2 2003/01/17 17:05:12 flaterco Exp $
/* xxDrawable Abstract class for all tide-predicting windows.
Copyright (C) 1998 David Flater.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
class xxDrawable: public xxWindow {
friend void xxDrawableMarkCallback (PredictionValue *marklevel,
void *in_ptr);
friend void xxDrawableTimestampCallback (Timestamp t,
void *in_ptr);
friend void xxDrawableAspectCallback (double aspect, void *in_ptr);
friend void xxDrawableStepCallback (Interval step, void *in_ptr);
friend void xxDrawableGraphCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableTextCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableRawCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableMediumRareCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableClockCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableChooserCallback (Widget w, XtPointer client_data, XtPointer call_data);
friend void xxDrawableControlPanelCallback (Widget w, XtPointer client_data, XtPointer call_data);
public:
// needcontainer:
// 0 No thanks
// 1 Make me a box
// 2 Make me a form
xxDrawable (xxTideContext *in_tidecontext, xxContext *in_xxcontext,
Station *in_station, int needcontainer = 1);
virtual ~xxDrawable();
virtual void help() = 0;
virtual void save() = 0;
virtual void redraw() = 0;
// Global_redraw signals a change in global parameters (like colors).
virtual void global_redraw();
// These are actually the same for all drawables.
void mark();
void timestamp();
void aspect();
void step();
// This is called by subclasses to hook up the dismiss button, the help
// button, and the options menu. Requires needcontainer > 0.
// Forms must pass the widgets above and to the left for layout purposes.
void addNormalButtons (Widget below_this = NULL, Widget beside_this = NULL);
// Set this to NULL if station is "stolen" for another window.
Station *station;
virtual int is_graph();
virtual int is_clock();
virtual int is_rare();
protected:
// This is the "starting time" or "now" that is used to calibrate
// any given drawable in time. This needs to be here so that it
// is possible for one drawable to create another one with the
// same start time.
Timestamp t;
xxContext *savebutton, *markbutton, *helpbutton, *dismissbutton,
*optionsbutton, *optionsmenu, *graphbutton, *textbutton,
*rawbutton, *mediumrarebutton,
*aspectbutton, *clockbutton, *chooserbutton, *timestampbutton,
*unitsbutton, *rootbutton, *stepbutton;
};
|