Commit Graph

76 Commits

Author SHA1 Message Date
Kristian Rietveld
3bd51183a8 add _gtk_tree_view_column_get_focus_area().
2007-03-20  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeviewcolumn.c:
	* gtk/gtktreeprivate.h: add _gtk_tree_view_column_get_focus_area().

	* gtk/gtktreeview.c (gtk_tree_view_clamp_column_visible): add
	focus_to_cell parameter, rework to handle clamping columns which
	are bigger than the available page size better,
	(gtk_tree_view_key_press): remove code handling moving the focus
	to other column headers,
	(gtk_tree_view_header_focus): add clamp_column_visible parameter,
	fix RTL support, don't wrap around when moving focus to other
	column headers, call gtk_tree_view_clamp_column_visible() instead
	of duplicating code,
	(gtk_tree_view_focus): only clamp the column visible when we are
	explicitly moving to another column header (fixes #399555, Charles
	Kerr),
	(gtk_tree_view_move_cursor_left_right): update call to
	gtk_tree_view_clamp_column_visible().


svn path=/trunk/; revision=17546
2007-03-20 12:32:19 +00:00
Kristian Rietveld
c24c88fe30 add cursor_offset field.
2007-02-16  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtktreeprivate.h: add cursor_offset field.

	* gtk/gtktreeview.c (gtk_tree_view_init),
	(gtk_tree_view_move_cursor_page_up_down): fix off by one error
	in page up/down handling by memorizing the offset into the cursor
	row.  (Fixes #399809, reported by Bruce Bowler).


svn path=/trunk/; revision=17316
2007-02-16 21:35:31 +00:00
Kristian Rietveld
61f4d77d55 Another fix for #164884.
2006-07-18  Kristian Rietveld  <kris@imendio.com>

	Another fix for #164884.

	* gtk/gtktreeprivate.h: add in_grab field.

	* gtk/gtktreeview.c (gtk_tree_view_button_press): only save press
	to possibly begin a drag when there's no grab pending,
	(gtk_tree_view_grab_notify): toggle in_grab field.
2006-07-18 12:33:25 +00:00
Kristian Rietveld
7a6a6ebcff Introduce grid and tree lines in GtkTreeView. (#106406, Martyn Russell).
2006-06-12  Kristian Rietveld  <kris@imendio.com>

	Introduce grid and tree lines in GtkTreeView. (#106406,
	Martyn Russell).

	* gtk/gtktreeprivate.h: add new fields to GtkTreePrivate.

	* gtk/gtkenums.h: add GtkTreeViewGridLines.

	* gtk/gtktreeview.[ch] (gtk_tree_view_set_grid_lines),
	(gtk_tree_view_get_grid_lines),
	(gtk_tree_view_set_enable_tree_lines),
	(gtk_tree_view_get_enable_tree_lines): new API,
	(gtk_tree_view_class_init): new properties,
	(gtk_tree_view_init), (gtk_tree_view_{get,set}_property),
	(gtk_tree_view_realize), (gtk_tree_view_draw_grid_lines),
	(gtk_tree_view_bin_expose): implement.

	* gtk/gtk.symbols: update.
2006-06-12 18:17:35 +00:00
Kristian Rietveld
f6c583f74e Rubber banding for GtkTreeView, #80127. Uses same method as GtkIconView.
2006-06-02  Kristian Rietveld  <kris@imendio.com>

	Rubber banding for GtkTreeView, #80127.  Uses same method as
	GtkIconView.

	* gtk/gtktreeview.c (gtk_tree_view_class_init),
	(gtk_tree_view_init), (gtk_tree_view_get_property),
	(gtk_tree_view_set_property), (gtk_tree_view_set_rubber_banding),
	(gtk_tree_view_get_rubber_banding): add property,
	(gtk_tree_view_button_press): start rubber banding if enabled and
	press is on a non-selected node,
	(gtk_tree_view_button_release): stop rubber banding,
	(gtk_tree_view_motion_bin_window), (scrool_row_timeout): enable/update
	the rubber band,
	(gtk_tree_view_bin_expose): draw rubber band if active,
	(gtk_tree_view_stop_rubberband),
	(gtk_tree_view_update_rubber_band_selection_range),
	(gtk_tree_view_update_rubber_band_selection),
	(gtk_tree_view_update_rubber_band),
	(gtk_tree_view_paint_rubber_band): new functions.

	* gtk/gtktreeview.h: add new set/get function for rubber banding
	property.

	* gtk/gtktreeprivate.h: add a bunch of new private fields.
2006-06-02 20:40:33 +00:00
Kristian Rietveld
ebe22cb38a (broken pipe) 2006-04-26 12:39:25 +00:00
Kristian Rietveld
2e6ba401cc rename to _gtk_tree_selection_row_is_selectable and export internally,
2006-03-01  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeselection.c (row_is_selectable): rename to
	_gtk_tree_selection_row_is_selectable and export internally,
	(gtk_tree_selection_real_select_node): changed so it is always
	possible to unselect insensitive nodes, changed the logic a bit to
	be more clear.

	* gtk/gtktreeprivate.h: add _gtk_tree_selection_row_is_selectable.

	* gtk/gtktreeview.c (gtk_tree_view_row_changed): Unselect a row if
	it became insensitive.
2006-03-01 12:18:57 +00:00
Kristian Rietveld
58e77fe25b #322591, Jonathan Blandford.
2006-01-24  Kristian Rietveld  <kris@gtk.org>

	#322591, Jonathan Blandford.

	* gtk/gtktreeview.[ch] (gtk_tree_view_get_search_entry),
	(gtk_tree_view_set_search_entry),
	(gtk_tree_view_get_search_position_func),
	(gtk_tree_view_set_search_position_func): New functions,
	and small adaptions to the tree view code to allow for setting
	the entry and search position function.

	* gtk/gtktreeprivate.h: Removed GtkTreeViewSearchDialogPositionFunc
	typedef, which is now in gtktreeview.h as
	GtkTreeViewSearchPositionFunc.  Add/update fields.

	* gtk/gtk.symbols: Add new functions.

	* tests/testtreesort.c: Add a little test for _set_search_entry().
2006-01-24 10:49:29 +00:00
Matthias Clasen
924765a2fe Properly handle model changes in GtkTreeSelection: (#322569, Milosz
2005-11-29  Matthias Clasen  <mclasen@redhat.com>

	Properly handle model changes in GtkTreeSelection: (#322569,
	Milosz Derezynski)

	* gtk/gtktreeselection.c (gtk_tree_selection_selected_foreach):
	Get a reference to the model, and stop the iteration if the model
	of the treeview is changed on the way.

	* gtk/gtktreeprivate.h:
	* gtk/gtktreeselection.c (_gtk_tree_selection_emit_changed): New
	private function to emit the GtkTreeSelection::changed signal.

	* gtk/gtktreeview.c (gtk_tree_view_set_model): Call
	_gtk_tree_selection_emit_changed() when the model changes.
2005-11-29 19:34:15 +00:00
Matthias Clasen
3845ca6eea Trivial cleanups. (#169647, #303455, Fabricio Barros Cabral, Benoit
2005-06-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.h: Trivial cleanups. (#169647, #303455,
	Fabricio Barros Cabral, Benoit Carpentier)
2005-06-21 05:35:43 +00:00
Matthias Clasen
d4853eb883 Add a new boolean property ::hover-expand and make the treeview
2004-08-02  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.h:
	* gtk/gtktreeview.c:
	* gtk/gtktreeprivate.h: Add a new boolean property
	::hover-expand and make the treeview expand/collapse rows
	on mouseover if it is set.
2004-08-02 19:11:32 +00:00
Jonathan Blandford
1541442d86 New arguments
Thu Jul 29 16:36:42 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtktreeprivate.h: New arguments

        * gtk/gtktreeview.c:
        (gtk_tree_view_class_init): Add key_release callback
        (gtk_tree_view_init): Initialize timeout handler
        (gtk_tree_view_unrealize): clear timeout if needed
        (gtk_tree_view_key_press): Typeahead support
        (gtk_tree_view_key_release): Not used yet -- will be needed for
        typeahead.
        (gtk_tree_view_search_entry_flush_timeout): Remove typeahead entry
        in a timeout.
        (gtk_tree_view_ensure_interactive_directory):
        (gtk_tree_view_real_start_interactive_search):
        (gtk_tree_view_search_init):
        (gtk_tree_view_start_interactive_search): Typeahead support added.
        (gtk_tree_view_search_dialog_hide): Clear timeout and text when we
        hide.
2004-08-01 03:32:19 +00:00
Matthias Clasen
bb4a9f9008 Forgotten file. 2004-07-07 15:26:21 +00:00
Matthias Clasen
011af2556d Forgotten commit 2004-05-10 21:10:28 +00:00
Jonathan Blandford
0aebe34351 Moved search entries into priv data.
Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtktreeprivate.h: Moved search entries into priv data.

        * gtk/gtktreeview.c: Prep for type-ahead support.

        (gtk_tree_view_destroy): Destroy the search window explicitly.
        (gtk_tree_view_key_press): Minor change; prep for type-ahead
        (gtk_tree_view_ensure_interactive_directory): New function
        (gtk_tree_view_focus_out): Rework to handle new entry life-cycle.
        (gtk_tree_view_real_start_interactive_search): rework
        (gtk_tree_view_search_dialog_hide): ditto
        (gtk_tree_view_search_delete_event): ditto
        (gtk_tree_view_search_button_press_event): ditto
        (gtk_tree_view_search_key_press_event): ditto
        (gtk_tree_view_search_move): ditto
        (gtk_tree_view_search_init): ditto

        * gtk/gtktreeviewcolumn.c:
        (gtk_tree_view_column_cell_layout_clear): remove unused variable.

        * tests/testfilechooser.c: (main): change
2004-04-11 19:15:24 +00:00
Matthias Clasen
4ec8e2b20e Add init_hadjust_value and prev_width. Initialize them here. ...and here.
Tue Feb  3 00:15:17 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): Add
	init_hadjust_value and prev_width.
	* gtk/gtktreeview.c (gtk_tree_view_init): Initialize
	them here.
	* gtk/gtktreeview.c (gtk_tree_view_update_size): ...and here.
	* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Use them
	here to properly handle the initial position of rtl-oriented
	tree views.  (#127581, chinen@jp.ibm.com)
2004-02-02 23:20:42 +00:00
Kristian Rietveld
c43efa516f Migrating all cell renderers to use the new instance private data
Thu Dec 18 00:57:18 2003  Kristian Rietveld  <kris@gtk.org>

	Migrating all cell renderers to use the new instance private data
	construction.

	* gtk/gtktreeprivate.h: remove GtkCellRendererInfo, as it is no
	longer being used.

	* gtk/gtkcellrenderer.c (gtk_cell_renderer_init),
	(gtk_cell_renderer_class_init), (gtk_cell_renderer_get_property),
	(set_cell_bg_color), (gtk_cell_renderer_render): remove old
	GtkCellRendererInfo handling, migrate to instance private data.

	* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
	(gtk_cell_renderer_text_start_editing): moved focus_out_id
	from GtkCellRendererInfo to text renderer private data.

	* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_init),
	(gtk_cell_renderer_pixbuf_class_init),
	(gtk_cell_renderer_pixbuf_finalize),
	(gtk_cell_renderer_pixbuf_get_property),
	(gtk_cell_renderer_pixbuf_set_property),
	(gtk_cell_renderer_pixbuf_create_stock_pixbuf),
	(gtk_cell_renderer_pixbuf_get_size), (gtk_cell_renderer_pixbuf_render):
	migrate to instance private data.

	* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
	(gtk_cell_renderer_toggle_get_property),
	(gtk_cell_renderer_toggle_set_property),
	(gtk_cell_renderer_toggle_render): migrate to instance private data.
2003-12-18 00:06:43 +00:00
Kristian Rietveld
f219093fd2 Yay! Fixed height mode! Hooray! (Part 2 of #80868).
Wed Dec 17 21:23:01 2003  Kristian Rietveld  <kris@gtk.org>

	Yay! Fixed height mode! Hooray! (Part 2 of #80868).

	* gtk/gtktreeview.c (gtk_tree_view_class_init),
	(gtk_tree_view_init), (gtk_tree_view_set_property),
	(gtk_tree_view_get_property), (gtk_tree_view_set_model): add a
	fixed_height_mode property,
	(intialize_fixed_height_mode), (do_validate_rows),
	(column_sizing_notify), (gtk_tree_view_set_fixed_height_mode),
	(gtk_tree_view_style_set), (gtk_tree_view_row_changed),
	(gtk_tree_view_row_inserted), (gtk_tree_view_remove_column),
	(gtk_tree_view_insert_column): implement fixed height mode,
	(gtk_tree_view_append_column), (gtk_tree_view_insert_column),
	(gtk_tree_view_insert_column_with_attributes),
	(gtk_tree_view_insert_column_with_data_func): update docs.

	* gtk/gtktreeprivate.h: add two fields to GtkTreePrivate.
2003-12-17 20:29:43 +00:00
Kristian Rietveld
b78691f098 Big TreeView DnD fixage, makes drops on empty models work, makes TreeStore
Wed Sep 10 01:06:44 2003  Kristian Rietveld  <kris@gtk.org>

	Big TreeView DnD fixage, makes drops on empty models work, makes
	TreeStore DnD work and gets rid of gtk-tree-model-drop-append.
	Related bugs #95362 and #113314. I don't want to touch this code
	ever again.

	* gtk/gtktreeprivate.h (GtkTreePrivate): add empty_view_drop field.

	* gtk/gtktreednd.c (gtk_tree_get_row_drag_data): add check
	for selection_data->length.

	* gtk/gtktreeview.c (struct DestRow), (dest_row_free),
	(set_dest_row), (get_dest_row): we don't store just the row ref
	anymore, but a struct with the row ref and additional info,
	(set_destination_row): handle drops on empty space and some
	style fixes,
	(get_logical_dest_row): also return path_down_mode/drop_append_mode
	flags, handle dropping childs on their new parents, rewrite
	drop append handling into something saner,
	(gtk_tree_view_drag_motion): show a "drop possible arrow" on empty
	spaces,
	(gtk_tree_view_drag_drop): updates for updated backend,
	(gtk_tree_view_drag_data_received): updates for updated backend,
	path down mode (treestore DnD) handling,
	(gtk_tree_view_set_drag_dest_row): set empty_view_drop flag,
	when we are trying to drop a row on an empty model,
	(gtk_tree_view_get_drag_dest_row): handle empty_view_drop flag.

	* gtk/gtkliststore.c (gtk_list_store_drag_data_received),
	(gtk_list_store_row_drop_possible): style and drop-append fixes.

	* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): ditto.
2003-09-09 23:13:39 +00:00
Kristian Rietveld
43d9992934 Merge from stable.
Mon Aug 25 23:21:43 2003  Kristian Rietveld  <kris@gtk.org>

	Merge from stable.

	Fixes #115871, reported by Michael Natterer.

	* gtk/gtktreeprivate.h: added GtkTreeSelectMode enum,
	added ctrl_pressed and shift_pressed bitfields,
	(_gtk_tree_selection_internal_select_node): replace GdkModifierType
	arg with GtkTreeSelectMode.

	* gtk/gtktreeselection.c (gtk_tree_selection_set_mode),
	(gtk_tree_selection_select_path), (gtk_tree_selection_unselect_path),
	(_gtk_tree_selection_internal_select_node): all updated for
	GdkModifierType -> GtkTreeSelectMode move.

	* gtk/gtktreeview.c (gtk_tree_view_button_press): set ctrl_pressed
	and shift_pressed around selection handling block,
	(gtk_tree_view_real_select_cursor_row),
	(gtk_tree_view_real_toggle_cursor_row),
	(gtk_tree_view_real_selection_cursor_parent),
	(gtk_tree_view_real_set_cursor): use ctrl_pressed and shift_pressed,
	instead of checking the event state. And also updates for the
	GdkModifierType -> GtkTreeSelectMode move.
2003-08-25 21:33:00 +00:00
Matthias Clasen
83c626bbe0 Remove dubious bitfields of unspecified signedness. (#112919, Morten
2003-05-27  Matthias Clasen  <maclas@gmx.de>

	* io-wbmp.c: Remove dubious bitfields of
	unspecified signedness.  (#112919, Morten Welinder)gdk-p

	* gdk-pixdata.c (gdk_pixdata_to_csource): Replace all occurances
	of g_string_new ("") by g_string_new (NULL). (#106975, Morten Welinder)

	* gtk/gtkwindow-decorate.c:
	* gtk/gtktreeprivate.h:
	* gtk/gtkdnd.c:
	* gdk/win32/gdkwindow-win32.h:
	* gdk/linux-fb/gdkprivate-fb.h:
	* gdk/linux-fb/gdkkeyboard-fb.c: Remove dubious bitfields of
	unspecified signedness.  (#112919, Morten Welinder)

	* gtk/queryimmodules.c (escape_string):
	* gtk/gtktextbtree.c (_gtk_text_btree_get_text):
	* gtk/gtksettings.c (_gtk_settings_parse_convert):
	* gtk/gtkrc.c (gtk_rc_parse_assignment):
	* gtk/gtkinputdialog.c (gtk_input_dialog_set_key):
	* gdk/x11/gdkdisplay-x11.c (escape_for_xmessage): Replace all
	occurances of g_string_new ("") by g_string_new (NULL). (#106975,
	Morten Welinder)
2003-05-27 21:21:00 +00:00
Kristian Rietveld
a09f497c36 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
Kristian Rietveld
6c3caf2a9c 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
Kristian Rietveld
acce60b799 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
Kristian Rietveld
b4ddb130c7 Fixes #74206.
Thu Apr 25 23:49:01 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #74206.

        * gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells

        * gtk/gtktreeview.c (_gtk_tree_view_column_has_editable_cell),
        (_gtk_tree_view_column_get_editable_cell): remove a space which made
        the code look ugly
        (_gtk_tree_view_column_count_special_cells): new function,
        (gtk_tree_view_column_cell_process_action): if there's only one
        activatable cell, the whole column will activate that renderer.
2002-04-25 21:44:33 +00:00
Kristian Rietveld
3e0a1a5190 add _gtk_tree_view_column_autosize
Fri Apr 19 23:38:16 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeprivate.h: add _gtk_tree_view_column_autosize

        * gtk/gtktreeview.c: privately export _gtk_tree_view_column_autosize,
        and add a small note about that function,
        (gtk_tree_view_button_press): check for double click and
        "not having an autosize" column before autosizing the column,

        * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_min_width):
        call _gtk_tree_view_column_autosize to update autosized column width
        (gtk_tree_view_column_set_max_width): ditto
2002-04-19 23:41:37 +00:00
Kristian Rietveld
d3a1294923 rename last_single_clicked{,_2} to last_button_press{,_2}, as the latter
Fri Apr 19 16:30:09 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
        last_single_clicked{,_2} to last_button_press{,_2}, as the latter
        is a more sane name.

        * gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
        instead of ->priv->cursor, check for the anchor at another place, as
        you can go in edit mode without having an anchor.
2002-04-19 14:31:54 +00:00
Kristian Rietveld
54db0fc9fd add _gtk_tree_view_column_get_editable_cell and
Sun Apr 14 16:56:59 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeprivate.h: add _gtk_tree_view_column_get_editable_cell and
        _gtk_tree_view_column_get_neighbor_sizes

        * gtk/gtktreeviewcolumn.c (struct _GtkTreeViewColumnCellInfo): add
        real_width field,
        (_gtk_tree_view_column_get_editable_cell): implement,
        (gtk_tree_view_column_cell_process_action): fill info->real_width
        (_gtk_tree_view_column_get_neighbor_sizes): implement

        * gtk/gtktreeview.c (gtk_tree_view_button_press): make the "editable
        widget" show up with the same size as the actual cell, so it doesnt
        cover the complete column if there are any other cells in that column.
2002-04-14 15:05:04 +00:00
Kristian Rietveld
64e33eb68f Fixes #78110
Tue Apr  9 21:41:24 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #78110

        * gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
        add override_browse_mode argument and implement,
        (gtk_tree_selection_unselect_path): always unselect the path,
        (toplevel): update uses of _gtk_tree_selection_internal_select_node

        * gtk/gtktreeview.c: update uses of
        _gtk_tree_selection_internal_select_node

        * gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
        update prototype

Tue Apr  9 21:39:44 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #77862

        * gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell

        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
        new function

        * gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
        on first click when cell isn't editable

Tue Apr  9 21:37:31 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
        types which were missing and useful to use (fixes #77870)
2002-04-09 19:48:32 +00:00
Kristian Rietveld
92febe2720 add _gtk_rbtree_set_fixed_height()
Wed Mar 20 22:59:23 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtkrbtree.[ch]: add _gtk_rbtree_set_fixed_height()

        * gtk/gtktreeprivate.h: add fixed_height_check field

        * gtk/gtktreeview.c (gtk_tree_view_init): initialize
        scroll_sync_timer and fixed_height_check
        (do_validate_rows): add fixed_height_check. If all validated rows
        in the first cycle have the same height, then we set that height for
        the entire tree. This is some sort of 'fake' optimization, but helps
        a lot for the common case. We keep validating the entire tree in
        the background though.
        (gtk_tree_view_set_model): reset fixed_height_check
2002-03-20 22:06:05 +00:00
Kristian Rietveld
bd7678c78d just return when we have an input_only window (fix by Owen Taylor)
Sat Mar 16 23:54:56 2002  Kristian Rietveld  <kris@gtk.org>

        * gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
        return when we have an input_only window (fix by Owen Taylor)

        * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
        scroll_sync_timer

        * gtk/gtktreeview.c (install_scroll_sync_handler): new function,
        (scroll_sync_handler): ditto,
        (gtk_tree_view_unrealize): take scroll_sync_timer into account
        (gtk_tree_view_row_deleted): install scroll_sync_timer instead of
        calling top_row_to_dy/dy_to_top_row directly
        -- this greatly speeds up clearing the model (#73199)

        * gtk/gtktreemodelsort.c
        (gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
        for some reason I really screwed it up (fixes #74663)
2002-03-16 23:30:44 +00:00
Jonathan Blandford
b2539ba480 delay scrolling until we try to draw the window.
Wed Feb 20 16:44:05 2002  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): delay
	scrolling until we try to draw the window.

	* gtk/gtktreeview.c (validate_visible_area): Implement
	scroll_to_cell.
2002-02-23 21:53:04 +00:00
Kristian Rietveld
45d646ebe9 add last_single_clicked and last_single_clicked_2 rowrefs and add
Fri Feb 22 22:39:59 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeprivate.h: add last_single_clicked and
        last_single_clicked_2 rowrefs and add disable_popdown to the
        bitfield

        * gtk/gtktreeview.c (gtk_tree_view_destroy): add destroy stuff
        for two new rowrefs
        (gtk_tree_view_button_press): add some 'advanced' button handling,
        so double click is being handled right (double click madness was
        discovered by Anders Carlsson)

        * gtk/gtktreeview.c (gtk_tree_view_set_property): add missing
        break
        (gtk_tree_view_class_init): default value of headers_visible
        should be TRUE (both pointed out by Damon Chaplin, #71986)

        * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
        connect to populate_popup,
        (gtk_tree_view_search_disable_popdown): new function,
        (gtk_tree_view_real_search_enable_popdown): ditto,
        (gtk_tree_view_search_enable_popdown): ditto,
        (gtk_tree_view_search_dialog_destroy): check for
        gtk-tree-view-popdown-disabled (#71868)

        * gtk/gtktreeview.c (gtk_tree_view_set_reorderable): move
        ->priv->reorderable assignment to bottom. (#72122)
2002-02-22 21:36:48 +00:00
Kristian Rietveld
601302c7a3 change gtk_tree_view_column_cell_render, gtk_tree_view_column_cell_focus,
Tue Feb 19 17:36:31 2002  Kristian Rietveld  <kris@gtk.org>

        * gtktreeprivate.h, gtktreeviewcolumn.[ch], gtktreeview.c: change
        gtk_tree_view_column_cell_render,
        gtk_tree_view_column_cell_focus,
        gtk_tree_view_column_cell_draw_focus and
        gtk_tree_view_column_cell_set_dirty to be private functions.

        * gtktreeviewcolumn.[ch]: add install_handler argument to
        _cell_set_dirty to control if _mark_rows_col_dirty (which calls
        install_presize_handler) gets called, set widths correctly so
        autosizing works (#71870)

        * gtktreeview.c (gtk_tree_view_column_autosize): new function,
        (gtk_tree_view_button_press): make double click on column
        separator resize the row (#71870)
        (gtk_tree_view_get_dest_row_at_pos): change DnD threshold to 33%
        (#71869, suggestion by Anders Carlsson)
2002-02-19 18:21:50 +00:00
Kristian Rietveld
ad219f2e3a Fix for bug #69586
Sun Jan 27 22:13:02  Kristian Rietveld  <kris@gtk.org>

        Fix for bug #69586

        * gtk/gtktreeprivate.h: get rid of tab_offset, introduce
        expander_size

        * gtk/gtktreeview.c: get rid of ->priv->tab_offset, introduce
        expander_size caching (from style), fix CELL_HEIGHT macro,
        use MAX ("RBNODE_HEIGHT", expander_size) (differs per case) for
        row height calculation, added style_set callback
2002-01-27 21:11:29 +00:00
Jonathan Blandford
969279b54e Update top_row. Remove extraneous print statements.
Mon Jan 21 18:28:17 2002  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): Update
	top_row.  Remove extraneous print statements.
2002-01-21 23:30:17 +00:00
Jonathan Blandford
ed50ebfb28 Now we test we can unselect nodes before selecting new ones.
Wed Jan  9 19:10:07 2002  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeselection.c
	(_gtk_tree_selection_internal_select_node): Now we test we can
	unselect nodes before selecting new ones.
	(gtk_tree_selection_real_select_node): be careful comparing booleans.
2002-01-10 00:11:32 +00:00
Anders Carlsson
88edb0e58e Rename gtk_tree_view_queue_draw_node to _gtk_tree_view_queue_draw_node.
2002-01-03  Anders Carlsson  <andersca@gnu.org>

	* gtk/gtktreeview.c: Rename gtk_tree_view_queue_draw_node to
	_gtk_tree_view_queue_draw_node.
	(gtk_tree_view_row_has_child_toggled): Only redraw one node.

	* gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func):
	sort_column_id can be 0.

	* gtk/gtktreeselection.c (gtk_tree_selection_real_select_node):
	Only redraw one the node being selected.

	* gtk/gtktreeprivate.h: Add _gtk_tree_view_queue_draw_node.
2002-01-02 23:51:03 +00:00
Hidetoshi Tajima
0657d7410b restore the else case of #ifdef __GNUC__ #66225
* gtk/gtktreeprivate.h: restore the else case of #ifdef __GNUC__
	#66225
2001-12-05 05:49:41 +00:00
Jonathan Blandford
d1a858c837 Minor fix.
Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>

	* demos/gtk-demo/main.c: (create_tree): Minor fix.

	* docs/tree-column-sizing.txt: Update

	* gtk/gtkrbtree.[ch]: Massive work to support validation.

	* gtk/gtktreemodel.c: Doc fixes.

	* gtk/gtktreeview.c: Incremental reflow added.
	* gtk/gtktreeviewcolumn.c: ditto
	* gtk/gtktreeviewcolumn.h: ditto
2001-12-04 23:49:57 +00:00
Kristian Rietveld
5a2ebedc20 if we use pointers, we should free the previous pointer first (if it
Mon Dec  3 21:15:59 2001  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
        we use pointers, we should free the previous pointer first (if
        it exists), before we set a new pointer. (#64726)

        * gtk/gtktreeprivate.h: get rid of cursor_drag

        * gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
        for cursor_drag
        (gtk_tree_view_bin_expose): don't directly return in the while
        loop
        (gtk_tree_view_class_init): indentend expanders by default
        (gtk_tree_view_header_focus): only give the button focus
        if it's clickable, visible and the column is reorderable
        (#65539)

        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
        create and free cursor
2001-12-03 21:20:12 +00:00
Owen Taylor
9b6c73271f Remove trailing commas in enum declarations.
Wed Nov 21 17:01:25 2001  Owen Taylor  <otaylor@redhat.com>
	* gtk/gtkcellrenderer.h gtk/gtktreemodel.h
	gtk/gtktreeprivate.h gtk/gtktreesortable.h: Remove
	trailing commas in enum declarations.
2001-11-21 22:08:09 +00:00
Jonathan Blandford
dc754528a0 Remove handle_box from App demo.
Mon Oct 22 14:08:26 2001  Jonathan Blandford  <jrb@redhat.com>

	* demos/gtk-demo/appwindow.c: Remove handle_box from App demo.

	* gtk/gtktreeview.c (size_allocate): Move to a different drawing
	system.  Instead of having a window the size of the tree, we have
	a window the size of widget->allocation, and simply draw with the
	offset.
	(coords_are_over_arrow): ditto.  Move to window coordinates.
	(do_prelight): ditto
	(do_unprelight): ditto

	* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
	Minor fix from Kristian Rietveld to fix unsorted case.
2001-10-22 18:24:29 +00:00
Jonathan Blandford
92841cb95a Make a GtkCellEditable (get_widget_window_size): Change to let it honor
Tue Sep 25 12:34:42 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtkentry.c: Make a GtkCellEditable
	(get_widget_window_size): Change to let it honor size_allocate
	when a CellEditable.

	* gtk/gtktreeview.c: M-x clean-line-ends.  Lots of focus and
	editable changes.
	(gtk_tree_view_set_cursor): Now you can set the cursor
	horizontally, as well as start editing.

	* gtk/gtkstyle.c (gtk_default_draw_check): changing toggle drawing
	code to look more like the other check buttons.

	* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
	Change the way we calculate cell size.

	* gtk/gtkmarshal.list (VOID:STRING,STRING): new marshaller.

	* demos/gtk-demo/sizegroup.c: Add mnemonics.

	* gtk/gtkcellrenderer.c (gtk_cell_renderer_get_size): Fix docs.
	Fix logic.

	* gtk/gtkcellrenderertext.c: Change to be editable.

	* gtk/gtkcellrenderertoggle.c: Change to be activatable.

	* test/testtreesort.c: Fix misspelling

	* test/testreecolumns.c: Add mnemonics.

	* test/testreeedit.c: New test program.
2001-09-25 16:44:39 +00:00
Jonathan Blandford
fa6e6928f6 centralize all the editing code
Tue Sep 18 18:46:54 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_start_editing): centralize all
	the editing code

	* gtk/gtkcelleditable.c: Got rid of stop_editing, as there was no
	reason to call it beyond emiting the two signals.

	* gtk/gtkentry.c (gtk_entry_class_init): add "has_frame" property
	to GtkEntry.
2001-09-18 22:49:02 +00:00
Jonathan Blandford
f724f836ec Add put for use with editable widgets. This function is private, and
Tue Sep 18 12:12:43 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_put): Add put for use with
	editable widgets.  This function is private, and should only be
	used by GtkTreeView.
2001-09-18 16:15:10 +00:00
Jonathan Blandford
747b72533a Add "use_align" to give people the option to just make a cell visible.
Fri Aug 24 16:03:45 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): Add
	"use_align" to give people the option to just make a cell visible.

	* gtk/gtktreeview.c (gtk_tree_view_scroll_to_point): fix bug where
	we were scrolling past the end of the tree.

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_pack_start):
	rename gtk_tree_view_column_pack_start_cell_renderer to
	gtk_tree_view_column_pack_start.  Same for pack_end, and clear.
2001-08-24 20:09:26 +00:00
Jonathan Blandford
953d4b248e Fix selection. I think it's all dandy now. We check the current event for
Wed Aug 22 18:25:46 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c: Fix selection.  I think it's all dandy now.
	We check the current event for modifiers rather than try to trap
	all presses.
2001-08-22 22:27:41 +00:00
Jonathan Blandford
ac1e4ef3d2 Add heavily modified patch from Kristian Rietveld to handle interactive
Fri Aug 17 19:30:14 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeprivate.h:
	* gtk/gtktreeview.c: (gtk_tree_view_class_init),
	(gtk_tree_view_init), (gtk_tree_view_set_property),
	(gtk_tree_view_get_property), (gtk_tree_view_destroy),
	(gtk_tree_view_key_press), (gtk_tree_view_leave_notify),
	(gtk_tree_view_focus_out), (gtk_tree_view_set_model),
	(gtk_tree_view_set_destroy_count_func),
	(gtk_tree_view_set_enable_search),
	(gtk_tree_view_get_enable_search),
	(gtk_tree_view_get_search_column),
	(gtk_tree_view_set_search_column),
	(gtk_tree_view_get_search_equal_func),
	(gtk_tree_view_set_search_equal_func),
	(gtk_tree_view_search_dialog_destroy),
	(gtk_tree_view_search_position_func),
	(gtk_tree_view_interactive_search),
	(gtk_tree_view_search_delete_event),
	(gtk_tree_view_search_button_press_event),
	(gtk_tree_view_search_key_press_event),
	(gtk_tree_view_search_move), (gtk_tree_view_search_equal_func),
	(gtk_tree_view_search_iter), (gtk_tree_view_search_init):
	* gtk/gtktreeview.h:
	Add heavily modified patch from Kristian Rietveld to handle
	interactive searching.
2001-08-17 23:35:52 +00:00
Anders Carlsson
f4ca329027 Add support for animating expanders.
2001-07-22  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): Replace the
	expander_height and expander_width properties with a single
	property, expander_size.
	(gtk_tree_view_init): Set the tab_offset to expander_size
	plus some padding.
	(gtk_tree_view_unrealize): Remove the expand/collapse
	timeout if it exists.
	(coords_are_over_arrow): Fix a small bug.
	(gtk_tree_view_motion_draw_column_motion_arrow): Use
	expander_size.
	(gtk_tree_view_draw_focus): Use "treeview" instead of
	"add-mode" as detail when drawing the focus.
	(gtk_tree_view_bin_expose): Use "treeview-drop-indicator"
	instead of "add-mode" as detail when drawing the focus.
	(gtk_tree_view_deleted): If we have a node currently being
	expanded or collapsed, remove the timeout and set the node
	to NULL.
	(gtk_tree_view_queue_draw_arrow): New function that just
	redraws the arrow of a node.
	(gtk_tree_view_draw_arrow): Use expander_size instead of
	expander_width/expander_height, also pass a different
	expander_style to gtk_paint_expander depending on the
	state of the node being drawn.
	(expand_collapse_timeout): New function for expanding
	or collapsing a node depending on the previous state.
	(gtk_tree_view_real_expand_row): Add timeout and set
	correct state for node being expanded.
	(gtk_tree_view_real_collapse_row): Add timeout and set
	correct state for node being collapsed.

	* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): Add
	information about the node currently being expanded or
	collapsed, and also a timeout id.

	* gtk/gtkstyle.h (struct _GtkStyleClass): Replace is_open
	with expander_style for draw_expander.

	* gtk/gtkstyle.c (gtk_draw_expander): Replace is_open with
	expander_style.
	(create_expander_affine): New function for creating an
	expander affine.
	(apply_affine_on_point): New function for applying an
	affine to a point.
	(gtk_default_draw_expander): Modified to take expander_style
	instead of is_open, and to draw the rectangle rotated differently
	depending on the expander style.
	(gtk_paint_expander): Replace is_open with expander_style.

	* gtk/gtkrbtree.h: Add expander states to GtkRBNodeColor.

	* gtk/gtkenums.h: Add expander style enum.
2001-07-22 20:09:00 +00:00