gtkdataboxmm
0.9.3
|
#include <gtkdataboxmm/databox.h>
Public Member Functions | |
virtual | ~Databox () |
GtkDatabox* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkDatabox* | gobj () const |
Provides access to the underlying C GtkObject. | |
Databox () | |
Databox (Gtk::Table** table, bool scrollbar_x=false, bool scrollbar_y=false, bool ruler_x=false, bool ruler_y=false) | |
int | graph_add (const Glib::RefPtr< Graph >& graph) |
Adds the graph to the box. | |
int | graph_remove (const Glib::RefPtr< Graph >& graph) |
Removes the graph from the box once. | |
int | graph_remove_all () |
Removes all graphs from the box. | |
int | auto_rescale (float border) |
This function is similar to set_total_limits(). | |
int | calculate_extrema (float& min_x, float& max_x, float& min_y, float& max_y) |
Determines the minimum and maximum x and y values of all Gtk::DataboxGraph objects which have been added to the Gtk::Databox widget via graph_add(). | |
void | set_total_limits (float left, float right, float top, float bottom) |
This function is used to set the limits of the total display area of box. | |
void | set_visible_limits (float left, float right, float top, float bottom) |
This function is used to set the limits of the visible display area of box. | |
void | get_total_limits (float&left, float&right, float& top, float& bottom) const |
Gives the total limits (as set by auto_rescale() or set_total_limits()). | |
void | get_visible_limits (float&left, float&right, float& top, float& bottom) const |
Gives the current visible limits. | |
void | set_adjustment_x (Gtk::Adjustment& adj) |
Setter function for the Gtk::Databox::property_adjustment_x() property. | |
void | set_adjustment_y (Gtk::Adjustment& adj) |
Setter function for the Gtk::Databox::property_adjustment_y() property. | |
Gtk::Adjustment* | get_adjustment_x () |
Getter function for the Gtk::Databox::property_adjustment_x() property. | |
const Gtk::Adjustment* | get_adjustment_x () const |
Getter function for the Gtk::Databox::property_adjustment_x() property. | |
Gtk::Adjustment* | get_adjustment_y () |
Getter function for the Gtk::Databox::property_adjustment_y() property. | |
const Gtk::Adjustment* | get_adjustment_y () const |
Getter function for the Gtk::Databox::property_adjustment_y() property. | |
void | set_ruler_x (const Ruler& ruler) |
Setter function for the Gtk::Databox::property_ruler_x() property. | |
void | set_ruler_y (const Ruler& ruler) |
Setter function for the Gtk::Databox::property_ruler_y() property. | |
const Ruler* | get_ruler_x () const |
Getter function for the Gtk::Databox::property_ruler_x() property. | |
const Ruler* | get_ruler_y () const |
Getter function for the Gtk::Databox::property_ruler_y() property. | |
void | set_enable_selection (bool enable) |
Setter function for the Gtk::Databox::property_enable_selection() property. | |
void | set_enable_zoom (bool enable) |
Setter function for the Gtk::Databox::property_enable_zoom() property. | |
bool | get_enable_selection () const |
Getter function for the Gtk::Databox::property_enable_selection() property. | |
bool | get_enable_zoom () const |
Getter function for the Gtk::Databox::property_enable_selection() property. | |
void | zoom_to_selection () |
This is equivalent to left-clicking into the selected area. | |
void | zoom_out () |
This is equivalent to right-clicking into the box. | |
void | zoom_home () |
This is equivalent to shift right-clicking into the box. | |
short | value_to_pixel_x (float value) |
Calculates the horizontal pixel coordinate which represents the x value. | |
short | value_to_pixel_y (float value) |
Calculates the horizontal pixel coordinate which represents the x value. | |
float | pixel_to_value_x (short pixel) |
Calculates the x value which is represented by the horizontal pixel coordinate. | |
float | pixel_to_value_y (short pixel) |
Calculates the y value which is represented by the vertical pixel coordinate. | |
Glib::RefPtr< Gdk::Pixmap > | get_backing_pixmap () const |
This function returns the pixmap which is used by box and its Gtk::DataboxGraph objects for drawing operations before copying the result to the screen. | |
Glib::SignalProxy0< void > | signal_zoomed () |
Glib::SignalProxy0< void > | signal_selection_canceled () |
Glib::PropertyProxy< bool > | property_enable_selection () |
Enable selection of areas via mouse (TRUE/FALSE). | |
Glib::PropertyProxy_ReadOnly < bool > | property_enable_selection () const |
Enable selection of areas via mouse (TRUE/FALSE). | |
Glib::PropertyProxy< bool > | property_enable_zoom () |
Enable zooming in or out via mouse click (TRUE/FALSE). | |
Glib::PropertyProxy_ReadOnly < bool > | property_enable_zoom () const |
Enable zooming in or out via mouse click (TRUE/FALSE). | |
Glib::PropertyProxy < Gtk::Adjustment* > | property_adjustment_x () |
GtkAdjustment for horizontal scrolling. | |
Glib::PropertyProxy_ReadOnly < Gtk::Adjustment* > | property_adjustment_x () const |
GtkAdjustment for horizontal scrolling. | |
Glib::PropertyProxy < Gtk::Adjustment* > | property_adjustment_y () |
GtkAdjustment for vertical scrolling. | |
Glib::PropertyProxy_ReadOnly < Gtk::Adjustment* > | property_adjustment_y () const |
GtkAdjustment for vertical scrolling. | |
Glib::PropertyProxy< Ruler > | property_ruler_x () |
A horizontal GtkDataboxRuler or NULL. | |
Glib::PropertyProxy_ReadOnly < Ruler > | property_ruler_x () const |
A horizontal GtkDataboxRuler or NULL. | |
Glib::PropertyProxy< Ruler > | property_ruler_y () |
A vertical GtkDataboxRuler or NULL. | |
Glib::PropertyProxy_ReadOnly < Ruler > | property_ruler_y () const |
A vertical GtkDataboxRuler or NULL. |
Protected Member Functions | |
virtual void | on_zoomed () |
This is a default handler for the signal signal_zoomed(). | |
virtual void | on_selection_canceled () |
This is a default handler for the signal signal_selection_canceled(). |
Related Functions | |
(Note that these are not member functions.) | |
GDatabox::Databox* | wrap (GtkDatabox* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
|
virtual |
GDatabox::Databox::Databox | ( | ) |
|
explicit |
int GDatabox::Databox::auto_rescale | ( | float | border | ) |
This function is similar to set_total_limits().
It sets the total limits to match the data extrema (see calculate_extrema()). If you do not like data pixels exactly at the widget's border, you can add modify the limits using the border parameter: The limits are extended by border*(max-min) if max!=min. If max==min, they are extended by border* max (otherwise the data could not be scaled to the pixel realm).
After calling this function, x values grow from left to right, y values grow from bottom to top.
border | Relative border width (e.g. 0.1 means that the border on each side is 10% of the data area). |
int GDatabox::Databox::calculate_extrema | ( | float & | min_x, |
float & | max_x, | ||
float & | min_y, | ||
float & | max_y | ||
) |
Determines the minimum and maximum x and y values of all Gtk::DataboxGraph objects which have been added to the Gtk::Databox widget via graph_add().
min_x | Will be filled with the lowest x value of all datasets. |
max_x | Will be filled with the highest x value of all datasets. |
min_y | Will be filled with the lowest y value of all datasets. |
max_y | Will be filled with the highest y value of all datasets. |
Gtk::Adjustment* GDatabox::Databox::get_adjustment_x | ( | ) |
Getter function for the Gtk::Databox::property_adjustment_x() property.
const Gtk::Adjustment* GDatabox::Databox::get_adjustment_x | ( | ) | const |
Getter function for the Gtk::Databox::property_adjustment_x() property.
Gtk::Adjustment* GDatabox::Databox::get_adjustment_y | ( | ) |
Getter function for the Gtk::Databox::property_adjustment_y() property.
const Gtk::Adjustment* GDatabox::Databox::get_adjustment_y | ( | ) | const |
Getter function for the Gtk::Databox::property_adjustment_y() property.
Glib::RefPtr<Gdk::Pixmap> GDatabox::Databox::get_backing_pixmap | ( | ) | const |
This function returns the pixmap which is used by box and its Gtk::DataboxGraph objects for drawing operations before copying the result to the screen.
The function is typically called by the Gtk::DataboxGraph objects.
bool GDatabox::Databox::get_enable_selection | ( | ) | const |
Getter function for the Gtk::Databox::property_enable_selection() property.
bool GDatabox::Databox::get_enable_zoom | ( | ) | const |
Getter function for the Gtk::Databox::property_enable_selection() property.
const Ruler* GDatabox::Databox::get_ruler_x | ( | ) | const |
Getter function for the Gtk::Databox::property_ruler_x() property.
const Ruler* GDatabox::Databox::get_ruler_y | ( | ) | const |
Getter function for the Gtk::Databox::property_ruler_y() property.
void GDatabox::Databox::get_total_limits | ( | float & | left, |
float & | right, | ||
float & | top, | ||
float & | bottom | ||
) | const |
Gives the total limits (as set by auto_rescale() or set_total_limits()).
left | Space for total left value or #0 . |
right | Space for total right value or #0 . |
top | Space for total top value or #0 . |
bottom | Space for total bottom value or #0 . |
void GDatabox::Databox::get_visible_limits | ( | float & | left, |
float & | right, | ||
float & | top, | ||
float & | bottom | ||
) | const |
Gives the current visible limits.
These differ from those given by get_total_limits() if you zoomed into the data for instance by zoom_to_selection() or set_visible_limits() (these values can be changed by scrolling, of course).
left | Space for visible left value or #0 . |
right | Space for visible right value or #0 . |
top | Space for visible top value or #0 . |
bottom | Space for visible bottom value or #0 . |
|
inline |
Provides access to the underlying C GtkObject.
|
inline |
Provides access to the underlying C GtkObject.
int GDatabox::Databox::graph_add | ( | const Glib::RefPtr< Graph >& | graph | ) |
Adds the graph to the box.
The next time the box is re-drawn, the graph will be shown.
It might be becessary to modify the total_limits in order for the graph to be displayed properly (see set_total_limits()). @param graph A graph, e.g. a Gtk::DataboxPoints or a Gtk::DataboxGrid object. @return 0 on success, -1 otherwise.
int GDatabox::Databox::graph_remove | ( | const Glib::RefPtr< Graph >& | graph | ) |
Removes the graph from the box once.
The next time the box is re-drawn, the graph will not be shown (unless it was added more than once).
graph | A graph, e.g. a Gtk::DataboxPoints or a Gtk::DataboxGrid object. |
int GDatabox::Databox::graph_remove_all | ( | ) |
Removes all graphs from the box.
The next time the box is re-drawn, no graphs will be shown.
|
protectedvirtual |
This is a default handler for the signal signal_selection_canceled().
|
protectedvirtual |
This is a default handler for the signal signal_zoomed().
float GDatabox::Databox::pixel_to_value_x | ( | short | pixel | ) |
Calculates the x value which is represented by the horizontal pixel coordinate.
Pixel coordinates are relative to the top-left corner of the box which is equivalent to (0,0).
pixel | A horizontal pixel coordinate. |
float GDatabox::Databox::pixel_to_value_y | ( | short | pixel | ) |
Calculates the y value which is represented by the vertical pixel coordinate.
Pixel coordinates are relative to the top-left corner of the box which is equivalent to (0,0).
pixel | A vertical pixel coordinate. |
Glib::PropertyProxy< Gtk::Adjustment* > GDatabox::Databox::property_adjustment_x | ( | ) |
GtkAdjustment for horizontal scrolling.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > GDatabox::Databox::property_adjustment_x | ( | ) | const |
GtkAdjustment for horizontal scrolling.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Gtk::Adjustment* > GDatabox::Databox::property_adjustment_y | ( | ) |
GtkAdjustment for vertical scrolling.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > GDatabox::Databox::property_adjustment_y | ( | ) | const |
GtkAdjustment for vertical scrolling.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > GDatabox::Databox::property_enable_selection | ( | ) |
Enable selection of areas via mouse (TRUE/FALSE).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > GDatabox::Databox::property_enable_selection | ( | ) | const |
Enable selection of areas via mouse (TRUE/FALSE).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > GDatabox::Databox::property_enable_zoom | ( | ) |
Enable zooming in or out via mouse click (TRUE/FALSE).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > GDatabox::Databox::property_enable_zoom | ( | ) | const |
Enable zooming in or out via mouse click (TRUE/FALSE).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Ruler > GDatabox::Databox::property_ruler_x | ( | ) |
A horizontal GtkDataboxRuler or NULL.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Ruler > GDatabox::Databox::property_ruler_x | ( | ) | const |
A horizontal GtkDataboxRuler or NULL.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Ruler > GDatabox::Databox::property_ruler_y | ( | ) |
A vertical GtkDataboxRuler or NULL.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Ruler > GDatabox::Databox::property_ruler_y | ( | ) | const |
A vertical GtkDataboxRuler or NULL.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void GDatabox::Databox::set_adjustment_x | ( | Gtk::Adjustment & | adj | ) |
Setter function for the Gtk::Databox::property_adjustment_x() property.
Normally, it should not be required to use this function, see property documentation.
adj | A Gtk::Adjustment object. |
void GDatabox::Databox::set_adjustment_y | ( | Gtk::Adjustment & | adj | ) |
Setter function for the Gtk::Databox::property_adjustment_y() property.
Normally, it should not be required to use this function, see property documentation.
adj | A Gtk::Adjustment object. |
void GDatabox::Databox::set_enable_selection | ( | bool | enable | ) |
Setter function for the Gtk::Databox::property_enable_selection() property.
enable | Whether selection via mouse is enabled or not. |
void GDatabox::Databox::set_enable_zoom | ( | bool | enable | ) |
Setter function for the Gtk::Databox::property_enable_zoom() property.
enable | Whether zoom via mouse is enabled or not. |
void GDatabox::Databox::set_ruler_x | ( | const Ruler& | ruler | ) |
Setter function for the Gtk::Databox::property_ruler_x() property.
ruler | A Gtk::DataboxRuler object. |
void GDatabox::Databox::set_ruler_y | ( | const Ruler& | ruler | ) |
Setter function for the Gtk::Databox::property_ruler_y() property.
ruler | An Gtk::DataboxRuler object. |
void GDatabox::Databox::set_total_limits | ( | float | left, |
float | right, | ||
float | top, | ||
float | bottom | ||
) |
This function is used to set the limits of the total display area of box.
This function can be used to invert the orientation of the displayed graphs, e.g. top=-1000 and bottom=0.
Side effect: The box also internally calls set_visible_limits() with the same values.
left | Left total limit. |
right | Right total limit. |
top | Top total limit. |
bottom | Bottom total limit. |
void GDatabox::Databox::set_visible_limits | ( | float | left, |
float | right, | ||
float | top, | ||
float | bottom | ||
) |
This function is used to set the limits of the visible display area of box.
The visible display area can be section of the total area, i.e. the box zooms in, showing only a part of the complete picture.
The orientation of the values have to be the same as in set_total_limits() and the visible limits have to be within the total limits. The values will not be used otherwise.
Side effect: The box emits Gtk::Databox::signal_zoomed().
left | Left visible limit. |
right | Right visible limit. |
top | Top visible limit. |
bottom | Bottom visible limit. |
Glib::SignalProxy0< void > GDatabox::Databox::signal_selection_canceled | ( | ) |
void on_my_selection_canceled()
This signal is emitted after a right click outside a selection rectangle.
Glib::SignalProxy0< void > GDatabox::Databox::signal_zoomed | ( | ) |
void on_my_zoomed()
This signal is emitted each time the zoom of the widget is changed, see for example Gtk::Databox::zoom_to_selection(), Gtk::Databox::set_visible_limits().
short GDatabox::Databox::value_to_pixel_x | ( | float | value | ) |
Calculates the horizontal pixel coordinate which represents the x value.
Pixel coordinates are relative to the top-left corner of the box which is equivalent to (0,0).
value | An x value. |
short GDatabox::Databox::value_to_pixel_y | ( | float | value | ) |
Calculates the horizontal pixel coordinate which represents the x value.
Pixel coordinates are relative to the top-left corner of the box which is equivalent to (0,0).
value | An x value. |
void GDatabox::Databox::zoom_home | ( | ) |
This is equivalent to shift right-clicking into the box.
This function works, if the attribute #enable-zoom is set to #true
. It is equivalent to calling the set_visible_limits() with the total limits.
void GDatabox::Databox::zoom_out | ( | ) |
This is equivalent to right-clicking into the box.
This function works, if the attribute #enable-zoom is set to #true
. Calling the function then zooms out by a factor of 2 in both dimensions (the maximum is defined by the total limits, see set_total_limits()).
Side effect: The box emits Gtk::Databox::signal_zoomed().
void GDatabox::Databox::zoom_to_selection | ( | ) |
This is equivalent to left-clicking into the selected area.
This function works, if the attribute #enable-zoom is set to #true
. Calling the function then zooms to the area selected with the mouse.
Side effect: The box emits Gtk::Databox::signal_zoomed().
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |