libgaminggear
Data Structures | Macros | Typedefs | Functions
gaminggear_hscale.h File Reference

Horizontal scale with connected spinbutton and clamping. More...

Data Structures

struct  _GaminggearHScaleClass
 
struct  _GaminggearHScale
 

Macros

#define GAMINGGEAR_HSCALE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), GAMINGGEAR_HSCALE_TYPE, GaminggearHScaleClass))
 
#define IS_GAMINGGEAR_HSCALE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), GAMINGGEAR_HSCALE_TYPE))
 
#define GAMINGGEAR_HSCALE_TYPE   (gaminggear_hscale_get_type())
 
#define GAMINGGEAR_HSCALE(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GAMINGGEAR_HSCALE_TYPE, GaminggearHScale))
 
#define IS_GAMINGGEAR_HSCALE(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GAMINGGEAR_HSCALE_TYPE))
 

Typedefs

typedef struct _GaminggearHScaleClass GaminggearHScaleClass
 
typedef struct _GaminggearHScale GaminggearHScale
 
typedef struct _GaminggearHScalePrivate GaminggearHScalePrivate
 

Functions

GType gaminggear_hscale_get_type (void)
 
GtkWidget * gaminggear_hscale_new_with_range (gdouble min, gdouble max, gdouble step)
 Creates new hscale. More...
 
gdouble gaminggear_hscale_get_value (GaminggearHScale *hscale)
 Gets the current value of the scale. More...
 
void gaminggear_hscale_set_value (GaminggearHScale *hscale, gdouble value)
 Sets current value of scale. More...
 
void gaminggear_hscale_add_mark (GaminggearHScale *hscale, gdouble value, GtkPositionType position, gchar const *markup)
 Adds a tick mark to the scale. More...
 
void gaminggear_hscale_clear_marks (GaminggearHScale *hscale)
 Removes all marks from the scale. More...
 
guint gaminggear_hscale_get_digits (GaminggearHScale *hscale)
 Gets number of decimal places displayed in the spinbutton. More...
 
void gaminggear_hscale_set_digits (GaminggearHScale *hscale, guint digits)
 Sets number of decimal places displayed in the spinbutton. More...
 
void gaminggear_hscale_set_range (GaminggearHScale *hscale, gdouble min, gdouble max)
 Sets range of scale. More...
 
void gaminggear_hscale_set_increment (GaminggearHScale *hscale, gdouble step)
 Sets increment size. More...
 
void gaminggear_hscale_set_draw_spin (GaminggearHScale *hscale, gboolean draw_spin)
 Sets wether to draw the spinbutton. More...
 

Detailed Description

Horizontal scale with connected spinbutton and clamping.

Properties

Signals

Macro Definition Documentation

◆ GAMINGGEAR_HSCALE

#define GAMINGGEAR_HSCALE (   obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), GAMINGGEAR_HSCALE_TYPE, GaminggearHScale))

◆ GAMINGGEAR_HSCALE_CLASS

#define GAMINGGEAR_HSCALE_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GAMINGGEAR_HSCALE_TYPE, GaminggearHScaleClass))

◆ GAMINGGEAR_HSCALE_TYPE

#define GAMINGGEAR_HSCALE_TYPE   (gaminggear_hscale_get_type())

◆ IS_GAMINGGEAR_HSCALE

#define IS_GAMINGGEAR_HSCALE (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), GAMINGGEAR_HSCALE_TYPE))

◆ IS_GAMINGGEAR_HSCALE_CLASS

#define IS_GAMINGGEAR_HSCALE_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), GAMINGGEAR_HSCALE_TYPE))

Typedef Documentation

◆ GaminggearHScale

◆ GaminggearHScaleClass

◆ GaminggearHScalePrivate

typedef struct _GaminggearHScalePrivate GaminggearHScalePrivate

Function Documentation

◆ gaminggear_hscale_add_mark()

void gaminggear_hscale_add_mark ( GaminggearHScale hscale,
gdouble  value,
GtkPositionType  position,
gchar const *  markup 
)

Adds a tick mark to the scale.

Marks can only be removed in whole by gaminggear_hscale_clear_marks().

Parameters
hscaleA GaminggearHScale.
valueBetween limits of hscale.
positionWhere to draw the mark. GTK_POS_TOP or GTK_POS_BOTTOM.
markupText for the mark or NULL.

◆ gaminggear_hscale_clear_marks()

void gaminggear_hscale_clear_marks ( GaminggearHScale hscale)

Removes all marks from the scale.

Removes all marks that have been added by gaminggear_hscale_add_mark().

Parameters
hscaleA GaminggearHScale.

◆ gaminggear_hscale_get_digits()

guint gaminggear_hscale_get_digits ( GaminggearHScale hscale)

Gets number of decimal places displayed in the spinbutton.

Parameters
hscaleA GaminggearHScale.
Return values
digitsActual digits.

◆ gaminggear_hscale_get_type()

GType gaminggear_hscale_get_type ( void  )

◆ gaminggear_hscale_get_value()

gdouble gaminggear_hscale_get_value ( GaminggearHScale hscale)

Gets the current value of the scale.

Parameters
hscaleA GaminggearHScale.
Return values
valueActual value.

◆ gaminggear_hscale_new_with_range()

GtkWidget* gaminggear_hscale_new_with_range ( gdouble  min,
gdouble  max,
gdouble  step 
)

Creates new hscale.

Parameters
minMinimum value.
maxMaximum value.
stepStep increment.
Return values
widgetA new GaminggearHScale.

◆ gaminggear_hscale_set_digits()

void gaminggear_hscale_set_digits ( GaminggearHScale hscale,
guint  digits 
)

Sets number of decimal places displayed in the spinbutton.

Parameters
hscaleA GaminggearHScale.
digitsNumber of decimal places.

◆ gaminggear_hscale_set_draw_spin()

void gaminggear_hscale_set_draw_spin ( GaminggearHScale hscale,
gboolean  draw_spin 
)

Sets wether to draw the spinbutton.

Parameters
hscaleA GaminggearHScale.
draw_spinTRUE or FALSE.

◆ gaminggear_hscale_set_increment()

void gaminggear_hscale_set_increment ( GaminggearHScale hscale,
gdouble  step 
)

Sets increment size.

GaminggearHScale clamps its value to this increment. This means value is always: value = min + x * step

Parameters
hscaleA GaminggearHScale.
stepStep increment.

◆ gaminggear_hscale_set_range()

void gaminggear_hscale_set_range ( GaminggearHScale hscale,
gdouble  min,
gdouble  max 
)

Sets range of scale.

Parameters
hscaleA GaminggearHScale.
minMinimum value.
maxMaximum value.

◆ gaminggear_hscale_set_value()

void gaminggear_hscale_set_value ( GaminggearHScale hscale,
gdouble  value 
)

Sets current value of scale.

The scale emits "value-changed" signal after changing the value.

Parameters
hscaleA GaminggearHScale.
valueThe new value.