aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2001-01-30 19:37:34 +0800
committerChris Lahey <clahey@src.gnome.org>2001-01-30 19:37:34 +0800
commitda03d43325d3410577ace4073d5b26fd72944ce4 (patch)
treef8b56730e2d62409f0d951034eda25a69968a081
parent8ee392b8a3cea8965d3cc250c9e679d48f5d4aed (diff)
downloadgsoc2013-evolution-da03d43325d3410577ace4073d5b26fd72944ce4.tar.gz
gsoc2013-evolution-da03d43325d3410577ace4073d5b26fd72944ce4.tar.zst
gsoc2013-evolution-da03d43325d3410577ace4073d5b26fd72944ce4.zip
Made the contained %ETableItem have cursor_mode as
2001-01-30 Christopher James Lahey <clahey@helixcode.com> * e-table-click-to-add.c (etcta_event): Made the contained %ETableItem have cursor_mode as %E_TABLE_CURSOR_SPREADSHEET. * e-table-defines.h, e-table-item.c, e-table-specification.c: Added a new cursor mode E_TABLE_CURSOR_SPREADSHEET. This is accessed using cursor_mode="spreadsheet" in your specification xml, as well as by the click_to_add item. It is identical to E_TABLE_CURSOR_SIMPLE, except that tab goes to the next item in the table instead of to the next widget. svn path=/trunk/; revision=7910
-rw-r--r--widgets/table/e-table-click-to-add.c15
-rw-r--r--widgets/table/e-table-defines.h1
-rw-r--r--widgets/table/e-table-item.c61
-rw-r--r--widgets/table/e-table-specification.c2
4 files changed, 45 insertions, 34 deletions
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index 0948ad1eb0..4e2d71f9d6 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -303,6 +303,7 @@ finish_editing (ETableClickToAdd *etcta)
"minimum_width", etcta->width,
"drawgrid", TRUE,
"table_selection_model", etcta->selection,
+ "cursor_mode", E_TABLE_CURSOR_SPREADSHEET,
NULL);
gtk_signal_connect(GTK_OBJECT(etcta->row), "key_press",
@@ -347,6 +348,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e)
"minimum_width", etcta->width,
"drawgrid", TRUE,
"table_selection_model", etcta->selection,
+ "cursor_mode", E_TABLE_CURSOR_SPREADSHEET,
NULL);
gtk_signal_connect(GTK_OBJECT(etcta->row), "key_press",
@@ -367,17 +369,13 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_KEY_PRESS:
switch (e->key.keyval) {
- case GDK_Return:
- case GDK_KP_Enter:
- case GDK_ISO_Enter:
- case GDK_3270_Enter:
-
case GDK_Tab:
case GDK_KP_Tab:
case GDK_ISO_Left_Tab:
finish_editing (etcta);
break;
default:
+ return FALSE;
break;
}
@@ -503,6 +501,13 @@ e_table_click_to_add_get_type (void)
/* The colors in this need to be themefied. */
+/**
+ * e_table_click_to_add_commit:
+ * @etcta: The %ETableClickToAdd to commit.
+ *
+ * This routine commits the current thing being edited and returns to
+ * just displaying the click to add message.
+ **/
void
e_table_click_to_add_commit (ETableClickToAdd *etcta)
{
diff --git a/widgets/table/e-table-defines.h b/widgets/table/e-table-defines.h
index a1232911a7..01208da1aa 100644
--- a/widgets/table/e-table-defines.h
+++ b/widgets/table/e-table-defines.h
@@ -18,6 +18,7 @@ typedef enum
{
E_TABLE_CURSOR_LINE,
E_TABLE_CURSOR_SIMPLE,
+ E_TABLE_CURSOR_SPREADSHEET,
} ETableCursorMode;
#endif
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index c2aa4d1ffa..e0543ca536 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1310,6 +1310,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width,
ECellFlags flags;
switch (eti->cursor_mode) {
case E_TABLE_CURSOR_SIMPLE:
+ case E_TABLE_CURSOR_SPREADSHEET:
if (cursor_col == ecol->col_idx && cursor_row == view_to_model_row(eti, row))
col_selected = !col_selected;
break;
@@ -1370,6 +1371,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width,
}
break;
case E_TABLE_CURSOR_SIMPLE:
+ case E_TABLE_CURSOR_SPREADSHEET:
if (view_to_model_col(eti, col) == cursor_col && view_to_model_row(eti, row) == cursor_row) {
f_x1 = xd;
f_x2 = xd + ecol->width;
@@ -1879,7 +1881,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
#endif
case GDK_Home:
case GDK_KP_Home:
- if (eti->cursor_mode == E_TABLE_CURSOR_SIMPLE) {
+ if (eti->cursor_mode != E_TABLE_CURSOR_LINE) {
eti_cursor_move (eti, model_to_view_row(eti, cursor_row), 0);
return_val = TRUE;
} else
@@ -1887,7 +1889,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
break;
case GDK_End:
case GDK_KP_End:
- if (eti->cursor_mode == E_TABLE_CURSOR_SIMPLE) {
+ if (eti->cursor_mode != E_TABLE_CURSOR_LINE) {
eti_cursor_move (eti, model_to_view_row(eti, cursor_row), eti->cols - 1);
return_val = TRUE;
} else
@@ -1896,37 +1898,38 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_Tab:
case GDK_KP_Tab:
case GDK_ISO_Left_Tab:
+ if (eti->cursor_mode == E_TABLE_CURSOR_SPREADSHEET) {
+ if ((e->key.state & GDK_SHIFT_MASK) != 0){
+ /* shift tab */
+ if (cursor_col != view_to_model_col(eti, 0))
+ eti_cursor_move_left (eti);
+ else if (cursor_row != view_to_model_row(eti, 0))
+ eti_cursor_move (eti, model_to_view_row(eti, cursor_row) - 1, eti->cols - 1);
+ else
+ return_val = FALSE;
+ } else {
+ if (cursor_col != view_to_model_col (eti, eti->cols - 1))
+ eti_cursor_move_right (eti);
+ else if (cursor_row != view_to_model_row(eti, eti->rows - 1))
+ eti_cursor_move (eti, model_to_view_row(eti, cursor_row) + 1, 0);
+ else
+ return_val = FALSE;
+ }
+ gtk_object_get(GTK_OBJECT(eti->selection),
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
+
+ if (cursor_col >= 0 && cursor_row >= 0 && return_val &&
+ (!eti_editing(eti)) && e_table_model_is_cell_editable(eti->selection->model, cursor_col, cursor_row)) {
+ e_table_item_enter_edit (eti, model_to_view_col(eti, cursor_col), model_to_view_row(eti, cursor_row));
+ }
+ break;
+ } else {
/* Let tab send you to the next widget. */
return_val = FALSE;
break;
-#if 0
- if ((e->key.state & GDK_SHIFT_MASK) != 0){
- /* shift tab */
- if (cursor_col != view_to_model_col(eti, 0))
- eti_cursor_move_left (eti);
- else if (cursor_row != view_to_model_row(eti, 0))
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row) - 1, eti->cols - 1);
- else
- return_val = FALSE;
- } else {
- if (cursor_col != view_to_model_col (eti, eti->cols - 1))
- eti_cursor_move_right (eti);
- else if (cursor_row != view_to_model_row(eti, eti->rows - 1))
- eti_cursor_move (eti, model_to_view_row(eti, cursor_row) + 1, 0);
- else
- return_val = FALSE;
}
- gtk_object_get(GTK_OBJECT(eti->selection),
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- if (cursor_col >= 0 && cursor_row >= 0 && return_val &&
- (!eti_editing(eti)) && e_table_model_is_cell_editable(eti->selection->model, cursor_col, cursor_row)) {
- e_table_item_enter_edit (eti, model_to_view_col(eti, cursor_col), model_to_view_row(eti, cursor_row));
- }
- break;
-#endif
case GDK_Return:
case GDK_KP_Enter:
diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c
index 33523129b8..fff5812aa2 100644
--- a/widgets/table/e-table-specification.c
+++ b/widgets/table/e-table-specification.c
@@ -176,6 +176,8 @@ e_table_specification_load_from_node (ETableSpecification *specification,
temp = e_xml_get_string_prop_by_name (node, "cursor-mode");
if (temp && !strcasecmp (temp, "line")) {
specification->cursor_mode = E_TABLE_CURSOR_LINE;
+ } else if (temp && !strcasecmp (temp, "spreadsheet")) {
+ specification->cursor_mode = E_TABLE_CURSOR_SPREADSHEET;
}
g_free (temp);
g_free (specification->click_to_add_message);
al&id=3d1075594f3102655b6a022513fa902f37868dc7'>update to 4.0.5oliver2004-04-191-2/+2 * create ${X11BASE}/etc/gdm/Sessions if it doesn't exist and WITH_GDM is specifiedoliver2004-04-171-0/+2 * Trim whitespace.trevor2004-04-111-1/+0 * - Fix dependency after gtk 2.4.0 importale2004-04-061-1/+1 * Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-051-1/+1 * update to xfce 4.0.4oliver2004-03-151-2/+2 * Add missing space.ale2004-02-221-1/+1 * add gdm support for the xfce4-suiteoliver2004-02-214-1/+34 * update xfce4 to 4.0.3.1oliver2004-01-251-1/+1 * Update xfce to 4.0.3oliver2004-01-111-1/+1 * update xfce to 4.0.1oliver2003-12-051-1/+1 * Update to 4.0.0 release.demon2003-09-271-1/+1 * Define LATEST_LINK so it does not conflict with xfce (version 3) port.demon2003-09-071-0/+1 * Use sane PORTVERSION.demon2003-09-041-2/+2 * Update to version 4.0 RC3.demon2003-09-031-1/+1 * take maintainershipoliver2003-08-171-1/+1 * Start using the new xfce sub-categoryoliver2003-08-161-1/+1 * Import the xfce4-rc2 Meta-Portoliver2003-07-296-789/+38 * Remove USE_GNOMENG.marcus2003-04-211-1/+0 * Add Xft dependency when WITH_XFT is defined.nork2003-04-121-1/+2 * De-pkg-comment.knu2003-02-212-1/+1 * Update port: x11-wm/xfceedwin2003-01-121-8/+2 * move REINPLACE_CMD to a proper positionijliao2003-01-021-1/+4 * upgrade to 3.8.18ijliao2002-11-205-62/+92 * o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-112-2/+1 * Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-072-1/+2 * Add missing manpagekris2002-09-171-1/+1 * Deploy USE_GNOMENG infrastructurelioux2002-09-021-1/+2 * ${PERL} -> ${REINPLACE_CMD}dwcjr2002-09-021-3/+4 * symbolic link to see image in help filenakai2002-08-032-0/+6 * Update to 3.8.16 and assign maintainership to ports@FreeBSD.org, because oldsobomax2002-05-284-25/+25 * Iconv cleanup, stage 2b: remove regex hacks that change iconv.h to giconv.h andsobomax2002-03-181-4/+1 * Bump PORTREVISION to reflect the (lib)iconv upgrade.knu2002-03-181-0/+1 * Iconv cleanup, stage 1b: correct {BUILD,LIB,RUN}_DEPENDS of all ports that needsobomax2002-03-181-1/+1 * remove another g_free on a string culled from g_getenv.alfred2002-03-021-1/+9 * add a patch so that xfumed (xf menu editor) doesn't call g_free on aalfred2002-03-021-0/+10 * Update to 3.8.14cnakai2002-02-183-14/+16 * update to 3.8.14.sf2002-01-234-46/+172 * Update to 3.8.8bnakai2001-10-232-3/+15