vdk 2.4.0
vdkdatabox.h
1
2/*
3 * ===========================
4 * VDK Visual Development Kit
5 * Version 2.0.2
6 * May 2002
7 * ===========================
8 *
9 * Copyright (C) 1998, Mario Motta
10 * Developed by Mario Motta <mmotta@guest.net>
11 * Based on ISDataBox
12 * Developed by Ionutz Borcoman <borco@borco-ei.eng.hokudai.ac.jp>
13 * based on GtkDatabox - An extension to the gtk+ library
14 * Copyright (C) 1998-1999 Roland Bock
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Library General Public
18 * License as published by the Free Software Foundation; either
19 * version 2 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Library General Public License for more details.
25 *
26 * You should have received a copy of the GNU Library General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 * 02111-1307, USA.
30 */
31
32#ifndef _vdkdatabox_h_
33#define _vdkdatabox_h_
34
35#include <vdk/vdk.h>
36#include <vdk/gtkdatabox.h>
37
38
101{
102public:
104 VDKDataBox(VDKForm *owner);
106 ~VDKDataBox();
107
109 VDKReadWriteValueProp<VDKDataBox, bool> Rulers;
110 void SetRulers(bool);
111
113 VDKReadWriteValueProp<VDKDataBox, bool> Scrollbars;
114 void SetScrollbars(bool);
115
117 VDKReadWriteValueProp<VDKDataBox, bool> Zoom;
118 void SetZoom(bool);
119
121 VDKReadOnlyValueProp<VDKDataBox, GtkDataboxValue> TopLeft;
122
124 VDKReadOnlyValueProp<VDKDataBox, GtkDataboxValue> BottomRight;
125
127 VDKReadOnlyValueProp<VDKDataBox, GtkDataboxCoord> Mark;
128
130 VDKReadOnlyValueProp<VDKDataBox, GtkDataboxCoord> Select;
131
133
139 VDKColor* GetColor(int index);
140
142
147 void SetColor(int index, VDKColor *color, bool redraw = true);
148
150
153 GtkDataboxValue GetValue(GtkDataboxCoord coord);
154
156
162 void GetExtrema(GtkDataboxValue& min, GtkDataboxValue& max,
163 bool visible = true);
164
166
169 void Rescale(GtkDataboxValue min, GtkDataboxValue max);
170
174 void Rescale();
175
177 void Redraw();
178
180
183 gint RemoveData(gint index);
184
186
188 gint RemoveData();
189
191
197 gint DestroyData(gint index);
198
200
203 gint DestroyData();
204
206
216 gint AddXY(guint length, gfloat *X, gfloat *Y, VDKColor *color,
217 GtkDataboxDataType type = GTK_DATABOX_POINTS, guint dotSize = 1);
218
220
232 gint AddX (guint length, gfloat *X, guint indexSharedY, VDKColor *color,
233 GtkDataboxDataType type = GTK_DATABOX_POINTS, guint dotSize = 1);
234
236
248 gint AddY (guint length, gfloat *Y, guint indexSharedX, VDKColor *color,
249 GtkDataboxDataType type = GTK_DATABOX_POINTS, guint dotSize = 1);
250
251virtual void SetBackground(VDKRgb color, GtkStateType state);
252protected:
253 // Signal handling functions
254 static gint _zoomed(GtkDatabox *box,
255 GtkDataboxValue *top_left,
256 GtkDataboxValue *bottom_right,
257 gpointer);
258
259 static gint _marked(GtkDatabox *,
260 GtkDataboxCoord *mark,
261 gpointer gp);
262
263 static gint _selectionStarted(GtkDatabox *,
264 GtkDataboxCoord *mark,
265 gpointer gp);
266
267 static gint _selectionChanged(GtkDatabox *,
268 GtkDataboxCoord *mark,
269 GtkDataboxCoord *select,
270 gpointer gp);
271
272 static gint _selectionStoped(GtkDatabox *,
273 GtkDataboxCoord *mark,
274 GtkDataboxCoord *select,
275 gpointer gp);
276
277 static gint _selectionCanceled(GtkDatabox *,
278 gpointer gp);
279
280};
281#endif
provides a raw color object
Definition: colors.h:37
Databox widget.
Definition: vdkdatabox.h:101
gint AddY(guint length, gfloat *Y, guint indexSharedX, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
Add a dataset.
Definition: vdkdatabox.cc:209
VDKReadOnlyValueProp< VDKDataBox, GtkDataboxValue > TopLeft
Read the value of the top left corner of the window after a zoom.
Definition: vdkdatabox.h:121
gint RemoveData()
Remove all datasets.
Definition: vdkdatabox.cc:170
VDKReadOnlyValueProp< VDKDataBox, GtkDataboxValue > BottomRight
Read the value of the bottom right corner of the window after a zoom.
Definition: vdkdatabox.h:124
GtkDataboxValue GetValue(GtkDataboxCoord coord)
Get data value.
Definition: vdkdatabox.cc:103
gint AddX(guint length, gfloat *X, guint indexSharedY, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
Add a dataset.
Definition: vdkdatabox.cc:199
void GetExtrema(GtkDataboxValue &min, GtkDataboxValue &max, bool visible=true)
Get the extreme values.
Definition: vdkdatabox.cc:111
VDKReadWriteValueProp< VDKDataBox, bool > Scrollbars
Show or hides the scrollbars.
Definition: vdkdatabox.h:113
VDKReadWriteValueProp< VDKDataBox, bool > Rulers
Shows or hides the rulers.
Definition: vdkdatabox.h:109
VDKReadOnlyValueProp< VDKDataBox, GtkDataboxCoord > Mark
Read the value of the marked (where you clicked down the mouse) point.
Definition: vdkdatabox.h:127
void Redraw()
Redraw the databox. Use it after you change your datas.
Definition: vdkdatabox.cc:132
void Rescale()
Rescale the databox using the minimum and maximum values from the datasets associated with the databo...
Definition: vdkdatabox.cc:120
VDKColor * GetColor(int index)
Get the color of a dataset.
Definition: vdkdatabox.cc:138
gint AddXY(guint length, gfloat *X, gfloat *Y, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
Add a dataset.
Definition: vdkdatabox.cc:188
void SetColor(int index, VDKColor *color, bool redraw=true)
Set the color of a dataset.
Definition: vdkdatabox.cc:155
gint DestroyData()
Remove all datasets and destroy data associated with them.
Definition: vdkdatabox.cc:182
~VDKDataBox()
Destructor.
Definition: vdkdatabox.cc:70
virtual void SetBackground(VDKRgb color, GtkStateType state)
Definition: vdkdatabox.cc:317
VDKReadOnlyValueProp< VDKDataBox, GtkDataboxCoord > Select
Read the value of the selection.
Definition: vdkdatabox.h:130
VDKDataBox(VDKForm *owner)
Constructor.
Definition: vdkdatabox.cc:37
VDKReadWriteValueProp< VDKDataBox, bool > Zoom
Enable or disable the zoom.
Definition: vdkdatabox.h:117
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Definition: vdkobj.h:141
Provides a simple RGB color structure.
Definition: vdkutils.h:38