1 /* $Id: progressbar.hg,v 1.2 2004/11/10 22:05:57 murrayc Exp $ */
5 * Copyright (C) 1998-2002 The gtkmm Development Team
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <gtkmm/widget.h>
25 _PINCLUDE(gtkmm/private/widget_p.h)
26 _PINCLUDE(gtk/gtkprogress.h)
32 _CC_INCLUDE(gtk/gtktypebuiltins.h)
33 _WRAP_ENUM(ProgressBarStyle, GtkProgressBarStyle)
34 _WRAP_ENUM(ProgressBarOrientation, GtkProgressBarOrientation)
37 /** A widget which indicates progress visually.
39 * The Gtk::ProgressBar is typically used to display the progress of a long
40 * running operation. It provides a visual clue that processing is underway.
41 * The Gtk::ProgressBar can be used in two different modes: percentage mode
44 * When an application can determine how much work needs to take place (e.g.
45 * read a fixed number of bytes from a file) and can monitor its progress,
46 * it can use the Gtk::ProgressBar in percentage mode and the user sees a
47 * growing bar indicating the percentage of the work that has been
48 * completed. In this mode, the application is required to call
49 * set_fraction() periodically to update the progress bar.
51 * When an application has no accurate way of knowing the amount of work to
52 * do, it can use the Gtk::ProgressBar in activity mode, which shows
53 * activity by a block moving back and forth within the progress area. In
54 * this mode, the application is required to call pulse() perodically to
55 * update the progress bar.
57 * There is quite a bit of flexibility provided to control the appearance of
58 * the Gtk::ProgressBar. Functions are provided to control the orientation of
59 * the bar, optional text can be displayed along with the bar, and the step
60 * size used in activity mode can be set.
64 class ProgressBar : public Widget
66 _CLASS_GTKOBJECT(ProgressBar,GtkProgressBar,GTK_PROGRESS_BAR,Gtk::Widget,GtkWidget,GtkProgressBar,GtkProgress)
67 _IGNORE(gtk_progress_bar_new_with_adjustment, gtk_progress_bar_set_bar_style, gtk_progress_bar_set_discrete_blocks,
68 gtk_progress_bar_set_activity_step, gtk_progress_bar_set_activity_blocks, gtk_progress_bar_update)
72 _WRAP_METHOD(void pulse(), gtk_progress_bar_pulse)
74 _WRAP_METHOD(Glib::ustring get_text() const, gtk_progress_bar_get_text)
75 _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_progress_bar_set_text)
77 _WRAP_METHOD(double get_fraction() const, gtk_progress_bar_get_fraction)
78 _WRAP_METHOD(void set_fraction(double fraction), gtk_progress_bar_set_fraction)
80 _WRAP_METHOD(double get_pulse_step() const, gtk_progress_bar_get_pulse_step)
81 _WRAP_METHOD(void set_pulse_step(double fraction), gtk_progress_bar_set_pulse_step)
83 _WRAP_METHOD(void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT),
84 gtk_progress_bar_set_orientation)
85 _WRAP_METHOD(ProgressBarOrientation get_orientation() const, gtk_progress_bar_get_orientation)
87 _WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode mode), gtk_progress_bar_set_ellipsize)
88 _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const, gtk_progress_bar_get_ellipsize)
90 _WRAP_PROPERTY("fraction", double)
91 _WRAP_PROPERTY("pulse-step", double)
92 _WRAP_PROPERTY("orientation", ProgressBarOrientation)
93 _WRAP_PROPERTY("text", Glib::ustring)
94 _WRAP_PROPERTY("ellipsize", bool)