2000-10-05 01:04:57 +00:00
|
|
|
/* gtktreeviewcolumn.c
|
|
|
|
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2002-10-13 19:34:42 +00:00
|
|
|
#include <string.h>
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtktreeviewcolumn.h"
|
2001-03-02 00:49:32 +00:00
|
|
|
#include "gtktreeview.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtktreeprivate.h"
|
2003-07-11 12:51:24 +00:00
|
|
|
#include "gtkcelllayout.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtkbutton.h"
|
|
|
|
#include "gtkalignment.h"
|
2000-10-16 17:50:15 +00:00
|
|
|
#include "gtklabel.h"
|
2010-04-06 07:03:55 +00:00
|
|
|
#include "gtkextendedcell.h"
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
#include "gtkhbox.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
#include "gtkmarshalers.h"
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
#include "gtkarrow.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2001-01-09 23:24:20 +00:00
|
|
|
#include "gtkintl.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
#include "gtkalias.h"
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_VISIBLE,
|
2001-11-19 21:18:22 +00:00
|
|
|
PROP_RESIZABLE,
|
2001-01-09 23:24:20 +00:00
|
|
|
PROP_WIDTH,
|
2004-07-15 17:37:06 +00:00
|
|
|
PROP_SPACING,
|
2001-09-08 00:56:30 +00:00
|
|
|
PROP_SIZING,
|
|
|
|
PROP_FIXED_WIDTH,
|
2001-01-09 23:24:20 +00:00
|
|
|
PROP_MIN_WIDTH,
|
|
|
|
PROP_MAX_WIDTH,
|
|
|
|
PROP_TITLE,
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
PROP_EXPAND,
|
2001-01-09 23:24:20 +00:00
|
|
|
PROP_CLICKABLE,
|
|
|
|
PROP_WIDGET,
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
PROP_ALIGNMENT,
|
2001-05-16 00:23:30 +00:00
|
|
|
PROP_REORDERABLE,
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
PROP_SORT_INDICATOR,
|
2009-07-25 16:46:09 +00:00
|
|
|
PROP_SORT_ORDER,
|
|
|
|
PROP_SORT_COLUMN_ID
|
2001-01-09 23:24:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2000-10-05 01:04:57 +00:00
|
|
|
CLICKED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
typedef struct _GtkTreeViewColumnCellInfo GtkTreeViewColumnCellInfo;
|
|
|
|
struct _GtkTreeViewColumnCellInfo
|
|
|
|
{
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
GSList *attributes;
|
|
|
|
GtkTreeCellDataFunc func;
|
|
|
|
gpointer func_data;
|
2008-06-18 09:12:32 +00:00
|
|
|
GDestroyNotify destroy;
|
2001-06-30 02:38:17 +00:00
|
|
|
gint requested_width;
|
2002-04-14 15:05:04 +00:00
|
|
|
gint real_width;
|
2001-06-27 23:44:53 +00:00
|
|
|
guint expand : 1;
|
|
|
|
guint pack : 1;
|
2001-09-08 00:56:30 +00:00
|
|
|
guint has_focus : 1;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
guint in_editing_mode : 1;
|
2001-06-27 23:44:53 +00:00
|
|
|
};
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Type methods */
|
2003-07-11 12:51:24 +00:00
|
|
|
static void gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* GObject methods */
|
|
|
|
static void gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_tree_view_column_finalize (GObject *object);
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
/* GtkCellLayout implementation */
|
|
|
|
static void gtk_tree_view_column_cell_layout_pack_start (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gboolean expand);
|
|
|
|
static void gtk_tree_view_column_cell_layout_pack_end (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gboolean expand);
|
|
|
|
static void gtk_tree_view_column_cell_layout_clear (GtkCellLayout *cell_layout);
|
|
|
|
static void gtk_tree_view_column_cell_layout_add_attribute (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
const gchar *attribute,
|
|
|
|
gint column);
|
|
|
|
static void gtk_tree_view_column_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkCellLayoutDataFunc func,
|
|
|
|
gpointer func_data,
|
|
|
|
GDestroyNotify destroy);
|
|
|
|
static void gtk_tree_view_column_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell);
|
2003-12-19 22:47:20 +00:00
|
|
|
static void gtk_tree_view_column_cell_layout_reorder (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gint position);
|
2006-12-29 07:53:01 +00:00
|
|
|
static GList *gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *cell_layout);
|
2003-07-11 12:51:24 +00:00
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
/* Button handling code */
|
2001-05-16 00:23:30 +00:00
|
|
|
static void gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
|
|
/* Button signal handlers */
|
2001-05-22 19:18:47 +00:00
|
|
|
static gint gtk_tree_view_column_button_event (GtkWidget *widget,
|
2001-05-16 00:23:30 +00:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2002-02-19 21:16:49 +00:00
|
|
|
static gboolean gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
|
|
|
|
gboolean group_cycling,
|
|
|
|
gpointer data);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Property handlers */
|
|
|
|
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
|
|
/* Internal functions */
|
|
|
|
static void gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-05-16 00:23:30 +00:00
|
|
|
va_list args);
|
2001-06-27 23:44:53 +00:00
|
|
|
static GtkTreeViewColumnCellInfo *gtk_tree_view_column_get_cell_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* cell list manipulation */
|
|
|
|
static GList *gtk_tree_view_column_cell_first (GtkTreeViewColumn *tree_column);
|
|
|
|
static GList *gtk_tree_view_column_cell_last (GtkTreeViewColumn *tree_column);
|
|
|
|
static GList *gtk_tree_view_column_cell_next (GtkTreeViewColumn *tree_column,
|
|
|
|
GList *current);
|
|
|
|
static GList *gtk_tree_view_column_cell_prev (GtkTreeViewColumn *tree_column,
|
|
|
|
GList *current);
|
2002-06-07 22:02:23 +00:00
|
|
|
static void gtk_tree_view_column_clear_attributes_by_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkTreeViewColumnCellInfo *info);
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
/* GtkBuildable implementation */
|
|
|
|
static void gtk_tree_view_column_buildable_init (GtkBuildableIface *iface);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, GTK_TYPE_OBJECT,
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
gtk_tree_view_column_cell_layout_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
2010-04-06 07:03:55 +00:00
|
|
|
gtk_tree_view_column_buildable_init))
|
2009-12-19 07:07:51 +00:00
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
|
|
|
|
{
|
2001-01-09 23:24:20 +00:00
|
|
|
GObjectClass *object_class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
object_class = (GObjectClass*) class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
class->clicked = NULL;
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
object_class->finalize = gtk_tree_view_column_finalize;
|
2001-01-09 23:24:20 +00:00
|
|
|
object_class->set_property = gtk_tree_view_column_set_property;
|
|
|
|
object_class->get_property = gtk_tree_view_column_get_property;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column_signals[CLICKED] =
|
2005-09-01 05:11:46 +00:00
|
|
|
g_signal_new (I_("clicked"),
|
2002-10-13 19:34:42 +00:00
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
|
|
|
|
NULL, NULL,
|
2001-11-17 23:28:51 +00:00
|
|
|
_gtk_marshal_VOID__VOID,
|
2002-10-13 19:34:42 +00:00
|
|
|
G_TYPE_NONE, 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_VISIBLE,
|
|
|
|
g_param_spec_boolean ("visible",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Visible"),
|
|
|
|
P_("Whether to display the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_RESIZABLE,
|
|
|
|
g_param_spec_boolean ("resizable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Resizable"),
|
|
|
|
P_("Column is user-resizable"),
|
2001-11-19 21:18:22 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-11-19 21:18:22 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDTH,
|
|
|
|
g_param_spec_int ("width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Width"),
|
|
|
|
P_("Current width of the column"),
|
2001-09-08 00:56:30 +00:00
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
2004-07-15 17:37:06 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SPACING,
|
|
|
|
g_param_spec_int ("spacing",
|
|
|
|
P_("Spacing"),
|
|
|
|
P_("Space which is inserted between cells"),
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SIZING,
|
|
|
|
g_param_spec_enum ("sizing",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sizing"),
|
|
|
|
P_("Resize mode of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
|
2004-07-15 17:37:06 +00:00
|
|
|
GTK_TREE_VIEW_COLUMN_GROW_ONLY,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
2001-09-08 00:56:30 +00:00
|
|
|
PROP_FIXED_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("fixed-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Fixed Width"),
|
|
|
|
P_("Current fixed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
1,
|
|
|
|
G_MAXINT,
|
|
|
|
1, /* not useful */
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MIN_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("min-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Minimum Width"),
|
|
|
|
P_("Minimum allowed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MAX_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("max-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Maximum Width"),
|
|
|
|
P_("Maximum allowed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_TITLE,
|
|
|
|
g_param_spec_string ("title",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Title"),
|
|
|
|
P_("Title to appear in column header"),
|
2001-01-09 23:24:20 +00:00
|
|
|
"",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_EXPAND,
|
|
|
|
g_param_spec_boolean ("expand",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Expand"),
|
|
|
|
P_("Column gets share of extra width allocated to the widget"),
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
g_param_spec_boolean ("clickable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Clickable"),
|
|
|
|
P_("Whether the header can be clicked"),
|
2004-07-15 17:37:06 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDGET,
|
|
|
|
g_param_spec_object ("widget",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Widget"),
|
|
|
|
P_("Widget to put in column header button instead of column title"),
|
2001-01-09 23:24:20 +00:00
|
|
|
GTK_TYPE_WIDGET,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
PROP_ALIGNMENT,
|
|
|
|
g_param_spec_float ("alignment",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Alignment"),
|
|
|
|
P_("X Alignment of the column header text or widget"),
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
0.0,
|
|
|
|
1.0,
|
2004-07-15 17:37:06 +00:00
|
|
|
0.0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
g_param_spec_boolean ("reorderable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Reorderable"),
|
|
|
|
P_("Whether the column can be reordered around the headers"),
|
2001-05-16 00:23:30 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_INDICATOR,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_boolean ("sort-indicator",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sort indicator"),
|
|
|
|
P_("Whether to show a sort indicator"),
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_ORDER,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_enum ("sort-order",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sort order"),
|
|
|
|
P_("Sort direction the sort indicator should indicate"),
|
2001-08-23 18:33:37 +00:00
|
|
|
GTK_TYPE_SORT_TYPE,
|
|
|
|
GTK_SORT_ASCENDING,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2009-07-25 16:46:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkTreeViewColumn:sort-column-id:
|
|
|
|
*
|
|
|
|
* Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
|
|
|
|
* clickable. Set to %-1 to make the column unsortable.
|
|
|
|
*
|
|
|
|
* Since: 2.18
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_COLUMN_ID,
|
|
|
|
g_param_spec_int ("sort-column-id",
|
|
|
|
P_("Sort column ID"),
|
|
|
|
P_("Logical sort column ID this column sorts on when selected for sorting"),
|
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
|
|
|
-1,
|
|
|
|
GTK_PARAM_READWRITE));
|
2009-12-19 07:07:51 +00:00
|
|
|
|
|
|
|
g_type_class_add_private (class, sizeof (GtkTreeViewColumnPrivate));
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_buildable_init (GtkBuildableIface *iface)
|
|
|
|
{
|
2007-06-19 12:23:36 +00:00
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
|
|
|
|
iface->custom_tag_end = _gtk_cell_layout_buildable_custom_tag_end;
|
|
|
|
}
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
{
|
|
|
|
iface->pack_start = gtk_tree_view_column_cell_layout_pack_start;
|
|
|
|
iface->pack_end = gtk_tree_view_column_cell_layout_pack_end;
|
|
|
|
iface->clear = gtk_tree_view_column_cell_layout_clear;
|
|
|
|
iface->add_attribute = gtk_tree_view_column_cell_layout_add_attribute;
|
|
|
|
iface->set_cell_data_func = gtk_tree_view_column_cell_layout_set_cell_data_func;
|
|
|
|
iface->clear_attributes = gtk_tree_view_column_cell_layout_clear_attributes;
|
2003-12-19 22:47:20 +00:00
|
|
|
iface->reorder = gtk_tree_view_column_cell_layout_reorder;
|
2006-12-29 07:53:01 +00:00
|
|
|
iface->get_cells = gtk_tree_view_column_cell_layout_get_cells;
|
2003-07-11 12:51:24 +00:00
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
tree_column->button = NULL;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
tree_column->xalign = 0.0;
|
2001-09-08 00:56:30 +00:00
|
|
|
tree_column->width = 0;
|
2004-07-15 17:37:06 +00:00
|
|
|
tree_column->spacing = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->requested_width = -1;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->min_width = -1;
|
|
|
|
tree_column->max_width = -1;
|
2001-12-04 23:49:57 +00:00
|
|
|
tree_column->resized_width = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
tree_column->column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->visible = TRUE;
|
2001-11-19 21:18:22 +00:00
|
|
|
tree_column->resizable = FALSE;
|
2004-07-15 17:37:06 +00:00
|
|
|
tree_column->expand = FALSE;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->clickable = FALSE;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->dirty = TRUE;
|
2001-08-23 18:33:37 +00:00
|
|
|
tree_column->sort_order = GTK_SORT_ASCENDING;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
tree_column->show_sort_indicator = FALSE;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->property_changed_signal = 0;
|
2001-03-29 21:30:05 +00:00
|
|
|
tree_column->sort_clicked_signal = 0;
|
|
|
|
tree_column->sort_column_changed_signal = 0;
|
2001-03-28 01:54:14 +00:00
|
|
|
tree_column->sort_column_id = -1;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->reorderable = FALSE;
|
|
|
|
tree_column->maybe_reordered = FALSE;
|
2004-07-15 17:37:06 +00:00
|
|
|
tree_column->fixed_width = 1;
|
2001-12-04 23:49:57 +00:00
|
|
|
tree_column->use_resized_width = FALSE;
|
2004-07-15 17:37:06 +00:00
|
|
|
tree_column->title = g_strdup ("");
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
2002-03-03 05:41:28 +00:00
|
|
|
|
|
|
|
if (info->destroy)
|
|
|
|
{
|
2008-06-18 09:12:32 +00:00
|
|
|
GDestroyNotify d = info->destroy;
|
2002-03-03 05:41:28 +00:00
|
|
|
|
|
|
|
info->destroy = NULL;
|
|
|
|
d (info->func_data);
|
|
|
|
}
|
2002-06-07 22:02:23 +00:00
|
|
|
gtk_tree_view_column_clear_attributes_by_info (tree_column, info);
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_unref (info->cell);
|
2001-06-27 23:44:53 +00:00
|
|
|
g_free (info);
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
g_free (tree_column->title);
|
Behaviour change, apply changes if the entry of the editable gets a focus
Tue Oct 15 00:53:14 2002 Kristian Rietveld <kris@gtk.org>
Behaviour change, apply changes if the entry of the editable gets
a focus out event (#82405).
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_focus_out_event):
new function,
(gtk_cell_renderer_text_start_editing): stop editing and apply
changes on focus-out.
Tue Oct 15 00:47:35 2002 Kristian Rietveld <kris@gtk.org>
Fixes an *evil* GtkTreeModelSort bug, #93629.
* gtk/gtktreemodel.c (release_row_references): return if the
refs->list is NULL.
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_changed): if we
are swapping two rows (re-insertion on row_changed), also *emit*
a rows_reordered signal. oops.
Tue Oct 15 00:45:03 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_remove_silently): free
the actual link after the node has been removed (#92014).
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_column_finalize):
free the cell_list and the child if the exists (#92014).
Tue Oct 15 00:40:25 2002 Kristian Rietveld <kris@gtk.org>
Don't accept drops if the model has been sorted, #93758)
* gtk/gtkliststore.c (gtk_list_store_row_drop_possible): return
FALSE if the list has been sorted.
* gtk/gtktreestore.c (gtk_tree_store_row_drop_possible): check
if drag_dest is a TreeStore, return FALSE if the tree has been
sorted.
Tue Oct 15 00:33:59 2002 Kristian Rietveld <kris@gtk.org>
Compiler warning fixage, (#85858, #85859, #85860, #85872)
* gtk/gtkcellrendererpixbuf (gtk_cell_renderer_pixbuf_render):
s/guint/GtkCellRendererState/.
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render):
ditto.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render),
(gtk_cell_renderer_toggle_activate): ditto.
* gtk/gtkliststore.c (gtk_list_store_get_flags): a
s/guint/GtkTreeModelFlags/ on the return type.
2002-10-14 22:50:18 +00:00
|
|
|
g_list_free (tree_column->cell_list);
|
|
|
|
|
|
|
|
if (tree_column->child)
|
2003-02-28 01:45:51 +00:00
|
|
|
g_object_unref (tree_column->child);
|
2001-08-23 16:54:49 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->finalize (object);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_VISIBLE:
|
|
|
|
gtk_tree_view_column_set_visible (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
case PROP_RESIZABLE:
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_SIZING:
|
|
|
|
gtk_tree_view_column_set_sizing (tree_column,
|
|
|
|
g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_FIXED_WIDTH:
|
|
|
|
gtk_tree_view_column_set_fixed_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
|
|
|
gtk_tree_view_column_set_min_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
|
|
|
gtk_tree_view_column_set_max_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
case PROP_SPACING:
|
|
|
|
gtk_tree_view_column_set_spacing (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_TITLE:
|
|
|
|
gtk_tree_view_column_set_title (tree_column,
|
|
|
|
g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
case PROP_EXPAND:
|
|
|
|
gtk_tree_view_column_set_expand (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_CLICKABLE:
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
|
|
|
gtk_tree_view_column_set_widget (tree_column,
|
|
|
|
(GtkWidget*) g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
gtk_tree_view_column_set_alignment (tree_column,
|
|
|
|
g_value_get_float (value));
|
|
|
|
break;
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
gtk_tree_view_column_set_reorderable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column,
|
|
|
|
g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
gtk_tree_view_column_set_sort_column_id (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_VISIBLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_visible (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
case PROP_RESIZABLE:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_resizable (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_WIDTH:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_width (tree_column));
|
|
|
|
break;
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
case PROP_SPACING:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_spacing (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_SIZING:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_enum (value,
|
|
|
|
gtk_tree_view_column_get_sizing (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_FIXED_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_fixed_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_min_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_max_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_TITLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_string (value,
|
|
|
|
gtk_tree_view_column_get_title (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
case PROP_EXPAND:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_expand (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_CLICKABLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_clickable (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_object (value,
|
|
|
|
(GObject*) gtk_tree_view_column_get_widget (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
g_value_set_float (value,
|
|
|
|
gtk_tree_view_column_get_alignment (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_reorderable (tree_column));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_sort_indicator (tree_column));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
g_value_set_enum (value,
|
|
|
|
gtk_tree_view_column_get_sort_order (tree_column));
|
|
|
|
break;
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_sort_column_id (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
/* Implementation of GtkCellLayout interface
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_pack_start (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gboolean expand)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeViewColumnCellInfo *cell_info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
g_return_if_fail (! gtk_tree_view_column_get_cell_info (column, cell));
|
|
|
|
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (cell);
|
2003-07-11 12:51:24 +00:00
|
|
|
|
|
|
|
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
|
|
|
|
cell_info->cell = cell;
|
|
|
|
cell_info->expand = expand ? TRUE : FALSE;
|
|
|
|
cell_info->pack = GTK_PACK_START;
|
|
|
|
cell_info->has_focus = 0;
|
|
|
|
cell_info->attributes = NULL;
|
|
|
|
|
|
|
|
column->cell_list = g_list_append (column->cell_list, cell_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_pack_end (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gboolean expand)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeViewColumnCellInfo *cell_info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
g_return_if_fail (! gtk_tree_view_column_get_cell_info (column, cell));
|
|
|
|
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (cell);
|
2003-07-11 12:51:24 +00:00
|
|
|
|
|
|
|
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
|
|
|
|
cell_info->cell = cell;
|
|
|
|
cell_info->expand = expand ? TRUE : FALSE;
|
|
|
|
cell_info->pack = GTK_PACK_END;
|
|
|
|
cell_info->has_focus = 0;
|
|
|
|
cell_info->attributes = NULL;
|
|
|
|
|
|
|
|
column->cell_list = g_list_append (column->cell_list, cell_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_clear (GtkCellLayout *cell_layout)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
2004-03-12 23:23:28 +00:00
|
|
|
while (column->cell_list)
|
2003-07-11 12:51:24 +00:00
|
|
|
{
|
2004-03-12 23:23:28 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)column->cell_list->data;
|
2003-07-11 12:51:24 +00:00
|
|
|
|
2004-03-12 23:23:28 +00:00
|
|
|
gtk_tree_view_column_cell_layout_clear_attributes (cell_layout, info->cell);
|
2004-11-19 23:18:38 +00:00
|
|
|
g_object_unref (info->cell);
|
2003-07-11 12:51:24 +00:00
|
|
|
g_free (info);
|
2004-03-12 23:23:28 +00:00
|
|
|
column->cell_list = g_list_delete_link (column->cell_list,
|
|
|
|
column->cell_list);
|
2003-07-11 12:51:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_add_attribute (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
const gchar *attribute,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
|
|
|
info = gtk_tree_view_column_get_cell_info (tree_column, cell);
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
|
|
|
|
info->attributes = g_slist_prepend (info->attributes, GINT_TO_POINTER (column));
|
|
|
|
info->attributes = g_slist_prepend (info->attributes, g_strdup (attribute));
|
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkCellLayoutDataFunc func,
|
|
|
|
gpointer func_data,
|
|
|
|
GDestroyNotify destroy)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
|
|
|
info = gtk_tree_view_column_get_cell_info (column, cell);
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
|
|
|
|
if (info->destroy)
|
|
|
|
{
|
|
|
|
GDestroyNotify d = info->destroy;
|
|
|
|
|
|
|
|
info->destroy = NULL;
|
|
|
|
d (info->func_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
info->func = (GtkTreeCellDataFunc)func;
|
|
|
|
info->func_data = func_data;
|
|
|
|
info->destroy = destroy;
|
|
|
|
|
|
|
|
if (column->tree_view)
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (column, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell_renderer)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
|
|
|
info = gtk_tree_view_column_get_cell_info (column, cell_renderer);
|
2004-10-01 18:56:14 +00:00
|
|
|
if (info)
|
|
|
|
gtk_tree_view_column_clear_attributes_by_info (column, info);
|
2003-07-11 12:51:24 +00:00
|
|
|
}
|
|
|
|
|
2003-12-19 22:47:20 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_reorder (GtkCellLayout *cell_layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gint position)
|
|
|
|
{
|
|
|
|
GList *link;
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout));
|
|
|
|
column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
|
|
|
info = gtk_tree_view_column_get_cell_info (column, cell);
|
|
|
|
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
g_return_if_fail (position >= 0);
|
|
|
|
|
|
|
|
link = g_list_find (column->cell_list, info);
|
|
|
|
|
|
|
|
g_return_if_fail (link != NULL);
|
|
|
|
|
2007-12-15 11:15:19 +00:00
|
|
|
column->cell_list = g_list_delete_link (column->cell_list, link);
|
2003-12-19 22:47:20 +00:00
|
|
|
column->cell_list = g_list_insert (column->cell_list, info, position);
|
|
|
|
|
2006-08-06 02:00:24 +00:00
|
|
|
if (column->tree_view)
|
|
|
|
gtk_widget_queue_draw (column->tree_view);
|
2003-12-19 22:47:20 +00:00
|
|
|
}
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_clear_attributes_by_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkTreeViewColumnCellInfo *info)
|
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
list = info->attributes;
|
|
|
|
|
|
|
|
while (list && list->next)
|
|
|
|
{
|
|
|
|
g_free (list->data);
|
|
|
|
list = list->next->next;
|
|
|
|
}
|
|
|
|
g_slist_free (info->attributes);
|
|
|
|
info->attributes = NULL;
|
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Helper functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Button handling code
|
|
|
|
*/
|
2001-02-17 00:16:08 +00:00
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
|
2001-02-17 00:16:08 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GtkWidget *child;
|
|
|
|
GtkWidget *hbox;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_view = (GtkTreeView *) tree_column->tree_view;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
|
|
|
g_return_if_fail (tree_column->button == NULL);
|
|
|
|
|
|
|
|
gtk_widget_push_composite_child ();
|
|
|
|
tree_column->button = gtk_button_new ();
|
2002-01-21 17:38:28 +00:00
|
|
|
gtk_widget_add_events (tree_column->button, GDK_POINTER_MOTION_MASK);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_pop_composite_child ();
|
|
|
|
|
|
|
|
/* make sure we own a reference to it as well. */
|
2001-05-25 23:10:49 +00:00
|
|
|
if (tree_view->priv->header_window)
|
|
|
|
gtk_widget_set_parent_window (tree_column->button, tree_view->priv->header_window);
|
2001-07-19 14:57:15 +00:00
|
|
|
gtk_widget_set_parent (tree_column->button, GTK_WIDGET (tree_view));
|
2002-02-19 21:16:49 +00:00
|
|
|
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_connect (tree_column->button, "event",
|
2002-02-19 21:16:49 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_button_event),
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column);
|
|
|
|
g_signal_connect (tree_column->button, "clicked",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_button_clicked),
|
|
|
|
tree_column);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0, 0.0);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
tree_column->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
|
|
|
|
|
|
|
|
if (tree_column->child)
|
|
|
|
child = tree_column->child;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
child = gtk_label_new (tree_column->title);
|
|
|
|
gtk_widget_show (child);
|
|
|
|
}
|
|
|
|
|
2008-08-08 14:23:32 +00:00
|
|
|
g_signal_connect (child, "mnemonic-activate",
|
2002-02-19 21:16:49 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_mnemonic_activate),
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->xalign <= 0.5)
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0);
|
|
|
|
else
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), tree_column->alignment, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_column->alignment), child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_column->button), hbox);
|
|
|
|
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_widget_show (tree_column->alignment);
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-02-17 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2006-09-24 17:03:45 +00:00
|
|
|
gint sort_column_id = -1;
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *arrow;
|
|
|
|
GtkWidget *current_child;
|
2006-05-28 12:37:21 +00:00
|
|
|
GtkArrowType arrow_type = GTK_ARROW_NONE;
|
2006-05-30 09:29:49 +00:00
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_column->tree_view));
|
|
|
|
else
|
|
|
|
model = NULL;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Create a button if necessary */
|
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->button == NULL &&
|
|
|
|
tree_column->tree_view &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_create_button (tree_column);
|
|
|
|
|
|
|
|
if (! tree_column->button)
|
|
|
|
return;
|
|
|
|
|
|
|
|
hbox = GTK_BIN (tree_column->button)->child;
|
|
|
|
alignment = tree_column->alignment;
|
|
|
|
arrow = tree_column->arrow;
|
|
|
|
current_child = GTK_BIN (alignment)->child;
|
|
|
|
|
|
|
|
/* Set up the actual button */
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), tree_column->xalign,
|
|
|
|
0.5, 0.0, 0.0);
|
|
|
|
|
|
|
|
if (tree_column->child)
|
|
|
|
{
|
|
|
|
if (current_child != tree_column->child)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (alignment),
|
|
|
|
current_child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment),
|
|
|
|
tree_column->child);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (current_child == NULL)
|
|
|
|
{
|
|
|
|
current_child = gtk_label_new (NULL);
|
|
|
|
gtk_widget_show (current_child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment),
|
|
|
|
current_child);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_LABEL (current_child));
|
|
|
|
|
|
|
|
if (tree_column->title)
|
2002-02-19 21:16:49 +00:00
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
|
|
|
tree_column->title);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2002-02-19 21:16:49 +00:00
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
|
|
|
"");
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2006-09-24 17:03:45 +00:00
|
|
|
if (GTK_IS_TREE_SORTABLE (model))
|
|
|
|
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
&sort_column_id,
|
|
|
|
NULL);
|
|
|
|
|
2007-12-17 13:25:43 +00:00
|
|
|
if (tree_column->show_sort_indicator)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2006-12-27 19:52:25 +00:00
|
|
|
gboolean alternative;
|
|
|
|
|
|
|
|
g_object_get (gtk_widget_get_settings (tree_column->tree_view),
|
|
|
|
"gtk-alternative-sort-arrows", &alternative,
|
|
|
|
NULL);
|
|
|
|
|
2006-09-24 17:03:45 +00:00
|
|
|
switch (tree_column->sort_order)
|
|
|
|
{
|
|
|
|
case GTK_SORT_ASCENDING:
|
2006-12-27 19:52:25 +00:00
|
|
|
arrow_type = alternative ? GTK_ARROW_UP : GTK_ARROW_DOWN;
|
2006-09-24 17:03:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SORT_DESCENDING:
|
2006-12-27 19:52:25 +00:00
|
|
|
arrow_type = alternative ? GTK_ARROW_DOWN : GTK_ARROW_UP;
|
2006-09-24 17:03:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_warning (G_STRLOC": bad sort order");
|
|
|
|
break;
|
2006-05-28 12:37:21 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2006-05-28 12:37:21 +00:00
|
|
|
gtk_arrow_set (GTK_ARROW (arrow),
|
|
|
|
arrow_type,
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
/* Put arrow on the right if the text is left-or-center justified, and on the
|
|
|
|
* left otherwise; do this by packing boxes, so flipping text direction will
|
|
|
|
* reverse things
|
|
|
|
*/
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_ref (arrow);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_container_remove (GTK_CONTAINER (hbox), arrow);
|
|
|
|
|
|
|
|
if (tree_column->xalign <= 0.5)
|
|
|
|
{
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
|
|
|
|
/* move it to the front */
|
|
|
|
gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0);
|
|
|
|
}
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_unref (arrow);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2006-09-24 17:03:45 +00:00
|
|
|
if (tree_column->show_sort_indicator
|
|
|
|
|| (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0))
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_show (arrow);
|
|
|
|
else
|
|
|
|
gtk_widget_hide (arrow);
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
/* It's always safe to hide the button. It isn't always safe to show it, as
|
|
|
|
* if you show it before it's realized, it'll get the wrong window. */
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->button &&
|
|
|
|
tree_column->tree_view != NULL &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
if (tree_column->visible)
|
|
|
|
{
|
2001-05-25 23:10:49 +00:00
|
|
|
gtk_widget_show_now (tree_column->button);
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->window)
|
|
|
|
{
|
2001-11-19 21:18:22 +00:00
|
|
|
if (tree_column->resizable)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gdk_window_show (tree_column->window);
|
|
|
|
gdk_window_raise (tree_column->window);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdk_window_hide (tree_column->window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_hide (tree_column->button);
|
|
|
|
if (tree_column->window)
|
|
|
|
gdk_window_hide (tree_column->window);
|
|
|
|
}
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
|
|
|
|
if (tree_column->reorderable || tree_column->clickable)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2010-03-02 03:40:38 +00:00
|
|
|
gtk_widget_set_can_focus (tree_column->button, TRUE);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
else
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2010-03-02 03:40:38 +00:00
|
|
|
gtk_widget_set_can_focus (tree_column->button, FALSE);
|
2010-03-01 03:21:41 +00:00
|
|
|
if (gtk_widget_has_focus (tree_column->button))
|
2001-07-05 02:58:34 +00:00
|
|
|
{
|
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (tree_column->tree_view);
|
2010-01-04 06:49:26 +00:00
|
|
|
if (gtk_widget_is_toplevel (toplevel))
|
2001-10-31 22:57:51 +00:00
|
|
|
{
|
|
|
|
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
|
|
|
|
}
|
2001-07-05 02:58:34 +00:00
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2002-01-18 00:23:26 +00:00
|
|
|
/* Queue a resize on the assumption that we always want to catch all changes
|
|
|
|
* and columns don't change all that often.
|
|
|
|
*/
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (tree_column->tree_view))
|
2002-01-18 00:23:26 +00:00
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Button signal handlers
|
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
static gint
|
2001-05-22 19:18:47 +00:00
|
|
|
gtk_tree_view_column_button_event (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-22 19:18:47 +00:00
|
|
|
GtkTreeViewColumn *column = (GtkTreeViewColumn *) data;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
if (event->type == GDK_BUTTON_PRESS &&
|
2005-01-04 22:10:56 +00:00
|
|
|
column->reorderable &&
|
|
|
|
((GdkEventButton *)event)->button == 1)
|
2001-05-22 19:18:47 +00:00
|
|
|
{
|
|
|
|
column->maybe_reordered = TRUE;
|
2005-09-09 21:21:12 +00:00
|
|
|
gdk_window_get_pointer (GTK_BUTTON (widget)->event_window,
|
2001-05-22 19:18:47 +00:00
|
|
|
&column->drag_x,
|
|
|
|
&column->drag_y,
|
|
|
|
NULL);
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
}
|
|
|
|
|
2004-12-08 03:17:41 +00:00
|
|
|
if (event->type == GDK_BUTTON_RELEASE ||
|
|
|
|
event->type == GDK_LEAVE_NOTIFY)
|
2001-05-22 19:18:47 +00:00
|
|
|
column->maybe_reordered = FALSE;
|
2004-12-08 03:17:41 +00:00
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
if (event->type == GDK_MOTION_NOTIFY &&
|
2004-12-08 03:17:41 +00:00
|
|
|
column->maybe_reordered &&
|
2001-05-22 19:18:47 +00:00
|
|
|
(gtk_drag_check_threshold (widget,
|
|
|
|
column->drag_x,
|
|
|
|
column->drag_y,
|
|
|
|
(gint) ((GdkEventMotion *)event)->x,
|
|
|
|
(gint) ((GdkEventMotion *)event)->y)))
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-22 19:18:47 +00:00
|
|
|
column->maybe_reordered = FALSE;
|
|
|
|
_gtk_tree_view_column_start_drag (GTK_TREE_VIEW (column->tree_view), column);
|
2000-10-05 01:04:57 +00:00
|
|
|
return TRUE;
|
2001-05-22 19:18:47 +00:00
|
|
|
}
|
|
|
|
if (column->clickable == FALSE)
|
|
|
|
{
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
case GDK_3BUTTON_PRESS:
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_emit_by_name (data, "clicked");
|
2001-04-12 16:11:54 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2002-02-19 21:16:49 +00:00
|
|
|
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);
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
GTK_TREE_VIEW (column->tree_view)->priv->focus_column = column;
|
2002-02-19 21:16:49 +00:00
|
|
|
if (column->clickable)
|
|
|
|
gtk_button_clicked (GTK_BUTTON (column->button));
|
2010-01-04 03:56:11 +00:00
|
|
|
else if (gtk_widget_get_can_focus (column->button))
|
2002-02-19 21:16:49 +00:00
|
|
|
gtk_widget_grab_focus (column->button);
|
|
|
|
else
|
2002-04-05 16:11:32 +00:00
|
|
|
gtk_widget_grab_focus (column->tree_view);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-04-12 16:11:54 +00:00
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
2001-12-04 23:49:57 +00:00
|
|
|
GtkTreeViewColumn *column)
|
2001-04-12 16:11:54 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
gint sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType order;
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (gtk_tree_sortable_get_sort_column_id (sortable,
|
|
|
|
&sort_column_id,
|
|
|
|
&order))
|
|
|
|
{
|
|
|
|
if (sort_column_id == column->sort_column_id)
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sort_order (column, order);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
}
|
|
|
|
}
|
2001-10-09 18:51:43 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
}
|
2001-04-12 16:11:54 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
gpointer data)
|
2001-03-02 00:49:32 +00:00
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
gint sort_column_id;
|
|
|
|
GtkSortType order;
|
|
|
|
gboolean has_sort_column;
|
|
|
|
gboolean has_default_sort_func;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (tree_column->tree_view != NULL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-10-06 00:50:36 +00:00
|
|
|
has_sort_column =
|
|
|
|
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
&sort_column_id,
|
|
|
|
&order);
|
|
|
|
has_default_sort_func =
|
|
|
|
gtk_tree_sortable_has_default_sort_func (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model));
|
|
|
|
|
|
|
|
if (has_sort_column &&
|
|
|
|
sort_column_id == tree_column->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
if (order == GTK_SORT_ASCENDING)
|
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
GTK_SORT_DESCENDING);
|
|
|
|
else if (order == GTK_SORT_DESCENDING && has_default_sort_func)
|
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2001-10-06 00:50:36 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
if (tree_column->tree_view == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_column->tree_view));
|
|
|
|
|
|
|
|
if (model == NULL)
|
2001-08-21 04:49:15 +00:00
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (GTK_IS_TREE_SORTABLE (model) &&
|
|
|
|
tree_column->sort_column_id != -1)
|
|
|
|
{
|
|
|
|
gint real_sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType real_order;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (tree_column->sort_column_changed_signal == 0)
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
tree_column->sort_column_changed_signal =
|
2008-08-08 14:23:32 +00:00
|
|
|
g_signal_connect (model, "sort-column-changed",
|
2002-10-13 19:34:42 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_model_sort_column_changed),
|
|
|
|
tree_column);
|
2001-06-29 16:30:25 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
&real_sort_column_id,
|
|
|
|
&real_order) &&
|
|
|
|
(real_sort_column_id == tree_column->sort_column_id))
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, real_order);
|
2004-10-03 06:12:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Exported Private Functions.
|
|
|
|
* These should only be called by gtktreeview.c or gtktreeviewcolumn.c
|
|
|
|
*/
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GdkWindowAttr attr;
|
|
|
|
guint attributes_mask;
|
2003-11-29 06:16:11 +00:00
|
|
|
gboolean rtl;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
|
|
tree_view = (GtkTreeView *)column->tree_view;
|
2003-11-29 06:16:11 +00:00
|
|
|
rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
2010-03-02 06:16:02 +00:00
|
|
|
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view)));
|
2001-03-02 00:49:32 +00:00
|
|
|
g_return_if_fail (tree_view->priv->header_window != NULL);
|
|
|
|
g_return_if_fail (column->button != NULL);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_set_parent_window (column->button, tree_view->priv->header_window);
|
|
|
|
|
|
|
|
if (column->visible)
|
|
|
|
gtk_widget_show (column->button);
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
attr.window_type = GDK_WINDOW_CHILD;
|
|
|
|
attr.wclass = GDK_INPUT_ONLY;
|
|
|
|
attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
|
|
|
|
attr.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
|
2003-07-17 17:09:57 +00:00
|
|
|
attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view)) |
|
|
|
|
(GDK_BUTTON_PRESS_MASK |
|
2001-03-02 00:49:32 +00:00
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_POINTER_MOTION_MASK |
|
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK);
|
|
|
|
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
|
2002-06-18 20:59:44 +00:00
|
|
|
attr.cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (tree_view->priv->header_window),
|
|
|
|
GDK_SB_H_DOUBLE_ARROW);
|
2001-03-02 00:49:32 +00:00
|
|
|
attr.y = 0;
|
|
|
|
attr.width = TREE_VIEW_DRAG_WIDTH;
|
|
|
|
attr.height = tree_view->priv->header_height;
|
|
|
|
|
2007-02-14 12:13:48 +00:00
|
|
|
attr.x = (column->button->allocation.x + (rtl ? 0 : column->button->allocation.width)) - TREE_VIEW_DRAG_WIDTH / 2;
|
2001-03-02 00:49:32 +00:00
|
|
|
column->window = gdk_window_new (tree_view->priv->header_window,
|
|
|
|
&attr, attributes_mask);
|
|
|
|
gdk_window_set_user_data (column->window, tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
gtk_tree_view_column_update_button (column);
|
2001-12-03 21:20:12 +00:00
|
|
|
|
|
|
|
gdk_cursor_unref (attr.cursor);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unrealize_button (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (column != NULL);
|
|
|
|
g_return_if_fail (column->window != NULL);
|
|
|
|
|
|
|
|
gdk_window_set_user_data (column->window, NULL);
|
|
|
|
gdk_window_destroy (column->window);
|
|
|
|
column->window = NULL;
|
|
|
|
}
|
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unset_model (GtkTreeViewColumn *column,
|
|
|
|
GtkTreeModel *old_model)
|
|
|
|
{
|
|
|
|
if (column->sort_column_changed_signal)
|
2002-10-13 19:34:42 +00:00
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (old_model,
|
|
|
|
column->sort_column_changed_signal);
|
|
|
|
column->sort_column_changed_signal = 0;
|
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
|
|
|
|
GtkTreeView *tree_view)
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
g_assert (column->tree_view == NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
column->tree_view = GTK_WIDGET (tree_view);
|
|
|
|
gtk_tree_view_column_create_button (column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-06-01 22:57:30 +00:00
|
|
|
column->property_changed_signal =
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_connect_swapped (tree_view,
|
2001-07-09 17:09:35 +00:00
|
|
|
"notify::model",
|
2002-10-13 19:34:42 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_setup_sort_column_id_callback),
|
2001-07-09 17:09:35 +00:00
|
|
|
column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (column);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
if (column->tree_view && column->button)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (column->tree_view), column->button);
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
if (column->property_changed_signal)
|
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_handler_disconnect (column->tree_view, column->property_changed_signal);
|
2001-05-16 00:23:30 +00:00
|
|
|
column->property_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (column->sort_column_changed_signal)
|
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_handler_disconnect (gtk_tree_view_get_model (GTK_TREE_VIEW (column->tree_view)),
|
2001-08-21 04:49:15 +00:00
|
|
|
column->sort_column_changed_signal);
|
2001-05-16 00:23:30 +00:00
|
|
|
column->sort_column_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
column->tree_view = NULL;
|
|
|
|
column->button = NULL;
|
|
|
|
}
|
|
|
|
|
2002-04-09 19:48:32 +00:00
|
|
|
gboolean
|
|
|
|
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2002-04-25 21:44:33 +00:00
|
|
|
for (list = column->cell_list; list; list = list->next)
|
2002-04-09 19:48:32 +00:00
|
|
|
if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode ==
|
|
|
|
GTK_CELL_RENDERER_MODE_EDITABLE)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* gets cell being edited */
|
2002-04-14 15:05:04 +00:00
|
|
|
GtkCellRenderer *
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
_gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column)
|
2002-04-14 15:05:04 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2002-04-25 21:44:33 +00:00
|
|
|
for (list = column->cell_list; list; list = list->next)
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
if (((GtkTreeViewColumnCellInfo *)list->data)->in_editing_mode)
|
2002-04-14 15:05:04 +00:00
|
|
|
return ((GtkTreeViewColumnCellInfo *)list->data)->cell;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-04-25 21:44:33 +00:00
|
|
|
gint
|
|
|
|
_gtk_tree_view_column_count_special_cells (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
gint i = 0;
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *cellinfo = list->data;
|
|
|
|
|
2003-01-30 22:42:21 +00:00
|
|
|
if ((cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
|
|
|
|
cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE) &&
|
|
|
|
cellinfo->cell->visible)
|
2002-04-25 21:44:33 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
GtkCellRenderer *
|
|
|
|
_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
|
|
|
|
gint x)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gint current_x = 0;
|
|
|
|
|
|
|
|
list = gtk_tree_view_column_cell_first (column);
|
|
|
|
for (; list; list = gtk_tree_view_column_cell_next (column, list))
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *cellinfo = list->data;
|
|
|
|
if (current_x <= x && x <= current_x + cellinfo->real_width)
|
|
|
|
return cellinfo->cell;
|
|
|
|
current_x += cellinfo->real_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
/* Public Functions */
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new:
|
|
|
|
*
|
|
|
|
* Creates a new #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkTreeViewColumn.
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *
|
2000-10-05 01:04:57 +00:00
|
|
|
gtk_tree_view_column_new (void)
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeViewColumn *tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, NULL);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new_with_attributes:
|
|
|
|
* @title: The title to set the header to.
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @Varargs: A %NULL-terminated list of attributes.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Creates a new #GtkTreeViewColumn with a number of default values. This is
|
2001-12-08 21:39:34 +00:00
|
|
|
* equivalent to calling gtk_tree_view_column_set_title(),
|
|
|
|
* gtk_tree_view_column_pack_start(), and
|
|
|
|
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
|
2002-03-15 21:47:52 +00:00
|
|
|
*
|
|
|
|
* Here's a simple example:
|
2007-11-25 06:51:19 +00:00
|
|
|
* |[
|
2002-04-18 22:04:46 +00:00
|
|
|
* enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
|
|
|
|
* ...
|
|
|
|
* {
|
|
|
|
* GtkTreeViewColumn *column;
|
2007-11-25 06:51:19 +00:00
|
|
|
* GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
|
2002-04-18 22:04:46 +00:00
|
|
|
*
|
|
|
|
* column = gtk_tree_view_column_new_with_attributes ("Title",
|
|
|
|
* renderer,
|
|
|
|
* "text", TEXT_COLUMN,
|
|
|
|
* "foreground", COLOR_COLUMN,
|
|
|
|
* NULL);
|
|
|
|
* }
|
2007-11-25 06:51:19 +00:00
|
|
|
* ]|
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkTreeViewColumn.
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *
|
2001-02-17 00:16:08 +00:00
|
|
|
gtk_tree_view_column_new_with_attributes (const gchar *title,
|
2000-10-05 01:04:57 +00:00
|
|
|
GtkCellRenderer *cell,
|
|
|
|
...)
|
|
|
|
{
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *retval;
|
2000-10-05 01:04:57 +00:00
|
|
|
va_list args;
|
|
|
|
|
|
|
|
retval = gtk_tree_view_column_new ();
|
|
|
|
|
2000-11-09 16:52:17 +00:00
|
|
|
gtk_tree_view_column_set_title (retval, title);
|
2001-09-25 19:38:18 +00:00
|
|
|
gtk_tree_view_column_pack_start (retval, cell, TRUE);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
va_start (args, cell);
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_set_attributesv (retval, cell, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
static GtkTreeViewColumnCellInfo *
|
|
|
|
gtk_tree_view_column_get_cell_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
if (((GtkTreeViewColumnCellInfo *)list->data)->cell == cell_renderer)
|
|
|
|
return (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
/**
|
2001-08-24 20:09:26 +00:00
|
|
|
* gtk_tree_view_column_pack_start:
|
2001-06-27 23:44:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
* Packs the @cell into the beginning of the column. If @expand is %FALSE, then
|
2002-09-28 20:03:56 +00:00
|
|
|
* the @cell is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2001-06-27 23:44:53 +00:00
|
|
|
**/
|
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_pack_end:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
* Adds the @cell to end of the column. If @expand is %FALSE, then the @cell
|
2002-09-28 20:03:56 +00:00
|
|
|
* is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clear:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Unsets all the mappings on all renderers on the @tree_column.
|
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_clear (GTK_CELL_LAYOUT (tree_column));
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2009-07-08 14:41:32 +00:00
|
|
|
static GList *
|
|
|
|
gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *layout)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
{
|
2009-07-08 14:41:32 +00:00
|
|
|
GtkTreeViewColumn *tree_column = GTK_TREE_VIEW_COLUMN (layout);
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *retval = NULL, *list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (tree_column != NULL, NULL);
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data;
|
|
|
|
|
|
|
|
retval = g_list_append (retval, info->cell);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
2009-07-08 14:41:32 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_cell_renderers:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Returns a newly-allocated #GList of all the cell renderers in the column,
|
|
|
|
* in no particular order. The list must be freed with g_list_free().
|
|
|
|
*
|
|
|
|
* Return value: A list of #GtkCellRenderers
|
|
|
|
*
|
|
|
|
* Deprecated: 2.18: use gtk_cell_layout_get_cells() instead.
|
|
|
|
**/
|
|
|
|
GList *
|
|
|
|
gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column)
|
2006-12-29 07:53:01 +00:00
|
|
|
{
|
2009-07-08 14:41:32 +00:00
|
|
|
return gtk_tree_view_column_cell_layout_get_cells (GTK_CELL_LAYOUT (tree_column));
|
2006-12-29 07:53:01 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_add_attribute:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-09-08 06:24:46 +00:00
|
|
|
* @cell_renderer: the #GtkCellRenderer to set attributes on
|
|
|
|
* @attribute: An attribute on the renderer
|
2000-10-16 06:14:53 +00:00
|
|
|
* @column: The column position on the model to get the attribute from.
|
|
|
|
*
|
|
|
|
* Adds an attribute mapping to the list in @tree_column. The @column is the
|
2001-09-08 06:24:46 +00:00
|
|
|
* column of the model to get a value from, and the @attribute is the
|
|
|
|
* parameter on @cell_renderer to be set from the value. So for example
|
|
|
|
* if column 2 of the model contains strings, you could have the
|
|
|
|
* "text" attribute of a #GtkCellRendererText get its values from
|
|
|
|
* column 2.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-02-17 00:16:08 +00:00
|
|
|
const gchar *attribute,
|
2000-10-05 01:04:57 +00:00
|
|
|
gint column)
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
va_list args)
|
|
|
|
{
|
|
|
|
gchar *attribute;
|
|
|
|
gint column;
|
|
|
|
|
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_clear_attributes (tree_column, cell_renderer);
|
2001-01-11 17:59:40 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
while (attribute != NULL)
|
|
|
|
{
|
|
|
|
column = va_arg (args, gint);
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_add_attribute (tree_column, cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_attributes:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-09-08 06:24:46 +00:00
|
|
|
* @cell_renderer: the #GtkCellRenderer we're setting the attributes of
|
2001-12-08 21:39:34 +00:00
|
|
|
* @Varargs: A %NULL-terminated list of attributes.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
* Sets the attributes in the list as the attributes of @tree_column.
|
|
|
|
* The attributes should be in attribute/column order, as in
|
2001-12-08 21:39:34 +00:00
|
|
|
* gtk_tree_view_column_add_attribute(). All existing attributes
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
* are removed, and replaced with the new attributes.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-06-27 23:44:53 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
|
|
|
|
g_return_if_fail (gtk_tree_view_column_get_cell_info (tree_column, cell_renderer));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
va_start (args, cell_renderer);
|
|
|
|
gtk_tree_view_column_set_attributesv (tree_column, cell_renderer, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
|
|
|
|
/**
|
2001-02-21 19:59:23 +00:00
|
|
|
* gtk_tree_view_column_set_cell_data_func:
|
2001-02-17 00:16:08 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2001-10-03 04:44:13 +00:00
|
|
|
* @cell_renderer: A #GtkCellRenderer
|
2001-02-17 00:16:08 +00:00
|
|
|
* @func: The #GtkTreeViewColumnFunc to use.
|
|
|
|
* @func_data: The user data for @func.
|
|
|
|
* @destroy: The destroy notification for @func_data
|
|
|
|
*
|
2001-09-08 06:24:46 +00:00
|
|
|
* Sets the #GtkTreeViewColumnFunc to use for the column. This
|
|
|
|
* function is used instead of the standard attributes mapping for
|
|
|
|
* setting the column value, and should set the value of @tree_column's
|
2001-12-08 21:39:34 +00:00
|
|
|
* cell renderer as appropriate. @func may be %NULL to remove an
|
2001-09-08 06:24:46 +00:00
|
|
|
* older one.
|
2001-02-17 00:16:08 +00:00
|
|
|
**/
|
|
|
|
void
|
2001-06-01 22:57:30 +00:00
|
|
|
gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-06-01 22:57:30 +00:00
|
|
|
GtkTreeCellDataFunc func,
|
|
|
|
gpointer func_data,
|
2008-06-18 09:12:32 +00:00
|
|
|
GDestroyNotify destroy)
|
2001-02-17 00:16:08 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer,
|
|
|
|
(GtkCellLayoutDataFunc)func,
|
|
|
|
func_data, destroy);
|
2001-02-17 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-01-11 17:59:40 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clear_attributes:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
* @cell_renderer: a #GtkCellRenderer to clear the attribute mapping on.
|
2001-01-11 17:59:40 +00:00
|
|
|
*
|
|
|
|
* Clears all existing attributes previously set with
|
|
|
|
* gtk_tree_view_column_set_attributes().
|
|
|
|
**/
|
|
|
|
void
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer)
|
2001-01-11 17:59:40 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer);
|
2002-06-07 22:02:23 +00:00
|
|
|
}
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_spacing:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @spacing: distance between cell renderers in pixels.
|
|
|
|
*
|
|
|
|
* Sets the spacing field of @tree_column, which is the number of pixels to
|
|
|
|
* place between cell renderers packed into it.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_spacing (GtkTreeViewColumn *tree_column,
|
|
|
|
gint spacing)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (spacing >= 0);
|
|
|
|
|
|
|
|
if (tree_column->spacing == spacing)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->spacing = spacing;
|
|
|
|
if (tree_column->tree_view)
|
2002-02-19 18:21:50 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
2001-06-30 02:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_spacing:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the spacing of @tree_column.
|
2001-12-08 21:39:34 +00:00
|
|
|
*
|
|
|
|
* Return value: the spacing of @tree_column.
|
2001-06-30 02:38:17 +00:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
return tree_column->spacing;
|
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
/* Options for manipulating the columns */
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @visible: %TRUE if the @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Sets the visibility of @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean visible)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
visible = !! visible;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
if (tree_column->visible == visible)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->visible = visible;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2002-02-25 21:20:25 +00:00
|
|
|
if (tree_column->visible)
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "visible");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Returns %TRUE if @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Return value: whether the column is visible or not. If it is visible, then
|
|
|
|
* the tree will show the column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
|
|
return tree_column->visible;
|
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_resizable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
* @resizable: %TRUE, if the column can be resized
|
|
|
|
*
|
|
|
|
* If @resizable is %TRUE, then the user can explicitly resize the column by
|
2004-01-31 21:42:28 +00:00
|
|
|
* grabbing the outer edge of the column button. If resizable is %TRUE and
|
2002-03-05 23:08:56 +00:00
|
|
|
* sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
|
|
|
|
* mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean resizable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
resizable = !! resizable;
|
|
|
|
|
|
|
|
if (tree_column->resizable == resizable)
|
|
|
|
return;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
tree_column->resizable = resizable;
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
if (resizable && tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
gtk_tree_view_column_set_sizing (tree_column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
|
|
|
|
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "resizable");
|
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_resizable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if the @tree_column can be resized by the end user.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE, if the @tree_column can be resized.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
|
|
return tree_column->resizable;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-01-04 21:33:24 +00:00
|
|
|
* gtk_tree_view_column_set_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-01-04 21:33:24 +00:00
|
|
|
* @type: The #GtkTreeViewColumnSizing.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Sets the growth behavior of @tree_column to @type.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
|
2001-01-09 23:24:20 +00:00
|
|
|
GtkTreeViewColumnSizing type)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (type == tree_column->column_type)
|
|
|
|
return;
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
if (type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column, FALSE);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* I was clearly on crack when I wrote this. I'm not sure what's supposed to
|
|
|
|
* be below so I'll leave it until I figure it out.
|
|
|
|
*/
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE &&
|
|
|
|
tree_column->requested_width != -1)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sizing (tree_column, tree_column->requested_width);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
2001-11-19 21:18:22 +00:00
|
|
|
#endif
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->column_type = type;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "sizing");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-01-09 23:24:20 +00:00
|
|
|
* gtk_tree_view_column_get_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the current type of @tree_column.
|
|
|
|
*
|
|
|
|
* Return value: The type of @tree_column.
|
|
|
|
**/
|
2001-06-05 19:01:30 +00:00
|
|
|
GtkTreeViewColumnSizing
|
2001-01-09 23:24:20 +00:00
|
|
|
gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
return tree_column->column_type;
|
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_get_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Returns the current size of @tree_column in pixels.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: The current width of @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2001-01-04 23:36:19 +00:00
|
|
|
return tree_column->width;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_set_fixed_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @fixed_width: The size to set @tree_column to. Must be greater than 0.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
2001-09-08 00:56:30 +00:00
|
|
|
* Sets the size of the column in pixels. This is meaningful only if the sizing
|
2002-03-05 23:22:27 +00:00
|
|
|
* type is #GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
|
|
|
|
* the min/max width for the column. Please note that the min/max width of the
|
|
|
|
* column doesn't actually affect the "fixed_width" property of the widget, just
|
|
|
|
* the actual size when displayed.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column,
|
2001-10-03 04:44:13 +00:00
|
|
|
gint fixed_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-10-03 13:33:50 +00:00
|
|
|
g_return_if_fail (fixed_width > 0);
|
2001-03-05 19:43:24 +00:00
|
|
|
|
2001-10-03 13:33:50 +00:00
|
|
|
tree_column->fixed_width = fixed_width;
|
2004-01-31 21:42:28 +00:00
|
|
|
tree_column->use_resized_width = FALSE;
|
2001-12-04 23:49:57 +00:00
|
|
|
|
|
|
|
if (tree_column->tree_view &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view) &&
|
2001-12-04 23:49:57 +00:00
|
|
|
tree_column->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
|
|
|
|
{
|
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
2002-01-28 18:52:49 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "fixed-width");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_get_fixed_width:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-12-04 23:49:57 +00:00
|
|
|
* Gets the fixed width of the column. This value is only meaning may not be
|
|
|
|
* the actual width of the column on the screen, just what is requested.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
*
|
2001-09-08 00:56:30 +00:00
|
|
|
* Return value: the fixed width of the column
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
**/
|
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
return tree_column->fixed_width;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_min_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @min_width: The minimum width of the column in pixels, or -1.
|
|
|
|
*
|
|
|
|
* Sets the minimum width of the @tree_column. If @min_width is -1, then the
|
|
|
|
* minimum width is unset.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
|
|
|
|
gint min_width)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (min_width >= -1);
|
|
|
|
|
|
|
|
if (min_width == tree_column->min_width)
|
|
|
|
return;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->tree_view != NULL &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2001-12-04 23:49:57 +00:00
|
|
|
if (min_width > tree_column->width)
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
tree_column->min_width = min_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2001-12-04 23:49:57 +00:00
|
|
|
if (tree_column->max_width != -1 && tree_column->max_width < min_width)
|
|
|
|
{
|
|
|
|
tree_column->max_width = min_width;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "max-width");
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "min-width");
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
|
|
|
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (tree_column->tree_view),
|
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_min_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the minimum width in pixels of the @tree_column, or -1 if no minimum
|
|
|
|
* width is set.
|
|
|
|
*
|
|
|
|
* Return value: The minimum width of the @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
|
|
|
return tree_column->min_width;
|
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_max_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @max_width: The maximum width of the column in pixels, or -1.
|
|
|
|
*
|
|
|
|
* Sets the maximum width of the @tree_column. If @max_width is -1, then the
|
2001-08-24 20:09:26 +00:00
|
|
|
* maximum width is unset. Note, the column can actually be wider than max
|
|
|
|
* width if it's the last column in a view. In this case, the column expands to
|
2001-12-04 23:49:57 +00:00
|
|
|
* fill any extra space.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
|
|
|
|
gint max_width)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (max_width >= -1);
|
|
|
|
|
|
|
|
if (max_width == tree_column->max_width)
|
|
|
|
return;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->tree_view != NULL &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
2001-06-05 15:30:53 +00:00
|
|
|
{
|
2001-12-04 23:49:57 +00:00
|
|
|
if (max_width != -1 && max_width < tree_column->width)
|
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
2001-06-05 15:30:53 +00:00
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->max_width = max_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2001-12-04 23:49:57 +00:00
|
|
|
if (max_width != -1 && max_width < tree_column->min_width)
|
|
|
|
{
|
|
|
|
tree_column->min_width = max_width;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "min-width");
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "max-width");
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
|
|
|
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (tree_column->tree_view),
|
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_max_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the maximum width in pixels of the @tree_column, or -1 if no maximum
|
|
|
|
* width is set.
|
|
|
|
*
|
|
|
|
* Return value: The maximum width of the @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
|
|
|
return tree_column->max_width;
|
|
|
|
}
|
|
|
|
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clicked:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-05-16 00:23:30 +00:00
|
|
|
* Emits the "clicked" signal on the column. This function will only work if
|
2001-12-04 23:49:57 +00:00
|
|
|
* @tree_column is clickable.
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->button &&
|
|
|
|
tree_column->clickable)
|
|
|
|
gtk_button_clicked (GTK_BUTTON (tree_column->button));
|
2001-01-19 22:39:19 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_title:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @title: The title of the @tree_column.
|
|
|
|
*
|
|
|
|
* Sets the title of the @tree_column. If a custom widget has been set, then
|
|
|
|
* this value is ignored.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
|
2001-02-21 19:59:23 +00:00
|
|
|
const gchar *title)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2003-11-07 21:57:20 +00:00
|
|
|
gchar *new_title;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2003-11-07 21:57:20 +00:00
|
|
|
new_title = g_strdup (title);
|
2000-10-05 01:04:57 +00:00
|
|
|
g_free (tree_column->title);
|
2003-11-07 21:57:20 +00:00
|
|
|
tree_column->title = new_title;
|
2000-10-16 06:14:53 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "title");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_title:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* Returns the title of the widget.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* Return value: the title of the column. This string should not be
|
|
|
|
* modified or freed.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
G_CONST_RETURN gchar *
|
2000-10-05 01:04:57 +00:00
|
|
|
gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
|
|
return tree_column->title;
|
|
|
|
}
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_expand:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2005-06-10 04:45:40 +00:00
|
|
|
* @expand: %TRUE if the column should take available extra space, %FALSE if not
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
*
|
|
|
|
* Sets the column to take available extra space. This space is shared equally
|
|
|
|
* amongst all columns that have the expand set to %TRUE. If no column has this
|
|
|
|
* option set, then the last column gets all extra space. By default, every
|
|
|
|
* column is created with this %FALSE.
|
2003-04-12 22:25:21 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean expand)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
expand = expand?TRUE:FALSE;
|
|
|
|
if (tree_column->expand == expand)
|
|
|
|
return;
|
|
|
|
tree_column->expand = expand;
|
|
|
|
|
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->tree_view != NULL &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
{
|
2008-07-11 14:17:49 +00:00
|
|
|
/* We want to continue using the original width of the
|
|
|
|
* column that includes additional space added by the user
|
|
|
|
* resizing the columns and possibly extra (expanded) space, which
|
|
|
|
* are not included in the resized width.
|
|
|
|
*/
|
|
|
|
tree_column->use_resized_width = FALSE;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "expand");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_expand:
|
2005-06-10 04:45:40 +00:00
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
*
|
|
|
|
* Return %TRUE if the column expands to take any available space.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE, if the column expands
|
2003-04-12 22:25:21 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
|
|
return tree_column->expand;
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_clickable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @clickable: %TRUE if the header is active.
|
2001-05-16 00:23:30 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Sets the header to be active if @active is %TRUE. When the header is active,
|
2001-05-16 00:23:30 +00:00
|
|
|
* then it can take keyboard focus, and can be clicked.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean clickable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
clickable = !! clickable;
|
|
|
|
if (tree_column->clickable == clickable)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
tree_column->clickable = clickable;
|
2001-05-22 19:18:47 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "clickable");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_clickable:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Returns %TRUE if the user can click on the header for the column.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: %TRUE if user can click the column header.
|
2001-01-09 23:24:20 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column->clickable;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_widget:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2009-12-10 10:23:40 +00:00
|
|
|
* @widget: (allow-none): A child #GtkWidget, or %NULL.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Sets the widget in the header to be @widget. If widget is %NULL, then the
|
2000-10-16 06:14:53 +00:00
|
|
|
* header button is set with a #GtkLabel set to the title of @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
2001-01-19 22:39:19 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
if (widget)
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (widget);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
if (tree_column->child)
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_unref (tree_column->child);
|
2001-01-19 22:39:19 +00:00
|
|
|
|
|
|
|
tree_column->child = widget;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "widget");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_widget:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
2002-03-08 17:58:22 +00:00
|
|
|
* Returns the #GtkWidget in the button on the column header. If a custom
|
|
|
|
* widget has not been set then %NULL is returned.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
2002-03-08 17:58:22 +00:00
|
|
|
* Return value: The #GtkWidget in the column header, or %NULL
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
return tree_column->child;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* gtk_tree_view_column_set_alignment:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-10-06 00:50:36 +00:00
|
|
|
* @xalign: The alignment, which is between [0.0 and 1.0] inclusive.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* Sets the alignment of the title or custom widget inside the column header.
|
2001-10-06 00:50:36 +00:00
|
|
|
* The alignment determines its location inside the button -- 0.0 for left, 0.5
|
|
|
|
* for center, 1.0 for right.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gtk_tree_view_column_set_alignment (GtkTreeViewColumn *tree_column,
|
|
|
|
gfloat xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-09-25 19:38:18 +00:00
|
|
|
xalign = CLAMP (xalign, 0.0, 1.0);
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
if (tree_column->xalign == xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
return;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
tree_column->xalign = xalign;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "alignment");
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_alignment:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the current x alignment of @tree_column. This value can range
|
|
|
|
* between 0.0 and 1.0.
|
|
|
|
*
|
|
|
|
* Return value: The current alignent of @tree_column.
|
|
|
|
**/
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gfloat
|
|
|
|
gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0.5);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
return tree_column->xalign;
|
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_reorderable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2003-04-12 22:25:21 +00:00
|
|
|
* @reorderable: %TRUE, if the column can be reordered.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* If @reorderable is %TRUE, then the column can be reordered by the end user
|
2002-02-23 07:05:55 +00:00
|
|
|
* dragging the header.
|
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean reorderable)
|
2001-03-29 21:30:05 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
/* if (reorderable)
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);*/
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->reorderable == (reorderable?TRUE:FALSE))
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->reorderable = (reorderable?TRUE:FALSE);
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "reorderable");
|
2001-03-29 21:30:05 +00:00
|
|
|
}
|
2001-03-28 01:54:14 +00:00
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_reorderable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column)
|
2001-03-28 01:54:14 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column->reorderable;
|
2001-03-28 01:54:14 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2001-03-28 01:54:14 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_column_id:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
* @sort_column_id: The @sort_column_id of the model to sort on.
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Sets the logical @sort_column_id that this column sorts on when this column
|
|
|
|
* is selected for sorting. Doing so makes the column header clickable.
|
2001-03-28 01:54:14 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
|
|
|
|
gint sort_column_id)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2003-01-27 21:41:06 +00:00
|
|
|
g_return_if_fail (sort_column_id >= -1);
|
2001-03-28 01:54:14 +00:00
|
|
|
|
|
|
|
if (tree_column->sort_column_id == sort_column_id)
|
|
|
|
return;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_column_id = sort_column_id;
|
|
|
|
|
|
|
|
/* Handle unsetting the id */
|
2001-03-28 01:54:14 +00:00
|
|
|
if (sort_column_id == -1)
|
|
|
|
{
|
2003-01-27 21:41:06 +00:00
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_column->tree_view));
|
|
|
|
|
2001-03-29 21:30:05 +00:00
|
|
|
if (tree_column->sort_clicked_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_handler_disconnect (tree_column, tree_column->sort_clicked_signal);
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_clicked_signal = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree_column->sort_column_changed_signal)
|
|
|
|
{
|
2003-01-27 21:41:06 +00:00
|
|
|
g_signal_handler_disconnect (model, tree_column->sort_column_changed_signal);
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_column_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
2001-08-23 18:33:37 +00:00
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2003-01-27 21:41:06 +00:00
|
|
|
gtk_tree_view_column_set_clickable (tree_column, FALSE);
|
2009-07-25 16:46:09 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
|
2001-03-28 01:54:14 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);
|
|
|
|
|
2001-03-29 21:30:05 +00:00
|
|
|
if (! tree_column->sort_clicked_signal)
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column->sort_clicked_signal = g_signal_connect (tree_column,
|
2001-06-29 16:30:25 +00:00
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_sort),
|
|
|
|
NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (tree_column);
|
2009-07-25 16:46:09 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
|
2001-03-28 01:54:14 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_column_id:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Gets the logical @sort_column_id that the model sorts on when this
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
* column is selected for sorting.
|
|
|
|
* See gtk_tree_view_column_set_sort_column_id().
|
2001-06-24 15:34:48 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: the current @sort_column_id for this column, or -1 if
|
2001-06-24 15:34:48 +00:00
|
|
|
* this column can't be used for sorting.
|
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
return tree_column->sort_column_id;
|
|
|
|
}
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_indicator:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
* @setting: %TRUE to display an indicator that the column is sorted
|
|
|
|
*
|
|
|
|
* Call this function with a @setting of %TRUE to display an arrow in
|
|
|
|
* the header button indicating the column is sorted. Call
|
|
|
|
* gtk_tree_view_column_set_sort_order() to change the direction of
|
|
|
|
* the arrow.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean setting)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (setting == tree_column->show_sort_indicator)
|
|
|
|
return;
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->show_sort_indicator = setting;
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-indicator");
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_indicator:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_indicator().
|
|
|
|
*
|
|
|
|
* Return value: whether the sort indicator arrow is displayed
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
|
|
return tree_column->show_sort_indicator;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_order:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
* @order: sort order that the sort indicator should indicate
|
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
* Changes the appearance of the sort indicator.
|
|
|
|
*
|
|
|
|
* This <emphasis>does not</emphasis> actually sort the model. Use
|
2001-03-28 01:54:14 +00:00
|
|
|
* gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
|
|
|
|
* support. This function is primarily for custom sorting behavior, and should
|
2001-11-10 01:30:31 +00:00
|
|
|
* be used in conjunction with gtk_tree_sortable_set_sort_column() to do
|
|
|
|
* that. For custom models, the mechanism will vary.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
* The sort indicator changes direction to indicate normal sort or reverse sort.
|
|
|
|
* Note that you must have the sort indicator enabled to see anything when
|
|
|
|
* calling this function; see gtk_tree_view_column_set_sort_indicator().
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column,
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType order)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (order == tree_column->sort_order)
|
|
|
|
return;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_order = order;
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-order");
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_order:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_order().
|
|
|
|
*
|
|
|
|
* Return value: the sort order the sort indicator is indicating
|
|
|
|
**/
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
return tree_column->sort_order;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
2001-01-19 22:39:19 +00:00
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @tree_model: The #GtkTreeModel to to get the cell renderers attributes from.
|
|
|
|
* @iter: The #GtkTreeIter to to get the cell renderer's attributes from.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @is_expander: %TRUE, if the row has children
|
|
|
|
* @is_expanded: %TRUE, if the row has visible children
|
2001-05-25 23:10:49 +00:00
|
|
|
*
|
2002-09-28 20:03:56 +00:00
|
|
|
* Sets the cell renderer based on the @tree_model and @iter. That is, for
|
2001-05-25 23:10:49 +00:00
|
|
|
* every attribute mapping in @tree_column, it will get a value from the set
|
2002-09-28 20:03:56 +00:00
|
|
|
* column on the @iter, and use that value to set the attribute on the cell
|
2001-12-08 21:39:34 +00:00
|
|
|
* renderer. This is used primarily by the #GtkTreeView.
|
2001-05-25 23:10:49 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkTreeModel *tree_model,
|
2001-08-19 04:19:56 +00:00
|
|
|
GtkTreeIter *iter,
|
|
|
|
gboolean is_expander,
|
|
|
|
gboolean is_expanded)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
GValue value = { 0, };
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *cell_list;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (tree_model == NULL)
|
|
|
|
return;
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
for (cell_list = tree_column->cell_list; cell_list; cell_list = cell_list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) cell_list->data;
|
|
|
|
GObject *cell = (GObject *) info->cell;
|
|
|
|
|
|
|
|
list = info->attributes;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
g_object_freeze_notify (cell);
|
2003-06-27 02:38:44 +00:00
|
|
|
|
|
|
|
if (info->cell->is_expander != is_expander)
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_set (cell, "is-expander", is_expander, NULL);
|
2003-06-27 02:38:44 +00:00
|
|
|
|
|
|
|
if (info->cell->is_expanded != is_expanded)
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_set (cell, "is-expanded", is_expanded, NULL);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
while (list && list->next)
|
|
|
|
{
|
|
|
|
gtk_tree_model_get_value (tree_model, iter,
|
|
|
|
GPOINTER_TO_INT (list->next->data),
|
|
|
|
&value);
|
|
|
|
g_object_set_property (cell, (gchar *) list->data, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
list = list->next->next;
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
if (info->func)
|
|
|
|
(* info->func) (tree_column, info->cell, tree_model, iter, info->func_data);
|
|
|
|
g_object_thaw_notify (G_OBJECT (info->cell));
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2001-09-17 21:44:20 +00:00
|
|
|
|
2010-04-04 01:37:42 +00:00
|
|
|
static void
|
2009-12-19 07:07:51 +00:00
|
|
|
gtk_tree_view_column_cell_get_real_size (GtkTreeViewColumn *tree_column,
|
2010-04-04 01:37:42 +00:00
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
gint *x_offset,
|
|
|
|
gint *y_offset,
|
|
|
|
GtkRequisition *minimal_size,
|
|
|
|
GtkRequisition *desired_size)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gboolean first_cell = TRUE;
|
2002-01-28 20:19:42 +00:00
|
|
|
gint focus_line_width;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-04-04 00:34:43 +00:00
|
|
|
if (minimal_size)
|
|
|
|
{
|
|
|
|
minimal_size->height = 0;
|
|
|
|
minimal_size->width = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (desired_size)
|
|
|
|
{
|
|
|
|
desired_size->height = 0;
|
|
|
|
desired_size->width = 0;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2002-01-28 20:19:42 +00:00
|
|
|
gtk_widget_style_get (tree_column->tree_view, "focus-line-width", &focus_line_width, NULL);
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
gboolean visible;
|
2009-12-19 07:07:51 +00:00
|
|
|
GtkRequisition min_req, nat_req;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
g_object_get (info->cell, "visible", &visible, NULL);
|
|
|
|
|
|
|
|
if (visible == FALSE)
|
|
|
|
continue;
|
|
|
|
|
2009-12-19 07:07:51 +00:00
|
|
|
if (first_cell == FALSE)
|
|
|
|
{
|
|
|
|
min_req.width += tree_column->spacing;
|
|
|
|
nat_req.width += tree_column->spacing;
|
|
|
|
}
|
|
|
|
|
2010-04-06 07:03:55 +00:00
|
|
|
gtk_extended_cell_get_desired_size (GTK_EXTENDED_CELL (info->cell),
|
|
|
|
tree_column->tree_view,
|
|
|
|
&min_req, &nat_req);
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2009-12-19 07:07:51 +00:00
|
|
|
min_req.width += focus_line_width * 2;
|
|
|
|
min_req.height += focus_line_width * 2;
|
|
|
|
nat_req.width += focus_line_width * 2;
|
|
|
|
nat_req.height += focus_line_width * 2;
|
|
|
|
|
|
|
|
info->requested_width = MAX (info->requested_width, min_req.width);
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2002-03-01 23:08:31 +00:00
|
|
|
first_cell = FALSE;
|
2009-12-19 07:07:51 +00:00
|
|
|
|
|
|
|
if (minimal_size)
|
|
|
|
*minimal_size = min_req;
|
|
|
|
|
|
|
|
if (desired_size)
|
|
|
|
*desired_size = nat_req;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2010-04-04 01:37:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_get_size:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @cell_area: (allow-none): The area a cell in the column will be allocated, or %NULL
|
|
|
|
* @x_offset: (allow-none): location to return x offset of a cell relative to @cell_area, or %NULL
|
|
|
|
* @y_offset: (allow-none): location to return y offset of a cell relative to @cell_area, or %NULL
|
|
|
|
* @width: (allow-none): location to return width needed to render a cell, or %NULL
|
|
|
|
* @height: (allow-none): location to return height needed to render a cell, or %NULL
|
|
|
|
*
|
|
|
|
* Obtains the width and height needed to render the column. This is used
|
|
|
|
* primarily by the #GtkTreeView.
|
|
|
|
**/
|
2009-12-19 07:07:51 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
gint *x_offset,
|
|
|
|
gint *y_offset,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
GtkRequisition min_req;
|
|
|
|
|
|
|
|
gtk_tree_view_column_cell_get_real_size (tree_column, cell_area,
|
|
|
|
x_offset, y_offset, &min_req, NULL);
|
|
|
|
|
|
|
|
if (width)
|
|
|
|
*width = min_req.width;
|
|
|
|
|
|
|
|
if (height)
|
|
|
|
*height = min_req.height;
|
|
|
|
}
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/* rendering, event handling and rendering focus are somewhat complicated, and
|
|
|
|
* quite a bit of code. Rather than duplicate them, we put them together to
|
|
|
|
* keep the code in one place.
|
2004-08-31 21:15:51 +00:00
|
|
|
*
|
|
|
|
* To better understand what's going on, check out
|
|
|
|
* docs/tree-column-sizing.png
|
2001-09-25 16:44:39 +00:00
|
|
|
*/
|
2002-03-06 05:27:29 +00:00
|
|
|
enum {
|
|
|
|
CELL_ACTION_RENDER,
|
|
|
|
CELL_ACTION_FOCUS,
|
|
|
|
CELL_ACTION_EVENT
|
|
|
|
};
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
2008-01-25 09:30:40 +00:00
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
2002-03-06 05:27:29 +00:00
|
|
|
guint flags,
|
|
|
|
gint action,
|
2008-01-25 09:30:40 +00:00
|
|
|
const GdkRectangle *expose_area, /* RENDER */
|
2002-03-06 05:27:29 +00:00
|
|
|
GdkRectangle *focus_rectangle, /* FOCUS */
|
|
|
|
GtkCellEditable **editable_widget, /* EVENT */
|
|
|
|
GdkEvent *event, /* EVENT */
|
|
|
|
gchar *path_string) /* EVENT */
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2001-09-08 00:56:30 +00:00
|
|
|
GList *list;
|
|
|
|
GdkRectangle real_cell_area;
|
2002-04-23 16:39:01 +00:00
|
|
|
GdkRectangle real_background_area;
|
2004-02-03 00:40:56 +00:00
|
|
|
GdkRectangle real_expose_area = *cell_area;
|
2005-07-13 19:14:15 +00:00
|
|
|
gint depth = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
gint expand_cell_count = 0;
|
|
|
|
gint full_requested_width = 0;
|
|
|
|
gint extra_space;
|
2001-09-25 16:44:39 +00:00
|
|
|
gint min_x, min_y, max_x, max_y;
|
2002-01-28 20:19:42 +00:00
|
|
|
gint focus_line_width;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
gint special_cells;
|
2003-06-09 23:10:20 +00:00
|
|
|
gint horizontal_separator;
|
2003-05-29 13:47:32 +00:00
|
|
|
gboolean cursor_row = FALSE;
|
2006-08-16 15:58:28 +00:00
|
|
|
gboolean first_cell = TRUE;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
gboolean rtl;
|
|
|
|
/* If we have rtl text, we need to transform our areas */
|
|
|
|
GdkRectangle rtl_cell_area;
|
|
|
|
GdkRectangle rtl_background_area;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
min_x = G_MAXINT;
|
|
|
|
min_y = G_MAXINT;
|
|
|
|
max_x = 0;
|
|
|
|
max_y = 0;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_column->tree_view)) == GTK_TEXT_DIR_RTL);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
special_cells = _gtk_tree_view_column_count_special_cells (tree_column);
|
|
|
|
|
|
|
|
if (special_cells > 1 && action == CELL_ACTION_FOCUS)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = NULL;
|
|
|
|
gboolean found_has_focus = FALSE;
|
|
|
|
|
|
|
|
/* one should have focus */
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
info = list->data;
|
|
|
|
if (info && info->has_focus)
|
|
|
|
{
|
|
|
|
found_has_focus = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found_has_focus)
|
|
|
|
{
|
|
|
|
/* give the first one focus */
|
|
|
|
info = gtk_tree_view_column_cell_first (tree_column)->data;
|
|
|
|
info->has_focus = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2001-09-25 16:44:39 +00:00
|
|
|
|
2003-05-29 13:47:32 +00:00
|
|
|
cursor_row = flags & GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
|
2002-01-28 20:19:42 +00:00
|
|
|
gtk_widget_style_get (GTK_WIDGET (tree_column->tree_view),
|
2002-03-06 05:27:29 +00:00
|
|
|
"focus-line-width", &focus_line_width,
|
2003-06-11 23:02:34 +00:00
|
|
|
"horizontal-separator", &horizontal_separator,
|
2002-03-06 05:27:29 +00:00
|
|
|
NULL);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
|
|
|
real_cell_area = *cell_area;
|
|
|
|
real_background_area = *background_area;
|
|
|
|
|
2005-10-26 04:23:46 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
real_cell_area.x += focus_line_width;
|
2005-06-19 12:44:12 +00:00
|
|
|
real_cell_area.y += focus_line_width;
|
|
|
|
real_cell_area.height -= 2 * focus_line_width;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
2007-03-24 14:40:11 +00:00
|
|
|
if (rtl)
|
|
|
|
depth = real_background_area.width - real_cell_area.width;
|
|
|
|
else
|
|
|
|
depth = real_cell_area.x - real_background_area.x;
|
|
|
|
|
2004-07-13 21:26:19 +00:00
|
|
|
/* Find out how much extra space we have to allocate */
|
2001-09-08 00:56:30 +00:00
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (! info->cell->visible)
|
2001-09-08 00:56:30 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (info->expand == TRUE)
|
|
|
|
expand_cell_count ++;
|
|
|
|
full_requested_width += info->requested_width;
|
2006-08-16 15:58:28 +00:00
|
|
|
|
|
|
|
if (!first_cell)
|
|
|
|
full_requested_width += tree_column->spacing;
|
|
|
|
|
|
|
|
first_cell = FALSE;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
|
2004-08-31 21:15:51 +00:00
|
|
|
extra_space = cell_area->width - full_requested_width;
|
2001-09-08 00:56:30 +00:00
|
|
|
if (extra_space < 0)
|
|
|
|
extra_space = 0;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
else if (extra_space > 0 && expand_cell_count > 0)
|
|
|
|
extra_space /= expand_cell_count;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* iterate list for GTK_PACK_START cells */
|
2001-09-08 00:56:30 +00:00
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
continue;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (! info->cell->visible)
|
2001-09-08 00:56:30 +00:00
|
|
|
continue;
|
|
|
|
|
2003-05-29 13:47:32 +00:00
|
|
|
if ((info->has_focus || special_cells == 1) && cursor_row)
|
2002-12-10 00:47:32 +00:00
|
|
|
flags |= GTK_CELL_RENDERER_FOCUSED;
|
2003-05-29 13:47:32 +00:00
|
|
|
else
|
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
2002-12-10 00:47:32 +00:00
|
|
|
|
2003-06-09 23:10:20 +00:00
|
|
|
info->real_width = info->requested_width + (info->expand?extra_space:0);
|
2002-04-23 16:39:01 +00:00
|
|
|
|
2004-08-31 21:15:51 +00:00
|
|
|
/* We constrain ourselves to only the width available */
|
2005-07-13 19:14:15 +00:00
|
|
|
if (real_cell_area.x - focus_line_width + info->real_width > cell_area->x + cell_area->width)
|
2004-08-31 21:15:51 +00:00
|
|
|
{
|
|
|
|
info->real_width = cell_area->x + cell_area->width - real_cell_area.x;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (real_cell_area.x > cell_area->x + cell_area->width)
|
|
|
|
break;
|
|
|
|
|
2003-06-09 23:10:20 +00:00
|
|
|
real_cell_area.width = info->real_width;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
real_cell_area.width -= 2 * focus_line_width;
|
2005-10-26 04:23:46 +00:00
|
|
|
|
|
|
|
if (list->next)
|
|
|
|
{
|
2006-05-27 16:20:20 +00:00
|
|
|
real_background_area.width = info->real_width + depth;
|
2005-10-26 04:23:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* fill the rest of background for the last cell */
|
|
|
|
real_background_area.width = background_area->x + background_area->width - real_background_area.x;
|
|
|
|
}
|
2002-04-23 16:39:01 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
rtl_cell_area = real_cell_area;
|
|
|
|
rtl_background_area = real_background_area;
|
2004-08-31 21:15:51 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
if (rtl)
|
|
|
|
{
|
|
|
|
rtl_cell_area.x = cell_area->x + cell_area->width - (real_cell_area.x - cell_area->x) - real_cell_area.width;
|
|
|
|
rtl_background_area.x = background_area->x + background_area->width - (real_background_area.x - background_area->x) - real_background_area.width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* RENDER */
|
2002-03-06 05:27:29 +00:00
|
|
|
if (action == CELL_ACTION_RENDER)
|
2001-09-25 16:44:39 +00:00
|
|
|
{
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
window,
|
|
|
|
tree_column->tree_view,
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
2004-02-03 00:40:56 +00:00
|
|
|
&real_expose_area,
|
2001-09-25 16:44:39 +00:00
|
|
|
flags);
|
|
|
|
}
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/* FOCUS */
|
2002-03-06 05:27:29 +00:00
|
|
|
else if (action == CELL_ACTION_FOCUS)
|
2001-09-25 16:44:39 +00:00
|
|
|
{
|
|
|
|
gint x_offset, y_offset, width, height;
|
|
|
|
|
|
|
|
gtk_cell_renderer_get_size (info->cell,
|
|
|
|
tree_column->tree_view,
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
&rtl_cell_area,
|
2001-09-25 16:44:39 +00:00
|
|
|
&x_offset, &y_offset,
|
|
|
|
&width, &height);
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
if (special_cells > 1)
|
|
|
|
{
|
|
|
|
if (info->has_focus)
|
|
|
|
{
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
min_x = rtl_cell_area.x + x_offset;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
max_x = min_x + width;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
min_y = rtl_cell_area.y + y_offset;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
max_y = min_y + height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
if (min_x > (rtl_cell_area.x + x_offset))
|
|
|
|
min_x = rtl_cell_area.x + x_offset;
|
|
|
|
if (max_x < rtl_cell_area.x + x_offset + width)
|
|
|
|
max_x = rtl_cell_area.x + x_offset + width;
|
|
|
|
if (min_y > (rtl_cell_area.y + y_offset))
|
|
|
|
min_y = rtl_cell_area.y + y_offset;
|
|
|
|
if (max_y < rtl_cell_area.y + y_offset + height)
|
|
|
|
max_y = rtl_cell_area.y + y_offset + height;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/* EVENT */
|
2002-03-06 05:27:29 +00:00
|
|
|
else if (action == CELL_ACTION_EVENT)
|
|
|
|
{
|
|
|
|
gboolean try_event = FALSE;
|
|
|
|
|
|
|
|
if (event)
|
|
|
|
{
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
if (special_cells == 1)
|
2002-04-25 21:44:33 +00:00
|
|
|
{
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* only 1 activatable cell -> whole column can activate */
|
2002-04-25 21:44:33 +00:00
|
|
|
if (cell_area->x <= ((GdkEventButton *)event)->x &&
|
|
|
|
cell_area->x + cell_area->width > ((GdkEventButton *)event)->x)
|
|
|
|
try_event = TRUE;
|
|
|
|
}
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
else if (rtl_cell_area.x <= ((GdkEventButton *)event)->x &&
|
|
|
|
rtl_cell_area.x + rtl_cell_area.width > ((GdkEventButton *)event)->x)
|
2002-04-25 21:44:33 +00:00
|
|
|
/* only activate cell if the user clicked on an individual
|
|
|
|
* cell
|
|
|
|
*/
|
2002-03-06 05:27:29 +00:00
|
|
|
try_event = TRUE;
|
|
|
|
}
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
else if (special_cells > 1 && info->has_focus)
|
|
|
|
try_event = TRUE;
|
|
|
|
else if (special_cells == 1)
|
|
|
|
try_event = TRUE;
|
|
|
|
|
2002-03-06 05:27:29 +00:00
|
|
|
if (try_event)
|
|
|
|
{
|
|
|
|
gboolean visible, mode;
|
|
|
|
|
2003-02-28 01:45:51 +00:00
|
|
|
g_object_get (info->cell,
|
2002-03-06 05:27:29 +00:00
|
|
|
"visible", &visible,
|
|
|
|
"mode", &mode,
|
|
|
|
NULL);
|
|
|
|
if (visible && mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
|
|
|
|
{
|
|
|
|
if (gtk_cell_renderer_activate (info->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
2004-07-13 21:26:19 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
2002-03-06 05:27:29 +00:00
|
|
|
flags))
|
2002-12-10 00:47:32 +00:00
|
|
|
{
|
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-03-06 05:27:29 +00:00
|
|
|
}
|
|
|
|
else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE)
|
|
|
|
{
|
|
|
|
*editable_widget =
|
|
|
|
gtk_cell_renderer_start_editing (info->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
2004-07-13 21:26:19 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
2002-03-06 05:27:29 +00:00
|
|
|
flags);
|
|
|
|
|
|
|
|
if (*editable_widget != NULL)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_EDITABLE (*editable_widget), FALSE);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
info->in_editing_mode = TRUE;
|
|
|
|
gtk_tree_view_column_focus_cell (tree_column, info->cell);
|
2002-03-06 05:27:29 +00:00
|
|
|
|
2002-12-10 00:47:32 +00:00
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
|
2002-03-06 05:27:29 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
2002-12-10 00:47:32 +00:00
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
|
2006-05-27 16:20:20 +00:00
|
|
|
real_cell_area.x += (real_cell_area.width + 2 * focus_line_width + tree_column->spacing);
|
|
|
|
real_background_area.x += real_background_area.width + tree_column->spacing;
|
2005-10-26 04:23:46 +00:00
|
|
|
|
|
|
|
/* Only needed for first cell */
|
2006-05-27 16:20:20 +00:00
|
|
|
depth = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
|
|
|
/* iterate list for PACK_END cells */
|
2001-09-08 00:56:30 +00:00
|
|
|
for (list = g_list_last (tree_column->cell_list); list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
continue;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (! info->cell->visible)
|
2001-09-08 00:56:30 +00:00
|
|
|
continue;
|
|
|
|
|
2003-05-29 13:47:32 +00:00
|
|
|
if ((info->has_focus || special_cells == 1) && cursor_row)
|
2002-12-10 00:47:32 +00:00
|
|
|
flags |= GTK_CELL_RENDERER_FOCUSED;
|
2003-05-29 13:47:32 +00:00
|
|
|
else
|
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
2002-12-10 00:47:32 +00:00
|
|
|
|
2003-06-09 23:10:20 +00:00
|
|
|
info->real_width = info->requested_width + (info->expand?extra_space:0);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
2004-08-31 21:15:51 +00:00
|
|
|
/* We constrain ourselves to only the width available */
|
2005-07-13 19:14:15 +00:00
|
|
|
if (real_cell_area.x - focus_line_width + info->real_width > cell_area->x + cell_area->width)
|
2004-08-31 21:15:51 +00:00
|
|
|
{
|
|
|
|
info->real_width = cell_area->x + cell_area->width - real_cell_area.x;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (real_cell_area.x > cell_area->x + cell_area->width)
|
|
|
|
break;
|
|
|
|
|
2003-06-09 23:10:20 +00:00
|
|
|
real_cell_area.width = info->real_width;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
real_cell_area.width -= 2 * focus_line_width;
|
2006-05-27 16:20:20 +00:00
|
|
|
real_background_area.width = info->real_width + depth;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
rtl_cell_area = real_cell_area;
|
|
|
|
rtl_background_area = real_background_area;
|
|
|
|
if (rtl)
|
|
|
|
{
|
|
|
|
rtl_cell_area.x = cell_area->x + cell_area->width - (real_cell_area.x - cell_area->x) - real_cell_area.width;
|
|
|
|
rtl_background_area.x = background_area->x + background_area->width - (real_background_area.x - background_area->x) - real_background_area.width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* RENDER */
|
2002-03-06 05:27:29 +00:00
|
|
|
if (action == CELL_ACTION_RENDER)
|
|
|
|
{
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
window,
|
|
|
|
tree_column->tree_view,
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
2004-02-03 00:40:56 +00:00
|
|
|
&real_expose_area,
|
2002-03-06 05:27:29 +00:00
|
|
|
flags);
|
|
|
|
}
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/* FOCUS */
|
2002-03-06 05:27:29 +00:00
|
|
|
else if (action == CELL_ACTION_FOCUS)
|
|
|
|
{
|
|
|
|
gint x_offset, y_offset, width, height;
|
|
|
|
|
|
|
|
gtk_cell_renderer_get_size (info->cell,
|
|
|
|
tree_column->tree_view,
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
&rtl_cell_area,
|
2002-03-06 05:27:29 +00:00
|
|
|
&x_offset, &y_offset,
|
|
|
|
&width, &height);
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
if (special_cells > 1)
|
|
|
|
{
|
|
|
|
if (info->has_focus)
|
|
|
|
{
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
min_x = rtl_cell_area.x + x_offset;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
max_x = min_x + width;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
min_y = rtl_cell_area.y + y_offset;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
max_y = min_y + height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
if (min_x > (rtl_cell_area.x + x_offset))
|
|
|
|
min_x = rtl_cell_area.x + x_offset;
|
|
|
|
if (max_x < rtl_cell_area.x + x_offset + width)
|
|
|
|
max_x = rtl_cell_area.x + x_offset + width;
|
|
|
|
if (min_y > (rtl_cell_area.y + y_offset))
|
|
|
|
min_y = rtl_cell_area.y + y_offset;
|
|
|
|
if (max_y < rtl_cell_area.y + y_offset + height)
|
|
|
|
max_y = rtl_cell_area.y + y_offset + height;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
2002-03-06 05:27:29 +00:00
|
|
|
}
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/* EVENT */
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
else if (action == CELL_ACTION_EVENT)
|
|
|
|
{
|
|
|
|
gboolean try_event = FALSE;
|
|
|
|
|
|
|
|
if (event)
|
|
|
|
{
|
|
|
|
if (special_cells == 1)
|
|
|
|
{
|
|
|
|
/* only 1 activatable cell -> whole column can activate */
|
|
|
|
if (cell_area->x <= ((GdkEventButton *)event)->x &&
|
|
|
|
cell_area->x + cell_area->width > ((GdkEventButton *)event)->x)
|
|
|
|
try_event = TRUE;
|
|
|
|
}
|
2006-05-27 16:20:20 +00:00
|
|
|
else if (rtl_cell_area.x <= ((GdkEventButton *)event)->x &&
|
|
|
|
rtl_cell_area.x + rtl_cell_area.width > ((GdkEventButton *)event)->x)
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* only activate cell if the user clicked on an individual
|
|
|
|
* cell
|
|
|
|
*/
|
|
|
|
try_event = TRUE;
|
|
|
|
}
|
|
|
|
else if (special_cells > 1 && info->has_focus)
|
|
|
|
try_event = TRUE;
|
|
|
|
else if (special_cells == 1)
|
|
|
|
try_event = TRUE;
|
|
|
|
|
|
|
|
if (try_event)
|
|
|
|
{
|
|
|
|
gboolean visible, mode;
|
|
|
|
|
2003-02-28 01:45:51 +00:00
|
|
|
g_object_get (info->cell,
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
"visible", &visible,
|
|
|
|
"mode", &mode,
|
|
|
|
NULL);
|
|
|
|
if (visible && mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
|
|
|
|
{
|
|
|
|
if (gtk_cell_renderer_activate (info->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
2004-07-13 21:26:19 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
flags))
|
2002-12-10 00:47:32 +00:00
|
|
|
{
|
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
return TRUE;
|
|
|
|
}
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
|
|
|
else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE)
|
|
|
|
{
|
|
|
|
*editable_widget =
|
|
|
|
gtk_cell_renderer_start_editing (info->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
2004-07-13 21:26:19 +00:00
|
|
|
&rtl_background_area,
|
|
|
|
&rtl_cell_area,
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
flags);
|
|
|
|
|
|
|
|
if (*editable_widget != NULL)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_EDITABLE (*editable_widget), FALSE);
|
|
|
|
info->in_editing_mode = TRUE;
|
|
|
|
gtk_tree_view_column_focus_cell (tree_column, info->cell);
|
|
|
|
|
2002-12-10 00:47:32 +00:00
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-10 00:47:32 +00:00
|
|
|
flags &= ~GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
|
2006-05-27 16:20:20 +00:00
|
|
|
real_cell_area.x += (real_cell_area.width + 2 * focus_line_width + tree_column->spacing);
|
2003-06-09 23:10:20 +00:00
|
|
|
real_background_area.x += (real_background_area.width + tree_column->spacing);
|
2006-05-27 16:20:20 +00:00
|
|
|
|
|
|
|
/* Only needed for first cell */
|
|
|
|
depth = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
2002-03-06 05:27:29 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* fill focus_rectangle when required */
|
2002-03-06 05:27:29 +00:00
|
|
|
if (action == CELL_ACTION_FOCUS)
|
2001-09-25 16:44:39 +00:00
|
|
|
{
|
|
|
|
if (min_x >= max_x || min_y >= max_y)
|
|
|
|
{
|
|
|
|
*focus_rectangle = *cell_area;
|
2002-02-26 18:56:53 +00:00
|
|
|
/* don't change the focus_rectangle, just draw it nicely inside
|
|
|
|
* the cell area */
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-01-28 20:19:42 +00:00
|
|
|
focus_rectangle->x = min_x - focus_line_width;
|
|
|
|
focus_rectangle->y = min_y - focus_line_width;
|
|
|
|
focus_rectangle->width = (max_x - min_x) + 2 * focus_line_width;
|
|
|
|
focus_rectangle->height = (max_y - min_y) + 2 * focus_line_width;
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
|
|
|
}
|
2002-03-06 05:27:29 +00:00
|
|
|
|
|
|
|
return FALSE;
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_render:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @window: a #GdkDrawable to draw to
|
|
|
|
* @background_area: entire cell area (including tree expanders and maybe padding on the sides)
|
|
|
|
* @cell_area: area normally rendered by a cell renderer
|
|
|
|
* @expose_area: area that actually needs updating
|
|
|
|
* @flags: flags that affect rendering
|
|
|
|
*
|
|
|
|
* Renders the cell contained by #tree_column. This is used primarily by the
|
2001-12-08 21:39:34 +00:00
|
|
|
* #GtkTreeView.
|
2001-09-25 16:44:39 +00:00
|
|
|
**/
|
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
_gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
const GdkRectangle *expose_area,
|
|
|
|
guint flags)
|
2001-09-25 16:44:39 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (background_area != NULL);
|
|
|
|
g_return_if_fail (cell_area != NULL);
|
|
|
|
g_return_if_fail (expose_area != NULL);
|
|
|
|
|
2002-03-06 05:27:29 +00:00
|
|
|
gtk_tree_view_column_cell_process_action (tree_column,
|
|
|
|
window,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
flags,
|
|
|
|
CELL_ACTION_RENDER,
|
|
|
|
expose_area,
|
|
|
|
NULL, NULL, NULL, NULL);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2001-09-18 16:15:10 +00:00
|
|
|
_gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellEditable **editable_widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gchar *path_string,
|
2008-01-25 09:30:40 +00:00
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
2001-09-18 16:15:10 +00:00
|
|
|
guint flags)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2002-03-06 05:27:29 +00:00
|
|
|
return gtk_tree_view_column_cell_process_action (tree_column,
|
|
|
|
NULL,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
flags,
|
|
|
|
CELL_ACTION_EVENT,
|
|
|
|
NULL, NULL,
|
|
|
|
editable_widget,
|
|
|
|
event,
|
|
|
|
path_string);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
|
2007-03-20 12:32:19 +00:00
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
_gtk_tree_view_column_get_focus_area (GtkTreeViewColumn *tree_column,
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
GdkRectangle *focus_area)
|
2007-03-20 12:32:19 +00:00
|
|
|
{
|
|
|
|
gtk_tree_view_column_cell_process_action (tree_column,
|
|
|
|
NULL,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
0,
|
|
|
|
CELL_ACTION_FOCUS,
|
|
|
|
NULL,
|
|
|
|
focus_area,
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* cell list manipulation */
|
|
|
|
static GList *
|
|
|
|
gtk_tree_view_column_cell_first (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list = tree_column->cell_list;
|
|
|
|
|
|
|
|
/* first GTK_PACK_START cell we find */
|
|
|
|
for ( ; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* hmm, else the *last* GTK_PACK_END cell */
|
|
|
|
list = g_list_last (tree_column->cell_list);
|
|
|
|
|
|
|
|
for ( ; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
gtk_tree_view_column_cell_last (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list = tree_column->cell_list;
|
|
|
|
|
|
|
|
/* *first* GTK_PACK_END cell we find */
|
|
|
|
for ( ; list ; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* hmm, else the last GTK_PACK_START cell */
|
|
|
|
list = g_list_last (tree_column->cell_list);
|
|
|
|
|
|
|
|
for ( ; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
gtk_tree_view_column_cell_next (GtkTreeViewColumn *tree_column,
|
|
|
|
GList *current)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GtkTreeViewColumnCellInfo *info = current->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
{
|
|
|
|
for (list = current->next; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_START)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* out of GTK_PACK_START cells, get *last* GTK_PACK_END one */
|
|
|
|
list = g_list_last (tree_column->cell_list);
|
|
|
|
for (; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_END)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (list = current->prev; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_END)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
gtk_tree_view_column_cell_prev (GtkTreeViewColumn *tree_column,
|
|
|
|
GList *current)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GtkTreeViewColumnCellInfo *info = current->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
{
|
|
|
|
for (list = current->next; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_END)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* out of GTK_PACK_END, get last GTK_PACK_START one */
|
|
|
|
list = g_list_last (tree_column->cell_list);
|
|
|
|
for ( ; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_START)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (list = current->prev; list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *inf = list->data;
|
|
|
|
if (inf->pack == GTK_PACK_START)
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
|
|
gboolean
|
2002-02-19 18:21:50 +00:00
|
|
|
_gtk_tree_view_column_cell_focus (GtkTreeViewColumn *tree_column,
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
gint direction,
|
|
|
|
gboolean left,
|
|
|
|
gboolean right)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
gint count;
|
2006-05-28 21:51:04 +00:00
|
|
|
gboolean rtl;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
|
|
|
count = _gtk_tree_view_column_count_special_cells (tree_column);
|
2006-05-28 21:51:04 +00:00
|
|
|
rtl = gtk_widget_get_direction (GTK_WIDGET (tree_column->tree_view)) == GTK_TEXT_DIR_RTL;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
|
|
|
/* if we are the current focus column and have multiple editable cells,
|
|
|
|
* try to select the next one, else move the focus to the next column
|
|
|
|
*/
|
2001-09-25 16:44:39 +00:00
|
|
|
if (GTK_TREE_VIEW (tree_column->tree_view)->priv->focus_column == tree_column)
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
{
|
|
|
|
if (count > 1)
|
|
|
|
{
|
|
|
|
GList *next, *prev;
|
|
|
|
GList *list = tree_column->cell_list;
|
|
|
|
GtkTreeViewColumnCellInfo *info = NULL;
|
|
|
|
|
|
|
|
/* find current focussed cell */
|
|
|
|
for ( ; list; list = list->next)
|
|
|
|
{
|
|
|
|
info = list->data;
|
|
|
|
if (info->has_focus)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* not a focussed cell in the focus column? */
|
|
|
|
if (!list || !info || !info->has_focus)
|
|
|
|
return FALSE;
|
|
|
|
|
2006-05-28 21:51:04 +00:00
|
|
|
if (rtl)
|
|
|
|
{
|
|
|
|
prev = gtk_tree_view_column_cell_next (tree_column, list);
|
|
|
|
next = gtk_tree_view_column_cell_prev (tree_column, list);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
next = gtk_tree_view_column_cell_next (tree_column, list);
|
|
|
|
prev = gtk_tree_view_column_cell_prev (tree_column, list);
|
|
|
|
}
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
|
|
|
info->has_focus = FALSE;
|
|
|
|
if (direction > 0 && next)
|
|
|
|
{
|
|
|
|
info = next->data;
|
|
|
|
info->has_focus = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else if (direction > 0 && !next && !right)
|
|
|
|
{
|
2006-05-28 21:51:04 +00:00
|
|
|
/* keep focus on last cell */
|
|
|
|
if (rtl)
|
|
|
|
info = gtk_tree_view_column_cell_first (tree_column)->data;
|
|
|
|
else
|
|
|
|
info = gtk_tree_view_column_cell_last (tree_column)->data;
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
info->has_focus = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else if (direction < 0 && prev)
|
|
|
|
{
|
|
|
|
info = prev->data;
|
|
|
|
info->has_focus = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else if (direction < 0 && !prev && !left)
|
|
|
|
{
|
|
|
|
/* keep focus on first cell */
|
2006-05-28 21:51:04 +00:00
|
|
|
if (rtl)
|
|
|
|
info = gtk_tree_view_column_cell_last (tree_column)->data;
|
|
|
|
else
|
|
|
|
info = gtk_tree_view_column_cell_first (tree_column)->data;
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
info->has_focus = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we get focus, if we have multiple editable cells, give the correct one
|
|
|
|
* focus
|
|
|
|
*/
|
|
|
|
if (count > 1)
|
|
|
|
{
|
|
|
|
GList *list = tree_column->cell_list;
|
|
|
|
|
|
|
|
/* clear focus first */
|
|
|
|
for ( ; list ; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
if (info->has_focus)
|
|
|
|
info->has_focus = FALSE;
|
|
|
|
}
|
|
|
|
|
2006-05-28 21:51:04 +00:00
|
|
|
list = NULL;
|
|
|
|
if (rtl)
|
|
|
|
{
|
|
|
|
if (direction > 0)
|
|
|
|
list = gtk_tree_view_column_cell_last (tree_column);
|
|
|
|
else if (direction < 0)
|
|
|
|
list = gtk_tree_view_column_cell_first (tree_column);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (direction > 0)
|
|
|
|
list = gtk_tree_view_column_cell_first (tree_column);
|
|
|
|
else if (direction < 0)
|
|
|
|
list = gtk_tree_view_column_cell_last (tree_column);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (list)
|
|
|
|
((GtkTreeViewColumnCellInfo *) list->data)->has_focus = TRUE;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
2006-05-28 21:51:04 +00:00
|
|
|
|
2001-09-17 21:44:20 +00:00
|
|
|
return TRUE;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
|
2001-09-17 21:44:20 +00:00
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
_gtk_tree_view_column_cell_draw_focus (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
const GdkRectangle *expose_area,
|
|
|
|
guint flags)
|
2001-09-17 21:44:20 +00:00
|
|
|
{
|
2002-01-28 20:19:42 +00:00
|
|
|
gint focus_line_width;
|
|
|
|
GtkStateType cell_state;
|
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2002-01-28 20:19:42 +00:00
|
|
|
gtk_widget_style_get (GTK_WIDGET (tree_column->tree_view),
|
|
|
|
"focus-line-width", &focus_line_width, NULL);
|
2001-09-25 16:44:39 +00:00
|
|
|
if (tree_column->editable_widget)
|
|
|
|
{
|
|
|
|
/* This function is only called on the editable row when editing.
|
|
|
|
*/
|
2002-01-28 20:19:42 +00:00
|
|
|
#if 0
|
2001-09-25 16:44:39 +00:00
|
|
|
gtk_paint_focus (tree_column->tree_view->style,
|
|
|
|
window,
|
2010-03-03 20:49:33 +00:00
|
|
|
gtk_widget_get_state (tree_column->tree_view),
|
2001-09-25 16:44:39 +00:00
|
|
|
NULL,
|
|
|
|
tree_column->tree_view,
|
|
|
|
"treeview",
|
2002-01-28 20:19:42 +00:00
|
|
|
cell_area->x - focus_line_width,
|
|
|
|
cell_area->y - focus_line_width,
|
|
|
|
cell_area->width + 2 * focus_line_width,
|
|
|
|
cell_area->height + 2 * focus_line_width);
|
|
|
|
#endif
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GdkRectangle focus_rectangle;
|
2002-03-06 05:27:29 +00:00
|
|
|
gtk_tree_view_column_cell_process_action (tree_column,
|
|
|
|
window,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
flags,
|
|
|
|
CELL_ACTION_FOCUS,
|
|
|
|
expose_area,
|
|
|
|
&focus_rectangle,
|
|
|
|
NULL, NULL, NULL);
|
2002-01-28 20:19:42 +00:00
|
|
|
|
|
|
|
cell_state = flags & GTK_CELL_RENDERER_SELECTED ? GTK_STATE_SELECTED :
|
|
|
|
(flags & GTK_CELL_RENDERER_PRELIT ? GTK_STATE_PRELIGHT :
|
|
|
|
(flags & GTK_CELL_RENDERER_INSENSITIVE ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL));
|
2001-09-25 16:44:39 +00:00
|
|
|
gtk_paint_focus (tree_column->tree_view->style,
|
|
|
|
window,
|
2002-01-28 20:19:42 +00:00
|
|
|
cell_state,
|
2004-02-03 00:40:56 +00:00
|
|
|
cell_area,
|
2001-09-25 16:44:39 +00:00
|
|
|
tree_column->tree_view,
|
|
|
|
"treeview",
|
|
|
|
focus_rectangle.x,
|
|
|
|
focus_rectangle.y,
|
2001-12-04 03:27:30 +00:00
|
|
|
focus_rectangle.width,
|
|
|
|
focus_rectangle.height);
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_is_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if any of the cells packed into the @tree_column are visible.
|
2002-02-23 07:05:55 +00:00
|
|
|
* For this to be meaningful, you must first initialize the cells with
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data()
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE, if any of the cells packed into the @tree_column are currently visible
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (info->cell->visible)
|
2001-06-27 23:44:53 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_focus_cell:
|
2002-10-10 23:42:57 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
* @cell: A #GtkCellRenderer
|
|
|
|
*
|
|
|
|
* Sets the current keyboard focus to be at @cell, if the column contains
|
|
|
|
* 2 or more editable and activatable cells.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gboolean found_cell = FALSE;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
|
|
|
|
|
|
|
if (_gtk_tree_view_column_count_special_cells (tree_column) < 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
|
|
|
|
if (info->cell == cell)
|
|
|
|
{
|
|
|
|
info->has_focus = TRUE;
|
|
|
|
found_cell = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (found_cell)
|
|
|
|
{
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = list->data;
|
|
|
|
|
|
|
|
if (info->cell != cell)
|
|
|
|
info->has_focus = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: redraw? */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
void
|
2002-02-19 18:21:50 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean install_handler)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
|
|
|
|
info->requested_width = 0;
|
|
|
|
}
|
|
|
|
tree_column->dirty = TRUE;
|
2002-02-19 18:21:50 +00:00
|
|
|
tree_column->requested_width = -1;
|
|
|
|
tree_column->width = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
if (tree_column->tree_view &&
|
2010-03-02 06:16:02 +00:00
|
|
|
gtk_widget_get_realized (tree_column->tree_view))
|
2001-12-04 23:49:57 +00:00
|
|
|
{
|
2002-02-19 18:21:50 +00:00
|
|
|
if (install_handler)
|
|
|
|
_gtk_tree_view_install_mark_rows_col_dirty (GTK_TREE_VIEW (tree_column->tree_view));
|
|
|
|
else
|
|
|
|
GTK_TREE_VIEW (tree_column->tree_view)->priv->mark_rows_col_dirty = TRUE;
|
2001-12-04 23:49:57 +00:00
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
|
2001-09-18 22:49:02 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_start_editing (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellEditable *cell_editable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (tree_column->editable_widget == NULL);
|
|
|
|
|
|
|
|
tree_column->editable_widget = cell_editable;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_stop_editing (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
GList *list;
|
|
|
|
|
2001-09-18 22:49:02 +00:00
|
|
|
g_return_if_fail (tree_column->editable_widget != NULL);
|
|
|
|
|
|
|
|
tree_column->editable_widget = NULL;
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
((GtkTreeViewColumnCellInfo *)list->data)->in_editing_mode = FALSE;
|
2001-09-18 22:49:02 +00:00
|
|
|
}
|
2002-04-14 15:05:04 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_get_neighbor_sizes (GtkTreeViewColumn *column,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gint *left,
|
|
|
|
gint *right)
|
|
|
|
{
|
|
|
|
GList *list;
|
2006-04-13 03:20:43 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
gint l, r;
|
|
|
|
gboolean rtl;
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
l = r = 0;
|
2004-07-13 21:26:19 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
list = gtk_tree_view_column_cell_first (column);
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
info = (GtkTreeViewColumnCellInfo *)list->data;
|
|
|
|
|
|
|
|
list = gtk_tree_view_column_cell_next (column, list);
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
if (info->cell == cell)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (info->cell->visible)
|
2006-05-27 16:20:20 +00:00
|
|
|
l += info->real_width + column->spacing;
|
2002-04-14 15:05:04 +00:00
|
|
|
}
|
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
while (list)
|
2002-04-14 15:05:04 +00:00
|
|
|
{
|
2006-04-13 03:20:43 +00:00
|
|
|
info = (GtkTreeViewColumnCellInfo *)list->data;
|
|
|
|
|
|
|
|
list = gtk_tree_view_column_cell_next (column, list);
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
if (info->cell->visible)
|
2006-05-27 16:20:20 +00:00
|
|
|
r += info->real_width + column->spacing;
|
2006-04-13 03:20:43 +00:00
|
|
|
}
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
rtl = (gtk_widget_get_direction (GTK_WIDGET (column->tree_view)) == GTK_TEXT_DIR_RTL);
|
|
|
|
if (left)
|
|
|
|
*left = rtl ? r : l;
|
2002-04-14 15:05:04 +00:00
|
|
|
|
2006-04-13 03:20:43 +00:00
|
|
|
if (right)
|
|
|
|
*right = rtl ? l : r;
|
2002-04-14 15:05:04 +00:00
|
|
|
}
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
2003-04-12 22:25:21 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_get_position:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2003-04-15 22:51:04 +00:00
|
|
|
* @cell_renderer: a #GtkCellRenderer
|
2003-04-12 22:25:21 +00:00
|
|
|
* @start_pos: return location for the horizontal position of @cell within
|
|
|
|
* @tree_column, may be %NULL
|
|
|
|
* @width: return location for the width of @cell, may be %NULL
|
|
|
|
*
|
|
|
|
* Obtains the horizontal position and size of a cell in a column. If the
|
|
|
|
* cell is not found in the column, @start_pos and @width are not changed and
|
|
|
|
* %FALSE is returned.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @cell belongs to @tree_column.
|
|
|
|
*/
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer,
|
|
|
|
gint *start_pos,
|
|
|
|
gint *width)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gint current_x = 0;
|
|
|
|
gboolean found_cell = FALSE;
|
2002-12-10 00:47:32 +00:00
|
|
|
GtkTreeViewColumnCellInfo *cellinfo = NULL;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
|
|
|
list = gtk_tree_view_column_cell_first (tree_column);
|
|
|
|
for (; list; list = gtk_tree_view_column_cell_next (tree_column, list))
|
|
|
|
{
|
|
|
|
cellinfo = list->data;
|
|
|
|
if (cellinfo->cell == cell_renderer)
|
|
|
|
{
|
|
|
|
found_cell = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
2003-01-30 22:42:21 +00:00
|
|
|
|
|
|
|
if (cellinfo->cell->visible)
|
|
|
|
current_x += cellinfo->real_width;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (found_cell)
|
|
|
|
{
|
|
|
|
if (start_pos)
|
|
|
|
*start_pos = current_x;
|
|
|
|
if (width)
|
|
|
|
*width = cellinfo->real_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
return found_cell;
|
|
|
|
}
|
2003-04-12 22:25:21 +00:00
|
|
|
|
2005-07-14 00:05:49 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_queue_resize:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Flags the column, and the cell renderers added to this column, to have
|
|
|
|
* their sizes renegotiated.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2007-06-06 12:56:13 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2005-07-14 00:05:49 +00:00
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
}
|
|
|
|
|
2007-06-06 12:54:35 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_tree_view:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Returns the #GtkTreeView wherein @tree_column has been inserted. If
|
|
|
|
* @column is currently not inserted in any tree view, %NULL is
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* Return value: The tree view wherein @column has been inserted if any,
|
|
|
|
* %NULL otherwise.
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
|
|
return tree_column->tree_view;
|
|
|
|
}
|
|
|
|
|
2010-04-06 07:03:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_desired_size:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
* @minimum_size: location for storing the minimum size, or %NULL
|
|
|
|
* @natural_size: location for storing the preferred size, or %NULL
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Retreives @tree_column's minimum and natural size.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_get_desired_size (GtkTreeViewColumn *column,
|
|
|
|
GtkRequisition *minimal_size,
|
|
|
|
GtkRequisition *desired_size)
|
2009-12-19 07:07:51 +00:00
|
|
|
{
|
2010-04-06 07:03:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
|
|
|
|
|
|
|
|
gtk_tree_view_column_cell_get_real_size (column,
|
2009-12-19 07:07:51 +00:00
|
|
|
NULL, NULL, NULL,
|
|
|
|
minimal_size, desired_size);
|
|
|
|
}
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
#define __GTK_TREE_VIEW_COLUMN_C__
|
|
|
|
#include "gtkaliasdef.c"
|