cvs: php-gtk-doc /en/reference/gtk gtkmenu.xml gtkprogress.xml gtkprogressbar.xml
| From: | Steph Fox | Date: | Sun, 20 Jan 2002 06:34:39 +0000 |
| Subject: | cvs: php-gtk-doc /en/reference/gtk gtkmenu.xml gtkprogress.xml gtkprogressbar.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-302@lists.php.net to get a copy of this message | ||
sfox Sun Jan 20 01:34:39 2002 EDT
Modified files:
/php-gtk-doc/en/reference/gtk gtkmenu.xml gtkprogress.xml
gtkprogressbar.xml
Log:
Finally added example to progressbar entry
Index: php-gtk-doc/en/reference/gtk/gtkmenu.xml diff -u php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.8 php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.8 Wed Jan 16 01:25:25 2002 +++ php-gtk-doc/en/reference/gtk/gtkmenu.xml Sun Jan 20 01:34:39 2002 @@ -601,8 +601,8 @@ <function class="GtkMenu">set_title()</function> sets the window title for a menu that has been detached from its parent through either a <classname>GtkTearoffMenuItem</classname> widget or the - <function class="GtkMenu">set_tearoff_state()</function>. As with all - window titles, the text will be truncated to fit the area available. + <function class="GtkMenu">set_tearoff_state()</function> method. As with + all window titles, the text will be truncated to fit the area available. </simpara> <simpara> Note that the title needs to be set prior to the menu's becoming torn Index: php-gtk-doc/en/reference/gtk/gtkprogress.xml diff -u php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.4 php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.4 Tue Jan 8 02:26:10 2002 +++ php-gtk-doc/en/reference/gtk/gtkprogress.xml Sun Jan 20 01:34:39 2002 @@ -8,18 +8,14 @@ <desc> <simpara> <classname>GtkProgress</classname> is a base class providing methods - and properties for widgets implementing progress bar style - functionality. The only built-in widget using - <classname>GtkProgress</classname> is + for widgets implementing progress bar functionality. The only built-in + widget using <classname>GtkProgress</classname> is <classname>GtkProgressBar</classname>. </simpara> <simpara> Note that <classname>GtkProgress</classname> is an abstract class and cannot be constructed directly. </simpara> - <simpara> - See also: <classname>GtkProgressBar</classname>. - </simpara> </desc> </classmeta> @@ -33,12 +29,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - Controls progress text display. + Toggles progress text display. </shortdesc> <desc> <simpara> The <parameter>show_text</parameter> parameter controls whether the - progress text is shown or not. + progress text is shown. The default setting is <literal>false</literal>. + </simpara> + <simpara> + See also: <function class="GtkProgress">set_format_string()</function>. </simpara> </desc> </method> @@ -61,7 +60,10 @@ <parameter>y_align</parameter> parameters control the horizontal and vertical alignment of the text, respectively. Their range can be from <literal>0.0</literal> to <literal>1.0</literal> (meaning from - one side of progress area to another). + one side of the progress area to another). + </simpara> + <simpara> + The default setting is <literal>(0.5, 0.5)</literal>. </simpara> </desc> </method> @@ -74,12 +76,12 @@ </funcprototype> </funcsynopsis> <shortdesc> - Sets progress text formatting. + Sets and formats progress text. </shortdesc> <desc> <para> - The format of the progress text can be modified with the - <parameter>format</parameter> string. It can contain the following + The content of the progress text can be modified with the + <parameter>format</parameter> string. It can contain the following format characters: <itemizedlist> <listitem> @@ -103,8 +105,16 @@ </simpara> </listitem> </itemizedlist> - The <literal>%</literal> character itself can be specified as <literal>%%</literal>. + The <literal>%</literal> character itself can be specified as + <emphasis>%%</emphasis>. </para> + <simpara> + The default text string is "%p%%". + </simpara> + <simpara> + See also: <classname>GtkAdjustment</classname>, where the progress + value and bounds are set. + </simpara> </desc> </method> @@ -112,7 +122,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_adjustment</function></funcdef> - <paramdef><classname>GtkAdjustment</classname> <parameter>adjustment</parameter></paramdef> + <paramdef> + <classname>GtkAdjustment</classname> + <parameter>adjustment</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -120,10 +133,10 @@ </shortdesc> <desc> <simpara> - A progress has an associated <classname>GtkAdjustment</classname> - object which specifies the bounds and the step increment of the - value the progress of which is being displayed. This method - associates an adjustment object with the progress. + A progress has an associated <classname>GtkAdjustment</classname> + object which specifies the bounds of the value having its progress + displayed. This method associates the specified adjustment object + with the progress. </simpara> </desc> </method> @@ -145,6 +158,9 @@ This method provides a way to directly control the current value and the bounds of a <classname>GtkProgress</classname>. </simpara> + <simpara> + See also: <classname>GtkAdjustment</classname>. + </simpara> </desc> </method> @@ -160,9 +176,13 @@ </shortdesc> <desc> <simpara> - This method sets the current percentage for - <classname>GtkProgress</classname>. Its value must be between - <literal>0.0</literal> to <literal>1.0</literal>. + This method sets the current percentage for a + <classname>GtkProgress</classname>. Its value must be between + <literal>0.0</literal> and <literal>1.0</literal>. + </simpara> + <simpara> + Use this method to update a <classname>GtkProgressBar</classname> that + is in <literal>percentage</literal> mode. </simpara> </desc> </method> @@ -180,8 +200,13 @@ <desc> <simpara> The progress value can be set directly with this method. The value - must be within the range of an underlying - <classname>GtkAdjustment</classname>. + must be within the range of the underlying + <classname>GtkAdjustment</classname> in order for the + <classname>GtkProgressBar</classname> to display it. + </simpara> + <simpara> + Use this method to update a <classname>GtkProgressBar</classname> that + is in <literal>activity</literal> mode. </simpara> </desc> </method> @@ -197,7 +222,9 @@ Gets the current progress value. </shortdesc> <desc> - Returns the current progress value. + <simpara> + Returns the current progress value. + </simpara> </desc> </method> @@ -209,19 +236,24 @@ </funcprototype> </funcsynopsis> <shortdesc> - Controls progress mode. + Toggles progress mode. </shortdesc> <desc> <simpara> - <classname>GtkProgress</classname> can be either in percentage mode - (when the total amount of work is known and progress can be - calculated) or activity mode (when there is no way to estimate - total amount of work and only progress must be indicated somehow). + <classname>GtkProgress</classname> can be either in + <literal>percentage</literal> mode (when the total amount of work is + known and progress can be calculated) or <literal>activity</literal> + mode (when there is no way to estimate the total amount of work and + only activity must be indicated somehow). </simpara> <simpara> If <parameter>activity_mode</parameter> is <literal>true</literal>, the activity mode is turned on, otherwise - the percentage mode. </simpara> + <simpara> + See also: <function class="GtkProgressBar">set_value()</function>, + <function class="GtkProgress">set_percentage()</function>. + </simpara> </desc> </method> @@ -238,9 +270,11 @@ <desc> <simpara> The text indicating the amount of progress can be retrieved with - this method. Before the text is returned, it is formatted with the - currently set progress format (see <function - class="GtkProgress">set_format_string</function>). + this method. Before the text is returned, it is formatted using the + current progress format. + </simpara> + <simpara> + See also: <function class="GtkProgress">set_format_string()</function>). </simpara> </desc> </method> @@ -295,8 +329,8 @@ <desc> <simpara> If you wish to retrieve the progress percentage based on some value - other than the current one, then this method should be used. It - returns the desired percentage as a number between + other than the current one, then this method should be used. It + returns the desired percentage as a number between <literal>0.0</literal> and <literal>1.0</literal>. </simpara> </desc> Index: php-gtk-doc/en/reference/gtk/gtkprogressbar.xml diff -u php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.5 php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.6 --- php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.5 Tue Jan 8 02:26:10 2002 +++ php-gtk-doc/en/reference/gtk/gtkprogressbar.xml Sun Jan 20 01:34:39 2002 @@ -7,27 +7,29 @@ </shortdesc> <desc> <simpara> - The purpose of <classname>GtkProgressBar</classname> is to show user the progress of a - long-running operation. It can be used in two modes: a percentage - mode and an activity mode. + The purpose of <classname>GtkProgressBar</classname> is to show the + user the progress of a long-running operation. It can be used in two + modes: a <literal>percentage</literal> mode or an + <literal>activity</literal> mode. </simpara> <simpara> - The percentage mode should be used when the application can in - advance determine the total amount of work that will be done. As the - operation progresses the application should update the bar widget - with the amount of work completed so far. The widget will reflect - this by displaying a growing percentage bar. + The <literal>percentage</literal> mode should be used when the + application can in advance determine the total amount of work that + will be done. As the operation progresses the application should + update the bar widget with the amount of work completed so far. The + widget will reflect this by displaying a growing percentage bar. </simpara> <simpara> - The activity mode is useful when the application cannot determine - the total amount of work and instead simply wishes to provide an - indication that an operation is in progress. In this mode, the - widget will display a block moving back and forth in the progress - area. + The <literal>activity</literal> mode is useful when the application + cannot determine the total amount of work and instead simply wishes + to provide an indication that an operation is in progress. In this + mode, the widget will display a block moving back and forth in the + progress area. + </simpara> + <simpara> + See also: <classname>GtkProgress</classname>, + <function class="GtkProgress">set_activity_mode()</function>. </simpara> - <simpara> - See also: <classname>GtkProgress</classname>. - </simpara> </desc> </classmeta> @@ -35,7 +37,14 @@ <funcsynopsis> <funcprototype> <funcdef> <function>GtkProgressBar</function></funcdef> - <paramdef><classname>GtkAdjustment</classname> <parameter><optional>adjustment = NULL</optional></parameter></paramdef> + <paramdef> + <classname>GtkAdjustment</classname> + <!-- + I took out the 'optional' part because I can't get that to work!! + - sf jan 02 + --> + <parameter>adjustment</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -43,10 +52,65 @@ </shortdesc> <desc> <simpara> - When constructing a progress bar, you may specify an optional - associated <classname>GtkAdjustment</classname> that will be used to - configure the progress bar, including lower and upper bounds of its - values. + When constructing a progress bar, you need to specify an associated + <classname>GtkAdjustment</classname> which will be used to configure + the progress bar's initial value and range. + </simpara> + <para> + <example> + <title>Setting up a Progress Bar</title> + <programlisting role="php"> +dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); + +function update_bar() { + global $progressbar, $value; + $progressbar->set_percentage($value); + start_update(); + } + +function start_update() { + global $value; + if($value <= 1.0) { + $value += 0.01; + gtk::timeout_add(200, 'update_bar'); + } + else gtk::timeout_add(50, array('gtk', 'main_quit')); + } + +$window = &new GtkWindow(); +$window->set_uposition(200, 250); +$window->set_policy(false, false, true); +$window->connect_object('destroy', array('gtk', 'main_quit')); + +/* These adjustment settings are on the wild side for demo purposes */ +$adjustment = &new GtkAdjustment(0.5, 100.0, 200.0, 0.0, 0.0, 0.0); +$value = $adjustment->value; + +$progressbar = &new GtkProgressBar($adjustment); +$progressbar->set_show_text(true); +$progressbar->set_text_alignment(0.02, 1.0); +$progressbar->set_format_string("%v%% complete"); +$progressbar->set_usize(gdk::screen_width()/2, 30); +$window->add($progressbar); + +$window->show_all(); + +start_update(); +gtk::main(); + </programlisting> + </example> + To create a progress bar in <literal>activity</literal> mode, delete + the references to the text string and replace them with + <programlisting> +$progressbar->set_activity_mode(true); + </programlisting> + and any further methods appropriate to an activity indicator. + </para> + <simpara> + Note that a progress bar in <literal>activity</literal> mode will not + be redrawn when the values of the <literal>lower</literal> and + <literal>upper</literal> bounds in the attached + <classname>GtkAdjustment</classname> have been exceeded. </simpara> </desc> </constructor> @@ -57,18 +121,31 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_bar_style</function></funcdef> - <paramdef><enumname>GtkProgressBarStyle</enumname> <parameter>style</parameter></paramdef> + <paramdef> + <enumname>GtkProgressBarStyle</enumname> + <parameter>style</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - Sets the progress bar style. + Sets the progress bar style in percentage mode. </shortdesc> <desc> <simpara> - The default style of progress bar upon creation is - GTK_PROGRESS_CONTINUOUS. This method may be used to change it to - a style specified by <parameter>style</parameter> parameter - (GTK_PROGRESS_CONTINUOUS or GTK_PROGRESS_DISCRETE). + The default style of a progress bar upon creation is + <literal>GTK_PROGRESS_CONTINUOUS</literal>. This method may be used + to change it to the style specified in the <parameter>style</parameter> + parameter (<literal>GTK_PROGRESS_CONTINUOUS</literal> or + <literal>GTK_PROGRESS_DISCRETE</literal>) when the progress bar is in + <literal>percentage</literal> mode. + </simpara> + <simpara> + Note that the progress bar will not display text if it is drawn in the + discrete style. + </simpara> + <simpara> + See also: + <function class="GtkProgressBar">set_discrete_blocks()</function>. </simpara> </desc> </method> @@ -89,6 +166,9 @@ number of blocks. This method can be used to change the number of these blocks. </simpara> + <simpara> + The default value is <literal>10</literal>. + </simpara> </desc> </method> @@ -104,9 +184,13 @@ </shortdesc> <desc> <simpara> - When the progress bar is in the activity mode, this method can be - used to set the step value by which the progress bar will be updated - on each iteration. + When the progress bar is in the <literal>activity</literal> mode, this + method can be used to set the step value by which the progress bar will + be updated on each iteration. Higher values make the progress indicator + appear to move faster. + </simpara> + <simpara> + The default value is <literal>3</literal>. </simpara> </desc> </method> @@ -123,9 +207,12 @@ </shortdesc> <desc> <simpara> - When the progress bar is in the activity mode, this method can be - used to set the number of blocks that make it up, with larger - numbers making the blocks look smaller. + When the progress bar is in <literal>activity</literal> mode, this + method can be used to set the number of blocks that make up the + progress bar. Larger numbers make the progress indicator smaller. + </simpara> + <simpara> + The default value is <literal>5</literal>. </simpara> </desc> </method> @@ -134,7 +221,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_orientation</function></funcdef> - <paramdef><enumname>GtkProgressBarOrientation</enumname> <parameter>orientation</parameter></paramdef> + <paramdef> + <enumname>GtkProgressBarOrientation</enumname> + <parameter>orientation</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -143,9 +233,34 @@ <desc> <simpara> This method can be used to change the orientation of the progress - bar. The <parameter>orientation</parameter> controls whether the bar - is vertical or horizontal and in what direction it grows as the - operation progresses. + bar. The <parameter>orientation</parameter> parameter controls the + direction in which the progress indicator grows (in + <literal>percentage</literal> mode) or moves (in + <literal>activity</literal> mode), as the operation progresses. + </simpara> + <simpara> + The default setting is <literal>GTK_PROGRESS_LEFT_TO_RIGHT</literal>. + </simpara> + </desc> + </method> + + <method id="gtk.gtkprogressbar.method.update"> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>update</function></funcdef> + <paramdef>double <parameter>percentage</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Sets progress update value. *deprecated* + </shortdesc> + <desc> + <simpara> + This is a deprecated method that has had its usage replaced by + <function class="GtkProgress">set_percentage()</function> when a + progress bar is set to the <literal>percentage</literal> mode, or by + <function class="GtkProgress">set_value()</function> when using the + <literal>activity</literal> mode. </simpara> </desc> </method>
Index: php-gtk-doc/en/reference/gtk/gtkmenu.xml diff -u php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.8 php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkmenu.xml:1.8 Wed Jan 16 01:25:25 2002 +++ php-gtk-doc/en/reference/gtk/gtkmenu.xml Sun Jan 20 01:34:39 2002 @@ -601,8 +601,8 @@ <function class="GtkMenu">set_title()</function> sets the window title for a menu that has been detached from its parent through either a <classname>GtkTearoffMenuItem</classname> widget or the - <function class="GtkMenu">set_tearoff_state()</function>. As with all - window titles, the text will be truncated to fit the area available. + <function class="GtkMenu">set_tearoff_state()</function> method. As with + all window titles, the text will be truncated to fit the area available. </simpara> <simpara> Note that the title needs to be set prior to the menu's becoming torn Index: php-gtk-doc/en/reference/gtk/gtkprogress.xml diff -u php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.4 php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkprogress.xml:1.4 Tue Jan 8 02:26:10 2002 +++ php-gtk-doc/en/reference/gtk/gtkprogress.xml Sun Jan 20 01:34:39 2002 @@ -8,18 +8,14 @@ <desc> <simpara> <classname>GtkProgress</classname> is a base class providing methods - and properties for widgets implementing progress bar style - functionality. The only built-in widget using - <classname>GtkProgress</classname> is + for widgets implementing progress bar functionality. The only built-in + widget using <classname>GtkProgress</classname> is <classname>GtkProgressBar</classname>. </simpara> <simpara> Note that <classname>GtkProgress</classname> is an abstract class and cannot be constructed directly. </simpara> - <simpara> - See also: <classname>GtkProgressBar</classname>. - </simpara> </desc> </classmeta> @@ -33,12 +29,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - Controls progress text display. + Toggles progress text display. </shortdesc> <desc> <simpara> The <parameter>show_text</parameter> parameter controls whether the - progress text is shown or not. + progress text is shown. The default setting is <literal>false</literal>. + </simpara> + <simpara> + See also: <function class="GtkProgress">set_format_string()</function>. </simpara> </desc> </method> @@ -61,7 +60,10 @@ <parameter>y_align</parameter> parameters control the horizontal and vertical alignment of the text, respectively. Their range can be from <literal>0.0</literal> to <literal>1.0</literal> (meaning from - one side of progress area to another). + one side of the progress area to another). + </simpara> + <simpara> + The default setting is <literal>(0.5, 0.5)</literal>. </simpara> </desc> </method> @@ -74,12 +76,12 @@ </funcprototype> </funcsynopsis> <shortdesc> - Sets progress text formatting. + Sets and formats progress text. </shortdesc> <desc> <para> - The format of the progress text can be modified with the - <parameter>format</parameter> string. It can contain the following + The content of the progress text can be modified with the + <parameter>format</parameter> string. It can contain the following format characters: <itemizedlist> <listitem> @@ -103,8 +105,16 @@ </simpara> </listitem> </itemizedlist> - The <literal>%</literal> character itself can be specified as <literal>%%</literal>. + The <literal>%</literal> character itself can be specified as + <emphasis>%%</emphasis>. </para> + <simpara> + The default text string is "%p%%". + </simpara> + <simpara> + See also: <classname>GtkAdjustment</classname>, where the progress + value and bounds are set. + </simpara> </desc> </method> @@ -112,7 +122,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_adjustment</function></funcdef> - <paramdef><classname>GtkAdjustment</classname> <parameter>adjustment</parameter></paramdef> + <paramdef> + <classname>GtkAdjustment</classname> + <parameter>adjustment</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -120,10 +133,10 @@ </shortdesc> <desc> <simpara> - A progress has an associated <classname>GtkAdjustment</classname> - object which specifies the bounds and the step increment of the - value the progress of which is being displayed. This method - associates an adjustment object with the progress. + A progress has an associated <classname>GtkAdjustment</classname> + object which specifies the bounds of the value having its progress + displayed. This method associates the specified adjustment object + with the progress. </simpara> </desc> </method> @@ -145,6 +158,9 @@ This method provides a way to directly control the current value and the bounds of a <classname>GtkProgress</classname>. </simpara> + <simpara> + See also: <classname>GtkAdjustment</classname>. + </simpara> </desc> </method> @@ -160,9 +176,13 @@ </shortdesc> <desc> <simpara> - This method sets the current percentage for - <classname>GtkProgress</classname>. Its value must be between - <literal>0.0</literal> to <literal>1.0</literal>. + This method sets the current percentage for a + <classname>GtkProgress</classname>. Its value must be between + <literal>0.0</literal> and <literal>1.0</literal>. + </simpara> + <simpara> + Use this method to update a <classname>GtkProgressBar</classname> that + is in <literal>percentage</literal> mode. </simpara> </desc> </method> @@ -180,8 +200,13 @@ <desc> <simpara> The progress value can be set directly with this method. The value - must be within the range of an underlying - <classname>GtkAdjustment</classname>. + must be within the range of the underlying + <classname>GtkAdjustment</classname> in order for the + <classname>GtkProgressBar</classname> to display it. + </simpara> + <simpara> + Use this method to update a <classname>GtkProgressBar</classname> that + is in <literal>activity</literal> mode. </simpara> </desc> </method> @@ -197,7 +222,9 @@ Gets the current progress value. </shortdesc> <desc> - Returns the current progress value. + <simpara> + Returns the current progress value. + </simpara> </desc> </method> @@ -209,19 +236,24 @@ </funcprototype> </funcsynopsis> <shortdesc> - Controls progress mode. + Toggles progress mode. </shortdesc> <desc> <simpara> - <classname>GtkProgress</classname> can be either in percentage mode - (when the total amount of work is known and progress can be - calculated) or activity mode (when there is no way to estimate - total amount of work and only progress must be indicated somehow). + <classname>GtkProgress</classname> can be either in + <literal>percentage</literal> mode (when the total amount of work is + known and progress can be calculated) or <literal>activity</literal> + mode (when there is no way to estimate the total amount of work and + only activity must be indicated somehow). </simpara> <simpara> If <parameter>activity_mode</parameter> is <literal>true</literal>, the activity mode is turned on, otherwise - the percentage mode. </simpara> + <simpara> + See also: <function class="GtkProgressBar">set_value()</function>, + <function class="GtkProgress">set_percentage()</function>. + </simpara> </desc> </method> @@ -238,9 +270,11 @@ <desc> <simpara> The text indicating the amount of progress can be retrieved with - this method. Before the text is returned, it is formatted with the - currently set progress format (see <function - class="GtkProgress">set_format_string</function>). + this method. Before the text is returned, it is formatted using the + current progress format. + </simpara> + <simpara> + See also: <function class="GtkProgress">set_format_string()</function>). </simpara> </desc> </method> @@ -295,8 +329,8 @@ <desc> <simpara> If you wish to retrieve the progress percentage based on some value - other than the current one, then this method should be used. It - returns the desired percentage as a number between + other than the current one, then this method should be used. It + returns the desired percentage as a number between <literal>0.0</literal> and <literal>1.0</literal>. </simpara> </desc> Index: php-gtk-doc/en/reference/gtk/gtkprogressbar.xml diff -u php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.5 php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.6 --- php-gtk-doc/en/reference/gtk/gtkprogressbar.xml:1.5 Tue Jan 8 02:26:10 2002 +++ php-gtk-doc/en/reference/gtk/gtkprogressbar.xml Sun Jan 20 01:34:39 2002 @@ -7,27 +7,29 @@ </shortdesc> <desc> <simpara> - The purpose of <classname>GtkProgressBar</classname> is to show user the progress of a - long-running operation. It can be used in two modes: a percentage - mode and an activity mode. + The purpose of <classname>GtkProgressBar</classname> is to show the + user the progress of a long-running operation. It can be used in two + modes: a <literal>percentage</literal> mode or an + <literal>activity</literal> mode. </simpara> <simpara> - The percentage mode should be used when the application can in - advance determine the total amount of work that will be done. As the - operation progresses the application should update the bar widget - with the amount of work completed so far. The widget will reflect - this by displaying a growing percentage bar. + The <literal>percentage</literal> mode should be used when the + application can in advance determine the total amount of work that + will be done. As the operation progresses the application should + update the bar widget with the amount of work completed so far. The + widget will reflect this by displaying a growing percentage bar. </simpara> <simpara> - The activity mode is useful when the application cannot determine - the total amount of work and instead simply wishes to provide an - indication that an operation is in progress. In this mode, the - widget will display a block moving back and forth in the progress - area. + The <literal>activity</literal> mode is useful when the application + cannot determine the total amount of work and instead simply wishes + to provide an indication that an operation is in progress. In this + mode, the widget will display a block moving back and forth in the + progress area. + </simpara> + <simpara> + See also: <classname>GtkProgress</classname>, + <function class="GtkProgress">set_activity_mode()</function>. </simpara> - <simpara> - See also: <classname>GtkProgress</classname>. - </simpara> </desc> </classmeta> @@ -35,7 +37,14 @@ <funcsynopsis> <funcprototype> <funcdef> <function>GtkProgressBar</function></funcdef> - <paramdef><classname>GtkAdjustment</classname> <parameter><optional>adjustment = NULL</optional></parameter></paramdef> + <paramdef> + <classname>GtkAdjustment</classname> + <!-- + I took out the 'optional' part because I can't get that to work!! + - sf jan 02 + --> + <parameter>adjustment</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -43,10 +52,65 @@ </shortdesc> <desc> <simpara> - When constructing a progress bar, you may specify an optional - associated <classname>GtkAdjustment</classname> that will be used to - configure the progress bar, including lower and upper bounds of its - values. + When constructing a progress bar, you need to specify an associated + <classname>GtkAdjustment</classname> which will be used to configure + the progress bar's initial value and range. + </simpara> + <para> + <example> + <title>Setting up a Progress Bar</title> + <programlisting role="php"> +dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); + +function update_bar() { + global $progressbar, $value; + $progressbar->set_percentage($value); + start_update(); + } + +function start_update() { + global $value; + if($value <= 1.0) { + $value += 0.01; + gtk::timeout_add(200, 'update_bar'); + } + else gtk::timeout_add(50, array('gtk', 'main_quit')); + } + +$window = &new GtkWindow(); +$window->set_uposition(200, 250); +$window->set_policy(false, false, true); +$window->connect_object('destroy', array('gtk', 'main_quit')); + +/* These adjustment settings are on the wild side for demo purposes */ +$adjustment = &new GtkAdjustment(0.5, 100.0, 200.0, 0.0, 0.0, 0.0); +$value = $adjustment->value; + +$progressbar = &new GtkProgressBar($adjustment); +$progressbar->set_show_text(true); +$progressbar->set_text_alignment(0.02, 1.0); +$progressbar->set_format_string("%v%% complete"); +$progressbar->set_usize(gdk::screen_width()/2, 30); +$window->add($progressbar); + +$window->show_all(); + +start_update(); +gtk::main(); + </programlisting> + </example> + To create a progress bar in <literal>activity</literal> mode, delete + the references to the text string and replace them with + <programlisting> +$progressbar->set_activity_mode(true); + </programlisting> + and any further methods appropriate to an activity indicator. + </para> + <simpara> + Note that a progress bar in <literal>activity</literal> mode will not + be redrawn when the values of the <literal>lower</literal> and + <literal>upper</literal> bounds in the attached + <classname>GtkAdjustment</classname> have been exceeded. </simpara> </desc> </constructor> @@ -57,18 +121,31 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_bar_style</function></funcdef> - <paramdef><enumname>GtkProgressBarStyle</enumname> <parameter>style</parameter></paramdef> + <paramdef> + <enumname>GtkProgressBarStyle</enumname> + <parameter>style</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - Sets the progress bar style. + Sets the progress bar style in percentage mode. </shortdesc> <desc> <simpara> - The default style of progress bar upon creation is - GTK_PROGRESS_CONTINUOUS. This method may be used to change it to - a style specified by <parameter>style</parameter> parameter - (GTK_PROGRESS_CONTINUOUS or GTK_PROGRESS_DISCRETE). + The default style of a progress bar upon creation is + <literal>GTK_PROGRESS_CONTINUOUS</literal>. This method may be used + to change it to the style specified in the <parameter>style</parameter> + parameter (<literal>GTK_PROGRESS_CONTINUOUS</literal> or + <literal>GTK_PROGRESS_DISCRETE</literal>) when the progress bar is in + <literal>percentage</literal> mode. + </simpara> + <simpara> + Note that the progress bar will not display text if it is drawn in the + discrete style. + </simpara> + <simpara> + See also: + <function class="GtkProgressBar">set_discrete_blocks()</function>. </simpara> </desc> </method> @@ -89,6 +166,9 @@ number of blocks. This method can be used to change the number of these blocks. </simpara> + <simpara> + The default value is <literal>10</literal>. + </simpara> </desc> </method> @@ -104,9 +184,13 @@ </shortdesc> <desc> <simpara> - When the progress bar is in the activity mode, this method can be - used to set the step value by which the progress bar will be updated - on each iteration. + When the progress bar is in the <literal>activity</literal> mode, this + method can be used to set the step value by which the progress bar will + be updated on each iteration. Higher values make the progress indicator + appear to move faster. + </simpara> + <simpara> + The default value is <literal>3</literal>. </simpara> </desc> </method> @@ -123,9 +207,12 @@ </shortdesc> <desc> <simpara> - When the progress bar is in the activity mode, this method can be - used to set the number of blocks that make it up, with larger - numbers making the blocks look smaller. + When the progress bar is in <literal>activity</literal> mode, this + method can be used to set the number of blocks that make up the + progress bar. Larger numbers make the progress indicator smaller. + </simpara> + <simpara> + The default value is <literal>5</literal>. </simpara> </desc> </method> @@ -134,7 +221,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_orientation</function></funcdef> - <paramdef><enumname>GtkProgressBarOrientation</enumname> <parameter>orientation</parameter></paramdef> + <paramdef> + <enumname>GtkProgressBarOrientation</enumname> + <parameter>orientation</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -143,9 +233,34 @@ <desc> <simpara> This method can be used to change the orientation of the progress - bar. The <parameter>orientation</parameter> controls whether the bar - is vertical or horizontal and in what direction it grows as the - operation progresses. + bar. The <parameter>orientation</parameter> parameter controls the + direction in which the progress indicator grows (in + <literal>percentage</literal> mode) or moves (in + <literal>activity</literal> mode), as the operation progresses. + </simpara> + <simpara> + The default setting is <literal>GTK_PROGRESS_LEFT_TO_RIGHT</literal>. + </simpara> + </desc> + </method> + + <method id="gtk.gtkprogressbar.method.update"> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>update</function></funcdef> + <paramdef>double <parameter>percentage</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Sets progress update value. *deprecated* + </shortdesc> + <desc> + <simpara> + This is a deprecated method that has had its usage replaced by + <function class="GtkProgress">set_percentage()</function> when a + progress bar is set to the <literal>percentage</literal> mode, or by + <function class="GtkProgress">set_value()</function> when using the + <literal>activity</literal> mode. </simpara> </desc> </method>