new function (gtk_tree_view_column_create_button): use g_signal_* instead

Tue Feb 19 22:10:59 2002  Kristian Rietveld  <kris@gtk.org>

        * gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
        function
        (gtk_tree_view_column_create_button): use g_signal_* instead of
        gtk_signal_*, hook up _mnemonic_activate callback
        (gtk_tree_view_column_update_button): use
        gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
        (#69095)

        * gtktreeview.c (gtk_tree_view_class_init): remove key bindings
        for C-f and C-b, let treeview search use C-f (instead of C-s)
        (#61886)

        * gtkrc.key.emacs: add some GtkTreeView bindings
This commit is contained in:
Kristian Rietveld 2002-02-19 21:16:49 +00:00 committed by Kristian Rietveld
parent fde8cad894
commit 19f961d46a
10 changed files with 168 additions and 22 deletions

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -1,3 +1,19 @@
Tue Feb 19 22:10:59 2002 Kristian Rietveld <kris@gtk.org>
* gtktreeviewcolumn.c (gtk_tree_view_column_mnemonic_activate): new
function
(gtk_tree_view_column_create_button): use g_signal_* instead of
gtk_signal_*, hook up _mnemonic_activate callback
(gtk_tree_view_column_update_button): use
gtk_label_set_text_width_mnemonic instead of gtk_label_set_text
(#69095)
* gtktreeview.c (gtk_tree_view_class_init): remove key bindings
for C-f and C-b, let treeview search use C-f (instead of C-s)
(#61886)
* gtkrc.key.emacs: add some GtkTreeView bindings
Tue Feb 19 20:56:32 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/theme-bits/decompose-bits.c (do_part): fix bug (skipping all

View File

@ -50,6 +50,17 @@ binding "gtk-emacs-text-view"
bind "<ctrl>KP_Space" { "set-anchor" () }
}
#
# Bindings for GtkTreeView
#
binding "gtk-emacs-tree-view"
{
bind "<ctrl>s" { "start-interactive-search" () }
bind "<ctrl>f" { "move-cursor" (logical-positions, 1) }
bind "<ctrl>b" { "move-cursor" (logical-positions, -1) }
}
class "GtkEntry" binding "gtk-emacs-text-entry"
class "GtkTextView" binding "gtk-emacs-text-entry"
class "GtkTextView" binding "gtk-emacs-text-view"
class "GtkTreeView" binding "gtk-emacs-tree-view"

View File

@ -818,14 +818,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, -1);
gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_b, GDK_CONTROL_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_TYPE_INT, -1);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, "toggle_cursor_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, "select_all", 0);
@ -886,9 +878,9 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "select_cursor_parent", 0);
gtk_binding_entry_add_signal (binding_set, GDK_s, GDK_CONTROL_MASK, "start_interactive_search", 0);
gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "start_interactive_search", 0);
gtk_binding_entry_add_signal (binding_set, GDK_S, GDK_CONTROL_MASK, "start_interactive_search", 0);
gtk_binding_entry_add_signal (binding_set, GDK_F, GDK_CONTROL_MASK, "start_interactive_search", 0);
}
static void

View File

@ -94,6 +94,9 @@ static gint gtk_tree_view_column_button_event (GtkWidget
gpointer data);
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
gpointer data);
static gboolean gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling,
gpointer data);
/* Property handlers */
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
@ -535,14 +538,14 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
if (tree_view->priv->header_window)
gtk_widget_set_parent_window (tree_column->button, tree_view->priv->header_window);
gtk_widget_set_parent (tree_column->button, GTK_WIDGET (tree_view));
gtk_signal_connect (GTK_OBJECT (tree_column->button), "event",
(GtkSignalFunc) gtk_tree_view_column_button_event,
(gpointer) tree_column);
gtk_signal_connect (GTK_OBJECT (tree_column->button), "clicked",
(GtkSignalFunc) gtk_tree_view_column_button_clicked,
(gpointer) tree_column);
g_signal_connect (G_OBJECT (tree_column->button), "event",
G_CALLBACK (gtk_tree_view_column_button_event),
(gpointer) tree_column);
g_signal_connect (G_OBJECT (tree_column->button), "clicked",
(GtkSignalFunc) gtk_tree_view_column_button_clicked,
(gpointer) tree_column);
tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0, 0.0);
@ -557,6 +560,10 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
gtk_widget_show (child);
}
g_signal_connect (G_OBJECT (child), "mnemonic_activate",
G_CALLBACK (gtk_tree_view_column_mnemonic_activate),
(gpointer) tree_column);
if (tree_column->xalign <= 0.5)
gtk_box_pack_end (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0);
else
@ -622,11 +629,11 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
g_return_if_fail (GTK_IS_LABEL (current_child));
if (tree_column->title)
gtk_label_set_text (GTK_LABEL (current_child),
tree_column->title);
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
tree_column->title);
else
gtk_label_set_text (GTK_LABEL (current_child),
"");
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
"");
}
switch (tree_column->sort_order)
@ -795,6 +802,30 @@ gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
g_signal_emit_by_name (G_OBJECT (data), "clicked");
}
static gboolean
gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling,
gpointer data)
{
GtkTreeViewColumn *column = (GtkTreeViewColumn *)data;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), FALSE);
if (column->clickable)
gtk_button_clicked (GTK_BUTTON (column->button));
else if (GTK_WIDGET_CAN_FOCUS (column->button))
gtk_widget_grab_focus (column->button);
else
{
GTK_TREE_VIEW (column->tree_view)->priv->focus_column = column;
GTK_TREE_VIEW_SET_FLAG (GTK_TREE_VIEW (column->tree_view),
GTK_TREE_VIEW_DRAW_KEYFOCUS);
gtk_widget_grab_focus (column->tree_view);
}
return TRUE;
}
static void
gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
GtkTreeViewColumn *column)