Module blingbling.triangular_progress_graph
Triangular progress graph widget.
Functions
-
set_background_color (color)
-
Fill all the widget (width * height) with this color (default is transparent ).
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
myvolume:set_background_color(string) -->"#rrggbbaa"
-
set_bar (boolean)
-
Define the form of the graph: use five growing bars instead of a triangle.
Parameters:
- boolean
true or false (default is false)
Usage:
myvolume:set_bar(boolean) --> true or false
-
set_v_margin (margin)
-
Define the top and bottom margin for the graph.
Parameters:
- margin
an integer for top and bottom margin
Usage:
myvolume:set_v_margin(integer)
-
set_h_margin (margin)
-
Define the left and right margin for the graph.
Parameters:
- margin
an integer for left and right margin
Usage:
myvolume:set_h_margin(integer)
-
set_filled_color (color)
-
Set the color of the graph background.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
myvolume:set_filled_color(string) -->"#rrggbbaa"
-
set_graph_color (color)
-
Define the graph color.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
myvolume:set_graph_color(string) -->"#rrggbbaa"
-
set_show_text (boolean)
-
Display text on the graph or not.
Parameters:
- boolean
true or false (default is false)
Usage:
myvolume:set_show_text(boolean) --> true or false
-
set_text_color (color)
-
Define the color of the text.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb" defaul is white
Usage:
myvolume:set_text_color(string) -->"#rrggbbaa"
-
set_text_background_color (color)
-
Define the background color of the text.
Parameters:
- color
a string "#rrggbbaa" or "#rrggbb"
Usage:
myvolume:set_text_background_color(string) -->"#rrggbbaa"
-
set_font_size (graph, size)
-
Define the text font size.
myvolume:set_font_size(integer)
Parameters:
- graph
the graph
- size
the font size
-
set_label (graph, text)
-
Define the template of the text to display.
Parameters:
- graph
the graph
- text
the text to display
Usage:
myvolume:set_label(string)
By default the text is : (value_send_to_the_widget *100) .. "%"
static string: example set_label("Volume:") will display "Volume:" on the graph
dynamic string: use $percent in the string example set_label("Volume $percent %") will display "Volume 10%"
-
triangular_progressgraph:set_height (height)
-
Set the tp_graph height.
Parameters:
- height
The height to set.
-
triangular_progressgraph:set_width (width)
-
Set the tp_graph width.
Parameters:
-
triangular_progressgraph.new (args)
-
Create a tp_graph widget.
Parameters:
- args
Standard widget() arguments. You should add width and height
key to set graph geometry.
Returns:
A graph widget.
Local Functions
-
set_value (tp_graph, value)
-
Set the tp_graph value.
Parameters:
- tp_graph
The progress bar.
- value
The progress bar value between 0 and 1.