VDKDataBox Class Reference
Databox widget.
More...
#include <vdkdatabox.h>
Inheritance diagram for VDKDataBox:
List of all members.Public Member Functions
-
VDKDataBox (VDKForm *owner)
- Constructor.
-
~VDKDataBox ()
- Destructor.
- VDKColor * GetColor (int index)
- Get the color of a dataset.
- void SetColor (int index, VDKColor *color, bool redraw=true)
- Set the color of a dataset.
- GtkDataboxValue GetValue (GtkDataboxCoord coord)
- Get data value.
- void GetExtrema (GtkDataboxValue &min, GtkDataboxValue &max, bool visible=true)
- Get the extreme values.
- void Rescale (GtkDataboxValue min, GtkDataboxValue max)
- Rescale the databox using given minimum and maximum values.
-
void Rescale ()
- Rescale the databox using the minimum and maximum values from the datasets associated with the databox.
-
void Redraw ()
- Redraw the databox. Use it after you change your datas.
- gint RemoveData (gint index)
- Remove a single dataset.
- gint RemoveData ()
- Remove all datasets.
- gint DestroyData (gint index)
- Remove a single dataset and destroy data associated with it.
- gint DestroyData ()
- Remove all datasets and destroy data associated with them.
- gint AddXY (guint length, gfloat *X, gfloat *Y, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
- Add a dataset.
- gint AddX (guint length, gfloat *X, guint indexSharedY, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
- Add a dataset.
- gint AddY (guint length, gfloat *Y, guint indexSharedX, VDKColor *color, GtkDataboxDataType type=GTK_DATABOX_POINTS, guint dotSize=1)
- Add a dataset.
- virtual void SetBackground (VDKRgb color, GtkStateType state)
Public Attributes
-
VDKReadWriteValueProp< VDKDataBox,
bool > Rulers
- Shows or hides the rulers.
-
VDKReadWriteValueProp< VDKDataBox,
bool > Scrollbars
- Show or hides the scrollbars.
-
VDKReadWriteValueProp< VDKDataBox,
bool > Zoom
- Enable or disable the zoom.
-
VDKReadOnlyValueProp< VDKDataBox,
GtkDataboxValue > TopLeft
- Read the value of the top left corner of the window after a zoom.
-
VDKReadOnlyValueProp< VDKDataBox,
GtkDataboxValue > BottomRight
- Read the value of the bottom right corner of the window after a zoom.
-
VDKReadOnlyValueProp< VDKDataBox,
GtkDataboxCoord > Mark
- Read the value of the marked (where you clicked down the mouse) point.
-
VDKReadOnlyValueProp< VDKDataBox,
GtkDataboxCoord > Select
- Read the value of the selection.
Detailed Description
Databox widget.
This is a simple (almost 1:1) wrapper of GtkDatabox 0.1.11.0 widget. Some of the functions have been modified in order to return a value, instead to change the value sent as parameter, as I have thought this is more in the VDK spirit. Also, wherever the case, I used a VDKColor instead of GdkColor, for the same reason: VDK spirit.
The data box has the following styles (but check GtkDataboxDataType for other styles):
- GTK_DATABOX_NOT_DISPLAYED
- GTK_DATABOX_POINTS
- GTK_DATABOX_LINES
- GTK_DATABOX_BARS
- GTK_DATABOX_CROSS_SIMPLE,
- GTK_DATABOX_GRID
Public Members
Properties
- bool Rulers
- bool Scrollbars
- bool Zoom
- GtkDataboxValue Mark (read-only)
- GtkDataboxValue Select (read-only)
- GtkDataboxCoord TopLeft (read-only)
- GtkDataboxCoord BottomRight (read-only)
Static Table Signals
- databox_zoomed_signal Emitted when databox is zoomed.
- databox_marked_signal Emitted when mouse is clicked in databox.
- databox_selection_started_signal Emitted when a selection is started in databox.
- databox_selection_changed_signal Emitted when the selection is changed.
- databox_selection_stopped_signal Emitted when the selection is finished.
- databox_selection_canceled_signal Emitted when the selection is canceled (by clicking outside the selection).
Dynamic Table Signals
- "databox_zoomed"
- "databox_marked"
- "databox_selection_started"
- "databox_selection_changed"
- "databox_selection_stopped"
- "databox_selection_canceled"
Dynamic table signals are different from the equivalent databox signals in that that they do not send values of the marked point or selection, for instance. These values can be read using the read-only properties.
- Author:
- Ionutz Borcoman <borco@borco-ei.eng.hokudai.ac.jp>
- Date:
- March 1999
- Author:
- Mario Motta <mmotta@guest.net> that have done the porting to vdk 2.x
- Date:
- May 2002
Member Function Documentation
gint VDKDataBox::AddX |
( |
guint |
length, |
|
|
gfloat * |
X, |
|
|
guint |
indexSharedY, |
|
|
VDKColor * |
color, |
|
|
GtkDataboxDataType |
type = GTK_DATABOX_POINTS , |
|
|
guint |
dotSize = 1 |
|
) |
|
|
|
Add a dataset.
You must supply a X vector of data and an index to an existent Y vector. Also the number of points and a color to be used for ploting the dataset. If the number of points of X and shared Y vector are different, an error is generated. - Parameters:
-
| length | number of points from the dataset. |
| X | pointer to x vector of data. |
| indexSharedY | index to a shared y vector of data. |
| color | color for the ploting the dataset |
| type | type of points. |
| dotsize | size of the dots used. |
- Returns:
- index of the dataset added, on success, or -1, on error.
|
gint VDKDataBox::AddXY |
( |
guint |
length, |
|
|
gfloat * |
X, |
|
|
gfloat * |
Y, |
|
|
VDKColor * |
color, |
|
|
GtkDataboxDataType |
type = GTK_DATABOX_POINTS , |
|
|
guint |
dotSize = 1 |
|
) |
|
|
|
Add a dataset.
Both X and Y must be supplied. Also the number of points and a color to be used for ploting the dataset. - Parameters:
-
| length | number of points from the dataset. |
| X | pointer to x vector of data. |
| Y | pointer to y vector of data. |
| color | color for the ploting the dataset |
| type | type of points. |
| dotsize | size of the dots used. |
- Returns:
- index of the dataset added, on success, or -1, on error.
|
gint VDKDataBox::AddY |
( |
guint |
length, |
|
|
gfloat * |
Y, |
|
|
guint |
indexSharedX, |
|
|
VDKColor * |
color, |
|
|
GtkDataboxDataType |
type = GTK_DATABOX_POINTS , |
|
|
guint |
dotSize = 1 |
|
) |
|
|
|
Add a dataset.
You must supply a Y vector of data and an index to an existent X vector. Also the number of points and a color to be used for ploting the dataset. If the number of points of X and shared Y vector are different, an error is generated. - Parameters:
-
| length | number of points from the dataset. |
| Y | pointer to y vector of data. |
| indexSharedX | index to a shared x vector of data. |
| color | color for the ploting the dataset |
| type | type of points. |
| dotsize | size of the dots used. |
- Returns:
- index of the dataset added, on success, or -1, on error.
|
gint VDKDataBox::DestroyData |
( |
|
) |
|
|
|
Remove all datasets and destroy data associated with them.
- Returns:
- 0 on success.
- See also:
- Destroy(gint)
|
gint VDKDataBox::DestroyData |
( |
gint |
index |
) |
|
|
|
Remove a single dataset and destroy data associated with it.
- Parameters:
-
| index | index of dataset to be destroyed. |
- Returns:
- 0 on success.
- Bug:
- this function destroys data associated using g_free(). Do not use it, unless you have used g_new() to allocate the memory for your data.
|
VDKColor * VDKDataBox::GetColor |
( |
int |
index |
) |
|
|
|
Get the color of a dataset.
- Parameters:
-
- Returns:
- pointer to a VDKColor identical with the one of the dataset.
- Bug:
- The returned value is a pointer to a new allocated VDKColor. Therefore, it will not reflect furthure changes in the color of the index dataset. You can free memory associated with it using Destroy() method.
|
void VDKDataBox::GetExtrema |
( |
GtkDataboxValue & |
min, |
|
|
GtkDataboxValue & |
max, |
|
|
bool |
visible = true |
|
) |
|
|
|
Get the extreme values.
- Parameters:
-
| min | returns the minimum x and y values of the databox. |
| max | returns the maximum x and y values of the databox. |
| visible | if true, then min and max are computed for the visible window; otherwise, they are computed for the whole databox. |
|
GtkDataboxValue VDKDataBox::GetValue |
( |
GtkDataboxCoord |
coord |
) |
|
|
|
Get data value.
- Parameters:
-
| coord | screen coordinates of a point. |
- Returns:
- data value associated with the coord.
|
gint VDKDataBox::RemoveData |
( |
|
) |
|
|
|
Remove all datasets.
- Returns:
- 0 on success.
|
gint VDKDataBox::RemoveData |
( |
gint |
index |
) |
|
|
|
Remove a single dataset.
- Parameters:
-
| index | index of dataset to be removed. |
- Returns:
- 0 on success.
|
void VDKDataBox::Rescale |
( |
GtkDataboxValue |
min, |
|
|
GtkDataboxValue |
max |
|
) |
|
|
|
Rescale the databox using given minimum and maximum values.
- Parameters:
-
| min | the minimum x and y values. |
| max | the maximum x and y values. |
|
void VDKDataBox::SetBackground |
( |
VDKRgb |
color, |
|
|
GtkStateType |
state |
|
) |
[virtual] |
|
|
Sets object background - Parameters:
-
| color | a VDKRgb object |
| state | can be one of the gtk+ widget states |
Reimplemented from VDKObject. |
void VDKDataBox::SetColor |
( |
int |
index, |
|
|
VDKColor * |
color, |
|
|
bool |
redraw = true |
|
) |
|
|
|
Set the color of a dataset.
- Parameters:
-
| index | dataset index |
| color | new color for the dataset |
| redraw | constrols if we call or not a subsequent Redraw(). Set to false if you don't want a redraw. |
|
The documentation for this class was generated from the following files:
Generated on Tue Aug 17 12:39:51 2004 for vdk 2.4.0 by
1.3.7