Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_entry.c ewl_entry.h
Log Message:
Double click will select all text in the entry, patch from Vincent Torri.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -3 -r1.88 -r1.89
--- ewl_entry.c 24 May 2004 14:56:01 -0000 1.88
+++ ewl_entry.c 24 May 2004 19:25:20 -0000 1.89
@@ -144,6 +144,8 @@
ewl_entry_mouse_down_cb, NULL);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_UP,
ewl_entry_mouse_up_cb);
+ ewl_callback_append(w, EWL_CALLBACK_DOUBLE_CLICKED,
+ ewl_entry_mouse_double_click_cb, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
ewl_entry_mouse_move_cb, NULL);
}
@@ -154,6 +156,8 @@
ewl_entry_mouse_down_cb);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_UP,
ewl_entry_mouse_up_cb);
+ ewl_callback_del(w, EWL_CALLBACK_DOUBLE_CLICKED,
+ ewl_entry_mouse_double_click_cb);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE,
ewl_entry_mouse_move_cb);
}
@@ -342,6 +346,8 @@
index = len + 1;
ewl_cursor_set_base(EWL_CURSOR(e->cursor), index);
+ e->in_select_mode = FALSE;
+
ewl_widget_configure(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -362,6 +368,8 @@
e->start_time = 0.0;
}
+ e->in_select_mode = TRUE;
+
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -383,7 +391,8 @@
/*
* Check for the button pressed state, otherwise, do nothing.
*/
- if (!(ewl_object_has_state(EWL_OBJECT(e), EWL_FLAG_STATE_PRESSED)))
+ if (!(ewl_object_has_state(EWL_OBJECT(e), EWL_FLAG_STATE_PRESSED)) ||
+ (e->in_select_mode))
DRETURN(DLEVEL_STABLE);
if (ev->x < CURRENT_X(e->text))
@@ -425,6 +434,31 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
+void
+ewl_entry_mouse_double_click_cb(Ewl_Widget * w, void *ev_data, void *user_data)
+{
+ Ewl_Event_Mouse_Down *ev;
+ Ewl_Entry *e;
+ int len = 0;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("w", w);
+
+ ev = ev_data;
+ e = EWL_ENTRY(w);
+
+ len = ewl_text_length_get(EWL_TEXT(e->text));
+
+ ewl_cursor_set_base(EWL_CURSOR(e->cursor), 1);
+ ewl_cursor_select_to(EWL_CURSOR(e->cursor), len);
+
+ e->in_select_mode = TRUE;
+
+ ewl_widget_configure(w);
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
void ewl_entry_select_cb(Ewl_Widget * w, void *ev_data, void *user_data)
{
Ewl_Entry *e;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_entry.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewl_entry.h 30 Apr 2004 05:43:59 -0000 1.33
+++ ewl_entry.h 24 May 2004 19:25:20 -0000 1.34
@@ -67,6 +67,8 @@
void ewl_entry_mouse_down_cb(Ewl_Widget * w, void *ev_data, void *user_data);
void ewl_entry_mouse_up_cb(Ewl_Widget * w, void *ev_data, void *user_data);
void ewl_entry_mouse_move_cb(Ewl_Widget * w, void *ev_data, void *user_data);
+void ewl_entry_mouse_double_click_cb(Ewl_Widget * w, void *ev_data,
+ void *user_data);
void ewl_entry_select_cb(Ewl_Widget * w, void *ev_data, void *user_data);
void ewl_entry_deselect_cb(Ewl_Widget * w, void *ev_data, void *user_data);
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs