aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Lahey <clahey@src.gnome.org>2000-01-14 13:18:59 +0800
committerChris Lahey <clahey@src.gnome.org>2000-01-14 13:18:59 +0800
commit4ac908c6ffa505ae3978eec809bf50fc7cb88e90 (patch)
treeec44e0269b86ab31e5b3c0a4aa5e10d591fb0d7c /addressbook/gui
parentf21a1a70bdcdf055e889a3ab736d76153ca2f760 (diff)
downloadgsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar.gz
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar.bz2
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar.lz
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar.xz
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.tar.zst
gsoc2013-evolution-4ac908c6ffa505ae3978eec809bf50fc7cb88e90.zip
Added selection and clipboard support. Added up and down arrow keys. Fixed
* widgets/e-text-event-processor-types.h, widgets/e-text-event-processor-emacs-like.c, widgets/e-text.c, widgets/e-text.h: Added selection and clipboard support. Added up and down arrow keys. Fixed choice of font colors for the selection to be based on the current style. * widgets/e-minicard.c: Caused a click to grab the focus. Changed the fake information added. * widgets/e-minicard-label.c: Forward mouse events to the field EText item. svn path=/trunk/; revision=1568
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/minicard/e-minicard-label.c43
-rw-r--r--addressbook/gui/minicard/e-minicard.c7
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c43
-rw-r--r--addressbook/gui/widgets/e-minicard.c7
4 files changed, 92 insertions, 8 deletions
diff --git a/addressbook/gui/minicard/e-minicard-label.c b/addressbook/gui/minicard/e-minicard-label.c
index a550031123..7e32acad59 100644
--- a/addressbook/gui/minicard/e-minicard-label.c
+++ b/addressbook/gui/minicard/e-minicard-label.c
@@ -126,7 +126,6 @@ e_minicard_label_class_init (EMinicardLabelClass *klass)
static void
e_minicard_label_init (EMinicardLabel *minicard_label)
{
- GnomeCanvasGroup *group = GNOME_CANVAS_GROUP( minicard_label );
minicard_label->width = 10;
minicard_label->height = 10;
minicard_label->rect = NULL;
@@ -215,7 +214,6 @@ e_minicard_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
static void
e_minicard_label_realize (GnomeCanvasItem *item)
{
- double ascent, descent;
EMinicardLabel *e_minicard_label;
GnomeCanvasGroup *group;
@@ -339,7 +337,46 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
}
}
break;
- default:
+ case GDK_BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ case GDK_MOTION_NOTIFY: {
+ GnomeCanvasItem *field;
+ ArtPoint p;
+ double inv[6], affine[6];
+ gboolean return_val;
+
+ field = e_minicard_label->field;
+ art_affine_identity (affine);
+
+ if (field->xform != NULL) {
+ if (field->object.flags & GNOME_CANVAS_ITEM_AFFINE_FULL) {
+ art_affine_multiply (affine, affine, field->xform);
+ } else {
+ affine[4] += field->xform[0];
+ affine[5] += field->xform[1];
+ }
+ }
+
+ art_affine_invert (inv, affine);
+ if (event->type == GDK_MOTION_NOTIFY) {
+ p.x = event->motion.x;
+ p.y = event->motion.y;
+ art_affine_point (&p, &p, inv);
+ event->motion.x = p.x;
+ event->motion.y = p.y;
+ } else {
+ p.x = event->button.x;
+ p.y = event->button.y;
+ art_affine_point (&p, &p, inv);
+ event->button.x = p.x;
+ event->button.y = p.y;
+ }
+
+ gtk_signal_emit_by_name(GTK_OBJECT(e_minicard_label->field), "event", event, &return_val);
+ return return_val;
+ break;
+ }
+ default:
break;
}
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index 52d241d11e..bef929b36c 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/e-minicard.c
@@ -279,7 +279,7 @@ e_minicard_realize (GnomeCanvasItem *item)
"y", e_minicard->height,
"width", e_minicard->width - 4.0,
"fieldname", "Email:",
- "field", "clahey@helixcode.com",
+ "field", "clahey@address.com",
NULL );
e_minicard->fields = g_list_append( e_minicard->fields, new_item);
@@ -349,6 +349,11 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
}
}
break;
+ case GDK_BUTTON_PRESS:
+ if (event->button.button == 1) {
+ gnome_canvas_item_grab_focus(item);
+ }
+ break;
case GDK_KEY_PRESS:
if (event->key.length == 1 && event->key.string[0] == '\t') {
GList *list;
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index a550031123..7e32acad59 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -126,7 +126,6 @@ e_minicard_label_class_init (EMinicardLabelClass *klass)
static void
e_minicard_label_init (EMinicardLabel *minicard_label)
{
- GnomeCanvasGroup *group = GNOME_CANVAS_GROUP( minicard_label );
minicard_label->width = 10;
minicard_label->height = 10;
minicard_label->rect = NULL;
@@ -215,7 +214,6 @@ e_minicard_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
static void
e_minicard_label_realize (GnomeCanvasItem *item)
{
- double ascent, descent;
EMinicardLabel *e_minicard_label;
GnomeCanvasGroup *group;
@@ -339,7 +337,46 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
}
}
break;
- default:
+ case GDK_BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ case GDK_MOTION_NOTIFY: {
+ GnomeCanvasItem *field;
+ ArtPoint p;
+ double inv[6], affine[6];
+ gboolean return_val;
+
+ field = e_minicard_label->field;
+ art_affine_identity (affine);
+
+ if (field->xform != NULL) {
+ if (field->object.flags & GNOME_CANVAS_ITEM_AFFINE_FULL) {
+ art_affine_multiply (affine, affine, field->xform);
+ } else {
+ affine[4] += field->xform[0];
+ affine[5] += field->xform[1];
+ }
+ }
+
+ art_affine_invert (inv, affine);
+ if (event->type == GDK_MOTION_NOTIFY) {
+ p.x = event->motion.x;
+ p.y = event->motion.y;
+ art_affine_point (&p, &p, inv);
+ event->motion.x = p.x;
+ event->motion.y = p.y;
+ } else {
+ p.x = event->button.x;
+ p.y = event->button.y;
+ art_affine_point (&p, &p, inv);
+ event->button.x = p.x;
+ event->button.y = p.y;
+ }
+
+ gtk_signal_emit_by_name(GTK_OBJECT(e_minicard_label->field), "event", event, &return_val);
+ return return_val;
+ break;
+ }
+ default:
break;
}
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 52d241d11e..bef929b36c 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -279,7 +279,7 @@ e_minicard_realize (GnomeCanvasItem *item)
"y", e_minicard->height,
"width", e_minicard->width - 4.0,
"fieldname", "Email:",
- "field", "clahey@helixcode.com",
+ "field", "clahey@address.com",
NULL );
e_minicard->fields = g_list_append( e_minicard->fields, new_item);
@@ -349,6 +349,11 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
}
}
break;
+ case GDK_BUTTON_PRESS:
+ if (event->button.button == 1) {
+ gnome_canvas_item_grab_focus(item);
+ }
+ break;
case GDK_KEY_PRESS:
if (event->key.length == 1 && event->key.string[0] == '\t') {
GList *list;