GwyRuler

GwyRuler — Base class for GwyHRuler and GwyVRuler

Synopsis




struct      GwyRuler;
struct      GwyRulerClass;
void        gwy_ruler_set_range             (GwyRuler *ruler,
                                             gdouble lower,
                                             gdouble upper,
                                             gdouble position,
                                             gdouble max_size);
void        gwy_ruler_draw_ticks            (GwyRuler *ruler);
void        gwy_ruler_draw_pos              (GwyRuler *ruler);
void        gwy_ruler_get_range             (GwyRuler *ruler,
                                             gdouble *lower,
                                             gdouble *upper,
                                             gdouble *position,
                                             gdouble *max_size);
void        gwy_ruler_set_units             (GwyRuler *ruler,
                                             GwySIUnit *units);
GwySIUnit*  gwy_ruler_get_units             (GwyRuler *ruler);
GwyUnitsPlacement gwy_ruler_get_units_placement
                                            (GwyRuler *ruler);
void        gwy_ruler_set_units_placement   (GwyRuler *ruler,
                                             GwyUnitsPlacement placement);

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GwyRuler
                     +----GwyHRuler
                     +----GwyVRuler

Implemented Interfaces

GwyRuler implements AtkImplementorIface.

Properties


  "lower"                gdouble              : Read / Write
  "max-size"             gdouble              : Read / Write
  "position"             gdouble              : Read / Write
  "units-placement"      GwyUnitsPlacement    : Read / Write
  "upper"                gdouble              : Read / Write

Description

GwyRuler is a ruler similar to GtkRuler, but it is more suited for a scientific application. It is scale-independent and thus has no arbitrary limits on the ranges or interpretation of displayed values. It can display units on the ruler (this can be controlled with gwy_ruler_set_units_placement()) and cooperates with GwySIUnit (see gwy_ruler_set_units()). It also better follows Gtk+ theme than GtkRuler.

Details

struct GwyRuler

struct GwyRuler;


struct GwyRulerClass

struct GwyRulerClass {

    GtkWidgetClass parent_class;

    void (*draw_ticks) (GwyRuler *ruler);
    void (*draw_pos)   (GwyRuler *ruler);

    gpointer reserved1;
    gpointer reserved2;
};


gwy_ruler_set_range ()

void        gwy_ruler_set_range             (GwyRuler *ruler,
                                             gdouble lower,
                                             gdouble upper,
                                             gdouble position,
                                             gdouble max_size);

Sets range and current value of a ruler.

ruler : A GwyRuler
lower : Lower limit of the ruler.
upper : Upper limit of the ruler.
position : Current position of the mark on the ruler.
max_size : Maximum value used for calculating size of text labels.

gwy_ruler_draw_ticks ()

void        gwy_ruler_draw_ticks            (GwyRuler *ruler);

ruler :

gwy_ruler_draw_pos ()

void        gwy_ruler_draw_pos              (GwyRuler *ruler);

ruler :

gwy_ruler_get_range ()

void        gwy_ruler_get_range             (GwyRuler *ruler,
                                             gdouble *lower,
                                             gdouble *upper,
                                             gdouble *position,
                                             gdouble *max_size);

Retrieves values indicating the range and current position of a GwyRuler. See gwy_ruler_set_range().

ruler : A GwyRuler
lower : Location to store lower limit of the ruler, or NULL
upper : Location to store upper limit of the ruler, or NULL
position : Location to store the current position of the mark on the ruler, or NULL
max_size : Location to store the maximum size of the ruler used when calculating the space to leave for the text, or NULL.

gwy_ruler_set_units ()

void        gwy_ruler_set_units             (GwyRuler *ruler,
                                             GwySIUnit *units);

Sets the base units a ruler displays.

Setting units to NULL effectively disables them.

ruler : A GwyRuler.
units : The base units this ruler should display.

gwy_ruler_get_units ()

GwySIUnit*  gwy_ruler_get_units             (GwyRuler *ruler);

Returns the base units a ruler uses.

ruler : A GwyRuler.
Returns : The units the rules uses.

gwy_ruler_get_units_placement ()

GwyUnitsPlacement gwy_ruler_get_units_placement
                                            (GwyRuler *ruler);

Gets current units placement of ruler ruler.

ruler : A GwyRuler
Returns : The units placement.

gwy_ruler_set_units_placement ()

void        gwy_ruler_set_units_placement   (GwyRuler *ruler,
                                             GwyUnitsPlacement placement);

Sets whether and where units should be placed on the ruler.

ruler : A GwyRuler
placement : Units placement specification.

Properties

"lower" (gdouble : Read / Write)

Lower limit of ruler.

"max-size" (gdouble : Read / Write)

Maximum size of the ruler.

"position" (gdouble : Read / Write)

Position of mark on the ruler.

"units-placement" (GwyUnitsPlacement : Read / Write)

The placement of units on the ruler, if any.

"upper" (gdouble : Read / Write)

Upper limit of ruler.

See Also

GwyVRuler, GwyHRuler, GwySIUnit.