winprogress.h File Reference

Fuctions to display a progress widget. More...

#include <winwidget.h>

Go to the source code of this file.

Defines

#define WIN_PROGRESS_HORIZ   0
 Horizontal left-to-right orientation for a progress widget.
#define WIN_PROGRESS_VERT   1
 Vertical bottom-to-top orientation for a progress widget.
#define WIN_PROGRESS_HORIZ_RIGHT   2
 Horizontal right-to-left orientation for a progress widget.
#define WIN_PROGRESS_VERT_TOP   3
 Vertical top-to-bottom orientation for a progress widget.

Functions

win_widget_twin_progress_new (int slider)
 Creates a new progress widget.
void win_progress_set_value (win_widget_t *bar, double value)
 Sets the progress bar at the given value.
double win_progress_get_value (win_widget_t *bar)
 Gets the progress bar current value.
void win_progress_set_inc (win_widget_t *bar, double inc)
 Sets the increment value of the progress widget.
void win_progress_set_orient (win_widget_t *bar, int orient)
 Sets orientation of the progress bar.
void win_progress_set_range (win_widget_t *bar, double min, double max)
 Sets the progress bar range.
void win_progress_set_delay (win_widget_t *widget, int first, int next)
 Sets the slider auto-repeat parameters.
void win_progress_set_event (win_widget_t *widget, int event)
 Sets the slider event.


Detailed Description

Fuctions to display a progress widget.

The progress widget is used to visually display a value between two bounds. It can be made focusable (in which case it acts like a slider control for user adjustment), or it can be made non-focusable to function as a progress bar.

Definition in file winprogress.h.


Define Documentation

#define WIN_PROGRESS_HORIZ   0

Horizontal left-to-right orientation for a progress widget.

This orientation causes a progress widget to draw itself horizontally and fill from left to right.

Definition at line 54 of file winprogress.h.

#define WIN_PROGRESS_HORIZ_RIGHT   2

Horizontal right-to-left orientation for a progress widget.

This orientation causes a progress widget to draw itself horizontally and fill from right to left.

Definition at line 70 of file winprogress.h.

#define WIN_PROGRESS_VERT   1

Vertical bottom-to-top orientation for a progress widget.

This orientation causes a progress widget to draw itself vertically and fill from bottom to top.

Definition at line 62 of file winprogress.h.

#define WIN_PROGRESS_VERT_TOP   3

Vertical top-to-bottom orientation for a progress widget.

This orientation causes a progress widget to draw itself vertically and fill from top to bottom.

Definition at line 78 of file winprogress.h.


Function Documentation

double win_progress_get_value ( win_widget_t bar  ) 

Gets the progress bar current value.

This function is used to get the progress bar value. It is useful when the progress bar is configured as a slider.

Parameters:
bar The progress widget to query.
Returns:
The progress value.

win_widget_t* win_progress_new ( int  slider  ) 

Creates a new progress widget.

Allocates and returns a new progress widget.

Parameters:
slider Indicates if the widget can be used as a slider (1) or just as a progress bar (0)
Returns:
A pointer to the newly allocated progress bar component.

void win_progress_set_delay ( win_widget_t widget,
int  first,
int  next 
)

Sets the slider auto-repeat parameters.

This functions sets up the auto-repeat times for the component. Auto-repeat provides both a delay before the first auto-repeat, and a delay for each subsequent auto-repeat click.

Parameters:
bar The progress bar
first Delay before auto-repeat, in milliseconds.
next Delay between repetitions, in milliseconds.

void win_progress_set_event ( win_widget_t widget,
int  event 
)

Sets the slider event.

This function is used to set the event sent by the slider when it is changed.

Parameters:
bar The progress bar.
event Event number to send for value changes.

void win_progress_set_inc ( win_widget_t bar,
double  inc 
)

Sets the increment value of the progress widget.

This function is used to set the progress bar increment value, when it is used as a slider with the arrow keys.

Parameters:
bar The progress bar.
inc The increment value.

void win_progress_set_orient ( win_widget_t bar,
int  orient 
)

Sets orientation of the progress bar.

This function is used to set the progress bar orientation. The four values for orientation are WIN_PROGRESS_HORIZ, WIN_PROGRESS_VERT, WIN_PROGRESS_HORIZ_RIGHT, and WIN_PROGRESS_VERT_TOP.

Parameters:
bar The progress bar.
orient The progress bar orientation.

void win_progress_set_range ( win_widget_t bar,
double  min,
double  max 
)

Sets the progress bar range.

This function is used to set minimal and maximal value corresponding respectively to 0% and 100% of the progress bar. If the current value is out of range in either direction, it will be set to the minimum or maximum value, respectively.

Parameters:
bar The progress bar
min Minimum value
max Maximum value

void win_progress_set_value ( win_widget_t bar,
double  value 
)

Sets the progress bar at the given value.

This function is used to set the progress bar value.

Parameters:
bar The progress bar.
value The progress value. If it is out of the range [min, max], it is set to the min / max value.


Generated on Sat Feb 17 00:05:27 2007 for HPGCCWindows by  doxygen 1.5.0