Enlightenment CVS committal
Author : ningerso
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests
Modified Files:
ewl_colorpicker.c
Log Message:
Colorpicker patch from nerochiaro.
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/ewl_colorpicker.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_colorpicker.c 10 Mar 2006 04:05:42 -0000 1.2
+++ ewl_colorpicker.c 11 May 2006 23:12:55 -0000 1.3
@@ -1,6 +1,40 @@
#include "Ewl_Test.h"
#include <stdio.h>
+/**
+ * @addtogroup Ewl_Colorpicker
+ * @section image_tut Tutorial
+ *
+ * The Ewl_Colorpicker widget provides a way to let the user select a color
+ * either by manually entering its values, or graphically via the built-in
+ * Ewl_Spectrum widget, which also provides a preview of the color.
+ * The color can be selected in RGB or HSV format (but can be retrieved only
+ * in RGB format for now).
+ *
+ * @code
+ * Ewl_Widget *cp;
+ * cp = ewl_colorpicker_new();
+ * ewl_widget_show(cp);
+ * @endcode
+ *
+ * Once you've setup the colour picker, you can read its current and previous
+ * value and set them. For example the following swaps the two.
+ *
+ * @code
+ * unsigned int r,g,b;
+ * ewl_colorpicker_current_rgb_get(EWL_COLORPICKER(cp), &r, &g, &b);
+ * ewl_colorpicker_previous_rgb_set(EWL_COLORPICKER(cp), r, g, b);
+ * @endcode
+ *
+ * You can also change the display mode of the spectrum programmatically
+ *
+ * @code
+ * void ewl_colorpicker_color_mode_set(Ewl_Colorpicker *cp,
Ewl_Color_Mode type);
+ * Ewl_Color_Mode ewl_colorpicker_color_mode_get(Ewl_Colorpicker *cp);
+ * @endcode
+ *
+ */
+
static int create_test(Ewl_Container *box);
static void color_value_changed(Ewl_Widget *w, void *ev, void *data);
@@ -33,9 +67,10 @@
void *data __UNUSED__)
{
Ewl_Color_Set *col;
+ int r, g, b;
- col = ev;
- printf("value changed to (%i, %i, %i)\n", col->r, col->g, col->b);
+ ewl_colorpicker_current_rgb_get(EWL_COLORPICKER(w), &r, &g, &b);
+ printf("value changed to (%i, %i, %i)\n", r, g, b);
}
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs