Damien Krotkine > Curses-Toolkit-0.207 > Curses::Toolkit::Widget::VProgressBar

Download:
Curses-Toolkit-0.207.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  2
View/Report Bugs
Module Version: 0.207   Source   Latest Release: Curses-Toolkit-0.211

NAME ^

Curses::Toolkit::Widget::VProgressBar - a vertical progress bar widget

VERSION ^

version 0.207

DESCRIPTION ^

The Curses::Toolkit::Widget::VProgressBar widget is a classical progress bar widget, used to provide some sort of progress information to your program user.

This Progress bar is vertical.

ATTRIBUTES ^

minimum

The minimum value (a float) for the progress bar. Default to 0.

maximum

The maximum value (a float) for the progress bar. Default to 100.

position

The current value of the progress bar. Default to 0.

label

What to show in the progress bar. Must be a PROGRESS_BAR_LABEL - check Curses::Toolkit::Types for valid options. Default to percent.

METHODS ^

new

  input:  none
  output: a Curses::Toolkit::Widget::VProgressBar

draw

Redraw the progress bar.

get_desired_space

Given a coordinate representing the available space, returns the space desired The Button desires the minimum size : text length plus the button brackets

  input:  a Curses::Toolkit::Object::Coordinates object
  output: a Curses::Toolkit::Object::Coordinates object

The desired space is as much horizontal space as possible, with a height of 1.

get_minimum_space

Given a coordinate representing the available space, returns the minimum space required The Button requires the text length plus the button brackets.

  input:  a Curses::Toolkit::Object::Coordinates object
  output: a Curses::Toolkit::Object::Coordinates object

The ProgressBar requires 12x1 minimum.

possible_signals

  my @signals = keys $vprogressbar->possible_signals();

Returns the possible signals that can be used on this widget. See Curses::Toolkit::Widget::signal_connect to bind signals to actions

  input:  none
  output: HASH, keys are signal names, values are signal classes

The progress bar accepts no signal.

THEME RELATED PROPERTIES ^

To set/get a theme properties, you should do :

  $vprogressbar->set_theme_property(property_name => $property_value);
  $value = $vprogressbar->get_theme_property('property_name');

Here is the list of properties related to the progressbar, that can be changed in the associated theme. See the Curses::Toolkit::Theme class used for the default (default class to look at is Curses::Toolkit::Theme::Default)

Don't forget to look at properties from the parent class, as these are also inherited from!

border_width (inherited)

The width of the border of the progressbar.

Example: # set the progressbar to have a border of 1 $vprogressbar->set_theme_property(border_width => 1 );

default_length

Sets the value of the default length of the progress bar.

Example : # set default_length $vprogressbar->set_theme_property(default_length => 10 );

char_done

Sets the value of the char used to represent the done portion of the progress bar.

Example : # set char_done $vprogressbar->set_theme_property(char_done => '=' );

char_left

Sets the value of the char used to represent the left portion of the progress bar.

Example : # set char_left $vprogressbar->set_theme_property(char_left => ' ' );

start_enclosing

The string to be displayed at the top of the progress bar. Usually some enclosing characters.

Example : # set top enclosing $vprogressbar->set_theme_property(start_enclosing => '< ' ); $vprogressbar->set_theme_property(start_enclosing => '[ ' );

end_enclosing

The string to be displayed at the bottom of the progress bar. Usually some enclosing characters.

Example : # set bottom enclosing $vprogressbar->set_theme_property(end_enclosing => ' >' ); $vprogressbar->set_theme_property(end_enclosing => ' ]' );

Appearence ^

Standard theme:

  ||||||||---------- 14% ------------------

With a border:

  +------------------------------------------+
  |||||||||---------- 14% -------------------|
  +------------------------------------------+

AUTHOR ^

Damien "dams" Krotkine

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Damien "dams" Krotkine.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: