Elementary: Update documentation for progressbar example
authorDaniel Willmann <d.willmann@samsung.com>
Tue, 3 Jul 2012 16:28:06 +0000 (16:28 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Tue, 3 Jul 2012 16:28:06 +0000 (16:28 +0000)
Explanation of the format function and changed callback.

Patch by: Daniel Willmann <d.willmann@samsung.com>

SVN revision: 73244

doc/examples.dox
src/examples/progressbar_example.c

index 390b836..0ce4b13 100644 (file)
  * @until pb2
  *
  * Next, comes a progress bar with an @b icon, a primary label and a
- * @b custom unit label set. It's also made to grow its bar in an
+ * unit label @b function set. It's also made to grow its bar in an
  * @b inverted manner, so check that out during the timer's progression:
  * @dontinclude progressbar_example.c
  * @skip ic1 =
  * manually, as you can see in the @ref progressbar_example_c
  * "complete code".
  *
+ * The format callback is a simple function that gets passed the progress value
+ * and returns a string. A free function should be provided as well, if the
+ * format callback allocates memory.
+ * @dontinclude progressbar_example.c
+ * @skip Format callback
+ * @until }
+ * @until }
+ * 
+ * The last horizontal progress bar has a callback that gets called when its
+ * value is @b changed. This callback updates a label to provide an estimate
+ * when the operation finishes.
+ * @dontinclude progressbar_example.c
+ * @skip pb3
+ * @skip changed trigger
+ * @until pb4
+ *
+ * The "changed" signal is emitted every time the progressbar value is updated
+ * through @ref elm_progressbar_value_set(). This callback calculates and
+ * displays the ETA based on the progress and time that has passed.
+ * @dontinclude progressbar_example.c
+ * @skip Callback for "changed" signal
+ * @until }
+ * @until }
+ * @until }
+ *
  * The next three progress bars are just variants on the ones already
  * shown, but now all being @b vertical. Another time we use one of
  * than to give the window a minimum vertical size, with
index c6dca5f..0aa9b79 100644 (file)
@@ -86,6 +86,7 @@ _progressbar_example_stop(void        *data,
      }
 }
 
+/* Format callback */
 static char *
 _progress_format_cb(double val)
 {
@@ -102,6 +103,7 @@ _progress_format_free(char *str)
    free(str);
 }
 
+/* Callback for "changed" signal */
 static void
 _on_changed(void        *data,
             Evas_Object *obj,