GiwDial
GiwDial - A dial widget


Synopsis
#include <gtkdial.h>


                       
      GiwDial;
GtkWidget*   
        giw_dial_new                                  (GtkAdjustment *adjustment);
GtkWidget*    
       giw_dial_new_with_adjusment      (gdouble min, gdouble max, gdouble value);
gdouble                 giw_dial_get_value                         (GiwDial *dial);
void                       giw_dial_set_value                         (GiwDial *dial, gdouble value);
GtkAdjustment*    giw_dial_get_adjustment               (GiwDial *dial);
void                       giw_dial_set_adjustment               (GiwDial *dial, GtkAdjustment *adjustment);
void                       giw_dial_set_legends_digits          (GiwDial *dial, guint digits_number);
void                       giw_dial_set_ticks_number            (GiwDial *dial, guint major, guint minor);
void                       giw_dial_set_mouse_policy            (GiwDial *dial, GiwDialMousePolicy policy);
void                       giw_dial_set_title                            (GiwDial *dial, gchar *str);


Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwDial

Description

GiwDial is a dial, with the legends and the pointer.
It can be created with a giw_dial_new(), an cofigured with the functions below. If you want to connect signals with it, you have to connect them to the adjustment it uses, wich can be acessed by
giw_dial_get_adjustment.   

Details

GiwDial
typedef struct GiwDial _GiwDial

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

giw_dial_new()

GtkWidget*     giw_dial_new                                       (GtkAdjustment *adjustment);

Creates a new dial, with all default options and the adjustment sent as a parementer (only the fields value, lower and upper are used).

adjustment: The adjustment to be used (it will define the value, and the lower and upper values of the dial).
Returns: a new dial.

giw_dial_new_with_adjusment()

GtkWidget*           giw_dial_new_with_adjusment      (gdouble min, gdouble max, gdouble value);

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

min
: The lower value.
max: The upper value.
value: The initial value.
Returns: A new dial.

giw_dial_get_value()

gdouble                 giw_dial_get_value                         (GiwDial *dial);

Gets the current value of the dial.


dial: A dial.
Return: The value.

giw_dial_set_value()

void                       giw_dial_set_value                         (GiwDial *dial, gdouble value);

Sets the current value of the dial.


dial: A dial.
value
: The desired value.

giw_dial_get_adjustment()

GtkAdjustment*    giw_dial_get_adjustment               (GiwDial *dial);

Gets the adjusment that the dial uses.


dial: A dial.
Return
: The adjusment.

giw_dial_set_adjustment()

void                       giw_dial_set_adjustment               (GiwDial *dial, GtkAdjustment *adjustment);

Sets a new adjusment to be used.


dial: A dial.
adjustment
: The new adjusment.

giw_dial_set_legends_digits()

void                       giw_dial_set_legends_digits          (GiwDial *dial, guint digits_number);

Sets the number of digits that the legends will use (including the "." and "-" if it exists). If you don't want legends, you can set "0" here.


dial: A dial.
digits_number
: The number of digits.

giw_dial_set_ticks_number()

void                       giw_dial_set_ticks_number            (GiwDial *dial, guint major, guint minor);

Sets the number ticks in the dial.


dial: A dial.
major
: The number of major ticks in the dial.
minor: The number of minor ticks between each two major ticks.

giw_dial_set_mouse_policy()

void                       giw_dial_set_mouse_policy            (GiwDial *dial, GiwDialMousePolicy policy);

Sets the policy to use mouse to change the dial's value.
The default option is GIW_DIAL_MOUSE_DISABLED.

dial: A dial.
policy
: The chosen policy to be used.

enum GiwDialMousePolicy

typedef enum{
  GIW_DIAL_MOUSE_DISABLED,
  GIW_DIAL_MOUSE_AUTOMATICALLY,
  GIW_DIAL_MOUSE_DELAYED
}GiwDialMousePolicy;

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

giw_dial_set_title()

void                       giw_dial_set_title                            (GiwDial *dial, gchar *str);

Sets the title, it it be in the bottom of the dial. The not show any title, set it to NULL.

dial: A dial.
str
: The string with the title.