Hello!
While playing with some progressbars, I found myself dreaming about
some missing features... So I coded them :p
- First I added a char *label_format to struct Ewl_Progressbar, it is
set to %3$.0lf%% at initialization, to keep the default percentage
mode, as I changed label arguments to value, range, value/range*100,
range-value, (range-value)/range*100 (there shouldn't be anything that
could be useful missing now :p).
- ewl_progressbar_label_get: retrieves current label value
- ewl_progressbar_label_format_set: sets the default label format, so
that we don't have to call ewl_progressbar_custom_label_set at each
value update, that's a hassle less :)
- ewl_progressbar_label_format_get: do I have to explain what it's
supposed to do ;D
- ewl_progressbar_default_label_set: resets the label format to its
initial value, so %3$.0lf%% (maybe this name is not as good)
- some cosmetic changes (english error corrections)
- correction of default (winter) theme where the bottom of the
progressbar (the 'done' part) was not shown
Hope this is bugless (;D) and helpful...
Cheers!
--
ilLogict
Etudiant:1A, E.S.I.A.L., Nancy, France
Student: Y1, E.S.I.A.L., Nancy, France
Website: http://illogict.online.fr
E-Mail: [EMAIL PROTECTED]
ICQ: #74274856
AIM: illogict
MSN: [EMAIL PROTECTED]
Yahoo: illogict
Jabber: [EMAIL PROTECTED]
Mobile: +33 6 81921083
Message: Enlightenment DR17 oune ! Et honte ceux qui ne sont pas d'accord !
Message: Enlightenment DR17 rocks! Shame on whoever doesn't agree!Index: libs/ewl/data/themes/default/bits/progressbar-groups.edc
===
RCS file: /cvsroot/enlightenment/e17/libs/ewl/data/themes/default/bits/progressbar-groups.edc,v
retrieving revision 1.3
diff -u -r1.3 progressbar-groups.edc
--- libs/ewl/data/themes/default/bits/progressbar-groups.edc 1 Nov 2004 04:49:49 - 1.3
+++ libs/ewl/data/themes/default/bits/progressbar-groups.edc 6 Jun 2005 15:31:33 -
@@ -46,7 +46,7 @@
}
rel2 {
relative, 1.0 1.0;
- offset, -1 -1;
+ offset, -1 -3;
}
image {
normal, button-up.png;
Index: libs/ewl/src/bin/ewl_test.c
===
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/ewl_test.c,v
retrieving revision 1.8
diff -u -r1.8 ewl_test.c
--- libs/ewl/src/bin/ewl_test.c 28 May 2005 20:32:49 - 1.8
+++ libs/ewl/src/bin/ewl_test.c 6 Jun 2005 15:31:33 -
@@ -78,10 +78,10 @@
{ Spinner, __create_spinner_test_window, ewl_spinner_test.c },
{ Statusbar, __create_statusbar_test_window, ewl_statusbar_test.c },
{ Table, __create_table_test_window, ewl_table_test.c },
- { Textarea,__create_textarea_test_window,ewl_textarea_test.c },
- { Theme, __create_theme_test_window, ewl_theme_test.c },
+ //{ Textarea,__create_textarea_test_window,ewl_textarea_test.c },
+ //{ Theme, __create_theme_test_window, ewl_theme_test.c },
{ Tooltip, __create_tooltip_test_window, ewl_tooltip_test.c },
- { Tree,__create_tree_test_window,ewl_tree_test.c },
+ //{ Tree,__create_tree_test_window,ewl_tree_test.c },
{ 0, 0, 0 }
};
static char* tooltips[] = {
@@ -227,6 +227,7 @@
* Add the row to the tree, and setup it's alignment and
* fill.
*/
+ printf(%d\n,i);
prow[i] = ewl_tree_text_row_add( EWL_TREE (main_tree), NULL,
(tests[i].name));
ewl_callback_append (EWL_WIDGET (prow[i]),
Index: libs/ewl/src/lib/ewl_progressbar.c
===
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_progressbar.c,v
retrieving revision 1.2
diff -u -r1.2 ewl_progressbar.c
--- libs/ewl/src/lib/ewl_progressbar.c 28 Mar 2005 07:04:29 - 1.2
+++ libs/ewl/src/lib/ewl_progressbar.c 6 Jun 2005 15:31:33 -
@@ -6,7 +6,7 @@
/**
* @return Returns NULL on failure, or a pointer to the new progressbar on success.
- * @brief Allocate and initialize a new progressbar
+ * @brief Allocates and initializes a new progressbar.
*/
Ewl_Widget *ewl_progressbar_new()
{
@@ -26,7 +26,7 @@
/**
* @param p: the progressbar to be initialized
* @return Returns no value.
- * @brief Initialize the progressbar to some sane starting values
+ * @brief Initializes the progressbar to some sane starting values.
*/
void ewl_progressbar_init(Ewl_Progressbar * p)
{
@@ -64,6 +64,10 @@
p-value = 0.0;
p-range = 100.0;
p-auto_label = TRUE;
+ /*
+ * Do a percentage calculation as a default label.
+ */
+ p-label_format = strdup(%3$.0lf%%);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
ewl_progressbar_configure_cb, NULL);
@@ -74,9 +78,9 @@
/**
* @param p: the progressbar whose value will be changed
- * @param v: the new value of the statusbar
+ * @param v: the new value of the progressbar
* @return