aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-minicard
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-02-24 14:51:23 +0800
committerChris Lahey <clahey@src.gnome.org>2000-02-24 14:51:23 +0800
commit7699b8996aa2d9ae3fea0e94981637c98e89a273 (patch)
treef4321790cd8c8619babfac9e2d4f38ca621d7e2d /widgets/e-minicard
parent6b338ae8ecd1332f574e33620e0765a16aab03a3 (diff)
downloadgsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar.gz
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar.bz2
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar.lz
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar.xz
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.tar.zst
gsoc2013-evolution-7699b8996aa2d9ae3fea0e94981637c98e89a273.zip
This were moved to widgets/e-text/ a while ago but never removed. They
2000-02-24 Christopher James Lahey <clahey@helixcode.com> * widgets/e-text.c, widgets/e-text.h, e-text-event-processor.c, e-text-event-processor.h, e-text-event-processor-emacs-like.c, e-text-event-processor-emacs-like.h, e-text-event-processor-types.h: This were moved to widgets/e-text/ a while ago but never removed. They have now been removed. * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Removed some warnings from this file. Made tooltips disappear when you're finished with them. * widgets/e-minicard/test-reflow.c, widgets/e-minicard/test-minicard.c, widgets/e-minicard/test-minicard-label.c: Commented out unused about_callback functions. * widgets/e-minicard/e-reflow.c: Made e-reflow pass an EFocus to its e-minicard children. * widgets/e-minicard/e-minicard.c: Made e-minicard take and return an EFocus for its "has_focus" argument. This makes shift-tab work properly. * widgets/e-minicard/e-minicard-label.c: Made e-minicard-label take and return an EFocus for its "has_focus" argument. Made the font that e-minicard-label uses only be allocated once. * e-util/e-canvas-utils.h: Fixed the comment at the top and added #ifndef __E_CANVAS_UTILS__. * e-util/Makefile.am: Added e-xml-utils.c and e-xml-utils.h. * e-util/e-xml-utils.h, e-util/e-xml-utils.c: Added files for some xml utilities. * e-util/e-util.h: Added type EFocus which describes which direction the focus will be coming from. in mail: 2000-02-24 Christopher James Lahey <clahey@helixcode.com> * message-list.c: Changed this to not use the "x" and "y" arguments to e-table-item. in widgets/e-table: 2000-02-24 Christopher James Lahey <clahey@helixcode.com> * e-table-subset-variable.c, e-table-subset-variable.h: A new model which is a subset, but you can add and remove rows. * test-table.c: Added a thaw method for use with the e-table-subset (emits model_changed.) Adapted to the changes to e_table_item. Properly parse headers. Adapted to the changes to e_table, including creating example xml spec data. * test-cols.c, test-check.c: Added a thaw method for use with the e-table-subset (emits model_changed.) Adapted to the changes to e_table_item. * e-table.c, e-table.h: Reworked e-table to use the ETable grouping system. The only difference for the interface is that instead of passing in a column_spec and a grouping_spec, you pass in a single string that is an xml format that includes both pieces of information. * e-table-subset.h: Added rules for emacs to do correct indentation. * e-table-subset.c: Implemented freezing. No signals are emitted while frozen and "model_changed" is emitted when thawed. * e-table-sorted.h: ETableSortedClass has ETableSubset as its parent object instead of ETableSubsetClass. Fixed this. * e-table-simple.c, e-table-simple.h: Implemented the thaw method. Use of simple now requires an extra argument (the thaw method.) * e-table-model.h, e-table-model.c: Added e_table_model_freeze and e_table_model_thaw. * e-table-item.h, e-table-item.c: Reworked this a bit to make it provide some things the new group system needed and to make inter-item keyboard focus work. Changed the external interface only in the list of arguments it recognizes and signals it emits. Instead of "x" and "y", you have to use e_canvas_item_move_absolute and instead of emitting a "height_changed" signal, it emits a "resize" signal. There's new "has_focus", "width", and "height" arguments and a function to get the currently focused column. * e-table-header-item.c: Got rid of some warnings here. Changed the * e-table-group-leaf.h, e-table-group-leaf.c, e-table-group-container.h, e-table-group-container.c: New types to make e_table_group work properly. * e-table-group.h, e-table-group.c: Completely reworked e-table grouping. e-table-group now uses a hierarchical structure. * e-cell.h: Added e_cell_print. This doesn't work yet. * e-cell.c: Made e_cell_realize exist. (It was improperly named e_cell_view_realize in the .c.) * e-cell-text.c: Made the blinking cursor disappear properly. * check-filled.xpm, check-empty.xpm: Made these const char *[] instead of char *[] to avoid compiler warnings. * Makefile.am: Added e-table-group-container.c, e-table-group-container.h, e-table-group-leaf.c, e-table-group-leaf.h, e-table-subset-variable.c, e-table-subset-variable.h. svn path=/trunk/; revision=1915
Diffstat (limited to 'widgets/e-minicard')
-rw-r--r--widgets/e-minicard/e-minicard-label.c32
-rw-r--r--widgets/e-minicard/e-minicard.c27
-rw-r--r--widgets/e-minicard/e-reflow.c6
-rw-r--r--widgets/e-minicard/test-minicard-label.c2
-rw-r--r--widgets/e-minicard/test-minicard.c2
-rw-r--r--widgets/e-minicard/test-reflow.c2
6 files changed, 46 insertions, 25 deletions
diff --git a/widgets/e-minicard/e-minicard-label.c b/widgets/e-minicard/e-minicard-label.c
index 43603f2d6d..5b528d6190 100644
--- a/widgets/e-minicard/e-minicard-label.c
+++ b/widgets/e-minicard/e-minicard-label.c
@@ -24,6 +24,7 @@
#include "e-minicard-label.h"
#include "e-text.h"
#include "e-canvas.h"
+#include "e-util.h"
static void e_minicard_label_init (EMinicardLabel *card);
static void e_minicard_label_class_init (EMinicardLabelClass *klass);
static void e_minicard_label_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
@@ -32,8 +33,8 @@ static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_label_realize (GnomeCanvasItem *item);
static void e_minicard_label_unrealize (GnomeCanvasItem *item);
-static void _update_label( EMinicardLabel *minicard_label );
-static void _resize( GtkObject *object, gpointer data );
+static void update_label( EMinicardLabel *minicard_label );
+static void resize( GtkObject *object, gpointer data );
static GnomeCanvasGroupClass *parent_class = NULL;
@@ -148,11 +149,11 @@ e_minicard_label_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
switch (arg_id){
case ARG_WIDTH:
e_minicard_label->width = GTK_VALUE_DOUBLE (*arg);
- _update_label( e_minicard_label );
+ update_label( e_minicard_label );
gnome_canvas_item_request_update (item);
break;
case ARG_HAS_FOCUS:
- if (e_minicard_label->field && GTK_VALUE_BOOL(*arg))
+ if (e_minicard_label->field && (GTK_VALUE_ENUM(*arg) != E_FOCUS_NONE))
e_canvas_item_grab_focus(e_minicard_label->field);
break;
case ARG_FIELD:
@@ -186,7 +187,7 @@ e_minicard_label_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_DOUBLE (*arg) = e_minicard_label->height;
break;
case ARG_HAS_FOCUS:
- GTK_VALUE_BOOL (*arg) = e_minicard_label->has_focus;
+ GTK_VALUE_ENUM (*arg) = e_minicard_label->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE;
break;
case ARG_FIELD:
if ( e_minicard_label->field ) {
@@ -213,6 +214,11 @@ e_minicard_label_realize (GnomeCanvasItem *item)
{
EMinicardLabel *e_minicard_label;
GnomeCanvasGroup *group;
+ static GdkFont *font = NULL;
+
+ if ( font == NULL ) {
+ font = gdk_font_load("lucidasans-10");
+ }
e_minicard_label = E_MINICARD_LABEL (item);
group = GNOME_CANVAS_GROUP( item );
@@ -239,7 +245,7 @@ e_minicard_label_realize (GnomeCanvasItem *item)
"clip_height", (double) 1,
"clip", TRUE,
"use_ellipsis", TRUE,
- "font", "lucidasans-10",
+ "font_gdk", font,
"fill_color", "black",
NULL );
if ( e_minicard_label->fieldname_text )
@@ -251,7 +257,7 @@ e_minicard_label_realize (GnomeCanvasItem *item)
}
gtk_signal_connect(GTK_OBJECT(e_minicard_label->fieldname),
"resize",
- GTK_SIGNAL_FUNC(_resize),
+ GTK_SIGNAL_FUNC(resize),
(gpointer) e_minicard_label);
e_minicard_label->field =
@@ -264,7 +270,7 @@ e_minicard_label_realize (GnomeCanvasItem *item)
"clip_height", (double) 1,
"clip", TRUE,
"use_ellipsis", TRUE,
- "font", "lucidasans-10",
+ "font_gdk", font,
"fill_color", "black",
"editable", TRUE,
NULL );
@@ -278,10 +284,10 @@ e_minicard_label_realize (GnomeCanvasItem *item)
gtk_signal_connect(GTK_OBJECT(e_minicard_label->field),
"resize",
- GTK_SIGNAL_FUNC(_resize),
+ GTK_SIGNAL_FUNC(resize),
(gpointer) e_minicard_label);
- _update_label (e_minicard_label);
+ update_label (e_minicard_label);
if (!item->canvas->aa)
{
@@ -400,7 +406,7 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
}
static void
-_update_label( EMinicardLabel *e_minicard_label )
+update_label( EMinicardLabel *e_minicard_label )
{
if ( GTK_OBJECT_FLAGS( e_minicard_label ) & GNOME_CANVAS_ITEM_REALIZED )
{
@@ -450,7 +456,7 @@ _update_label( EMinicardLabel *e_minicard_label )
static void
-_resize( GtkObject *object, gpointer data )
+resize( GtkObject *object, gpointer data )
{
- _update_label(E_MINICARD_LABEL(data));
+ update_label(E_MINICARD_LABEL(data));
}
diff --git a/widgets/e-minicard/e-minicard.c b/widgets/e-minicard/e-minicard.c
index b667f1ac21..805c4e78ff 100644
--- a/widgets/e-minicard/e-minicard.c
+++ b/widgets/e-minicard/e-minicard.c
@@ -25,6 +25,7 @@
#include "e-minicard-label.h"
#include "e-text.h"
#include "e-canvas.h"
+#include "e-util.h"
static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
@@ -105,7 +106,7 @@ e_minicard_class_init (EMinicardClass *klass)
GTK_ARG_READWRITE, ARG_WIDTH);
gtk_object_add_arg_type ("EMinicard::height", GTK_TYPE_DOUBLE,
GTK_ARG_READABLE, ARG_HEIGHT);
- gtk_object_add_arg_type ("EMinicard::has_focus", GTK_TYPE_BOOL,
+ gtk_object_add_arg_type ("EMinicard::has_focus", GTK_TYPE_ENUM,
GTK_ARG_READWRITE, ARG_HAS_FOCUS);
gtk_object_add_arg_type ("EMinicard::card", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_CARD);
@@ -149,10 +150,18 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
}
break;
case ARG_HAS_FOCUS:
- if (e_minicard->fields)
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(e_minicard->fields->data),
- "has_focus", GTK_VALUE_BOOL(*arg),
- NULL);
+ if (e_minicard->fields) {
+ if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_START ||
+ GTK_VALUE_ENUM(*arg) == E_FOCUS_CURRENT) {
+ gnome_canvas_item_set(GNOME_CANVAS_ITEM(e_minicard->fields->data),
+ "has_focus", GTK_VALUE_ENUM(*arg),
+ NULL);
+ } else if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_END ) {
+ gnome_canvas_item_set(GNOME_CANVAS_ITEM(g_list_last(e_minicard->fields)->data),
+ "has_focus", GTK_VALUE_ENUM(*arg),
+ NULL);
+ }
+ }
else
e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(e_minicard));
break;
@@ -179,7 +188,7 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_DOUBLE (*arg) = e_minicard->height;
break;
case ARG_HAS_FOCUS:
- GTK_VALUE_BOOL (*arg) = e_minicard->has_focus;
+ GTK_VALUE_ENUM (*arg) = e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE;
break;
case ARG_CARD:
/* GTK_VALUE_POINTER (*arg) = e_minicard->card; */
@@ -364,11 +373,11 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
GList *list;
for (list = e_minicard->fields; list; list = list->next) {
GnomeCanvasItem *item = GNOME_CANVAS_ITEM (list->data);
- gboolean has_focus;
+ EFocus has_focus;
gtk_object_get(GTK_OBJECT(item),
"has_focus", &has_focus,
NULL);
- if (has_focus) {
+ if (has_focus != E_FOCUS_NONE) {
if (event->key.state & GDK_SHIFT_MASK)
list = list->prev;
else
@@ -376,7 +385,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
if (list) {
item = GNOME_CANVAS_ITEM (list->data);
gnome_canvas_item_set(item,
- "has_focus", TRUE,
+ "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START,
NULL);
return 1;
} else {
diff --git a/widgets/e-minicard/e-reflow.c b/widgets/e-minicard/e-reflow.c
index c1022f8f78..984e972f0c 100644
--- a/widgets/e-minicard/e-reflow.c
+++ b/widgets/e-minicard/e-reflow.c
@@ -24,6 +24,7 @@
#include <math.h>
#include "e-reflow.h"
#include "e-canvas-utils.h"
+#include "e-util.h"
static void e_reflow_init (EReflow *card);
static void e_reflow_class_init (EReflowClass *klass);
static void e_reflow_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
@@ -278,7 +279,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
GList *list;
for (list = e_reflow->items; list; list = list->next) {
GnomeCanvasItem *item = GNOME_CANVAS_ITEM (list->data);
- gboolean has_focus;
+ EFocus has_focus;
gtk_object_get(GTK_OBJECT(item),
"has_focus", &has_focus,
NULL);
@@ -290,7 +291,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
if (list) {
item = GNOME_CANVAS_ITEM(list->data);
gnome_canvas_item_set(item,
- "has_focus", TRUE,
+ "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START,
NULL);
return 1;
} else {
@@ -625,7 +626,6 @@ e_reflow_point (GnomeCanvasItem *item,
double x, double y, int cx, int cy,
GnomeCanvasItem **actual_item)
{
- EReflow *e_reflow = E_REFLOW(item);
double distance = 1;
if (GNOME_CANVAS_ITEM_CLASS(parent_class)->point)
diff --git a/widgets/e-minicard/test-minicard-label.c b/widgets/e-minicard/test-minicard-label.c
index 67c17a0ace..8da34e6f22 100644
--- a/widgets/e-minicard/test-minicard-label.c
+++ b/widgets/e-minicard/test-minicard-label.c
@@ -44,6 +44,7 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpoi
NULL );
}
+#if 0
static void about_callback( GtkWidget *widget, gpointer data )
{
@@ -61,6 +62,7 @@ static void about_callback( GtkWidget *widget, gpointer data )
NULL);
gtk_widget_show (about);
}
+#endif
static void button_press_callback( GtkWidget *widget, gpointer data )
{
diff --git a/widgets/e-minicard/test-minicard.c b/widgets/e-minicard/test-minicard.c
index 79077c4b2d..1ad066b3fe 100644
--- a/widgets/e-minicard/test-minicard.c
+++ b/widgets/e-minicard/test-minicard.c
@@ -43,6 +43,7 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpoi
NULL );
}
+#if 0
static void about_callback( GtkWidget *widget, gpointer data )
{
@@ -60,6 +61,7 @@ static void about_callback( GtkWidget *widget, gpointer data )
NULL);
gtk_widget_show (about);
}
+#endif
int main( int argc, char *argv[] )
{
diff --git a/widgets/e-minicard/test-reflow.c b/widgets/e-minicard/test-reflow.c
index 4533e0249d..319a3f5626 100644
--- a/widgets/e-minicard/test-reflow.c
+++ b/widgets/e-minicard/test-reflow.c
@@ -69,6 +69,7 @@ static void resize(GnomeCanvasItem *item, gpointer data)
NULL );
}
+#if 0
static void about_callback( GtkWidget *widget, gpointer data )
{
@@ -86,6 +87,7 @@ static void about_callback( GtkWidget *widget, gpointer data )
NULL);
gtk_widget_show (about);
}
+#endif
int main( int argc, char *argv[] )
{