Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

The Widget toolkit implements many common widgets for use on a graphical display using the functionality of Window system and Graphics library.

WTK.jpg

The following widgets are implemented:

Dependencies

This component driver depends on the following modules:

Modules

 Basic frame widget
 Basic frame widget provides a frame with only a background color.
 
 Plot widget
 
 Frame widget
 Frame widget provides a frame with border and a title bar.
 
 Progress bar widget
 
 Button widget
 
 Radio button widget
 
 Slider widget
 
 Icon button widget
 
 Check box widget
 
 Label widget
 

Functions

void wtk_copy_string (char *dest, char const *source)
 This function copies the string contents, including the zero terminator, from source to destination. More...
 
uint8_t wtk_rescale_value (uint8_t value, uint8_t from_scale, uint8_t to_scale)
 Rescale 8-bit value. More...
 

void wtk_copy_string ( char *  dest,
char const *  source 
)

This function copies the string contents, including the zero terminator, from source to destination.

The caller is responsible for providing memory for the destination string, either on the stack, static, or dynamically allocated.

Parameters
destDestination string.
sourceSource string, zero terminated.

References Assert.

Referenced by wtk_button_create(), wtk_check_box_create(), wtk_frame_create(), wtk_label_change(), wtk_label_create(), and wtk_radio_button_create().

uint8_t wtk_rescale_value ( uint8_t  value,
uint8_t  from_scale,
uint8_t  to_scale 
)

Rescale 8-bit value.

This function is used by, e.g., the slider widget for computing the slider knob position from a given value and vice versa. It returns a value with the same data width as the input, meaning value cannot exceed from_scale, or overflows will occur.

The formula is:

new_value = (value / from_scale) * to_scale
Parameters
valueValue to rescale.
from_scaleMaximum of old scale for value.
to_scaleMaximum of scale for new value.
Returns
Rescaled 8-bit value.

References Assert.

Referenced by wtk_plot_add_value(), wtk_plot_set_grid(), wtk_progress_bar_create(), wtk_progress_bar_set_value(), wtk_slider_create(), wtk_slider_handler(), and wtk_slider_set_value().