vdk 2.4.0
Public Member Functions | Public Attributes | List of all members
VDKDataBox Class Reference

Databox widget. More...

#include <vdkdatabox.h>

Inheritance diagram for VDKDataBox:
VDKObject VDKNotCopyAble

Public Member Functions

 VDKDataBox (VDKForm *owner)
 Constructor.
 ~VDKDataBox ()
 Destructor.
VDKColorGetColor (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 Member Functions inherited from VDKObject
VDKRgb GetBackground (GtkStateType state=GTK_STATE_NORMAL)
VDKRgb GetForeground (GtkStateType state=GTK_STATE_NORMAL)
 VDKObject (VDKForm *owner=NULL)
 VDKObject (VDKForm *owner, GtkWidget *widget)
virtual ~VDKObject ()
bool Destroy ()
virtual int isA ()
VDKFormOwner ()
virtual GtkWidget * Widget ()
GtkWidget * ConnectingWidget ()
GtkWidget * WrappedWidget ()
virtual void SetFont (VDKFont *f)
VDKFontGetFont ()
void SetVisible (bool visible)
bool GetVisible ()
void SetCursor (VDKCursorType)
VDKCursorType GetCursor ()
virtual void SetForeground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
void SetSize (int w, int h)
void SetUsize (VDKPoint s)
virtual void SetTip (char *)
virtual void Add (VDKObject *obj, int justify=l_justify, int expand=TRUE, int fill=TRUE, int padding=0)
ItemListItems ()
void Draw (GdkRectangle *area=NULL)
virtual void Setup ()
void SignalEmit (int signal)
void SignalEmit (char *sig)
void SignalEmitParent (int signal)
void SignalEmitParent (char *sig)
void GrabFocus ()
VDKObjectParent (VDKObject *p=NULL)
int SignalConnect (VDKObject *obj, char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
int SignalConnect (char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
bool SignalDisconnect (int connection)
int EventConnect (VDKObject *obj, char *event, bool(VDKObject::*method)(VDKObject *, GdkEvent *), bool after=false)
int EventConnect (char *, bool(VDKObject::*)(VDKObject *, GdkEvent *), bool after=false)
bool EventDisconnect (int connection)

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.
- Public Attributes inherited from VDKObject
VDKReadWriteValueProp
< VDKObject, VDKRgb
NormalBackground
VDKReadWriteValueProp
< VDKObject, VDKFont * > 
Font
SizeObjectProp Usize
VDKReadWriteValueProp
< VDKObject, bool > 
Enabled
VDKReadWriteValueProp
< VDKObject, VDKCursorType > 
Cursor
VDKReadWriteValueProp
< VDKObject, bool > 
Visible

Additional Inherited Members

- Protected Attributes inherited from VDKObject
VDKObjectSignal s_clicked
GtkWidget * widget
GtkWidget * sigwid
VDKObjectparent

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):

Public Members

Properties

Static Table Signals

Dynamic Table Signals

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.nosp@m.@bor.nosp@m.co-ei.nosp@m..eng.nosp@m..hoku.nosp@m.dai..nosp@m.ac.jp
Date
March 1999
Author
Mario Motta mmott.nosp@m.a@gu.nosp@m.est.n.nosp@m.et 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
lengthnumber of points from the dataset.
Xpointer to x vector of data.
indexSharedYindex to a shared y vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize 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
lengthnumber of points from the dataset.
Xpointer to x vector of data.
Ypointer to y vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize 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
lengthnumber of points from the dataset.
Ypointer to y vector of data.
indexSharedXindex to a shared x vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize of the dots used.
Returns
index of the dataset added, on success, or -1, on error.
gint VDKDataBox::DestroyData ( gint  index)

Remove a single dataset and destroy data associated with it.

Parameters
indexindex 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.
gint VDKDataBox::DestroyData ( )

Remove all datasets and destroy data associated with them.

Returns
0 on success.
See Also
Destroy(gint)
VDKColor * VDKDataBox::GetColor ( int  index)

Get the color of a dataset.

Parameters
indexdataset index
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
minreturns the minimum x and y values of the databox.
maxreturns the maximum x and y values of the databox.
visibleif 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
coordscreen coordinates of a point.
Returns
data value associated with the coord.
gint VDKDataBox::RemoveData ( gint  index)

Remove a single dataset.

Parameters
indexindex of dataset to be removed.
Returns
0 on success.
gint VDKDataBox::RemoveData ( )

Remove all datasets.

Returns
0 on success.
void VDKDataBox::Rescale ( GtkDataboxValue  min,
GtkDataboxValue  max 
)

Rescale the databox using given minimum and maximum values.

Parameters
minthe minimum x and y values.
maxthe maximum x and y values.
void VDKDataBox::SetBackground ( VDKRgb  color,
GtkStateType  state 
)
virtual

Sets object background

Parameters
colora VDKRgb object
statecan 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
indexdataset index
colornew color for the dataset
redrawconstrols 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: