Top |
GtkDataboxRulerGtkDataboxRuler — An improved version of the GtkRuler. |
guint | box-shadow | Read / Write |
guint | draw-position | Read / Write |
guint | draw-subticks | Read / Write |
guint | draw-ticks | Read / Write |
guint | invert-edge | Read / Write |
char * | linear-label-format | Read / Write |
char * | log-label-format | Read / Write |
double | lower | Read / Write |
guint | manual-tick-cnt | Read / Write |
gpointer | manual-tick-labels | Read / Write |
gpointer | manual-ticks | Read / Write |
guint | max-length | Read / Write |
guint | orientation | Read / Write / Construct Only |
double | position | Read / Write |
guint | text-alignment | Read / Write |
guint | text-hoffset | Read / Write |
guint | text-orientation | Read / Write |
double | upper | Read / Write |
struct | GtkDataboxRuler |
struct | GtkDataboxRulerClass |
GtkDataboxRulerPrivate | |
#define | GTK_DATABOX_RULER_MAX_MAX_LENGTH |
GtkDataboxRuler is a widget for the GTK+ library similar to GtkRuler.
It is improved in several ways:
It supports linear and logarithmic scales.
In the vertical orientation, the labels are rotated 90° (instead of being written as a vertical column of horizontal characters). This increases readability.
It works for very small and very large value ranges.
GtkWidget *
gtk_databox_ruler_new (GtkOrientation orientation
);
Creates a new GtkDataboxRuler widget with the given orientation
(horizontal or vertical).
void gtk_databox_ruler_set_range (GtkDataboxRuler *ruler
,gdouble lower
,gdouble upper
,gdouble position
);
Sets values indicating the range and current position of a GtkDataboxRuler.
void gtk_databox_ruler_set_max_length (GtkDataboxRuler *ruler
,guint max_length
);
This function sets the maximum number of digits to be used for each tick
label of the ruler
.
The max_length
cannot be smaller than 2 and not bigger than
GTK_DATABOX_RULER_MAX_MAX_LENGTH.
void gtk_databox_ruler_set_scale_type (GtkDataboxRuler *ruler
,guint scale_type
);
This function sets the scale type of the ruler
.
ruler |
A GtkDataboxRuler widget |
|
scale_type |
The new scale type for |
void gtk_databox_ruler_get_range (GtkDataboxRuler *ruler
,gdouble *lower
,gdouble *upper
,gdouble *position
);
Retrieves values indicating the range and current position of a GtkDataboxRuler.
See gtk_databox_ruler_set_range()
.
guint
gtk_databox_ruler_get_max_length (GtkDataboxRuler *ruler
);
This function returns the maximum number of digits to be used for each tick
label of the ruler
.
GtkDataboxScaleType
gtk_databox_ruler_get_scale_type (GtkDataboxRuler *ruler
);
This function returns the scale type of the ruler
(linear or logarithmic).
void gtk_databox_ruler_set_orientation (GtkDataboxRuler *ruler
,GtkOrientation orientation
);
Sets the orientation of the ruler
(horizontal or vertical).
GtkOrientation
gtk_databox_ruler_get_orientation (GtkDataboxRuler *ruler
);
Gets the orientation of the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_text_orientation (GtkDataboxRuler *ruler
,GtkOrientation orientation
);
Sets the text orientation of the ruler
(vertical).
GtkOrientation
gtk_databox_ruler_get_text_orientation
(GtkDataboxRuler *ruler
);
Gets the text orientation of the ruler
(horizontal or vertical).
Horizontal rulers always have horizontal text
void gtk_databox_ruler_set_text_alignment (GtkDataboxRuler *ruler
,PangoAlignment alignment
);
Sets the text alignment of the ruler
(vertical with horizontal text).
PangoAlignment
gtk_databox_ruler_get_text_alignment (GtkDataboxRuler *ruler
);
Gets the text alignment of the ruler
(vertical).
Vertical rulers with vertical text do not use this flag
void gtk_databox_ruler_set_text_hoffset (GtkDataboxRuler *ruler
,gint offset
);
Sets the text x (horizontal) offset of the ruler
.
gint
gtk_databox_ruler_get_text_hoffset (GtkDataboxRuler *ruler
);
Gets the text x (horizontal) offset of the ruler
.
void gtk_databox_ruler_set_draw_ticks (GtkDataboxRuler *ruler
,gboolean draw
);
Sets the option for drawing the ticks. If false, don't draw any ticks, If true draw major ticks and subticks if the draw_subticks boolean is set.
gboolean
gtk_databox_ruler_get_draw_ticks (GtkDataboxRuler *ruler
);
Gets the draw ticks option from the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_draw_position (GtkDataboxRuler *ruler
,gboolean draw
);
Sets the option for drawing the position arrows. If false, don't draw any arrows, If true draw arrows.
gboolean
gtk_databox_ruler_get_draw_position (GtkDataboxRuler *ruler
);
Gets the draw position arrows option from the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_draw_subticks (GtkDataboxRuler *ruler
,gboolean draw
);
Sets the option for drawing the subticks
gboolean
gtk_databox_ruler_get_draw_subticks (GtkDataboxRuler *ruler
);
Gets the draw subticks option from the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_invert_edge (GtkDataboxRuler *ruler
,gboolean invert
);
Sets the option for drawing the ruler detail on the opposite edge
gboolean
gtk_databox_ruler_get_invert_edge (GtkDataboxRuler *ruler
);
Gets the invert edge option from the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_linear_label_format (GtkDataboxRuler *ruler
,gchar *format
);
Sets the meta format
string for the labels of linear rulers, for example "%%+-dg
" will become "%+-#g" where # is the int variable
void gtk_databox_ruler_set_log_label_format (GtkDataboxRuler *ruler
,gchar *format
);
Sets the meta format
string for the labels of log scaled rulers, for example "%%-dg
" will become "%-#g" where # is the int variable
gchar *
gtk_databox_ruler_get_linear_label_format
(GtkDataboxRuler *ruler
);
Gets the linear label meta format of the ruler
(horizontal or vertical).
gchar *
gtk_databox_ruler_get_log_label_format
(GtkDataboxRuler *ruler
);
Gets the log label meta format of the ruler
(horizontal or vertical).
void gtk_databox_ruler_set_manual_ticks (GtkDataboxRuler *ruler
,gfloat *manual_ticks
);
Sets the ticks for the ruler
(horizontal or vertical).
gfloat *
gtk_databox_ruler_get_manual_ticks (GtkDataboxRuler *ruler
);
Gets the pointer to the manual tick values for the ruler
.
void gtk_databox_ruler_set_manual_tick_cnt (GtkDataboxRuler *ruler
,guint manual_tick_cnt
);
Sets the number of manual ticks for the ruler
(horizontal or vertical).
guint
gtk_databox_ruler_get_manual_tick_cnt (GtkDataboxRuler *ruler
);
Gets the number manual tick values for the ruler
.
void gtk_databox_ruler_set_manual_tick_labels (GtkDataboxRuler *ruler
,gchar **manual_tick_labels
);
Note: This function should be preceeded by calls to gtk_databox_ruler_set_manual_ticks()
and gtk_databox_ruler_set_manual_tick_cnt()
.
The number of tick labels should match gtk_databox_ruler_get_manual_tick_cnt()
.
Sets the tick labels of the ruler
(horizontal or vertical).
gchar **
gtk_databox_ruler_get_manual_tick_labels
(GtkDataboxRuler *ruler
);
Gets the pointer to the manual tick labels for the ruler
.
void gtk_databox_ruler_set_box_shadow (GtkDataboxRuler *ruler
,GtkShadowType which_shadow
);
Sets the shadow type when using gtk_paint_box. This will draw the desired edge shadow.
GtkShadowType
gtk_databox_ruler_get_box_shadow (GtkDataboxRuler *ruler
);
Gets the type of shadow being rendered to the ruler
(GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT).
struct GtkDataboxRuler;
An improved version (see above) of GtkRuler which supports linear and logarithmic scales.
struct GtkDataboxRulerClass { GtkWidgetClass parent_class; };
The object class of GtkDataboxRuler.
typedef struct _GtkDataboxRulerPrivate GtkDataboxRulerPrivate;
A private data structure used by the GtkDataboxRuler. It shields all internal things from developers who are just using the object.
“box-shadow”
property“box-shadow” guint
Style of the box shadow: GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 4
Default value: 2
“draw-position”
property“draw-position” guint
Draw the position arrows: true or false.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 1
Default value: 1
“draw-subticks”
property“draw-subticks” guint
Draw the subticks: true or false.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 1
Default value: 1
“draw-ticks”
property“draw-ticks” guint
Draw the Ticks: true or false.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 1
Default value: 1
“invert-edge”
property“invert-edge” guint
Invert the Edge - the edge is drawn inverted: true or false.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 1
Default value: 0
“linear-label-format”
property “linear-label-format” char *
Linear Label format mark up strings: marked up formatting strings for linear labels (i.e. "%%-+%dg").
Owner: GtkDataboxRuler
Flags: Read / Write
Default value: "%%-+%dg"
“log-label-format”
property “log-label-format” char *
Log Label format mark up strings: marked up formatting strings for log labels (i.e. "%%-%dg").
Owner: GtkDataboxRuler
Flags: Read / Write
Default value: "%%-%dg"
“lower”
property “lower” double
Lower limit of ruler.
Owner: GtkDataboxRuler
Flags: Read / Write
Default value: 0
“manual-tick-cnt”
property“manual-tick-cnt” guint
The number of manual ticks in the manual_tick array: horizontal or vertical.
Owner: GtkDataboxRuler
Flags: Read / Write
Default value: 0
“manual-tick-labels”
property“manual-tick-labels” gpointer
Manually specify the tick labels.
Owner: GtkDataboxRuler
Flags: Read / Write
“manual-ticks”
property“manual-ticks” gpointer
Manually specify the tick locations.
Owner: GtkDataboxRuler
Flags: Read / Write
“max-length”
property“max-length” guint
Maximum length of the labels (in digits).
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: [2,63]
Default value: 6
“orientation”
property“orientation” guint
Orientation of the ruler: horizontal or vertical.
Owner: GtkDataboxRuler
Flags: Read / Write / Construct Only
Allowed values: <= 1
Default value: 0
“position”
property “position” double
Position of mark on the ruler.
Owner: GtkDataboxRuler
Flags: Read / Write
Default value: 0
“text-alignment”
property“text-alignment” guint
Alignment of the tick mark text (on the vertical ruler when using horizonal text): { PANGO_ALIGN_LEFT, PANGO_ALIGN_CENTER, PANGO_ALIGN_RIGHT}.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 2
Default value: 0
“text-hoffset”
property“text-hoffset” guint
Move the tick mark text left or right : pixels.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 20
Default value: 0
“text-orientation”
property“text-orientation” guint
Orientation of the tick mark text (on the vertical ruler): horizontal or vertical.
Owner: GtkDataboxRuler
Flags: Read / Write
Allowed values: <= 1
Default value: 1