aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-07-11 18:30:51 +0800
committerChris Lahey <clahey@src.gnome.org>2001-07-11 18:30:51 +0800
commit7b9622f8e072a98ae8dcf449347a6d6383ba4cea (patch)
treebb548bb2265e68b8e378fe0f7482b96c41b392fa /widgets
parent0a71e607b1840e9e984337a02d09f88c750f7359 (diff)
downloadgsoc2013-evolution-7b9622f8e072a98ae8dcf449347a6d6383ba4cea.tar.gz
gsoc2013-evolution-7b9622f8e072a98ae8dcf449347a6d6383ba4cea.tar.zst
gsoc2013-evolution-7b9622f8e072a98ae8dcf449347a6d6383ba4cea.zip
Created this function for key presses that move in some way other than
2001-07-11 Christopher James Lahey <clahey@ximian.com> * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h (e_selection_model_select_as_key_press): Created this function for key presses that move in some way other than just to the next or previous row. (e_selection_model_key_press): Use e_selection_model_select_as_key_press for handling home and end here. svn path=/trunk/; revision=10993
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-selection-model.c64
-rw-r--r--widgets/misc/e-selection-model.h94
-rw-r--r--widgets/table/e-table.c8
-rw-r--r--widgets/table/e-tree.c8
4 files changed, 88 insertions, 86 deletions
diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c
index 8734bd58ad..5b53619519 100644
--- a/widgets/misc/e-selection-model.c
+++ b/widgets/misc/e-selection-model.c
@@ -434,31 +434,17 @@ e_selection_model_maybe_do_something (ESelectionModel *selection,
}
}
-static gint
-move_selection (ESelectionModel *selection,
- gboolean up,
- GdkModifierType state)
+void
+e_selection_model_select_as_key_press (ESelectionModel *selection,
+ guint row,
+ guint col,
+ GdkModifierType state)
{
- int row = e_selection_model_cursor_row(selection);
- int col = e_selection_model_cursor_col(selection);
int cursor_activated = TRUE;
- int row_count;
gint shift_p = state & GDK_SHIFT_MASK;
gint ctrl_p = state & GDK_CONTROL_MASK;
- row = e_sorter_model_to_sorted(selection->sorter, row);
- if (up)
- row--;
- else
- row++;
- if (row < 0)
- row = 0;
- row_count = e_selection_model_row_count(selection);
- if (row >= row_count)
- row = row_count - 1;
- row = e_sorter_sorted_to_model(selection->sorter, row);
-
switch (selection->mode) {
case GTK_SELECTION_BROWSE:
if (shift_p) {
@@ -482,6 +468,30 @@ move_selection (ESelectionModel *selection,
gtk_signal_emit(GTK_OBJECT(selection),
e_selection_model_signals[CURSOR_ACTIVATED], row, col);
}
+}
+
+static gint
+move_selection (ESelectionModel *selection,
+ gboolean up,
+ GdkModifierType state)
+{
+ int row = e_selection_model_cursor_row(selection);
+ int col = e_selection_model_cursor_col(selection);
+ int row_count;
+
+ row = e_sorter_model_to_sorted(selection->sorter, row);
+ if (up)
+ row--;
+ else
+ row++;
+ if (row < 0)
+ row = 0;
+ row_count = e_selection_model_row_count(selection);
+ if (row >= row_count)
+ row = row_count - 1;
+ row = e_sorter_sorted_to_model(selection->sorter, row);
+
+ e_selection_model_select_as_key_press (selection, row, col, state);
return TRUE;
}
@@ -535,13 +545,7 @@ e_selection_model_key_press (ESelectionModel *selection,
int cursor_col = e_selection_model_cursor_col(selection);
row = e_sorter_sorted_to_model(selection->sorter, row);
- e_selection_model_change_cursor(selection, row, cursor_col);
-
- e_selection_model_select_single_row (selection, row);
- gtk_signal_emit(GTK_OBJECT(selection),
- e_selection_model_signals[CURSOR_CHANGED], row, cursor_col);
- gtk_signal_emit(GTK_OBJECT(selection),
- e_selection_model_signals[CURSOR_ACTIVATED], row, cursor_col);
+ e_selection_model_select_as_key_press (selection, row, cursor_col, key->state);
return TRUE;
}
break;
@@ -552,13 +556,7 @@ e_selection_model_key_press (ESelectionModel *selection,
int cursor_col = e_selection_model_cursor_col(selection);
row = e_sorter_sorted_to_model(selection->sorter, row);
- e_selection_model_change_cursor(selection, row, cursor_col);
-
- e_selection_model_select_single_row (selection, row);
- gtk_signal_emit(GTK_OBJECT(selection),
- e_selection_model_signals[CURSOR_CHANGED], row, cursor_col);
- gtk_signal_emit(GTK_OBJECT(selection),
- e_selection_model_signals[CURSOR_ACTIVATED], row, cursor_col);
+ e_selection_model_select_as_key_press (selection, row, cursor_col, key->state);
return TRUE;
}
break;
diff --git a/widgets/misc/e-selection-model.h b/widgets/misc/e-selection-model.h
index cdd161f96a..f83d2631eb 100644
--- a/widgets/misc/e-selection-model.h
+++ b/widgets/misc/e-selection-model.h
@@ -71,58 +71,61 @@ typedef struct {
} ESelectionModelClass;
-
-GtkType e_selection_model_get_type (void);
-void e_selection_model_do_something (ESelectionModel *esm,
- guint row,
- guint col,
- GdkModifierType state);
-void e_selection_model_maybe_do_something (ESelectionModel *esm,
- guint row,
- guint col,
- GdkModifierType state);
-gint e_selection_model_key_press (ESelectionModel *esm,
- GdkEventKey *key);
+GtkType e_selection_model_get_type (void);
+void e_selection_model_do_something (ESelectionModel *esm,
+ guint row,
+ guint col,
+ GdkModifierType state);
+void e_selection_model_maybe_do_something (ESelectionModel *esm,
+ guint row,
+ guint col,
+ GdkModifierType state);
+gint e_selection_model_key_press (ESelectionModel *esm,
+ GdkEventKey *key);
+void e_selection_model_select_as_key_press (ESelectionModel *esm,
+ guint row,
+ guint col,
+ GdkModifierType state);
/* Virtual functions */
-gboolean e_selection_model_is_row_selected (ESelectionModel *esm,
- gint n);
-void e_selection_model_foreach (ESelectionModel *esm,
- EForeachFunc callback,
- gpointer closure);
-void e_selection_model_clear (ESelectionModel *esm);
-gint e_selection_model_selected_count (ESelectionModel *esm);
-void e_selection_model_select_all (ESelectionModel *esm);
-void e_selection_model_invert_selection (ESelectionModel *esm);
-int e_selection_model_row_count (ESelectionModel *esm);
+gboolean e_selection_model_is_row_selected (ESelectionModel *esm,
+ gint n);
+void e_selection_model_foreach (ESelectionModel *esm,
+ EForeachFunc callback,
+ gpointer closure);
+void e_selection_model_clear (ESelectionModel *esm);
+gint e_selection_model_selected_count (ESelectionModel *esm);
+void e_selection_model_select_all (ESelectionModel *esm);
+void e_selection_model_invert_selection (ESelectionModel *esm);
+int e_selection_model_row_count (ESelectionModel *esm);
/* Private virtual Functions */
-void e_selection_model_change_one_row (ESelectionModel *esm,
- int row,
- gboolean on);
-void e_selection_model_change_cursor (ESelectionModel *esm,
- int row,
- int col);
-int e_selection_model_cursor_row (ESelectionModel *esm);
-int e_selection_model_cursor_col (ESelectionModel *esm);
-void e_selection_model_select_single_row (ESelectionModel *selection,
- int row);
-void e_selection_model_toggle_single_row (ESelectionModel *selection,
- int row);
-void e_selection_model_move_selection_end (ESelectionModel *selection,
- int row);
-void e_selection_model_set_selection_end (ESelectionModel *selection,
- int row);
+void e_selection_model_change_one_row (ESelectionModel *esm,
+ int row,
+ gboolean on);
+void e_selection_model_change_cursor (ESelectionModel *esm,
+ int row,
+ int col);
+int e_selection_model_cursor_row (ESelectionModel *esm);
+int e_selection_model_cursor_col (ESelectionModel *esm);
+void e_selection_model_select_single_row (ESelectionModel *selection,
+ int row);
+void e_selection_model_toggle_single_row (ESelectionModel *selection,
+ int row);
+void e_selection_model_move_selection_end (ESelectionModel *selection,
+ int row);
+void e_selection_model_set_selection_end (ESelectionModel *selection,
+ int row);
/* Signals */
-void e_selection_model_cursor_changed (ESelectionModel *selection,
- int row,
- int col);
-void e_selection_model_cursor_activated (ESelectionModel *selection,
- int row,
- int col);
-void e_selection_model_selection_changed (ESelectionModel *selection);
+void e_selection_model_cursor_changed (ESelectionModel *selection,
+ int row,
+ int col);
+void e_selection_model_cursor_activated (ESelectionModel *selection,
+ int row,
+ int col);
+void e_selection_model_selection_changed (ESelectionModel *selection);
#ifdef __cplusplus
}
@@ -130,3 +133,4 @@ void e_selection_model_selection_changed (ESelectionModel *selection);
#endif /* _E_SELECTION_MODEL_H_ */
+
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 8b6a1b8d0d..a11d940bfe 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -490,8 +490,8 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et
y -= vadj->value;
e_table_get_cell_at (et, 30, y, &row_local, &col_local);
row_local = e_table_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col(E_SELECTION_MODEL (et->selection));
- e_selection_model_do_something(E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
+ col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
+ e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
return_val = 1;
break;
case GDK_Page_Up:
@@ -500,8 +500,8 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et
y -= vadj->value;
e_table_get_cell_at (et, 30, y, &row_local, &col_local);
row_local = e_table_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col(E_SELECTION_MODEL (et->selection));
- e_selection_model_do_something(E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
+ col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->selection));
+ e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
return_val = 1;
break;
default:
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 29555ed785..4af1cc2dab 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -539,8 +539,8 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
y -= vadj->value;
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
row_local = e_tree_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col(E_SELECTION_MODEL (et->priv->selection));
- e_selection_model_do_something(E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
+ col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->priv->selection));
+ e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
return_val = 1;
break;
case GDK_Page_Up:
@@ -549,8 +549,8 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
y -= vadj->value;
e_tree_get_cell_at (et, 30, y, &row_local, &col_local);
row_local = e_tree_view_to_model_row (et, row_local);
- col_local = e_selection_model_cursor_col(E_SELECTION_MODEL (et->priv->selection));
- e_selection_model_do_something(E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
+ col_local = e_selection_model_cursor_col (E_SELECTION_MODEL (et->priv->selection));
+ e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->priv->selection), row_local, col_local, key->state);
return_val = 1;
break;
case '=':
commit/shells?h=gstreamer0.10-removal&id=b86f862e6b897899e35d8240e80e7c8e5ffcb1e2'>- remove DIST_SUBDIRpetef2001-08-313-6/+12 * Remove redundant USE_PERL5 statements.tobez2001-08-253-3/+0 * 1. This should never have been a portade2001-08-116-43/+0 * Update ksh93 to 2001-07-04.0000 version. Earlier distfiles are notrevor2001-08-049-152/+26 * Update to 4.0.2.will2001-07-036-190/+87 * "the the" -> "the"chris2001-06-241-1/+1 * Preserve files in etc/.olgeni2001-06-182-4/+14 * Enable maildir support.will2001-06-161-1/+2 * Add hmmah, The Deep Prompt, a set of shell promptsdwcjr2001-06-146-0/+43 * upgrade to 1.0008ijliao2001-06-132-6/+8 * The perl man directories should not be removed.jeh2001-06-074-8/+2 * Upgrade Zsh to 4.0.1:will2001-06-049-151/+614 * Update to 1.03s and remove hotfix patches.knu2001-05-314-28/+3 * Make htshd work with tcsh.greid2001-05-301-1/+2 * Fix plistgreid2001-05-192-1/+2 * Update lang/ruby and lang/ruby-devel to the latest snapshots.knu2001-05-186-71/+0 * Don't hard-code -O2kris2001-04-301-1/+1 * Add a couple of missing files and remove extra directories on uninstall.steve2001-04-154-0/+12 * Our `end' key defintion for TERM==cons25 seems to be different from others.obrien2001-04-123-0/+42 * Re-update to 1.03r with a hotfix from the author. PORTREVISION is setknu2001-04-104-2/+26 * Remove. Patch not needed any longer.obrien2001-04-103-0/+0 * Update to version 2.05.obrien2001-04-1015-81/+33 * Temporarily back out the previous update. There seems to be a nastyknu2001-04-102-2/+2 * Update to 1.03r.knu2001-04-102-2/+2 * Make WRKDIR safe (fix broken on bento)mharo2001-03-301-1/+1 * make WRKDIR safe (fix broken on bento)mharo2001-03-301-2/+2 * Update to 1.03q.knu2001-03-202-2/+2 * Update to 0.6.knu2001-03-193-5/+13 * Fix a segmentation fault on the Alpha.obrien2001-03-173-0/+60 * Add ruby-shell, a Ruby library to run commands and control jobs like aknu2001-03-166-0/+63 * Update to lastest versionkevlo2001-03-112-2/+2 * I dropped maintainership or at least I tried to. Do it again.obrien2001-03-111-1/+1 * Add wapsh 1.0, a system to allow remote shell logins via a WAPwill2001-03-119-0/+252 * New port: mudsh: An "intelligent" game-like shellclive2001-03-016-0/+55 * - Remove the custom do-extract target.steve2001-02-281-8/+5 * Forgot to commit this file with the previous update to use the sourcesteve2001-02-271-0/+18 * Build from source now that it is available starting with versionsteve2001-02-2612-50/+183 * Update to version 0.009.steve2001-02-2610-82/+106 * add vshnu, the New Visual Shellijliao2001-02-266-0/+45 * Add secondary site to MASTER_SITESkevlo2001-02-251-1/+2 * Put back my editor hints that were removed w/o permission.obrien2001-02-073-0/+3 * Update to version 0.9.4kevlo2001-01-289-27/+72 * Master site disappeared. Use MASTER_SITE_LOCAL.nectar2001-01-223-4/+2 * Massive style enforcement - use ^I instead of spaces for variables identation.sobomax2001-01-175-27/+24 * Remove nonexistent master site.will2001-01-091-1/+0 * Update to 0.9.3kevlo2001-01-0712-144/+69 * Goodbye, YEAR2000. Hello, 2001.will2001-01-011-2/+0 * Add pash 2.2, a full-screen shell, similar to Midnight Commander. Somewill2000-12-3113-0/+447 * Add osh 001127, a reimplementation of the old and obsolete shell versionwill2000-12-308-0/+89 * Fix typoobrien2000-12-233-3/+3 * Update to version 6.10.00.steve2000-12-113-16/+15 * Well, basic reading skills certainly do help occassionally - Lorenroam2000-12-081-1/+1 * Bump PORTREVISION because of the added efree()/erealloc() patch.roam2000-12-081-1/+2 * free() before realloc() is bad, bad, bad.roam2000-12-081-0/+13 * It's my main shell, so I have in interest in seeing it maintained.obrien2000-11-303-3/+6 * Drop my maintainershipache2000-11-303-3/+3 * Also fix the symlink race vulnerability in bashbug.sh.obrien2000-11-301-0/+11 * Fix the symlink vulnerability noted at http://www.securityfocus.com/bid/2006obrien2000-11-301-0/+28 * Add $FreeBSD$'s which help me in problem reports.obrien2000-11-221-0/+1 * Fix the temporary file creation problem with <<kris2000-11-201-0/+1 * Depend on ncurses.5 after the upgrade of devel/ncurses.tg2000-11-161-1/+1 * Make sure to point this to my local distfile directory instead ofasmodai2000-11-101-1/+1 * Update port to the 20001106 version, which fixes a temporaryasmodai2000-11-062-4/+2 * Mark forbidden for now, due to tempfile creation issues.asmodai2000-11-061-0/+1 * Correct MASTER_SITES.shige2000-10-281-1/+1 * Remove an unnecessary "strip" line in post-install.patrick2000-10-191-1/+0 * Update to 1.03okevlo2000-10-123-6/+6 * Change PKGDIR from pkg/ to . Also fix places where ${PKGDIR} isasami2000-10-081-1/+1 * Rename PLIST.nobuild to pkg-plist.nobuild.asami2000-10-081-1/+1 * Rename PLIST.doc to pkg-plist.doc.asami2000-10-081-1/+1 * Eliminate WRKSRC=${WRKDIR}/${PKGNAME} lines, as these will break whenasami2000-09-251-1/+1 * Update _kld to look (also) into /boot/kernel for kernel modules.knu2000-09-062-2/+2 * - Update to 0.5.2alex2000-07-224-59/+261 * Correct OSVERSION, which I raised for testing but forgot toalex2000-07-221-2/+2 * Update to patchlevel 3.alex2000-07-213-7/+7 * - Add support for sigset_t - changes.alex2000-07-192-1/+27 * - Update to verison 6.09.01alex2000-07-164-23/+49 * Push the FreeBSD version check down to 400021 for tcsh in base system.obrien2000-07-121-1/+1 * Update MD5. Since ftp.freebsd.org never got a copy (and I don't have one)will2000-07-101-1/+1 * Use {MASTER,PATCH}_SITE_SUBDIR instead of make's sed capabilities.steve2000-07-081-1/+2 * Update to 3.0.8. Remove useless echo in Makefile.will2000-07-022-3/+2 * Get rid of the workaround regarding the libzsh-3.1.x.so generation, asknu2000-06-302-12/+3 * Move the stragler's www.freebsd.org/~user distfiles to the officalobrien2000-06-293-3/+6 * Use ${MASTER_SITE_LOCAL}.asami2000-06-291-2/+3 * Unleash all of these ports upon the people. I no longer have any interestwill2000-06-223-3/+3 * Locally hosted distfiles moved to ftp.freebsd.org.nectar2000-06-20