GiwThermo
GiwThermo - A thermo widget


Synopsis
#include <giwthermo.h>


                           GiwThermo;
GtkWidget*        giw_thermo_new                        
              (GtkAdjustment *adjustment);
GtkWidget*        giw_thermo_new_with_adjustment          (gdouble value, gdouble lower, gdouble upper);
void                    giw_thermo_set_value                              (GiwThermo *thermo, gdouble value);  
gdouble              giw_thermo_get_value                              (GiwThermo *thermo);  
GtkAdjustment* giw_thermo_get_adjustment                    (GiwThermo *thermo);
void                    giw_thermo_set_adjustment                     (GiwThermo *thermo, GtkAdjustment *adjustment);
void                    giw_thermo_set_legends_digits                 (GiwThermo *thermo, int digits);
void          
         giw_thermo_show_legends                      (GiwThermo *thermo, char option);
void                    giw_thermo_set_mouse_policy                 (GiwThermo *thermo,  GiwThermoMousePolicy policy);
void                    giw_thermo_set_major_ticks_number     (GiwThermo *thermo, gint number);
void                    giw_thermo_set_minor_ticks_number     (GiwThermo *thermo, gint number);

Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwThermo

Description

GiwThermo is a thermo like a mercury thermo. It has the column (like the mercury column) and the legends, a title and a label representing the current value.
It can be created with a giw_thermo_new(), an cofigured with the functions below.
The receive signals when the value is changed, get the adjustment of the thermo and receive the signal from it.

Details

GiwThermo
typedef struct GiwThermo _GiwThermo

The GiwThermo struct contains private data only, and should be manipulated using the functions below.

giw_thermo_new()

GtkWidget*     giw_thermo_new                         (void);

Creates a new thermo, with all default options.

Returns: a new thermo.

giw_thermo_new_with_adjustment()

GtkWidget*        giw_thermo_new_with_adjustment          (gdouble value, gdouble lower, gdouble upper);

A convenience function, wich don't need to receive a adjustement as paramenter, but his fields.

min: The lower value.
upper: The upper value.
lower: The initial value.
Returns: a new thermo.

giw_thermo_get_adjustment()

GtkAdjustment*    giw_thermo_get_adjustment               (GiwThermo *thermo);

Gets the adjusment that the thermo uses.


thermo: A thermo.
Return
: The adjusment.

giw_thermo_set_adjustment()

void                       giw_thermo_set_adjustment               (GiwThermo *thermo, GtkAdjustment *adjustment);

Sets a new adjusment to be used.


thermo: A thermo.
adjustment
: The new adjusment.
giw_thermo_set_value()

void                 giw_thermo_set_value                (GiwThermo *thermo, gdouble value);  

Sets the value (the size of the column) of the thermo,  is has to be between the min_value and max_value (wich can be set with the gtk_temometer_set_min_value and
gtk_temometer_set_max_value), or nothing will be drawn. The default value is 50.

thermo: A thermo.
value: The new value.

giw_thermo_get_value()

gdouble            giw_thermo_set_value                (GiwThermo *thermo);  

Gets the value (the size of the column) of the thermo.

thermo: A thermo.
Returns: The value.

giw_thermo_set_legends_digits()

void                 giw_thermo_set_legends_digits   (GiwThermo *thermo, int digits);

Sets the number os digits to be used by the legends (counting the "." and the signal "-" if exists). It has to bigger than 1. The default is 5.


thermo: A thermo.
digits: The number of digits.

giw_thermo_show_legends()

void                 giw_thermo_show_legends        (GiwThermo *thermo, char option);

Shows, or hides the legends.

thermo: A thermo.
option: TRUE to show the legends, FALSE  for hiding it.

giw_thermo_set_mouse_policy()

void                    giw_thermo_set_mouse_policy                 (GiwThermo *thermo,  GiwThermoMousePolicy policy);

Sets the policy for using mouse on changing thermo's value

thermo: A thermo.
policy: The policy to be used.

enum GiwThermoMousePolicy

typedef enum{
  GIW_THERMO_MOUSE_DISABLED,
  GIW_THERMO_MOUSE_AUTOMATICALLY,
  GIW_THERMO_MOUSE_DELAYED
}GiwThermoMousePolicy;

Used to set the way the mouse will be used.
 
    GIW_THERMO_MOUSE_DISABLED                Mouse can't be used to change value.
    GIW_THERMO_MOUSE_AUTOMATICALLY    The pointer folows mouse aftre a button is pressed.
    GIW_THERMO_MOUSE_DELAYED                  The pointer assumes mouse position only when the button is relased.


giw_thermo_set_major_ticks_number()

void                 giw_thermo_set_major_ticks_number     (GiwThermo *thermo, gint number);

Sets the number oj major ticks to be drawn in all the thermo, if it's 0, there are no ticks (and no legends too).

thermo: A thermo.
option: The number of ticks desired.

giw_thermo_set_minor_ticks_number()

void                 giw_thermo_set_minor_ticks_number     (GiwThermo *thermo, gint number);

Sets the number oj minor ticks to be drawn between each major ticks, if it's 0 there are no minor ticks.

thermo: A thermo.
option: The number of minor ticks desired.