Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/test
Modified Files:
ewl_progressbar_test.c
Log Message:
More progressbar work from balony. Slight modifications to the theme for it
too.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/test/ewl_progressbar_test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_progressbar_test.c 12 Nov 2003 20:07:17 -0000 1.1
+++ ewl_progressbar_test.c 12 Nov 2003 23:18:00 -0000 1.2
@@ -6,17 +6,39 @@
int __increment_progress(Ewl_Widget *progressbar)
{
double val;
+ double value, range;
+ char c[30];
val = ewl_progressbar_get_value(EWL_PROGRESSBAR(progressbar));
- if (val >= 1.00) {
+ if (val >= 200) {
ecore_timer_del(progress_timer);
progress_timer = NULL;
return 0;
}
- val += 0.05;
+ val += 1;
ewl_progressbar_set_value(EWL_PROGRESSBAR(progressbar), val);
+
+ if (val >= 20 && val < 35 ) {
+ ewl_progressbar_set_custom_label (EWL_PROGRESSBAR(progressbar),
+ "%.0lf / %.0lf kbytes");
+ }
+
+ if (val >= 35 && val < 60) {
+ value = ewl_progressbar_get_value (EWL_PROGRESSBAR(progressbar));
+ range = ewl_progressbar_get_range (EWL_PROGRESSBAR(progressbar));
+
+ snprintf (c, sizeof (c), "%.0lf of %.0lf beers", value, range);
+ ewl_progressbar_set_label (EWL_PROGRESSBAR(progressbar), c);
+ }
+
+ if (val == 60)
+ ewl_progressbar_label_hide (EWL_PROGRESSBAR(progressbar));
+
+ if (val == 70)
+ ewl_progressbar_label_show (EWL_PROGRESSBAR(progressbar));
+
return 1;
}
@@ -55,14 +77,16 @@
progressbar_box = ewl_vbox_new();
ewl_container_append_child(EWL_CONTAINER(progressbar_win),
progressbar_box);
- ewl_box_set_spacing(EWL_BOX(progressbar_box), 10);
+ ewl_box_set_spacing(EWL_BOX(progressbar_box), 0);
ewl_widget_show(progressbar_box);
progressbar = ewl_progressbar_new();
- ewl_progressbar_set_value (EWL_PROGRESSBAR(progressbar), 0.0);
+ ewl_progressbar_set_value (EWL_PROGRESSBAR(progressbar), 0);
ewl_widget_show (progressbar);
- progress_timer = ecore_timer_add(0.2, __increment_progress,
+ ewl_progressbar_set_range (EWL_PROGRESSBAR(progressbar), 123);
+
+ progress_timer = ecore_timer_add(0.1, __increment_progress,
progressbar);
ewl_container_append_child(EWL_CONTAINER(progressbar_box), progressbar);
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs