1998-05-01 13:20:55 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald,
|
|
|
|
* Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org>
|
|
|
|
*
|
|
|
|
* GtkCTree widget for GTK+
|
|
|
|
* Copyright (C) 1998 Lars Hamann and Stefan Jeske
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include "gtkctree.h"
|
1998-07-15 23:40:00 +00:00
|
|
|
#include "gtkbindings.h"
|
1998-07-26 15:54:41 +00:00
|
|
|
#include "gtkmain.h"
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
#include "gtkdnd.h"
|
Merge in Win32 version: Define macro GDKVAR for declaring gdk variables
* gdk/gdktypes.h: Merge in Win32 version: Define macro GDKVAR for
declaring gdk variables exported/imported from the DLL. New image
type enum, GDK_IMAGE_SHARED_PIXMAP, for gdk_imlib. New drag and
drop protocol enums, GDK_DRAG_PROTO_WIN32_DROPFILES and
GDK_DRAG_PROTO_OLE2.
* gdk/gdk.h: Merge in Win32 version: Two new functions,
gdk_pixmap_create_on_shared_image and gdk_image_bitmap_new. So far
declared only for the Win32 version, but could be in the X11
version as well. (Needed for a Xlib-less gdk_imlib.)
gdk_color_hash should have only one parameter. Declare
gdk_threads_mutex with GDKVAR.
* gdk/gdkcolor.c (gdk_color_hash): As a hash function should have
just one parameter.
* gdk/gdkimage.c (gdk_image_get): Initialize bpp correctly. Bytes
per pixel, not bits.
* gdk/gdkrgb.c: Mingle includes somewhat. (gdk_rgb_select_conv):
Fetch bpp (which means bits-per-pixel here) from another place on
Win32. Accept also depth==32 (which we might get on Win32) with
bpp==32.
* gtk/{gtkclist,gtkctree,gtkdnd,gtkditable,gtkfontsel,
gtkhandlebox,gtklayout,gtkmain,gtkplug,gtkpreview,gtkrc,
gtkselection,gtksocket,gtkstyle,gtkwidget,gtkwindow}.c:
Include gdx.h from "gdkx.h", not "gdk/gdkx.h", as gdkx.h will be
in the backend-dependent directory, not in the common gdk
directory.
* gtk/testgtk.c: Ditto. Also, don't use ../gdk patchs to gdk
headers.
1999-03-17 23:02:10 +00:00
|
|
|
#include "gdkx.h"
|
1998-07-15 23:40:00 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
#define PM_SIZE 8
|
1998-06-22 17:00:21 +00:00
|
|
|
#define TAB_SIZE (PM_SIZE + 6)
|
1998-05-01 13:20:55 +00:00
|
|
|
#define CELL_SPACING 1
|
1999-02-08 21:03:54 +00:00
|
|
|
#define CLIST_OPTIMUM_SIZE 64
|
1998-05-04 09:40:35 +00:00
|
|
|
#define COLUMN_INSET 3
|
|
|
|
#define DRAG_WIDTH 6
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
#define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \
|
|
|
|
(((row) + 1) * CELL_SPACING) + \
|
|
|
|
(clist)->voffset)
|
|
|
|
#define ROW_FROM_YPIXEL(clist, y) (((y) - (clist)->voffset) / \
|
|
|
|
((clist)->row_height + CELL_SPACING))
|
|
|
|
#define COLUMN_LEFT_XPIXEL(clist, col) ((clist)->column[(col)].area.x \
|
|
|
|
+ (clist)->hoffset)
|
1998-05-04 09:40:35 +00:00
|
|
|
#define COLUMN_LEFT(clist, column) ((clist)->column[(column)].area.x)
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static inline gint
|
|
|
|
COLUMN_FROM_XPIXEL (GtkCList * clist,
|
|
|
|
gint x)
|
|
|
|
{
|
|
|
|
gint i, cx;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].visible)
|
|
|
|
{
|
|
|
|
cx = clist->column[i].area.x + clist->hoffset;
|
|
|
|
|
|
|
|
if (x >= (cx - (COLUMN_INSET + CELL_SPACING)) &&
|
|
|
|
x <= (cx + clist->column[i].area.width + COLUMN_INSET))
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* no match */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
#define GTK_CLIST_CLASS_FW(_widget_) GTK_CLIST_CLASS (((GtkObject*) (_widget_))->klass)
|
|
|
|
#define CLIST_UNFROZEN(clist) (((GtkCList*) (clist))->freeze_count == 0)
|
|
|
|
#define CLIST_REFRESH(clist) G_STMT_START { \
|
|
|
|
if (CLIST_UNFROZEN (clist)) \
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->refresh ((GtkCList*) (clist)); \
|
|
|
|
} G_STMT_END
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
enum {
|
|
|
|
ARG_0,
|
|
|
|
ARG_N_COLUMNS,
|
|
|
|
ARG_TREE_COLUMN,
|
|
|
|
ARG_INDENT,
|
|
|
|
ARG_SPACING,
|
|
|
|
ARG_SHOW_STUB,
|
|
|
|
ARG_LINE_STYLE,
|
|
|
|
ARG_EXPANDER_STYLE
|
|
|
|
};
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void gtk_ctree_class_init (GtkCTreeClass *klass);
|
|
|
|
static void gtk_ctree_init (GtkCTree *ctree);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
static void gtk_ctree_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
static void gtk_ctree_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void gtk_ctree_realize (GtkWidget *widget);
|
|
|
|
static void gtk_ctree_unrealize (GtkWidget *widget);
|
1998-05-01 13:20:55 +00:00
|
|
|
static gint gtk_ctree_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
1998-10-16 15:00:05 +00:00
|
|
|
static void ctree_attach_styles (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data);
|
|
|
|
static void ctree_detach_styles (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data);
|
|
|
|
static gint draw_cell_pixmap (GdkWindow *window,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkGC *fg_gc,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void get_cell_style (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint state,
|
|
|
|
gint column,
|
|
|
|
GtkStyle **style,
|
|
|
|
GdkGC **fg_gc,
|
|
|
|
GdkGC **bg_gc);
|
|
|
|
static gint gtk_ctree_draw_expander (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row,
|
|
|
|
GtkStyle *style,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
gint x);
|
|
|
|
static gint gtk_ctree_draw_lines (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gint state,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkRectangle *cell_rectangle,
|
|
|
|
GdkRectangle *crect,
|
|
|
|
GdkRectangle *area,
|
|
|
|
GtkStyle *style);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void draw_row (GtkCList *clist,
|
|
|
|
GdkRectangle *area,
|
|
|
|
gint row,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCListRow *clist_row);
|
|
|
|
static void draw_drag_highlight (GtkCList *clist,
|
|
|
|
GtkCListRow *dest_row,
|
|
|
|
gint dest_row_number,
|
|
|
|
GtkCListDragPos drag_pos);
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
static void tree_draw_node (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node);
|
1998-08-17 23:48:04 +00:00
|
|
|
static void set_cell_contents (GtkCList *clist,
|
1998-05-01 13:20:55 +00:00
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkCellType type,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text,
|
1998-05-01 13:20:55 +00:00
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask);
|
1998-05-01 23:45:18 +00:00
|
|
|
static void set_node_info (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text,
|
1998-05-01 23:45:18 +00:00
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap_closed,
|
|
|
|
GdkBitmap *mask_closed,
|
|
|
|
GdkPixmap *pixmap_opened,
|
|
|
|
GdkBitmap *mask_opened,
|
|
|
|
gboolean is_leaf,
|
|
|
|
gboolean expanded);
|
1998-05-04 09:40:35 +00:00
|
|
|
static GtkCTreeRow *row_new (GtkCTree *ctree);
|
|
|
|
static void row_delete (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row);
|
|
|
|
static void tree_delete (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
|
|
|
static void tree_delete_row (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
1998-07-15 23:40:00 +00:00
|
|
|
static void real_clear (GtkCList *clist);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void tree_update_level (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
|
|
|
static void tree_select (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
|
|
|
static void tree_unselect (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
1998-07-15 23:40:00 +00:00
|
|
|
static void real_select_all (GtkCList *clist);
|
|
|
|
static void real_unselect_all (GtkCList *clist);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void tree_expand (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
|
|
|
static void tree_collapse (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
1998-07-20 19:45:45 +00:00
|
|
|
static void tree_collapse_to_depth (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-20 19:45:45 +00:00
|
|
|
gint depth);
|
1998-07-15 23:40:00 +00:00
|
|
|
static void tree_toggle_expansion (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-15 23:40:00 +00:00
|
|
|
gpointer data);
|
|
|
|
static void change_focus_row_expansion (GtkCTree *ctree,
|
1998-07-27 01:50:16 +00:00
|
|
|
GtkCTreeExpansionType expansion);
|
1998-07-15 23:40:00 +00:00
|
|
|
static void real_select_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void real_unselect_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void real_tree_select (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gint column);
|
|
|
|
static void real_tree_unselect (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gint column);
|
|
|
|
static void real_tree_expand (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void real_tree_collapse (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void real_tree_move (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *new_parent,
|
|
|
|
GtkCTreeNode *new_sibling);
|
1998-12-02 00:52:14 +00:00
|
|
|
static void real_row_move (GtkCList *clist,
|
|
|
|
gint source_row,
|
|
|
|
gint dest_row);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void gtk_ctree_link (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode *sibling,
|
1998-07-15 23:40:00 +00:00
|
|
|
gboolean update_focus_row);
|
1998-05-04 09:40:35 +00:00
|
|
|
static void gtk_ctree_unlink (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-15 23:40:00 +00:00
|
|
|
gboolean update_focus_row);
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
static GtkCTreeNode * gtk_ctree_last_visible (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node);
|
1998-05-04 09:40:35 +00:00
|
|
|
static gboolean ctree_is_hot_spot (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gint row,
|
|
|
|
gint x,
|
|
|
|
gint y);
|
|
|
|
static void tree_sort (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-04 09:40:35 +00:00
|
|
|
gpointer data);
|
1998-07-15 23:40:00 +00:00
|
|
|
static void fake_unselect_all (GtkCList *clist,
|
|
|
|
gint row);
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
static GList * selection_find (GtkCList *clist,
|
1998-07-15 23:40:00 +00:00
|
|
|
gint row_number,
|
|
|
|
GList *row_list_element);
|
|
|
|
static void resync_selection (GtkCList *clist,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void real_undo_selection (GtkCList *clist);
|
|
|
|
static void select_row_recursive (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-15 23:40:00 +00:00
|
|
|
gpointer data);
|
1998-08-17 23:48:04 +00:00
|
|
|
static gint real_insert_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gchar *text[]);
|
|
|
|
static void real_remove_row (GtkCList *clist,
|
|
|
|
gint row);
|
|
|
|
static void real_sort_list (GtkCList *clist);
|
1998-10-19 22:46:38 +00:00
|
|
|
static void cell_size_request (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void column_auto_resize (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
gint old_width);
|
1998-11-11 20:46:51 +00:00
|
|
|
static void auto_resize_columns (GtkCList *clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
static gboolean check_drag (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *drag_source,
|
|
|
|
GtkCTreeNode *drag_target,
|
|
|
|
GtkCListDragPos insert_pos);
|
|
|
|
static void gtk_ctree_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static gint gtk_ctree_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static void gtk_ctree_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint32 time);
|
1999-01-08 00:21:36 +00:00
|
|
|
static void remove_grab (GtkCList *clist);
|
1999-04-30 11:48:42 +00:00
|
|
|
static void drag_dest_cell (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkCListDestInfo *dest_info);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TREE_SELECT_ROW,
|
|
|
|
TREE_UNSELECT_ROW,
|
|
|
|
TREE_EXPAND,
|
|
|
|
TREE_COLLAPSE,
|
|
|
|
TREE_MOVE,
|
1998-07-15 23:40:00 +00:00
|
|
|
CHANGE_FOCUS_ROW_EXPANSION,
|
1998-05-01 13:20:55 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
static GtkCListClass *parent_class = NULL;
|
|
|
|
static GtkContainerClass *container_class = NULL;
|
|
|
|
static guint ctree_signals[LAST_SIGNAL] = {0};
|
|
|
|
|
|
|
|
|
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_ctree_get_type (void)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
static GtkType ctree_type = 0;
|
|
|
|
|
|
|
|
if (!ctree_type)
|
|
|
|
{
|
1998-11-30 19:07:15 +00:00
|
|
|
static const GtkTypeInfo ctree_info =
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
"GtkCTree",
|
|
|
|
sizeof (GtkCTree),
|
|
|
|
sizeof (GtkCTreeClass),
|
|
|
|
(GtkClassInitFunc) gtk_ctree_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_ctree_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
1998-06-28 07:46:10 +00:00
|
|
|
(GtkClassInitFunc) NULL,
|
1998-05-01 13:20:55 +00:00
|
|
|
};
|
|
|
|
|
1998-07-16 02:47:15 +00:00
|
|
|
ctree_type = gtk_type_unique (GTK_TYPE_CLIST, &ctree_info);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ctree_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_ctree_class_init (GtkCTreeClass *klass)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
GtkCListClass *clist_class;
|
1999-02-11 23:47:48 +00:00
|
|
|
GtkBindingSet *binding_set;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
object_class = (GtkObjectClass *) klass;
|
|
|
|
widget_class = (GtkWidgetClass *) klass;
|
|
|
|
container_class = (GtkContainerClass *) klass;
|
|
|
|
clist_class = (GtkCListClass *) klass;
|
|
|
|
|
1998-07-16 02:47:15 +00:00
|
|
|
parent_class = gtk_type_class (GTK_TYPE_CLIST);
|
|
|
|
container_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCTree::n_columns",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY,
|
|
|
|
ARG_N_COLUMNS);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::tree_column",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY,
|
|
|
|
ARG_TREE_COLUMN);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::indent",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_INDENT);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::spacing",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_SPACING);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::show_stub",
|
|
|
|
GTK_TYPE_BOOL,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_SHOW_STUB);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::line_style",
|
1998-11-26 03:43:24 +00:00
|
|
|
GTK_TYPE_CTREE_LINE_STYLE,
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_LINE_STYLE);
|
|
|
|
gtk_object_add_arg_type ("GtkCTree::expander_style",
|
1998-11-26 03:43:24 +00:00
|
|
|
GTK_TYPE_CTREE_EXPANDER_STYLE,
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_EXPANDER_STYLE);
|
|
|
|
object_class->set_arg = gtk_ctree_set_arg;
|
|
|
|
object_class->get_arg = gtk_ctree_get_arg;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree_signals[TREE_SELECT_ROW] =
|
|
|
|
gtk_signal_new ("tree_select_row",
|
|
|
|
GTK_RUN_FIRST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_select_row),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER_INT,
|
1998-11-26 18:47:58 +00:00
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_CTREE_NODE, GTK_TYPE_INT);
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree_signals[TREE_UNSELECT_ROW] =
|
|
|
|
gtk_signal_new ("tree_unselect_row",
|
|
|
|
GTK_RUN_FIRST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_unselect_row),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER_INT,
|
1998-11-26 18:47:58 +00:00
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_CTREE_NODE, GTK_TYPE_INT);
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree_signals[TREE_EXPAND] =
|
|
|
|
gtk_signal_new ("tree_expand",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_expand),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER,
|
1998-11-26 18:47:58 +00:00
|
|
|
GTK_TYPE_NONE, 1, GTK_TYPE_CTREE_NODE);
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree_signals[TREE_COLLAPSE] =
|
|
|
|
gtk_signal_new ("tree_collapse",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_collapse),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER,
|
1999-02-10 16:37:09 +00:00
|
|
|
GTK_TYPE_NONE, 1, GTK_TYPE_CTREE_NODE);
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree_signals[TREE_MOVE] =
|
|
|
|
gtk_signal_new ("tree_move",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_move),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER_POINTER_POINTER,
|
1998-11-26 18:47:58 +00:00
|
|
|
GTK_TYPE_NONE, 3, GTK_TYPE_CTREE_NODE,
|
|
|
|
GTK_TYPE_CTREE_NODE, GTK_TYPE_CTREE_NODE);
|
1998-07-15 23:40:00 +00:00
|
|
|
ctree_signals[CHANGE_FOCUS_ROW_EXPANSION] =
|
|
|
|
gtk_signal_new ("change_focus_row_expansion",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCTreeClass,
|
|
|
|
change_focus_row_expansion),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__ENUM,
|
1998-11-26 03:43:24 +00:00
|
|
|
GTK_TYPE_NONE, 1, GTK_TYPE_CTREE_EXPANSION_TYPE);
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_object_class_add_signals (object_class, ctree_signals, LAST_SIGNAL);
|
|
|
|
|
|
|
|
widget_class->realize = gtk_ctree_realize;
|
|
|
|
widget_class->unrealize = gtk_ctree_unrealize;
|
|
|
|
widget_class->button_press_event = gtk_ctree_button_press;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
widget_class->drag_begin = gtk_ctree_drag_begin;
|
|
|
|
widget_class->drag_motion = gtk_ctree_drag_motion;
|
|
|
|
widget_class->drag_data_received = gtk_ctree_drag_data_received;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_class->select_row = real_select_row;
|
|
|
|
clist_class->unselect_row = real_unselect_row;
|
1998-12-02 00:52:14 +00:00
|
|
|
clist_class->row_move = real_row_move;
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_class->undo_selection = real_undo_selection;
|
|
|
|
clist_class->resync_selection = resync_selection;
|
|
|
|
clist_class->selection_find = selection_find;
|
1998-05-01 13:20:55 +00:00
|
|
|
clist_class->click_column = NULL;
|
|
|
|
clist_class->draw_row = draw_row;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist_class->draw_drag_highlight = draw_drag_highlight;
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_class->clear = real_clear;
|
|
|
|
clist_class->select_all = real_select_all;
|
|
|
|
clist_class->unselect_all = real_unselect_all;
|
|
|
|
clist_class->fake_unselect_all = fake_unselect_all;
|
1998-08-17 23:48:04 +00:00
|
|
|
clist_class->insert_row = real_insert_row;
|
|
|
|
clist_class->remove_row = real_remove_row;
|
|
|
|
clist_class->sort_list = real_sort_list;
|
|
|
|
clist_class->set_cell_contents = set_cell_contents;
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_class->cell_size_request = cell_size_request;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
klass->tree_select_row = real_tree_select;
|
|
|
|
klass->tree_unselect_row = real_tree_unselect;
|
1998-05-01 13:20:55 +00:00
|
|
|
klass->tree_expand = real_tree_expand;
|
|
|
|
klass->tree_collapse = real_tree_collapse;
|
|
|
|
klass->tree_move = real_tree_move;
|
1998-07-15 23:40:00 +00:00
|
|
|
klass->change_focus_row_expansion = change_focus_row_expansion;
|
|
|
|
|
1999-02-11 23:47:48 +00:00
|
|
|
binding_set = gtk_binding_set_by_class (klass);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
'+', GDK_SHIFT_MASK,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Add, 0,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Add, GDK_CONTROL_MASK,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM,
|
|
|
|
GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
'-', 0,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Subtract, 0,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Subtract, GDK_CONTROL_MASK,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM,
|
|
|
|
GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
'=', 0,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Multiply, 0,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set,
|
|
|
|
GDK_KP_Multiply, GDK_CONTROL_MASK,
|
|
|
|
"change_focus_row_expansion", 1,
|
|
|
|
GTK_TYPE_ENUM,
|
|
|
|
GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
static void
|
|
|
|
gtk_ctree_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
|
|
|
case ARG_N_COLUMNS: /* construct-only arg, only set when !GTK_CONSTRUCTED */
|
|
|
|
if (ctree->tree_column)
|
|
|
|
gtk_ctree_construct (ctree,
|
|
|
|
MAX (1, GTK_VALUE_UINT (*arg)),
|
|
|
|
ctree->tree_column, NULL);
|
|
|
|
else
|
|
|
|
GTK_CLIST (ctree)->columns = MAX (1, GTK_VALUE_UINT (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_TREE_COLUMN: /* construct-only arg, only set when !GTK_CONSTRUCTED */
|
|
|
|
if (GTK_CLIST (ctree)->columns)
|
|
|
|
gtk_ctree_construct (ctree,
|
|
|
|
GTK_CLIST (ctree)->columns,
|
|
|
|
MAX (1, GTK_VALUE_UINT (*arg)),
|
|
|
|
NULL);
|
|
|
|
else
|
|
|
|
ctree->tree_column = MAX (1, GTK_VALUE_UINT (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_INDENT:
|
|
|
|
gtk_ctree_set_indent (ctree, GTK_VALUE_UINT (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_SPACING:
|
|
|
|
gtk_ctree_set_spacing (ctree, GTK_VALUE_UINT (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_SHOW_STUB:
|
|
|
|
gtk_ctree_set_show_stub (ctree, GTK_VALUE_BOOL (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_LINE_STYLE:
|
|
|
|
gtk_ctree_set_line_style (ctree, GTK_VALUE_ENUM (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_EXPANDER_STYLE:
|
|
|
|
gtk_ctree_set_expander_style (ctree, GTK_VALUE_ENUM (*arg));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_ctree_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
|
|
|
case ARG_N_COLUMNS:
|
|
|
|
GTK_VALUE_UINT (*arg) = GTK_CLIST (ctree)->columns;
|
|
|
|
break;
|
|
|
|
case ARG_TREE_COLUMN:
|
|
|
|
GTK_VALUE_UINT (*arg) = ctree->tree_column;
|
|
|
|
break;
|
|
|
|
case ARG_INDENT:
|
|
|
|
GTK_VALUE_UINT (*arg) = ctree->tree_indent;
|
|
|
|
break;
|
|
|
|
case ARG_SPACING:
|
|
|
|
GTK_VALUE_UINT (*arg) = ctree->tree_spacing;
|
|
|
|
break;
|
|
|
|
case ARG_SHOW_STUB:
|
|
|
|
GTK_VALUE_BOOL (*arg) = ctree->show_stub;
|
|
|
|
break;
|
|
|
|
case ARG_LINE_STYLE:
|
|
|
|
GTK_VALUE_ENUM (*arg) = ctree->line_style;
|
|
|
|
break;
|
|
|
|
case ARG_EXPANDER_STYLE:
|
|
|
|
GTK_VALUE_ENUM (*arg) = ctree->expander_style;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
arg->type = GTK_TYPE_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void
|
|
|
|
gtk_ctree_init (GtkCTree *ctree)
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
GTK_CLIST_SET_FLAG (ctree, CLIST_DRAW_DRAG_RECT);
|
|
|
|
GTK_CLIST_SET_FLAG (ctree, CLIST_DRAW_DRAG_LINE);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree->tree_indent = 20;
|
1998-10-16 15:00:05 +00:00
|
|
|
ctree->tree_spacing = 5;
|
1998-05-01 13:20:55 +00:00
|
|
|
ctree->tree_column = 0;
|
1998-05-04 09:40:35 +00:00
|
|
|
ctree->line_style = GTK_CTREE_LINES_SOLID;
|
1998-10-16 15:00:05 +00:00
|
|
|
ctree->expander_style = GTK_CTREE_EXPANDER_SQUARE;
|
1998-08-15 07:30:01 +00:00
|
|
|
ctree->drag_compare = NULL;
|
1998-08-17 23:48:04 +00:00
|
|
|
ctree->show_stub = TRUE;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
clist->button_actions[0] |= GTK_BUTTON_EXPANDS;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
static void
|
|
|
|
ctree_attach_styles (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.style)
|
|
|
|
GTK_CTREE_ROW (node)->row.style =
|
|
|
|
gtk_style_attach (GTK_CTREE_ROW (node)->row.style, clist->clist_window);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.fg_set || GTK_CTREE_ROW (node)->row.bg_set)
|
|
|
|
{
|
|
|
|
GdkColormap *colormap;
|
|
|
|
|
|
|
|
colormap = gtk_widget_get_colormap (GTK_WIDGET (ctree));
|
|
|
|
if (GTK_CTREE_ROW (node)->row.fg_set)
|
|
|
|
gdk_color_alloc (colormap, &(GTK_CTREE_ROW (node)->row.foreground));
|
|
|
|
if (GTK_CTREE_ROW (node)->row.bg_set)
|
|
|
|
gdk_color_alloc (colormap, &(GTK_CTREE_ROW (node)->row.background));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[i].style)
|
|
|
|
GTK_CTREE_ROW (node)->row.cell[i].style =
|
|
|
|
gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[i].style,
|
|
|
|
clist->clist_window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ctree_detach_styles (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.style)
|
|
|
|
gtk_style_detach (GTK_CTREE_ROW (node)->row.style);
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[i].style)
|
|
|
|
gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[i].style);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void
|
|
|
|
gtk_ctree_realize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
1998-10-16 15:00:05 +00:00
|
|
|
GtkCList *clist;
|
1998-05-01 13:20:55 +00:00
|
|
|
GdkGCValues values;
|
1998-10-16 15:00:05 +00:00
|
|
|
GtkCTreeNode *node;
|
|
|
|
GtkCTreeNode *child;
|
|
|
|
gint i;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (widget));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
GTK_WIDGET_CLASS (parent_class)->realize (widget);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
ctree = GTK_CTREE (widget);
|
1998-10-16 15:00:05 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
node = GTK_CTREE_NODE (clist->row_list);
|
|
|
|
for (i = 0; i < clist->rows; i++)
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->children && !GTK_CTREE_ROW (node)->expanded)
|
|
|
|
for (child = GTK_CTREE_ROW (node)->children; child;
|
|
|
|
child = GTK_CTREE_ROW (child)->sibling)
|
|
|
|
gtk_ctree_pre_recursive (ctree, child, ctree_attach_styles, NULL);
|
|
|
|
node = GTK_CTREE_NODE_NEXT (node);
|
|
|
|
}
|
1998-07-25 01:10:58 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
values.foreground = widget->style->fg[GTK_STATE_NORMAL];
|
1998-12-16 00:52:46 +00:00
|
|
|
values.background = widget->style->base[GTK_STATE_NORMAL];
|
1998-05-01 13:20:55 +00:00
|
|
|
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
|
|
|
values.line_style = GDK_LINE_SOLID;
|
|
|
|
ctree->lines_gc = gdk_gc_new_with_values (GTK_CLIST(widget)->clist_window,
|
|
|
|
&values,
|
|
|
|
GDK_GC_FOREGROUND |
|
|
|
|
GDK_GC_BACKGROUND |
|
|
|
|
GDK_GC_SUBWINDOW |
|
|
|
|
GDK_GC_LINE_STYLE);
|
|
|
|
|
|
|
|
if (ctree->line_style == GTK_CTREE_LINES_DOTTED)
|
|
|
|
{
|
|
|
|
gdk_gc_set_line_attributes (ctree->lines_gc, 1,
|
|
|
|
GDK_LINE_ON_OFF_DASH, None, None);
|
1998-05-05 15:00:12 +00:00
|
|
|
gdk_gc_set_dashes (ctree->lines_gc, 0, "\1\1", 2);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_ctree_unrealize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
1998-10-16 15:00:05 +00:00
|
|
|
GtkCList *clist;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (widget));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
ctree = GTK_CTREE (widget);
|
1998-10-16 15:00:05 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
GtkCTreeNode *child;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
node = GTK_CTREE_NODE (clist->row_list);
|
|
|
|
for (i = 0; i < clist->rows; i++)
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->children &&
|
|
|
|
!GTK_CTREE_ROW (node)->expanded)
|
|
|
|
for (child = GTK_CTREE_ROW (node)->children; child;
|
|
|
|
child = GTK_CTREE_ROW (child)->sibling)
|
|
|
|
gtk_ctree_pre_recursive(ctree, child, ctree_detach_styles, NULL);
|
|
|
|
node = GTK_CTREE_NODE_NEXT (node);
|
|
|
|
}
|
|
|
|
}
|
1998-07-25 01:10:58 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
gdk_gc_destroy (ctree->lines_gc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_ctree_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GtkCList *clist;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gint button_actions;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (widget);
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
button_actions = clist->button_actions[event->button - 1];
|
|
|
|
|
|
|
|
if (button_actions == GTK_BUTTON_IGNORED)
|
|
|
|
return FALSE;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
if (event->window == clist->clist_window)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint x;
|
|
|
|
gint y;
|
|
|
|
gint row;
|
|
|
|
gint column;
|
|
|
|
|
|
|
|
x = event->x;
|
|
|
|
y = event->y;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (!gtk_clist_get_selection_info (clist, x, y, &row, &column))
|
|
|
|
return FALSE;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (g_list_nth (clist->row_list, row));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (button_actions & GTK_BUTTON_EXPANDS &&
|
|
|
|
(GTK_CTREE_ROW (work)->children && !GTK_CTREE_ROW (work)->is_leaf &&
|
|
|
|
(event->type == GDK_2BUTTON_PRESS ||
|
|
|
|
ctree_is_hot_spot (ctree, work, row, x, y))))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (work)->expanded)
|
|
|
|
gtk_ctree_collapse (ctree, work);
|
|
|
|
else
|
|
|
|
gtk_ctree_expand (ctree, work);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
return FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
draw_drag_highlight (GtkCList *clist,
|
|
|
|
GtkCListRow *dest_row,
|
|
|
|
gint dest_row_number,
|
|
|
|
GtkCListDragPos drag_pos)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCTree *ctree;
|
|
|
|
GdkPoint points[4];
|
1998-05-01 13:20:55 +00:00
|
|
|
gint level;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gint i;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint y = 0;
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
ctree = GTK_CTREE (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
level = ((GtkCTreeRow *)(dest_row))->level;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
y = ROW_TOP_YPIXEL (clist, dest_row_number) - 1;
|
|
|
|
|
|
|
|
switch (drag_pos)
|
|
|
|
{
|
|
|
|
case GTK_CLIST_DRAG_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_AFTER:
|
|
|
|
y += clist->row_height + 1;
|
|
|
|
case GTK_CLIST_DRAG_BEFORE:
|
1998-05-01 23:45:18 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (clist->column[ctree->tree_column].visible)
|
|
|
|
switch (clist->column[ctree->tree_column].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
if (ctree->tree_column > 0)
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
COLUMN_LEFT_XPIXEL(clist, 0), y,
|
|
|
|
COLUMN_LEFT_XPIXEL(clist, ctree->tree_column - 1)+
|
|
|
|
clist->column[ctree->tree_column - 1].area.width,
|
|
|
|
y);
|
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) +
|
|
|
|
ctree->tree_indent * level -
|
|
|
|
(ctree->tree_indent - PM_SIZE) / 2, y,
|
|
|
|
GTK_WIDGET (ctree)->allocation.width, y);
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
if (ctree->tree_column < clist->columns - 1)
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
COLUMN_LEFT_XPIXEL(clist, ctree->tree_column + 1),
|
|
|
|
y,
|
|
|
|
COLUMN_LEFT_XPIXEL(clist, clist->columns - 1) +
|
|
|
|
clist->column[clist->columns - 1].area.width, y);
|
1998-05-01 23:45:18 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
0, y, COLUMN_LEFT_XPIXEL(clist, ctree->tree_column)
|
|
|
|
+ clist->column[ctree->tree_column].area.width -
|
|
|
|
ctree->tree_indent * level +
|
|
|
|
(ctree->tree_indent - PM_SIZE) / 2, y);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
1998-10-07 19:28:25 +00:00
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
0, y, clist->clist_window_width, y);
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_INTO:
|
|
|
|
y = ROW_TOP_YPIXEL (clist, dest_row_number) + clist->row_height;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (clist->column[ctree->tree_column].visible)
|
|
|
|
switch (clist->column[ctree->tree_column].justification)
|
1998-10-07 00:03:24 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) +
|
|
|
|
ctree->tree_indent * level - (ctree->tree_indent - PM_SIZE) / 2;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[0].y = y;
|
|
|
|
points[3].x = points[0].x;
|
|
|
|
points[3].y = y - clist->row_height - 1;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
points[1].x = clist->clist_window_width - 1;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[1].y = points[0].y;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
points[2].x = points[1].x;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[2].y = points[3].y;
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
1998-10-07 19:28:25 +00:00
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
points[i].x, points[i].y,
|
|
|
|
points[i+1].x, points[i+1].y);
|
|
|
|
|
|
|
|
if (ctree->tree_column > 0)
|
|
|
|
{
|
|
|
|
points[0].x = COLUMN_LEFT_XPIXEL(clist,
|
|
|
|
ctree->tree_column - 1) +
|
|
|
|
clist->column[ctree->tree_column - 1].area.width ;
|
|
|
|
points[0].y = y;
|
|
|
|
points[3].x = points[0].x;
|
|
|
|
points[3].y = y - clist->row_height - 1;
|
|
|
|
points[1].x = 0;
|
|
|
|
points[1].y = points[0].y;
|
|
|
|
points[2].x = 0;
|
|
|
|
points[2].y = points[3].y;
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
points[i].x, points[i].y, points[i+1].x,
|
|
|
|
points[i+1].y);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) -
|
|
|
|
ctree->tree_indent * level + (ctree->tree_indent - PM_SIZE) / 2 +
|
|
|
|
clist->column[ctree->tree_column].area.width;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[0].y = y;
|
|
|
|
points[3].x = points[0].x;
|
|
|
|
points[3].y = y - clist->row_height - 1;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
points[1].x = 0;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[1].y = points[0].y;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
points[2].x = 0;
|
1998-10-07 00:03:24 +00:00
|
|
|
points[2].y = points[3].y;
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
1998-10-07 19:28:25 +00:00
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
1998-10-07 00:03:24 +00:00
|
|
|
points[i].x, points[i].y,
|
|
|
|
points[i+1].x, points[i+1].y);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
if (ctree->tree_column < clist->columns - 1)
|
|
|
|
{
|
|
|
|
points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column +1);
|
|
|
|
points[0].y = y;
|
|
|
|
points[3].x = points[0].x;
|
|
|
|
points[3].y = y - clist->row_height - 1;
|
|
|
|
points[1].x = clist->clist_window_width - 1;
|
|
|
|
points[1].y = points[0].y;
|
|
|
|
points[2].x = points[1].x;
|
|
|
|
points[2].y = points[3].y;
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
points[i].x, points[i].y,
|
|
|
|
points[i+1].x, points[i+1].y);
|
|
|
|
}
|
|
|
|
break;
|
1998-10-07 00:03:24 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
0, y - clist->row_height,
|
|
|
|
clist->clist_window_width - 1, clist->row_height);
|
|
|
|
break;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
static gint
|
|
|
|
draw_cell_pixmap (GdkWindow *window,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkGC *fg_gc,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
gint xsrc = 0;
|
|
|
|
gint ysrc = 0;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
gdk_gc_set_clip_mask (fg_gc, mask);
|
|
|
|
gdk_gc_set_clip_origin (fg_gc, x, y);
|
|
|
|
}
|
|
|
|
if (x < clip_rectangle->x)
|
|
|
|
{
|
|
|
|
xsrc = clip_rectangle->x - x;
|
|
|
|
width -= xsrc;
|
|
|
|
x = clip_rectangle->x;
|
|
|
|
}
|
|
|
|
if (x + width > clip_rectangle->x + clip_rectangle->width)
|
|
|
|
width = clip_rectangle->x + clip_rectangle->width - x;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (y < clip_rectangle->y)
|
|
|
|
{
|
|
|
|
ysrc = clip_rectangle->y - y;
|
|
|
|
height -= ysrc;
|
|
|
|
y = clip_rectangle->y;
|
|
|
|
}
|
|
|
|
if (y + height > clip_rectangle->y + clip_rectangle->height)
|
|
|
|
height = clip_rectangle->y + clip_rectangle->height - y;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (width > 0 && height > 0)
|
|
|
|
gdk_draw_pixmap (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height);
|
|
|
|
|
|
|
|
gdk_gc_set_clip_origin (fg_gc, 0, 0);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
return x + MAX (width, 0);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
static void
|
|
|
|
get_cell_style (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint state,
|
|
|
|
gint column,
|
|
|
|
GtkStyle **style,
|
|
|
|
GdkGC **fg_gc,
|
|
|
|
GdkGC **bg_gc)
|
|
|
|
{
|
1998-12-16 00:52:46 +00:00
|
|
|
gint fg_state;
|
|
|
|
|
|
|
|
if ((state == GTK_STATE_NORMAL) &&
|
|
|
|
(GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE))
|
|
|
|
fg_state = GTK_STATE_INSENSITIVE;
|
|
|
|
else
|
|
|
|
fg_state = state;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (clist_row->cell[column].style)
|
|
|
|
{
|
|
|
|
if (style)
|
|
|
|
*style = clist_row->cell[column].style;
|
|
|
|
if (fg_gc)
|
1998-12-16 00:52:46 +00:00
|
|
|
*fg_gc = clist_row->cell[column].style->fg_gc[fg_state];
|
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = clist_row->cell[column].style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = clist_row->cell[column].style->base_gc[state];
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
else if (clist_row->style)
|
|
|
|
{
|
|
|
|
if (style)
|
|
|
|
*style = clist_row->style;
|
|
|
|
if (fg_gc)
|
1998-12-16 00:52:46 +00:00
|
|
|
*fg_gc = clist_row->style->fg_gc[fg_state];
|
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = clist_row->style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = clist_row->style->base_gc[state];
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (style)
|
|
|
|
*style = GTK_WIDGET (clist)->style;
|
|
|
|
if (fg_gc)
|
1998-12-16 00:52:46 +00:00
|
|
|
*fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state];
|
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = GTK_WIDGET (clist)->style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
if (state != GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
if (fg_gc && clist_row->fg_set)
|
|
|
|
*fg_gc = clist->fg_gc;
|
|
|
|
if (bg_gc && clist_row->bg_set)
|
|
|
|
*bg_gc = clist->bg_gc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
static gint
|
|
|
|
gtk_ctree_draw_expander (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row,
|
|
|
|
GtkStyle *style,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
gint x)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GdkPoint points[3];
|
|
|
|
gint justification_factor;
|
|
|
|
gint y;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (ctree->expander_style == GTK_CTREE_EXPANDER_NONE)
|
|
|
|
return x;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT)
|
|
|
|
justification_factor = -1;
|
|
|
|
else
|
|
|
|
justification_factor = 1;
|
|
|
|
y = (clip_rectangle->y + (clip_rectangle->height - PM_SIZE) / 2 -
|
|
|
|
(clip_rectangle->height + 1) % 2);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!ctree_row->children)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
switch (ctree->expander_style)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_EXPANDER_NONE:
|
|
|
|
return x;
|
|
|
|
case GTK_CTREE_EXPANDER_TRIANGLE:
|
|
|
|
return x + justification_factor * (PM_SIZE + 3);
|
|
|
|
case GTK_CTREE_EXPANDER_SQUARE:
|
|
|
|
case GTK_CTREE_EXPANDER_CIRCULAR:
|
|
|
|
return x + justification_factor * (PM_SIZE + 1);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], clip_rectangle);
|
|
|
|
gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], clip_rectangle);
|
|
|
|
|
|
|
|
switch (ctree->expander_style)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
case GTK_CTREE_EXPANDER_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_TRIANGLE:
|
|
|
|
if (ctree_row->expanded)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
points[0].x = x;
|
|
|
|
points[0].y = y + (PM_SIZE + 2) / 6;
|
|
|
|
points[1].x = points[0].x + justification_factor * (PM_SIZE + 2);
|
|
|
|
points[1].y = points[0].y;
|
|
|
|
points[2].x = (points[0].x +
|
|
|
|
justification_factor * (PM_SIZE + 2) / 2);
|
|
|
|
points[2].y = y + 2 * (PM_SIZE + 2) / 3;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
points[0].x = x + justification_factor * ((PM_SIZE + 2) / 6 + 2);
|
|
|
|
points[0].y = y - 1;
|
|
|
|
points[1].x = points[0].x;
|
|
|
|
points[1].y = points[0].y + (PM_SIZE + 2);
|
|
|
|
points[2].x = (points[0].x +
|
|
|
|
justification_factor * (2 * (PM_SIZE + 2) / 3 - 1));
|
|
|
|
points[2].y = points[0].y + (PM_SIZE + 2) / 2;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_draw_polygon (clist->clist_window, style->base_gc[GTK_STATE_NORMAL],
|
|
|
|
TRUE, points, 3);
|
|
|
|
gdk_draw_polygon (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL],
|
|
|
|
FALSE, points, 3);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
x += justification_factor * (PM_SIZE + 3);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_SQUARE:
|
|
|
|
case GTK_CTREE_EXPANDER_CIRCULAR:
|
|
|
|
if (justification_factor == -1)
|
|
|
|
x += justification_factor * (PM_SIZE + 1);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (ctree->expander_style == GTK_CTREE_EXPANDER_CIRCULAR)
|
|
|
|
{
|
|
|
|
gdk_draw_arc (clist->clist_window, style->base_gc[GTK_STATE_NORMAL],
|
|
|
|
TRUE, x, y, PM_SIZE, PM_SIZE, 0, 360 * 64);
|
|
|
|
gdk_draw_arc (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL],
|
|
|
|
FALSE, x, y, PM_SIZE, PM_SIZE, 0, 360 * 64);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
else
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
|
|
|
style->base_gc[GTK_STATE_NORMAL], TRUE,
|
|
|
|
x, y, PM_SIZE, PM_SIZE);
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
|
|
|
style->fg_gc[GTK_STATE_NORMAL], FALSE,
|
|
|
|
x, y, PM_SIZE, PM_SIZE);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL],
|
|
|
|
x + 2, y + PM_SIZE / 2, x + PM_SIZE - 2, y + PM_SIZE / 2);
|
|
|
|
|
|
|
|
if (!ctree_row->expanded)
|
|
|
|
gdk_draw_line (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL],
|
|
|
|
x + PM_SIZE / 2, y + 2,
|
|
|
|
x + PM_SIZE / 2, y + PM_SIZE - 2);
|
|
|
|
|
|
|
|
if (justification_factor == 1)
|
|
|
|
x += justification_factor * (PM_SIZE + 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], NULL);
|
|
|
|
gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], NULL);
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_ctree_draw_lines (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gint state,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkRectangle *cell_rectangle,
|
|
|
|
GdkRectangle *crect,
|
|
|
|
GdkRectangle *area,
|
|
|
|
GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
GtkCTreeNode *parent;
|
|
|
|
GdkRectangle tree_rectangle;
|
|
|
|
GdkRectangle tc_rectangle;
|
|
|
|
GdkGC *bg_gc;
|
|
|
|
gint offset;
|
|
|
|
gint offset_x;
|
|
|
|
gint offset_y;
|
|
|
|
gint xcenter;
|
|
|
|
gint ycenter;
|
|
|
|
gint next_level;
|
|
|
|
gint column_right;
|
|
|
|
gint column_left;
|
|
|
|
gint justify_right;
|
|
|
|
gint justification_factor;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
ycenter = clip_rectangle->y + (clip_rectangle->height / 2);
|
|
|
|
justify_right = (clist->column[column].justification == GTK_JUSTIFY_RIGHT);
|
|
|
|
|
|
|
|
if (justify_right)
|
|
|
|
{
|
|
|
|
offset = (clip_rectangle->x + clip_rectangle->width - 1 -
|
|
|
|
ctree->tree_indent * (ctree_row->level - 1));
|
|
|
|
justification_factor = -1;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
offset = clip_rectangle->x + ctree->tree_indent * (ctree_row->level - 1);
|
|
|
|
justification_factor = 1;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
switch (ctree->line_style)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
case GTK_CTREE_LINES_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_LINES_TABBED:
|
|
|
|
xcenter = offset + justification_factor * TAB_SIZE;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
column_right = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) +
|
|
|
|
clist->column[ctree->tree_column].area.width +
|
|
|
|
COLUMN_INSET);
|
|
|
|
column_left = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) -
|
|
|
|
COLUMN_INSET - CELL_SPACING);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (area)
|
1998-06-22 17:00:21 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.y = crect->y;
|
|
|
|
tree_rectangle.height = crect->height;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (justify_right)
|
1998-06-22 17:00:21 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.x = xcenter;
|
|
|
|
tree_rectangle.width = column_right - xcenter;
|
1998-06-22 17:00:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.x = column_left;
|
|
|
|
tree_rectangle.width = xcenter - column_left;
|
1998-06-22 17:00:21 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!gdk_rectangle_intersect (area, &tree_rectangle, &tc_rectangle))
|
1998-06-22 17:00:21 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
offset += justification_factor * 3;
|
|
|
|
break;
|
1998-06-22 17:00:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_gc_set_clip_rectangle (ctree->lines_gc, crect);
|
|
|
|
|
|
|
|
next_level = ctree_row->level;
|
|
|
|
|
|
|
|
if (!ctree_row->sibling || (ctree_row->children && ctree_row->expanded))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
node = gtk_ctree_find_node_ptr (ctree, ctree_row);
|
|
|
|
if (GTK_CTREE_NODE_NEXT (node))
|
|
|
|
next_level = GTK_CTREE_ROW (GTK_CTREE_NODE_NEXT (node))->level;
|
|
|
|
else
|
|
|
|
next_level = 0;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
if (ctree->tree_indent > 0)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
node = ctree_row->parent;
|
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
xcenter -= (justification_factor * ctree->tree_indent);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if ((justify_right && xcenter < column_left) ||
|
|
|
|
(!justify_right && xcenter > column_right))
|
|
|
|
{
|
|
|
|
node = GTK_CTREE_ROW (node)->parent;
|
|
|
|
continue;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.y = cell_rectangle->y;
|
|
|
|
tree_rectangle.height = cell_rectangle->height;
|
|
|
|
if (justify_right)
|
|
|
|
{
|
|
|
|
tree_rectangle.x = MAX (xcenter - ctree->tree_indent + 1,
|
|
|
|
column_left);
|
|
|
|
tree_rectangle.width = MIN (xcenter - column_left,
|
|
|
|
ctree->tree_indent);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tree_rectangle.x = xcenter;
|
|
|
|
tree_rectangle.width = MIN (column_right - xcenter,
|
|
|
|
ctree->tree_indent);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!area || gdk_rectangle_intersect (area, &tree_rectangle,
|
|
|
|
&tc_rectangle))
|
|
|
|
{
|
|
|
|
get_cell_style (clist, >K_CTREE_ROW (node)->row,
|
|
|
|
state, column, NULL, NULL, &bg_gc);
|
|
|
|
|
|
|
|
if (bg_gc == clist->bg_gc)
|
|
|
|
gdk_gc_set_foreground
|
|
|
|
(clist->bg_gc, >K_CTREE_ROW (node)->row.background);
|
|
|
|
|
|
|
|
if (!area)
|
|
|
|
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
|
|
|
|
tree_rectangle.x,
|
|
|
|
tree_rectangle.y,
|
|
|
|
tree_rectangle.width,
|
|
|
|
tree_rectangle.height);
|
|
|
|
else
|
|
|
|
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
|
|
|
|
tc_rectangle.x,
|
|
|
|
tc_rectangle.y,
|
|
|
|
tc_rectangle.width,
|
|
|
|
tc_rectangle.height);
|
|
|
|
}
|
|
|
|
if (next_level > GTK_CTREE_ROW (node)->level)
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
xcenter, crect->y,
|
|
|
|
xcenter, crect->y + crect->height);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint width;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
offset_x = MIN (ctree->tree_indent, 2 * TAB_SIZE);
|
|
|
|
width = offset_x / 2 + offset_x % 2;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
parent = GTK_CTREE_ROW (node)->parent;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.y = ycenter;
|
|
|
|
tree_rectangle.height = (cell_rectangle->y - ycenter +
|
|
|
|
cell_rectangle->height);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (justify_right)
|
|
|
|
{
|
|
|
|
tree_rectangle.x = MAX(xcenter + 1 - width, column_left);
|
|
|
|
tree_rectangle.width = MIN (xcenter + 1 - column_left,
|
|
|
|
width);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tree_rectangle.x = xcenter;
|
|
|
|
tree_rectangle.width = MIN (column_right - xcenter,
|
|
|
|
width);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!area ||
|
|
|
|
gdk_rectangle_intersect (area, &tree_rectangle,
|
|
|
|
&tc_rectangle))
|
|
|
|
{
|
|
|
|
if (parent)
|
|
|
|
{
|
|
|
|
get_cell_style (clist, >K_CTREE_ROW (parent)->row,
|
|
|
|
state, column, NULL, NULL, &bg_gc);
|
|
|
|
if (bg_gc == clist->bg_gc)
|
|
|
|
gdk_gc_set_foreground
|
|
|
|
(clist->bg_gc,
|
|
|
|
>K_CTREE_ROW (parent)->row.background);
|
|
|
|
}
|
|
|
|
else if (state == GTK_STATE_SELECTED)
|
1998-12-16 00:52:46 +00:00
|
|
|
bg_gc = style->base_gc[state];
|
1998-10-16 15:00:05 +00:00
|
|
|
else
|
1998-12-16 00:52:46 +00:00
|
|
|
bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
if (!area)
|
|
|
|
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
|
|
|
|
tree_rectangle.x,
|
|
|
|
tree_rectangle.y,
|
|
|
|
tree_rectangle.width,
|
|
|
|
tree_rectangle.height);
|
|
|
|
else
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
|
|
|
bg_gc, TRUE,
|
|
|
|
tc_rectangle.x,
|
|
|
|
tc_rectangle.y,
|
|
|
|
tc_rectangle.width,
|
|
|
|
tc_rectangle.height);
|
|
|
|
}
|
|
|
|
|
|
|
|
get_cell_style (clist, >K_CTREE_ROW (node)->row,
|
|
|
|
state, column, NULL, NULL, &bg_gc);
|
|
|
|
if (bg_gc == clist->bg_gc)
|
|
|
|
gdk_gc_set_foreground
|
|
|
|
(clist->bg_gc, >K_CTREE_ROW (node)->row.background);
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (bg_gc, crect);
|
|
|
|
gdk_draw_arc (clist->clist_window, bg_gc, TRUE,
|
|
|
|
xcenter - (justify_right * offset_x),
|
|
|
|
cell_rectangle->y,
|
|
|
|
offset_x, clist->row_height,
|
|
|
|
(180 + (justify_right * 90)) * 64, 90 * 64);
|
|
|
|
gdk_gc_set_clip_rectangle (bg_gc, NULL);
|
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
xcenter, cell_rectangle->y, xcenter, ycenter);
|
|
|
|
|
|
|
|
if (justify_right)
|
|
|
|
gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE,
|
|
|
|
xcenter - offset_x, cell_rectangle->y,
|
|
|
|
offset_x, clist->row_height,
|
|
|
|
270 * 64, 90 * 64);
|
|
|
|
else
|
|
|
|
gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE,
|
|
|
|
xcenter, cell_rectangle->y,
|
|
|
|
offset_x, clist->row_height,
|
|
|
|
180 * 64, 90 * 64);
|
|
|
|
}
|
|
|
|
node = GTK_CTREE_ROW (node)->parent;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (state != GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
tree_rectangle.y = clip_rectangle->y;
|
|
|
|
tree_rectangle.height = clip_rectangle->height;
|
|
|
|
tree_rectangle.width = COLUMN_INSET + CELL_SPACING +
|
|
|
|
MIN (clist->column[ctree->tree_column].area.width + COLUMN_INSET,
|
|
|
|
TAB_SIZE);
|
|
|
|
|
|
|
|
if (justify_right)
|
|
|
|
tree_rectangle.x = MAX (xcenter + 1, column_left);
|
|
|
|
else
|
|
|
|
tree_rectangle.x = column_left;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!area)
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
|
|
|
GTK_WIDGET
|
1998-12-16 00:52:46 +00:00
|
|
|
(ctree)->style->base_gc[GTK_STATE_NORMAL],
|
1998-10-16 15:00:05 +00:00
|
|
|
TRUE,
|
|
|
|
tree_rectangle.x,
|
|
|
|
tree_rectangle.y,
|
|
|
|
tree_rectangle.width,
|
|
|
|
tree_rectangle.height);
|
|
|
|
else if (gdk_rectangle_intersect (area, &tree_rectangle,
|
|
|
|
&tc_rectangle))
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
|
|
|
GTK_WIDGET
|
1998-12-16 00:52:46 +00:00
|
|
|
(ctree)->style->base_gc[GTK_STATE_NORMAL],
|
1998-10-16 15:00:05 +00:00
|
|
|
TRUE,
|
|
|
|
tc_rectangle.x,
|
|
|
|
tc_rectangle.y,
|
|
|
|
tc_rectangle.width,
|
|
|
|
tc_rectangle.height);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
xcenter = offset + (justification_factor * ctree->tree_indent / 2);
|
|
|
|
|
|
|
|
get_cell_style (clist, &ctree_row->row, state, column, NULL, NULL,
|
|
|
|
&bg_gc);
|
|
|
|
if (bg_gc == clist->bg_gc)
|
|
|
|
gdk_gc_set_foreground (clist->bg_gc, &ctree_row->row.background);
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (bg_gc, crect);
|
|
|
|
if (ctree_row->is_leaf)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
GdkPoint points[6];
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
points[0].x = offset + justification_factor * TAB_SIZE;
|
|
|
|
points[0].y = cell_rectangle->y;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
points[1].x = points[0].x - justification_factor * 4;
|
|
|
|
points[1].y = points[0].y;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
points[2].x = points[1].x - justification_factor * 2;
|
|
|
|
points[2].y = points[1].y + 3;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
points[3].x = points[2].x;
|
|
|
|
points[3].y = points[2].y + clist->row_height - 5;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
points[4].x = points[3].x + justification_factor * 2;
|
|
|
|
points[4].y = points[3].y + 3;
|
|
|
|
|
|
|
|
points[5].x = points[4].x + justification_factor * 4;
|
|
|
|
points[5].y = points[4].y;
|
|
|
|
|
|
|
|
gdk_draw_polygon (clist->clist_window, bg_gc, TRUE, points, 6);
|
|
|
|
gdk_draw_lines (clist->clist_window, ctree->lines_gc, points, 6);
|
|
|
|
}
|
|
|
|
else
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_draw_arc (clist->clist_window, bg_gc, TRUE,
|
|
|
|
offset - (justify_right * 2 * TAB_SIZE),
|
|
|
|
cell_rectangle->y,
|
|
|
|
2 * TAB_SIZE, clist->row_height,
|
|
|
|
(90 + (180 * justify_right)) * 64, 180 * 64);
|
|
|
|
gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE,
|
|
|
|
offset - (justify_right * 2 * TAB_SIZE),
|
|
|
|
cell_rectangle->y,
|
|
|
|
2 * TAB_SIZE, clist->row_height,
|
|
|
|
(90 + (180 * justify_right)) * 64, 180 * 64);
|
|
|
|
}
|
|
|
|
gdk_gc_set_clip_rectangle (bg_gc, NULL);
|
|
|
|
gdk_gc_set_clip_rectangle (ctree->lines_gc, NULL);
|
1998-05-01 23:45:18 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
offset += justification_factor * 3;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xcenter = offset + justification_factor * PM_SIZE / 2;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (area)
|
|
|
|
{
|
|
|
|
tree_rectangle.y = crect->y;
|
|
|
|
tree_rectangle.height = crect->height;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (justify_right)
|
1998-05-01 23:45:18 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.x = xcenter - PM_SIZE / 2 - 2;
|
|
|
|
tree_rectangle.width = (clip_rectangle->x +
|
|
|
|
clip_rectangle->width -tree_rectangle.x);
|
1998-05-01 23:45:18 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
else
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_rectangle.x = clip_rectangle->x + PM_SIZE / 2;
|
|
|
|
tree_rectangle.width = (xcenter + PM_SIZE / 2 + 2 -
|
|
|
|
clip_rectangle->x);
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!gdk_rectangle_intersect (area, &tree_rectangle, &tc_rectangle))
|
|
|
|
break;
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
offset_x = 1;
|
|
|
|
offset_y = 0;
|
|
|
|
if (ctree->line_style == GTK_CTREE_LINES_DOTTED)
|
|
|
|
{
|
|
|
|
offset_x += abs((clip_rectangle->x + clist->hoffset) % 2);
|
|
|
|
offset_y = abs((cell_rectangle->y + clist->voffset) % 2);
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
clip_rectangle->y--;
|
|
|
|
clip_rectangle->height++;
|
|
|
|
gdk_gc_set_clip_rectangle (ctree->lines_gc, clip_rectangle);
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
xcenter,
|
|
|
|
(ctree->show_stub || clist->row_list->data != ctree_row) ?
|
|
|
|
cell_rectangle->y + offset_y : ycenter,
|
|
|
|
xcenter,
|
|
|
|
(ctree_row->sibling) ? crect->y +crect->height : ycenter);
|
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
xcenter + (justification_factor * offset_x), ycenter,
|
|
|
|
xcenter + (justification_factor * (PM_SIZE / 2 + 2)),
|
|
|
|
ycenter);
|
|
|
|
|
|
|
|
node = ctree_row->parent;
|
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
xcenter -= (justification_factor * ctree->tree_indent);
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->sibling)
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
xcenter, cell_rectangle->y + offset_y,
|
|
|
|
xcenter, crect->y + crect->height);
|
|
|
|
node = GTK_CTREE_ROW (node)->parent;
|
|
|
|
}
|
|
|
|
gdk_gc_set_clip_rectangle (ctree->lines_gc, NULL);
|
|
|
|
clip_rectangle->y++;
|
|
|
|
clip_rectangle->height--;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
static void
|
|
|
|
draw_row (GtkCList *clist,
|
|
|
|
GdkRectangle *area,
|
|
|
|
gint row,
|
|
|
|
GtkCListRow *clist_row)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GdkRectangle *rect;
|
|
|
|
GdkRectangle *crect;
|
|
|
|
GdkRectangle row_rectangle;
|
|
|
|
GdkRectangle cell_rectangle;
|
|
|
|
GdkRectangle clip_rectangle;
|
|
|
|
GdkRectangle intersect_rectangle;
|
1999-02-06 00:21:56 +00:00
|
|
|
gint last_column;
|
1998-10-16 15:00:05 +00:00
|
|
|
gint column_left = 0;
|
|
|
|
gint column_right = 0;
|
|
|
|
gint offset = 0;
|
|
|
|
gint state;
|
|
|
|
gint i;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* bail now if we arn't drawable yet */
|
|
|
|
if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-05-01 23:45:18 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
widget = GTK_WIDGET (clist);
|
|
|
|
ctree = GTK_CTREE (clist);
|
1998-05-01 23:45:18 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* if the function is passed the pointer to the row instead of null,
|
|
|
|
* it avoids this expensive lookup */
|
|
|
|
if (!clist_row)
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
/* rectangle of the entire row */
|
|
|
|
row_rectangle.x = 0;
|
|
|
|
row_rectangle.y = ROW_TOP_YPIXEL (clist, row);
|
|
|
|
row_rectangle.width = clist->clist_window_width;
|
|
|
|
row_rectangle.height = clist->row_height;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* rectangle of the cell spacing above the row */
|
|
|
|
cell_rectangle.x = 0;
|
|
|
|
cell_rectangle.y = row_rectangle.y - CELL_SPACING;
|
|
|
|
cell_rectangle.width = row_rectangle.width;
|
|
|
|
cell_rectangle.height = CELL_SPACING;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* rectangle used to clip drawing operations, it's y and height
|
|
|
|
* positions only need to be set once, so we set them once here.
|
|
|
|
* the x and width are set withing the drawing loop below once per
|
|
|
|
* column */
|
|
|
|
clip_rectangle.y = row_rectangle.y;
|
|
|
|
clip_rectangle.height = row_rectangle.height;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (clist_row->state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
if (clist_row->fg_set)
|
|
|
|
gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground);
|
|
|
|
if (clist_row->bg_set)
|
|
|
|
gdk_gc_set_foreground (clist->bg_gc, &clist_row->background);
|
|
|
|
}
|
1998-12-16 00:52:46 +00:00
|
|
|
|
|
|
|
state = clist_row->state;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_gc_set_foreground (ctree->lines_gc,
|
|
|
|
&widget->style->fg[clist_row->state]);
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* draw the cell borders */
|
|
|
|
if (area)
|
|
|
|
{
|
|
|
|
rect = &intersect_rectangle;
|
|
|
|
crect = &intersect_rectangle;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (gdk_rectangle_intersect (area, &cell_rectangle, crect))
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE], TRUE,
|
1998-10-16 15:00:05 +00:00
|
|
|
crect->x, crect->y, crect->width, crect->height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rect = &clip_rectangle;
|
|
|
|
crect = &cell_rectangle;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE], TRUE,
|
1998-10-16 15:00:05 +00:00
|
|
|
crect->x, crect->y, crect->width, crect->height);
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* horizontal black lines */
|
|
|
|
if (ctree->line_style == GTK_CTREE_LINES_TABBED)
|
|
|
|
{
|
|
|
|
|
|
|
|
column_right = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) +
|
|
|
|
clist->column[ctree->tree_column].area.width +
|
|
|
|
COLUMN_INSET);
|
|
|
|
column_left = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) -
|
|
|
|
COLUMN_INSET - (ctree->tree_column != 0) * CELL_SPACING);
|
|
|
|
|
|
|
|
switch (clist->column[ctree->tree_column].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
offset = (column_left + ctree->tree_indent *
|
|
|
|
(((GtkCTreeRow *)clist_row)->level - 1));
|
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
MIN (offset + TAB_SIZE, column_right),
|
|
|
|
cell_rectangle.y,
|
|
|
|
clist->clist_window_width, cell_rectangle.y);
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
offset = (column_right - 1 - ctree->tree_indent *
|
|
|
|
(((GtkCTreeRow *)clist_row)->level - 1));
|
|
|
|
|
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
|
|
|
-1, cell_rectangle.y,
|
|
|
|
MAX (offset - TAB_SIZE, column_left),
|
|
|
|
cell_rectangle.y);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* the last row has to clear it's bottom cell spacing too */
|
|
|
|
if (clist_row == clist->row_list_end->data)
|
|
|
|
{
|
|
|
|
cell_rectangle.y += clist->row_height + CELL_SPACING;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!area || gdk_rectangle_intersect (area, &cell_rectangle, crect))
|
|
|
|
{
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE], TRUE,
|
1998-10-16 15:00:05 +00:00
|
|
|
crect->x, crect->y, crect->width, crect->height);
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* horizontal black lines */
|
|
|
|
if (ctree->line_style == GTK_CTREE_LINES_TABBED)
|
|
|
|
{
|
|
|
|
switch (clist->column[ctree->tree_column].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
1998-05-01 23:45:18 +00:00
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
1998-10-16 15:00:05 +00:00
|
|
|
MIN (column_left + TAB_SIZE + COLUMN_INSET +
|
|
|
|
(((GtkCTreeRow *)clist_row)->level > 1) *
|
|
|
|
MIN (ctree->tree_indent / 2, TAB_SIZE),
|
|
|
|
column_right),
|
|
|
|
cell_rectangle.y,
|
|
|
|
clist->clist_window_width, cell_rectangle.y);
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
1998-05-01 23:45:18 +00:00
|
|
|
gdk_draw_line (clist->clist_window, ctree->lines_gc,
|
1998-10-16 15:00:05 +00:00
|
|
|
-1, cell_rectangle.y,
|
|
|
|
MAX (column_right - TAB_SIZE - 1 -
|
|
|
|
COLUMN_INSET -
|
|
|
|
(((GtkCTreeRow *)clist_row)->level > 1) *
|
|
|
|
MIN (ctree->tree_indent / 2, TAB_SIZE),
|
|
|
|
column_left - 1), cell_rectangle.y);
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-22 17:00:21 +00:00
|
|
|
|
1999-02-06 00:21:56 +00:00
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--)
|
|
|
|
;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* iterate and draw all the columns (row cells) and draw their contents */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
GdkGC *fg_gc;
|
|
|
|
GdkGC *bg_gc;
|
1998-05-01 23:45:18 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
gint pixmap_width;
|
|
|
|
gint string_width;
|
|
|
|
gint old_offset;
|
|
|
|
gint row_center_offset;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!clist->column[i].visible)
|
|
|
|
continue;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
get_cell_style (clist, clist_row, state, i, &style, &fg_gc, &bg_gc);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* calculate clipping region */
|
|
|
|
clip_rectangle.x = clist->column[i].area.x + clist->hoffset;
|
|
|
|
clip_rectangle.width = clist->column[i].area.width;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
cell_rectangle.x = clip_rectangle.x - COLUMN_INSET - CELL_SPACING;
|
|
|
|
cell_rectangle.width = (clip_rectangle.width + 2 * COLUMN_INSET +
|
1999-02-06 00:21:56 +00:00
|
|
|
(1 + (i == last_column)) * CELL_SPACING);
|
1998-10-16 15:00:05 +00:00
|
|
|
cell_rectangle.y = clip_rectangle.y;
|
|
|
|
cell_rectangle.height = clip_rectangle.height;
|
|
|
|
|
|
|
|
string_width = 0;
|
|
|
|
pixmap_width = 0;
|
|
|
|
|
|
|
|
if (area && !gdk_rectangle_intersect (area, &cell_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
{
|
|
|
|
if (i != ctree->tree_column)
|
|
|
|
continue;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
|
|
|
|
crect->x, crect->y, crect->width, crect->height);
|
|
|
|
|
|
|
|
/* calculate real width for column justification */
|
1998-05-01 13:20:55 +00:00
|
|
|
switch (clist_row->cell[i].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_TEXT:
|
1998-10-16 15:00:05 +00:00
|
|
|
width = gdk_string_width
|
|
|
|
(style->font, GTK_CELL_TEXT (clist_row->cell[i])->text);
|
1998-05-01 13:20:55 +00:00
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_window_get_size
|
|
|
|
(GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap, &pixmap_width,
|
|
|
|
&height);
|
|
|
|
width = pixmap_width;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap)
|
|
|
|
gdk_window_get_size
|
|
|
|
(GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
|
|
|
|
&pixmap_width, &height);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1999-01-18 00:36:33 +00:00
|
|
|
width = pixmap_width;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->text)
|
1998-06-10 21:48:21 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
string_width = gdk_string_width
|
|
|
|
(style->font, GTK_CELL_PIXTEXT (clist_row->cell[i])->text);
|
|
|
|
width += string_width;
|
1998-06-10 21:48:21 +00:00
|
|
|
}
|
|
|
|
|
1999-01-18 00:36:33 +00:00
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->text &&
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap)
|
|
|
|
width += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (i == ctree->tree_column)
|
|
|
|
width += (ctree->tree_indent *
|
|
|
|
((GtkCTreeRow *)clist_row)->level);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
switch (clist->column[i].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
offset = clip_rectangle.x + clist_row->cell[i].horizontal;
|
1998-05-01 13:20:55 +00:00
|
|
|
break;
|
1998-10-16 15:00:05 +00:00
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
offset = (clip_rectangle.x + clist_row->cell[i].horizontal +
|
|
|
|
clip_rectangle.width - width);
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
offset = (clip_rectangle.x + clist_row->cell[i].horizontal +
|
|
|
|
(clip_rectangle.width / 2) - (width / 2));
|
|
|
|
break;
|
|
|
|
};
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (i != ctree->tree_column)
|
|
|
|
{
|
|
|
|
offset += clist_row->cell[i].horizontal;
|
|
|
|
switch (clist_row->cell[i].type)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
draw_cell_pixmap
|
|
|
|
(clist->clist_window, &clip_rectangle, fg_gc,
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap,
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[i])->mask,
|
|
|
|
offset,
|
|
|
|
clip_rectangle.y + clist_row->cell[i].vertical +
|
|
|
|
(clip_rectangle.height - height) / 2,
|
|
|
|
pixmap_width, height);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
offset = draw_cell_pixmap
|
|
|
|
(clist->clist_window, &clip_rectangle, fg_gc,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->mask,
|
|
|
|
offset,
|
|
|
|
clip_rectangle.y + clist_row->cell[i].vertical +
|
|
|
|
(clip_rectangle.height - height) / 2,
|
|
|
|
pixmap_width, height);
|
|
|
|
offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing;
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
if (style != GTK_WIDGET (clist)->style)
|
|
|
|
row_center_offset = (((clist->row_height -
|
|
|
|
style->font->ascent -
|
|
|
|
style->font->descent - 1) / 2) +
|
|
|
|
1.5 + style->font->ascent);
|
|
|
|
else
|
|
|
|
row_center_offset = clist->row_center_offset;
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle);
|
|
|
|
gdk_draw_string
|
|
|
|
(clist->clist_window, style->font, fg_gc,
|
|
|
|
offset,
|
|
|
|
row_rectangle.y + row_center_offset +
|
|
|
|
clist_row->cell[i].vertical,
|
|
|
|
(clist_row->cell[i].type == GTK_CELL_PIXTEXT) ?
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->text :
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[i])->text);
|
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (bg_gc == clist->bg_gc)
|
|
|
|
gdk_gc_set_background (ctree->lines_gc, &clist_row->background);
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* draw ctree->tree_column */
|
|
|
|
cell_rectangle.y -= CELL_SPACING;
|
|
|
|
cell_rectangle.height += CELL_SPACING;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (area && !gdk_rectangle_intersect (area, &cell_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
continue;
|
1998-06-10 21:48:21 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* draw lines */
|
|
|
|
offset = gtk_ctree_draw_lines (ctree, (GtkCTreeRow *)clist_row, row, i,
|
|
|
|
state, &clip_rectangle, &cell_rectangle,
|
|
|
|
crect, area, style);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
/* draw expander */
|
|
|
|
offset = gtk_ctree_draw_expander (ctree, (GtkCTreeRow *)clist_row,
|
|
|
|
style, &clip_rectangle, offset);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (clist->column[i].justification == GTK_JUSTIFY_RIGHT)
|
|
|
|
offset -= ctree->tree_spacing;
|
|
|
|
else
|
|
|
|
offset += ctree->tree_spacing;
|
|
|
|
|
|
|
|
if (clist->column[i].justification == GTK_JUSTIFY_RIGHT)
|
|
|
|
offset -= (pixmap_width + clist_row->cell[i].horizontal);
|
|
|
|
else
|
|
|
|
offset += clist_row->cell[i].horizontal;
|
|
|
|
|
|
|
|
old_offset = offset;
|
|
|
|
offset = draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->mask,
|
|
|
|
offset,
|
|
|
|
clip_rectangle.y + clist_row->cell[i].vertical
|
|
|
|
+ (clip_rectangle.height - height) / 2,
|
|
|
|
pixmap_width, height);
|
|
|
|
|
|
|
|
if (string_width)
|
|
|
|
{
|
|
|
|
if (clist->column[i].justification == GTK_JUSTIFY_RIGHT)
|
1999-01-18 00:36:33 +00:00
|
|
|
{
|
|
|
|
offset = (old_offset - string_width);
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap)
|
|
|
|
offset -= GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing;
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
else
|
1999-01-18 00:36:33 +00:00
|
|
|
{
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap)
|
|
|
|
offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing;
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
if (style != GTK_WIDGET (clist)->style)
|
|
|
|
row_center_offset = (((clist->row_height - style->font->ascent -
|
|
|
|
style->font->descent - 1) / 2) +
|
|
|
|
1.5 + style->font->ascent);
|
|
|
|
else
|
|
|
|
row_center_offset = clist->row_center_offset;
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle);
|
|
|
|
gdk_draw_string (clist->clist_window, style->font, fg_gc, offset,
|
|
|
|
row_rectangle.y + row_center_offset +
|
|
|
|
clist_row->cell[i].vertical,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->text);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
/* draw focus rectangle */
|
1999-02-08 21:03:54 +00:00
|
|
|
if (clist->focus_row == row &&
|
|
|
|
GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS (widget))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!area)
|
1998-07-15 23:40:00 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
row_rectangle.x, row_rectangle.y,
|
|
|
|
row_rectangle.width - 1, row_rectangle.height - 1);
|
1998-10-16 15:00:05 +00:00
|
|
|
else if (gdk_rectangle_intersect (area, &row_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
{
|
|
|
|
gdk_gc_set_clip_rectangle (clist->xor_gc, &intersect_rectangle);
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
row_rectangle.x, row_rectangle.y,
|
|
|
|
row_rectangle.width - 1,
|
|
|
|
row_rectangle.height - 1);
|
|
|
|
gdk_gc_set_clip_rectangle (clist->xor_gc, NULL);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && gtk_ctree_is_viewable (ctree, node))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint num = 0;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (clist->row_list);
|
1998-08-17 23:48:04 +00:00
|
|
|
while (work && work != node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
1998-05-01 13:20:55 +00:00
|
|
|
num++;
|
|
|
|
}
|
1998-08-17 23:48:04 +00:00
|
|
|
if (work && gtk_clist_row_is_visible (clist, num) != GTK_VISIBILITY_NONE)
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row
|
|
|
|
(clist, NULL, num, GTK_CLIST_ROW ((GList *) node));
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
static GtkCTreeNode *
|
|
|
|
gtk_ctree_last_visible (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (!node)
|
1998-05-01 13:20:55 +00:00
|
|
|
return NULL;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (!work || !GTK_CTREE_ROW (node)->expanded)
|
|
|
|
return node;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
while (GTK_CTREE_ROW (work)->sibling)
|
|
|
|
work = GTK_CTREE_ROW (work)->sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
return gtk_ctree_last_visible (ctree, work);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_link (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode *sibling,
|
|
|
|
gboolean update_focus_row)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-10-02 23:45:09 +00:00
|
|
|
GList *list_end;
|
|
|
|
GList *list;
|
|
|
|
GList *work;
|
1998-07-15 23:40:00 +00:00
|
|
|
gboolean visible = FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint rows = 0;
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (sibling)
|
|
|
|
g_return_if_fail (GTK_CTREE_ROW (sibling)->parent == parent);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
g_return_if_fail (node != sibling);
|
|
|
|
g_return_if_fail (node != parent);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
for (rows = 1, list_end = (GList *)node; list_end->next;
|
|
|
|
list_end = list_end->next)
|
1998-05-01 13:20:55 +00:00
|
|
|
rows++;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->parent = parent;
|
|
|
|
GTK_CTREE_ROW (node)->sibling = sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (!parent || (parent && (gtk_ctree_is_viewable (ctree, parent) &&
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_CTREE_ROW (parent)->expanded)))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
visible = TRUE;
|
|
|
|
clist->rows += rows;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-02 23:45:09 +00:00
|
|
|
|
|
|
|
if (parent)
|
|
|
|
work = (GList *)(GTK_CTREE_ROW (parent)->children);
|
|
|
|
else
|
|
|
|
work = clist->row_list;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (sibling)
|
|
|
|
{
|
1998-10-02 23:45:09 +00:00
|
|
|
if (work != (GList *)sibling)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
while (GTK_CTREE_ROW (work)->sibling != sibling)
|
1998-10-02 23:45:09 +00:00
|
|
|
work = (GList *)(GTK_CTREE_ROW (work)->sibling);
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (work)->sibling = node;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (sibling == GTK_CTREE_NODE (clist->row_list))
|
1998-08-17 23:48:04 +00:00
|
|
|
clist->row_list = (GList *) node;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (GTK_CTREE_NODE_PREV (sibling) &&
|
|
|
|
GTK_CTREE_NODE_NEXT (GTK_CTREE_NODE_PREV (sibling)) == sibling)
|
1998-10-02 23:45:09 +00:00
|
|
|
{
|
|
|
|
list = (GList *)GTK_CTREE_NODE_PREV (sibling);
|
|
|
|
list->next = (GList *)node;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->prev = (GList *)GTK_CTREE_NODE_PREV (sibling);
|
|
|
|
list_end->next = (GList *)sibling;
|
|
|
|
list = (GList *)sibling;
|
|
|
|
list->prev = list_end;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (parent && GTK_CTREE_ROW (parent)->children == sibling)
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (parent)->children = node;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (work)
|
|
|
|
{
|
|
|
|
/* find sibling */
|
|
|
|
while (GTK_CTREE_ROW (work)->sibling)
|
1998-10-02 23:45:09 +00:00
|
|
|
work = (GList *)(GTK_CTREE_ROW (work)->sibling);
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (work)->sibling = node;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/* find last visible child of sibling */
|
1998-10-02 23:45:09 +00:00
|
|
|
work = (GList *) gtk_ctree_last_visible (ctree,
|
|
|
|
GTK_CTREE_NODE (work));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
list_end->next = work->next;
|
|
|
|
if (work->next)
|
|
|
|
list = work->next->prev = list_end;
|
|
|
|
work->next = (GList *)node;
|
|
|
|
list = (GList *)node;
|
|
|
|
list->prev = work;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (parent)
|
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (parent)->children = node;
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->prev = (GList *)parent;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (GTK_CTREE_ROW (parent)->expanded)
|
|
|
|
{
|
1998-10-02 23:45:09 +00:00
|
|
|
list_end->next = (GList *)GTK_CTREE_NODE_NEXT (parent);
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (GTK_CTREE_NODE_NEXT(parent))
|
1998-10-02 23:45:09 +00:00
|
|
|
{
|
|
|
|
list = (GList *)GTK_CTREE_NODE_NEXT (parent);
|
|
|
|
list->prev = list_end;
|
|
|
|
}
|
|
|
|
list = (GList *)parent;
|
|
|
|
list->next = (GList *)node;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
1998-10-02 23:45:09 +00:00
|
|
|
list_end->next = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
clist->row_list = (GList *)node;
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->prev = NULL;
|
|
|
|
list_end->next = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
gtk_ctree_pre_recursive (ctree, node, tree_update_level, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (clist->row_list_end == NULL ||
|
1998-08-17 23:48:04 +00:00
|
|
|
clist->row_list_end->next == (GList *)node)
|
1998-10-02 23:45:09 +00:00
|
|
|
clist->row_list_end = list_end;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (visible && update_focus_row)
|
|
|
|
{
|
|
|
|
gint pos;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
pos = g_list_position (clist->row_list, (GList *)node);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
if (pos <= clist->focus_row)
|
|
|
|
{
|
|
|
|
clist->focus_row += rows;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
}
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_unlink (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gboolean update_focus_row)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gint rows;
|
|
|
|
gint level;
|
|
|
|
gint visible;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *parent;
|
1998-10-02 23:45:09 +00:00
|
|
|
GList *list;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/* clist->row_list_end unlinked ? */
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (visible &&
|
|
|
|
(GTK_CTREE_NODE_NEXT (node) == NULL ||
|
|
|
|
(GTK_CTREE_ROW (node)->children &&
|
|
|
|
gtk_ctree_is_ancestor (ctree, node,
|
|
|
|
GTK_CTREE_NODE (clist->row_list_end)))))
|
1998-08-17 23:48:04 +00:00
|
|
|
clist->row_list_end = (GList *) (GTK_CTREE_NODE_PREV (node));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/* update list */
|
|
|
|
rows = 0;
|
1998-05-01 23:45:18 +00:00
|
|
|
level = GTK_CTREE_ROW (node)->level;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE_NEXT (node);
|
1998-05-01 13:20:55 +00:00
|
|
|
while (work && GTK_CTREE_ROW (work)->level > level)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
1998-05-01 13:20:55 +00:00
|
|
|
rows++;
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (visible)
|
|
|
|
{
|
|
|
|
clist->rows -= (rows + 1);
|
|
|
|
|
|
|
|
if (update_focus_row)
|
|
|
|
{
|
|
|
|
gint pos;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
pos = g_list_position (clist->row_list, (GList *)node);
|
1998-11-04 21:44:09 +00:00
|
|
|
if (pos + rows < clist->focus_row)
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->focus_row -= (rows + 1);
|
|
|
|
else if (pos <= clist->focus_row)
|
1998-11-04 21:44:09 +00:00
|
|
|
{
|
|
|
|
if (!GTK_CTREE_ROW (node)->sibling)
|
|
|
|
clist->focus_row = MAX (pos - 1, 0);
|
|
|
|
else
|
|
|
|
clist->focus_row = pos;
|
|
|
|
|
|
|
|
clist->focus_row = MIN (clist->focus_row, clist->rows - 1);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
if (work)
|
|
|
|
{
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)GTK_CTREE_NODE_PREV (work);
|
|
|
|
list->next = NULL;
|
|
|
|
list = (GList *)work;
|
|
|
|
list->prev = (GList *)GTK_CTREE_NODE_PREV (node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (GTK_CTREE_NODE_PREV (node) &&
|
|
|
|
GTK_CTREE_NODE_NEXT (GTK_CTREE_NODE_PREV (node)) == node)
|
1998-10-02 23:45:09 +00:00
|
|
|
{
|
|
|
|
list = (GList *)GTK_CTREE_NODE_PREV (node);
|
|
|
|
list->next = (GList *)work;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/* update tree */
|
1998-05-01 23:45:18 +00:00
|
|
|
parent = GTK_CTREE_ROW (node)->parent;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (parent)
|
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (parent)->children == node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (parent)->children = GTK_CTREE_ROW (node)->sibling;
|
1998-08-17 23:48:04 +00:00
|
|
|
if (!GTK_CTREE_ROW (parent)->children)
|
|
|
|
gtk_ctree_collapse (ctree, parent);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
sibling = GTK_CTREE_ROW (parent)->children;
|
1998-05-01 23:45:18 +00:00
|
|
|
while (GTK_CTREE_ROW (sibling)->sibling != node)
|
1998-05-01 13:20:55 +00:00
|
|
|
sibling = GTK_CTREE_ROW (sibling)->sibling;
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (sibling)->sibling = GTK_CTREE_ROW (node)->sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
if (clist->row_list == (GList *)node)
|
|
|
|
clist->row_list = (GList *) (GTK_CTREE_ROW (node)->sibling);
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *sibling;
|
|
|
|
|
|
|
|
sibling = GTK_CTREE_NODE (clist->row_list);
|
1998-05-01 23:45:18 +00:00
|
|
|
while (GTK_CTREE_ROW (sibling)->sibling != node)
|
1998-05-01 13:20:55 +00:00
|
|
|
sibling = GTK_CTREE_ROW (sibling)->sibling;
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (sibling)->sibling = GTK_CTREE_ROW (node)->sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
static void
|
|
|
|
real_row_move (GtkCList *clist,
|
|
|
|
gint source_row,
|
|
|
|
gint dest_row)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
|
|
|
if (GTK_CLIST_AUTO_SORT (clist))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (source_row < 0 || source_row >= clist->rows ||
|
|
|
|
dest_row < 0 || dest_row >= clist->rows ||
|
|
|
|
source_row == dest_row)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
node = GTK_CTREE_NODE (g_list_nth (clist->row_list, source_row));
|
|
|
|
|
|
|
|
if (source_row < dest_row)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *work;
|
|
|
|
|
|
|
|
dest_row++;
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
|
|
|
|
while (work && GTK_CTREE_ROW (work)->level > GTK_CTREE_ROW (node)->level)
|
|
|
|
{
|
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
|
|
|
dest_row++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dest_row > clist->rows)
|
|
|
|
dest_row = clist->rows;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dest_row < clist->rows)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *sibling;
|
|
|
|
|
|
|
|
sibling = GTK_CTREE_NODE (g_list_nth (clist->row_list, dest_row));
|
|
|
|
gtk_ctree_move (ctree, node, GTK_CTREE_ROW (sibling)->parent, sibling);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_ctree_move (ctree, node, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
real_tree_move (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *new_parent,
|
|
|
|
GtkCTreeNode *new_sibling)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-10-19 22:46:38 +00:00
|
|
|
gboolean visible = FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (!new_sibling ||
|
|
|
|
GTK_CTREE_ROW (new_sibling)->parent == new_parent);
|
|
|
|
|
|
|
|
if (new_parent && GTK_CTREE_ROW (new_parent)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* new_parent != child of child */
|
|
|
|
for (work = new_parent; work; work = GTK_CTREE_ROW (work)->parent)
|
1998-05-01 23:45:18 +00:00
|
|
|
if (work == node)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT (clist))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
if (new_parent == GTK_CTREE_ROW (node)->parent)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (new_parent)
|
|
|
|
new_sibling = GTK_CTREE_ROW (new_parent)->children;
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
new_sibling = GTK_CTREE_NODE (clist->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
while (new_sibling && clist->compare
|
|
|
|
(clist, GTK_CTREE_ROW (node), GTK_CTREE_ROW (new_sibling)) > 0)
|
1998-05-01 13:20:55 +00:00
|
|
|
new_sibling = GTK_CTREE_ROW (new_sibling)->sibling;
|
|
|
|
}
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (new_parent == GTK_CTREE_ROW (node)->parent &&
|
|
|
|
new_sibling == GTK_CTREE_ROW (node)->sibling)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-05-04 09:40:35 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
work = NULL;
|
1998-08-17 23:48:04 +00:00
|
|
|
if (gtk_ctree_is_viewable (ctree, node) ||
|
|
|
|
gtk_ctree_is_viewable (ctree, new_sibling))
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
gtk_ctree_unlink (ctree, node, FALSE);
|
|
|
|
gtk_ctree_link (ctree, node, new_parent, new_sibling, FALSE);
|
|
|
|
|
|
|
|
if (work)
|
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
while (work && !gtk_ctree_is_viewable (ctree, work))
|
1998-07-15 23:40:00 +00:00
|
|
|
work = GTK_CTREE_ROW (work)->parent;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
clist->focus_row = g_list_position (clist->row_list, (GList *)work);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist) &&
|
|
|
|
(visible || gtk_ctree_is_viewable (ctree, node)))
|
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, ctree->tree_column,
|
|
|
|
gtk_clist_optimal_column_width (clist, ctree->tree_column));
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
|
|
|
change_focus_row_expansion (GtkCTree *ctree,
|
1998-07-27 01:50:16 +00:00
|
|
|
GtkCTreeExpansionType action)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-26 13:12:07 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (ctree))
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (!(node =
|
|
|
|
GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row))) ||
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_CTREE_ROW (node)->is_leaf || !(GTK_CTREE_ROW (node)->children))
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_EXPANSION_EXPAND:
|
|
|
|
gtk_ctree_expand (ctree, node);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANSION_EXPAND_RECURSIVE:
|
|
|
|
gtk_ctree_expand_recursive (ctree, node);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANSION_COLLAPSE:
|
|
|
|
gtk_ctree_collapse (ctree, node);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE:
|
|
|
|
gtk_ctree_collapse_recursive (ctree, node);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANSION_TOGGLE:
|
|
|
|
gtk_ctree_toggle_expansion (ctree, node);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE:
|
|
|
|
gtk_ctree_toggle_expansion_recursive (ctree, node);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
real_tree_expand (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
|
|
|
gboolean visible;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint level;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
if (!node || GTK_CTREE_ROW (node)->expanded || GTK_CTREE_ROW (node)->is_leaf)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->expanded = TRUE;
|
|
|
|
level = GTK_CTREE_ROW (node)->level;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
/* get cell width if tree_column is auto resized */
|
|
|
|
if (visible && clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (node)->row, ctree->tree_column, &requisition);
|
|
|
|
|
|
|
|
/* unref/unset closed pixmap */
|
1998-08-17 23:48:04 +00:00
|
|
|
if (GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap);
|
|
|
|
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = NULL;
|
|
|
|
|
|
|
|
if (GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask);
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* set/ref opened pixmap */
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->pixmap_opened)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GTK_CELL_PIXTEXT
|
1998-05-01 23:45:18 +00:00
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap =
|
1998-08-17 23:48:04 +00:00
|
|
|
gdk_pixmap_ref (GTK_CTREE_ROW (node)->pixmap_opened);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->mask_opened)
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask =
|
|
|
|
gdk_pixmap_ref (GTK_CTREE_ROW (node)->mask_opened);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (work)
|
|
|
|
{
|
1999-01-03 17:32:43 +00:00
|
|
|
GList *list = (GList *)work;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint *cell_width = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint tmp = 0;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint row;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
1998-10-02 23:45:09 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
cell_width = g_new0 (gint, clist->columns);
|
|
|
|
if (clist->column[ctree->tree_column].auto_resize)
|
|
|
|
cell_width[ctree->tree_column] = requisition.width;
|
|
|
|
|
1999-01-03 17:32:43 +00:00
|
|
|
while (work)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
/* search maximum cell widths of auto_resize columns */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (work)->row, i, &requisition);
|
|
|
|
cell_width[i] = MAX (requisition.width, cell_width[i]);
|
|
|
|
}
|
|
|
|
|
1999-01-03 17:32:43 +00:00
|
|
|
list = (GList *)work;
|
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
|
|
|
tmp++;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1999-01-03 17:32:43 +00:00
|
|
|
else
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
list = (GList *)work;
|
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
|
|
|
tmp++;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
list->next = (GList *)GTK_CTREE_NODE_NEXT (node);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if (GTK_CTREE_NODE_NEXT (node))
|
1998-10-02 23:45:09 +00:00
|
|
|
{
|
1999-01-03 17:32:43 +00:00
|
|
|
GList *tmp_list;
|
|
|
|
|
|
|
|
tmp_list = (GList *)GTK_CTREE_NODE_NEXT (node);
|
|
|
|
tmp_list->prev = list;
|
1998-10-02 23:45:09 +00:00
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
1999-01-03 17:32:43 +00:00
|
|
|
clist->row_list_end = list;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->next = (GList *)(GTK_CTREE_ROW (node)->children);
|
1999-01-03 17:32:43 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
/* resize auto_resize columns if needed */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize &&
|
|
|
|
cell_width[i] > clist->column[i].width)
|
|
|
|
gtk_clist_set_column_width (clist, i, cell_width[i]);
|
|
|
|
g_free (cell_width);
|
|
|
|
|
|
|
|
/* update focus_row position */
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
row = g_list_position (clist->row_list, (GList *)node);
|
1998-07-15 23:40:00 +00:00
|
|
|
if (row < clist->focus_row)
|
1999-01-03 17:32:43 +00:00
|
|
|
clist->focus_row += tmp;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1999-01-03 17:32:43 +00:00
|
|
|
clist->rows += tmp;
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (visible && clist->column[ctree->tree_column].auto_resize)
|
|
|
|
/* resize tree_column if needed */
|
|
|
|
column_auto_resize (clist, >K_CTREE_ROW (node)->row, ctree->tree_column,
|
|
|
|
requisition.width);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
real_tree_collapse (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
|
|
|
gboolean visible;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint level;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!node || !GTK_CTREE_ROW (node)->expanded ||
|
|
|
|
GTK_CTREE_ROW (node)->is_leaf)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->expanded = FALSE;
|
1998-05-04 09:40:35 +00:00
|
|
|
level = GTK_CTREE_ROW (node)->level;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
/* get cell width if tree_column is auto resized */
|
|
|
|
if (visible && clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (node)->row, ctree->tree_column, &requisition);
|
|
|
|
|
|
|
|
/* unref/unset opened pixmap */
|
1998-08-17 23:48:04 +00:00
|
|
|
if (GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap);
|
|
|
|
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = NULL;
|
|
|
|
|
|
|
|
if (GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask);
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* set/ref closed pixmap */
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->pixmap_closed)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GTK_CELL_PIXTEXT
|
1998-05-01 23:45:18 +00:00
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap =
|
1998-08-17 23:48:04 +00:00
|
|
|
gdk_pixmap_ref (GTK_CTREE_ROW (node)->pixmap_closed);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->mask_closed)
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask =
|
|
|
|
gdk_pixmap_ref (GTK_CTREE_ROW (node)->mask_closed);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (work)
|
|
|
|
{
|
|
|
|
gint tmp = 0;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint row;
|
1998-10-02 23:45:09 +00:00
|
|
|
GList *list;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
while (work && GTK_CTREE_ROW (work)->level > level)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE_NEXT (work);
|
1998-05-01 13:20:55 +00:00
|
|
|
tmp++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (work)
|
|
|
|
{
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->next = (GList *)work;
|
|
|
|
list = (GList *)GTK_CTREE_NODE_PREV (work);
|
|
|
|
list->next = NULL;
|
|
|
|
list = (GList *)work;
|
|
|
|
list->prev = (GList *)node;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-02 23:45:09 +00:00
|
|
|
list = (GList *)node;
|
|
|
|
list->next = NULL;
|
1998-08-17 23:48:04 +00:00
|
|
|
clist->row_list_end = (GList *)node;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
/* resize auto_resize columns if needed */
|
1998-11-11 20:46:51 +00:00
|
|
|
auto_resize_columns (clist);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
row = g_list_position (clist->row_list, (GList *)node);
|
1998-07-15 23:40:00 +00:00
|
|
|
if (row < clist->focus_row)
|
|
|
|
clist->focus_row -= tmp;
|
|
|
|
clist->rows -= tmp;
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (visible && clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
/* resize tree_column if needed */
|
|
|
|
column_auto_resize (clist, >K_CTREE_ROW (node)->row, ctree->tree_column,
|
|
|
|
requisition.width);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
column_auto_resize (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
gint old_width)
|
|
|
|
{
|
|
|
|
/* resize column if needed for auto_resize */
|
|
|
|
GtkRequisition requisition;
|
|
|
|
|
|
|
|
if (!clist->column[column].auto_resize ||
|
|
|
|
GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
return;
|
|
|
|
|
1998-11-11 20:46:51 +00:00
|
|
|
if (clist_row)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
|
|
|
else
|
|
|
|
requisition.width = 0;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (requisition.width > clist->column[column].width)
|
1998-11-11 20:46:51 +00:00
|
|
|
gtk_clist_set_column_width (clist, column, requisition.width);
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (requisition.width < old_width &&
|
|
|
|
old_width == clist->column[column].width)
|
|
|
|
{
|
|
|
|
GList *list;
|
1998-11-11 20:46:51 +00:00
|
|
|
gint new_width;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
/* run a "gtk_clist_optimal_column_width" but break, if
|
|
|
|
* the column doesn't shrink */
|
1998-11-11 20:46:51 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES (clist) && clist->column[column].button)
|
|
|
|
new_width = (clist->column[column].button->requisition.width -
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET)));
|
|
|
|
else
|
|
|
|
new_width = 0;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (list = clist->row_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, GTK_CLIST_ROW (list), column, &requisition);
|
|
|
|
new_width = MAX (new_width, requisition.width);
|
|
|
|
if (new_width == clist->column[column].width)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (new_width < clist->column[column].width)
|
1998-11-11 20:46:51 +00:00
|
|
|
gtk_clist_set_column_width (clist, column, new_width);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-11-11 20:46:51 +00:00
|
|
|
static void
|
|
|
|
auto_resize_columns (GtkCList *clist)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if (GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
column_auto_resize (clist, NULL, i, clist->column[i].width);
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
cell_size_request (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GtkStyle *style;
|
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
|
1998-12-16 00:52:46 +00:00
|
|
|
get_cell_style (clist, clist_row, GTK_STATE_NORMAL, column, &style,
|
1998-10-19 22:46:38 +00:00
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
switch (clist_row->cell[column].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
requisition->width =
|
|
|
|
gdk_string_width (style->font,
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
requisition->height = style->font->ascent + style->font->descent;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
1998-11-04 21:44:09 +00:00
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap)
|
|
|
|
{
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXTEXT
|
|
|
|
(clist_row->cell[column])->pixmap,
|
|
|
|
&width, &height);
|
|
|
|
width += GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
width = height = 0;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
requisition->width = width +
|
|
|
|
gdk_string_width (style->font,
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
|
|
|
|
requisition->height = MAX (style->font->ascent + style->font->descent,
|
|
|
|
height);
|
|
|
|
if (column == ctree->tree_column)
|
|
|
|
{
|
|
|
|
requisition->width += (ctree->tree_spacing + ctree->tree_indent *
|
|
|
|
(((GtkCTreeRow *) clist_row)->level - 1));
|
|
|
|
switch (ctree->expander_style)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_EXPANDER_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_TRIANGLE:
|
|
|
|
requisition->width += PM_SIZE + 3;
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_SQUARE:
|
|
|
|
case GTK_CTREE_EXPANDER_CIRCULAR:
|
|
|
|
requisition->width += PM_SIZE + 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (ctree->line_style == GTK_CTREE_LINES_TABBED)
|
|
|
|
requisition->width += 3;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap,
|
|
|
|
&width, &height);
|
|
|
|
requisition->width = width;
|
|
|
|
requisition->height = height;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
requisition->width += clist_row->cell[column].horizontal;
|
|
|
|
requisition->height += clist_row->cell[column].vertical;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-09-03 07:28:37 +00:00
|
|
|
set_cell_contents (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkCellType type,
|
|
|
|
const gchar *text,
|
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gboolean visible = FALSE;
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkCTree *ctree;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
g_return_if_fail (clist_row != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
ctree = GTK_CTREE (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
GtkCTreeNode *parent;
|
|
|
|
|
|
|
|
parent = ((GtkCTreeRow *)clist_row)->parent;
|
|
|
|
if (!parent || (parent && GTK_CTREE_ROW (parent)->expanded &&
|
|
|
|
gtk_ctree_is_viewable (ctree, parent)))
|
|
|
|
{
|
|
|
|
visible = TRUE;
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
switch (clist_row->cell[column].type)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
case GTK_CELL_EMPTY:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
g_free (GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
gdk_pixmap_unref (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap);
|
|
|
|
if (GTK_CELL_PIXMAP (clist_row->cell[column])->mask)
|
|
|
|
gdk_bitmap_unref (GTK_CELL_PIXMAP (clist_row->cell[column])->mask);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->text)
|
|
|
|
g_free (GTK_CELL_PIXTEXT (clist_row->cell[column])->text);
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap);
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->mask)
|
|
|
|
gdk_bitmap_unref
|
|
|
|
(GTK_CELL_PIXTEXT (clist_row->cell[column])->mask);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_WIDGET:
|
|
|
|
/* unimplimented */
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
clist_row->cell[column].type = GTK_CELL_EMPTY;
|
|
|
|
if (column == ctree->tree_column && type != GTK_CELL_EMPTY)
|
|
|
|
type = GTK_CELL_PIXTEXT;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
switch (type)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
if (text)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_TEXT;
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text = g_strdup (text);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
if (pixmap)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_PIXMAP;
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap = pixmap;
|
|
|
|
/* We set the mask even if it is NULL */
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[column])->mask = mask;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
if (column == ctree->tree_column)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_PIXTEXT;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing;
|
|
|
|
if (text)
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text);
|
|
|
|
else
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->text = NULL;
|
|
|
|
if (pixmap)
|
|
|
|
{
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = NULL;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (text && pixmap)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_PIXTEXT;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text);
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-26 18:47:58 +00:00
|
|
|
if (visible && clist->column[column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
column_auto_resize (clist, clist_row, column, requisition.width);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
set_node_info (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap_closed,
|
|
|
|
GdkBitmap *mask_closed,
|
|
|
|
GdkPixmap *pixmap_opened,
|
|
|
|
GdkBitmap *mask_opened,
|
|
|
|
gboolean is_leaf,
|
|
|
|
gboolean expanded)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->pixmap_opened)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref (GTK_CTREE_ROW (node)->pixmap_opened);
|
|
|
|
if (GTK_CTREE_ROW (node)->mask_opened)
|
|
|
|
gdk_bitmap_unref (GTK_CTREE_ROW (node)->mask_opened);
|
|
|
|
}
|
|
|
|
if (GTK_CTREE_ROW (node)->pixmap_closed)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref (GTK_CTREE_ROW (node)->pixmap_closed);
|
|
|
|
if (GTK_CTREE_ROW (node)->mask_closed)
|
|
|
|
gdk_bitmap_unref (GTK_CTREE_ROW (node)->mask_closed);
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CTREE_ROW (node)->pixmap_opened = NULL;
|
|
|
|
GTK_CTREE_ROW (node)->mask_opened = NULL;
|
|
|
|
GTK_CTREE_ROW (node)->pixmap_closed = NULL;
|
|
|
|
GTK_CTREE_ROW (node)->mask_closed = NULL;
|
|
|
|
|
|
|
|
if (pixmap_closed)
|
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->pixmap_closed = gdk_pixmap_ref (pixmap_closed);
|
|
|
|
if (mask_closed)
|
|
|
|
GTK_CTREE_ROW (node)->mask_closed = gdk_bitmap_ref (mask_closed);
|
|
|
|
}
|
|
|
|
if (pixmap_opened)
|
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->pixmap_opened = gdk_pixmap_ref (pixmap_opened);
|
|
|
|
if (mask_opened)
|
|
|
|
GTK_CTREE_ROW (node)->mask_opened = gdk_bitmap_ref (mask_opened);
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CTREE_ROW (node)->is_leaf = is_leaf;
|
|
|
|
GTK_CTREE_ROW (node)->expanded = (is_leaf) ? FALSE : expanded;
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->expanded)
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_pixtext (ctree, node, ctree->tree_column,
|
|
|
|
text, spacing, pixmap_opened, mask_opened);
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_pixtext (ctree, node, ctree->tree_column,
|
|
|
|
text, spacing, pixmap_closed, mask_closed);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_delete (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
tree_unselect (ctree, node, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
row_delete (ctree, GTK_CTREE_ROW (node));
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
g_list_free_1 ((GList *)node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_delete_row (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
row_delete (ctree, GTK_CTREE_ROW (node));
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
g_list_free_1 ((GList *)node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_update_level (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
if (!node)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->parent)
|
|
|
|
GTK_CTREE_ROW (node)->level =
|
|
|
|
GTK_CTREE_ROW (GTK_CTREE_ROW (node)->parent)->level + 1;
|
|
|
|
else
|
|
|
|
GTK_CTREE_ROW (node)->level = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_select (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-09-11 13:52:42 +00:00
|
|
|
if (node && GTK_CTREE_ROW (node)->row.state != GTK_STATE_SELECTED &&
|
|
|
|
GTK_CTREE_ROW (node)->row.selectable)
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW],
|
|
|
|
node, -1);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_unselect (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
if (node && GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW],
|
1998-07-22 21:13:48 +00:00
|
|
|
node, -1);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_expand (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
if (node && !GTK_CTREE_ROW (node)->expanded)
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_collapse (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
if (node && GTK_CTREE_ROW (node)->expanded)
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_collapse_to_depth (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint depth)
|
1998-07-20 19:45:45 +00:00
|
|
|
{
|
|
|
|
if (node && GTK_CTREE_ROW (node)->level == depth)
|
|
|
|
gtk_ctree_collapse_recursive (ctree, node);
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_toggle_expansion (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (!node)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->expanded)
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node);
|
1998-07-15 23:40:00 +00:00
|
|
|
else
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static GtkCTreeRow *
|
|
|
|
row_new (GtkCTree *ctree)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTreeRow *ctree_row;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
ctree_row = g_chunk_new (GtkCTreeRow, clist->row_mem_chunk);
|
|
|
|
ctree_row->row.cell = g_chunk_new (GtkCell, clist->cell_mem_chunk);
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
{
|
|
|
|
ctree_row->row.cell[i].type = GTK_CELL_EMPTY;
|
|
|
|
ctree_row->row.cell[i].vertical = 0;
|
|
|
|
ctree_row->row.cell[i].horizontal = 0;
|
1998-10-16 15:00:05 +00:00
|
|
|
ctree_row->row.cell[i].style = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CELL_PIXTEXT (ctree_row->row.cell[ctree->tree_column])->text = NULL;
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
ctree_row->row.fg_set = FALSE;
|
|
|
|
ctree_row->row.bg_set = FALSE;
|
1998-10-16 15:00:05 +00:00
|
|
|
ctree_row->row.style = NULL;
|
1998-09-11 13:52:42 +00:00
|
|
|
ctree_row->row.selectable = TRUE;
|
|
|
|
ctree_row->row.state = GTK_STATE_NORMAL;
|
|
|
|
ctree_row->row.data = NULL;
|
|
|
|
ctree_row->row.destroy = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
ctree_row->level = 0;
|
|
|
|
ctree_row->expanded = FALSE;
|
|
|
|
ctree_row->parent = NULL;
|
|
|
|
ctree_row->sibling = NULL;
|
|
|
|
ctree_row->children = NULL;
|
|
|
|
ctree_row->pixmap_closed = NULL;
|
|
|
|
ctree_row->mask_closed = NULL;
|
|
|
|
ctree_row->pixmap_opened = NULL;
|
|
|
|
ctree_row->mask_opened = NULL;
|
|
|
|
|
|
|
|
return ctree_row;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
row_delete (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-10-16 15:00:05 +00:00
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, &(ctree_row->row), i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
|
|
|
|
if (ctree_row->row.cell[i].style)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gtk_style_detach (ctree_row->row.cell[i].style);
|
|
|
|
gtk_style_unref (ctree_row->row.cell[i].style);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ctree_row->row.style)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gtk_style_detach (ctree_row->row.style);
|
|
|
|
gtk_style_unref (ctree_row->row.style);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (ctree_row->pixmap_closed)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref (ctree_row->pixmap_closed);
|
|
|
|
if (ctree_row->mask_closed)
|
|
|
|
gdk_bitmap_unref (ctree_row->mask_closed);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ctree_row->pixmap_opened)
|
|
|
|
{
|
|
|
|
gdk_pixmap_unref (ctree_row->pixmap_opened);
|
|
|
|
if (ctree_row->mask_opened)
|
|
|
|
gdk_bitmap_unref (ctree_row->mask_opened);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ctree_row->row.destroy)
|
|
|
|
ctree_row->row.destroy (ctree_row->row.data);
|
|
|
|
|
|
|
|
g_mem_chunk_free (clist->cell_mem_chunk, ctree_row->row.cell);
|
|
|
|
g_mem_chunk_free (clist->row_mem_chunk, ctree_row);
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
|
|
|
real_select_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
|
|
|
GList *node;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
if ((node = g_list_nth (clist->row_list, row)) &&
|
|
|
|
GTK_CTREE_ROW (node)->row.selectable)
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), ctree_signals[TREE_SELECT_ROW],
|
1998-07-22 21:13:48 +00:00
|
|
|
node, column);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_unselect_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
|
|
|
GList *node;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
|
|
|
if ((node = g_list_nth (clist->row_list, row)))
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), ctree_signals[TREE_UNSELECT_ROW],
|
1998-07-22 21:13:48 +00:00
|
|
|
node, column);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
real_tree_select (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-07-15 23:40:00 +00:00
|
|
|
GList *list;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *sel_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
gboolean node_selected;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
if (!node || GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED ||
|
|
|
|
!GTK_CTREE_ROW (node)->row.selectable)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_BROWSE:
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
node_selected = FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
list = clist->selection;
|
|
|
|
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
sel_row = list->data;
|
|
|
|
list = list->next;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (node == sel_row)
|
|
|
|
node_selected = TRUE;
|
|
|
|
else
|
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree),
|
|
|
|
ctree_signals[TREE_UNSELECT_ROW], sel_row, column);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
if (node_selected)
|
|
|
|
return;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (!clist->selection)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->selection = g_list_append (clist->selection, node);
|
|
|
|
clist->selection_end = clist->selection;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
else
|
|
|
|
clist->selection_end = g_list_append (clist->selection_end, node)->next;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
real_tree_unselect (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-26 13:12:07 +00:00
|
|
|
if (!node || GTK_CTREE_ROW (node)->row.state != GTK_STATE_SELECTED)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (clist->selection_end && clist->selection_end->data == node)
|
|
|
|
clist->selection_end = clist->selection_end->prev;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
clist->selection = g_list_remove (clist->selection, node);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
select_row_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-09-11 13:52:42 +00:00
|
|
|
if (!node || GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED ||
|
|
|
|
!GTK_CTREE_ROW (node)->row.selectable)
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
GTK_CLIST (ctree)->undo_unselection =
|
|
|
|
g_list_prepend (GTK_CLIST (ctree)->undo_unselection, node);
|
|
|
|
gtk_ctree_select (ctree, node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_select_all (GtkCList *clist)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
|
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
return;
|
|
|
|
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
for (node = GTK_CTREE_NODE (clist->row_list); node;
|
|
|
|
node = GTK_CTREE_NODE_NEXT (node))
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_ctree_pre_recursive (ctree, node, select_row_recursive, NULL);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
gtk_ctree_select_recursive (ctree, NULL);
|
1999-01-23 18:44:36 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* do nothing */
|
|
|
|
break;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_unselect_all (GtkCList *clist)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-07-15 23:40:00 +00:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
|
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
if (clist->focus_row >= 0)
|
|
|
|
{
|
|
|
|
gtk_ctree_select
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
(ctree,
|
|
|
|
GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row)));
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
list = clist->selection;
|
|
|
|
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
node = list->data;
|
|
|
|
list = list->next;
|
|
|
|
gtk_ctree_unselect (ctree, node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
ctree_is_hot_spot (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint row,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkCTreeRow *tree_row;
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCellPixText *cell;
|
|
|
|
gint xl;
|
|
|
|
gint yu;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
|
|
|
g_return_val_if_fail (node != NULL, FALSE);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (!clist->column[ctree->tree_column].visible ||
|
|
|
|
ctree->expander_style == GTK_CTREE_EXPANDER_NONE)
|
1998-10-07 00:03:24 +00:00
|
|
|
return FALSE;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_row = GTK_CTREE_ROW (node);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
cell = GTK_CELL_PIXTEXT(tree_row->row.cell[ctree->tree_column]);
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - PM_SIZE) / 2 -
|
|
|
|
(clist->row_height - 1) % 2);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT)
|
1998-10-16 15:00:05 +00:00
|
|
|
xl = (clist->column[ctree->tree_column].area.x +
|
|
|
|
clist->column[ctree->tree_column].area.width - 1 + clist->hoffset -
|
|
|
|
(tree_row->level - 1) * ctree->tree_indent - PM_SIZE -
|
|
|
|
(ctree->line_style == GTK_CTREE_LINES_TABBED) * 3);
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
1998-10-16 15:00:05 +00:00
|
|
|
xl = (clist->column[ctree->tree_column].area.x + clist->hoffset +
|
|
|
|
(tree_row->level - 1) * ctree->tree_indent +
|
|
|
|
(ctree->line_style == GTK_CTREE_LINES_TABBED) * 3);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-04 09:40:35 +00:00
|
|
|
return (x >= xl && x <= xl + PM_SIZE && y >= yu && y <= yu + PM_SIZE);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
***********************************************************
|
|
|
|
*** Public interface ***
|
|
|
|
***********************************************************
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Creation, insertion, deletion *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
void
|
1998-11-23 13:53:25 +00:00
|
|
|
gtk_ctree_construct (GtkCTree *ctree,
|
|
|
|
gint columns,
|
|
|
|
gint tree_column,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *titles[])
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
g_return_if_fail (GTK_OBJECT_CONSTRUCTED (ctree) == FALSE);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
clist->row_mem_chunk = g_mem_chunk_new ("ctree row mem chunk",
|
|
|
|
sizeof (GtkCTreeRow),
|
|
|
|
sizeof (GtkCTreeRow)
|
|
|
|
* CLIST_OPTIMUM_SIZE,
|
|
|
|
G_ALLOC_AND_FREE);
|
1998-05-01 23:45:18 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
clist->cell_mem_chunk = g_mem_chunk_new ("ctree cell mem chunk",
|
|
|
|
sizeof (GtkCell) * columns,
|
|
|
|
sizeof (GtkCell) * columns
|
|
|
|
* CLIST_OPTIMUM_SIZE,
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
|
|
|
|
ctree->tree_column = tree_column;
|
|
|
|
|
|
|
|
gtk_clist_construct (clist, columns, titles);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
1998-11-23 13:53:25 +00:00
|
|
|
gtk_ctree_new_with_titles (gint columns,
|
|
|
|
gint tree_column,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *titles[])
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
g_return_val_if_fail (columns > 0, NULL);
|
|
|
|
g_return_val_if_fail (tree_column >= 0 && tree_column < columns, NULL);
|
|
|
|
|
1998-07-16 02:47:15 +00:00
|
|
|
widget = gtk_type_new (GTK_TYPE_CTREE);
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_ctree_construct (GTK_CTREE (widget), columns, tree_column, titles);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
return widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
gtk_ctree_new (gint columns,
|
|
|
|
gint tree_column)
|
|
|
|
{
|
|
|
|
return gtk_ctree_new_with_titles (columns, tree_column, NULL);
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
static gint
|
|
|
|
real_insert_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gchar *text[])
|
|
|
|
{
|
|
|
|
GtkCTreeNode *parent = NULL;
|
|
|
|
GtkCTreeNode *sibling;
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (clist), -1);
|
|
|
|
|
|
|
|
sibling = GTK_CTREE_NODE (g_list_nth (clist->row_list, row));
|
|
|
|
if (sibling)
|
|
|
|
parent = GTK_CTREE_ROW (sibling)->parent;
|
|
|
|
|
|
|
|
node = gtk_ctree_insert_node (GTK_CTREE (clist), parent, sibling, text, 5,
|
|
|
|
NULL, NULL, NULL, NULL, TRUE, FALSE);
|
|
|
|
|
|
|
|
if (GTK_CLIST_AUTO_SORT (clist) || !sibling)
|
|
|
|
return g_list_position (clist->row_list, (GList *) node);
|
|
|
|
|
|
|
|
return row;
|
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_insert_node (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode *sibling,
|
|
|
|
gchar *text[],
|
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap_closed,
|
|
|
|
GdkBitmap *mask_closed,
|
|
|
|
GdkPixmap *pixmap_opened,
|
|
|
|
GdkBitmap *mask_opened,
|
|
|
|
gboolean is_leaf,
|
|
|
|
gboolean expanded)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTreeRow *new_row;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-08-17 23:48:04 +00:00
|
|
|
GList *list;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
1998-08-17 23:48:04 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
if (sibling)
|
|
|
|
g_return_val_if_fail (GTK_CTREE_ROW (sibling)->parent == parent, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (parent && GTK_CTREE_ROW (parent)->is_leaf)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
/* create the row */
|
|
|
|
new_row = row_new (ctree);
|
1998-08-17 23:48:04 +00:00
|
|
|
list = g_list_alloc ();
|
|
|
|
list->data = new_row;
|
|
|
|
node = GTK_CTREE_NODE (list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (text)
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (text[i] && i != ctree->tree_column)
|
1998-08-17 23:48:04 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, &(new_row->row), i, GTK_CELL_TEXT, text[i], 0, NULL, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
set_node_info (ctree, node, text ?
|
|
|
|
text[ctree->tree_column] : NULL, spacing, pixmap_closed,
|
1998-05-01 13:20:55 +00:00
|
|
|
mask_closed, pixmap_opened, mask_opened, is_leaf, expanded);
|
|
|
|
|
1998-05-04 09:40:35 +00:00
|
|
|
/* sorted insertion */
|
1998-08-05 20:02:32 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT (clist))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
if (parent)
|
|
|
|
sibling = GTK_CTREE_ROW (parent)->children;
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
sibling = GTK_CTREE_NODE (clist->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
while (sibling && clist->compare
|
|
|
|
(clist, GTK_CTREE_ROW (node), GTK_CTREE_ROW (sibling)) > 0)
|
1998-05-01 13:20:55 +00:00
|
|
|
sibling = GTK_CTREE_ROW (sibling)->sibling;
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_ctree_link (ctree, node, parent, sibling, TRUE);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (text && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist) &&
|
|
|
|
gtk_ctree_is_viewable (ctree, node))
|
|
|
|
{
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
1998-11-11 20:46:51 +00:00
|
|
|
column_auto_resize (clist, &(new_row->row), i, 0);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
1999-02-02 01:57:11 +00:00
|
|
|
if (clist->rows == 1)
|
|
|
|
{
|
|
|
|
clist->focus_row = 0;
|
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE)
|
|
|
|
gtk_ctree_select (ctree, node);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
GtkCTreeNode *
|
|
|
|
gtk_ctree_insert_gnode (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode *sibling,
|
|
|
|
GNode *gnode,
|
|
|
|
GtkCTreeGNodeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
1998-08-05 20:02:32 +00:00
|
|
|
GtkCList *clist;
|
1998-08-05 02:11:32 +00:00
|
|
|
GtkCTreeNode *cnode = NULL;
|
|
|
|
GtkCTreeNode *child = NULL;
|
|
|
|
GtkCTreeNode *new_child;
|
1998-10-02 23:45:09 +00:00
|
|
|
GList *list;
|
1998-08-05 02:11:32 +00:00
|
|
|
GNode *work;
|
|
|
|
guint depth = 1;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
1998-08-17 23:48:04 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_val_if_fail (gnode != NULL, NULL);
|
|
|
|
g_return_val_if_fail (func != NULL, NULL);
|
|
|
|
if (sibling)
|
|
|
|
g_return_val_if_fail (GTK_CTREE_ROW (sibling)->parent == parent, NULL);
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
if (parent)
|
|
|
|
depth = GTK_CTREE_ROW (parent)->level + 1;
|
|
|
|
|
1998-10-02 23:45:09 +00:00
|
|
|
list = g_list_alloc ();
|
|
|
|
list->data = row_new (ctree);
|
|
|
|
cnode = GTK_CTREE_NODE (list);
|
1998-08-05 02:11:32 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-08-17 23:48:04 +00:00
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
set_node_info (ctree, cnode, "", 0, NULL, NULL, NULL, NULL, TRUE, FALSE);
|
|
|
|
|
|
|
|
if (!func (ctree, depth, gnode, cnode, data))
|
|
|
|
{
|
|
|
|
tree_delete_row (ctree, cnode, NULL);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT (clist))
|
1998-08-05 02:11:32 +00:00
|
|
|
{
|
|
|
|
if (parent)
|
|
|
|
sibling = GTK_CTREE_ROW (parent)->children;
|
|
|
|
else
|
1998-08-05 20:02:32 +00:00
|
|
|
sibling = GTK_CTREE_NODE (clist->row_list);
|
1998-08-05 02:11:32 +00:00
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
while (sibling && clist->compare
|
|
|
|
(clist, GTK_CTREE_ROW (cnode), GTK_CTREE_ROW (sibling)) > 0)
|
1998-08-05 02:11:32 +00:00
|
|
|
sibling = GTK_CTREE_ROW (sibling)->sibling;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_ctree_link (ctree, cnode, parent, sibling, TRUE);
|
|
|
|
|
|
|
|
for (work = g_node_last_child (gnode); work; work = work->prev)
|
|
|
|
{
|
|
|
|
new_child = gtk_ctree_insert_gnode (ctree, cnode, child,
|
|
|
|
work, func, data);
|
|
|
|
if (new_child)
|
|
|
|
child = new_child;
|
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-08-05 02:11:32 +00:00
|
|
|
|
|
|
|
return cnode;
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
GNode *
|
|
|
|
gtk_ctree_export_to_gnode (GtkCTree *ctree,
|
|
|
|
GNode *parent,
|
|
|
|
GNode *sibling,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeGNodeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *work;
|
|
|
|
GNode *gnode;
|
|
|
|
gint depth;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
g_return_val_if_fail (node != NULL, NULL);
|
|
|
|
g_return_val_if_fail (func != NULL, NULL);
|
|
|
|
if (sibling)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (parent != NULL, NULL);
|
|
|
|
g_return_val_if_fail (sibling->parent == parent, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
gnode = g_node_new (NULL);
|
|
|
|
depth = g_node_depth (parent) + 1;
|
|
|
|
|
|
|
|
if (!func (ctree, depth, gnode, node, data))
|
|
|
|
{
|
|
|
|
g_node_destroy (gnode);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parent)
|
|
|
|
g_node_insert_before (parent, sibling, gnode);
|
|
|
|
|
1998-12-04 00:04:31 +00:00
|
|
|
if (!GTK_CTREE_ROW (node)->is_leaf)
|
1998-08-17 23:48:04 +00:00
|
|
|
{
|
1998-12-04 00:04:31 +00:00
|
|
|
GNode *new_sibling = NULL;
|
|
|
|
|
|
|
|
for (work = GTK_CTREE_ROW (node)->children; work;
|
|
|
|
work = GTK_CTREE_ROW (work)->sibling)
|
|
|
|
new_sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling,
|
|
|
|
work, func, data);
|
|
|
|
|
|
|
|
g_node_reverse_children (gnode);
|
1998-08-17 23:48:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return gnode;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_remove_row (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
|
|
|
node = GTK_CTREE_NODE (g_list_nth (clist->row_list, row));
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
gtk_ctree_remove_node (GTK_CTREE (clist), node);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_remove_node (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (node)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_ctree_unlink (ctree, node, TRUE);
|
|
|
|
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_delete),
|
1998-05-01 13:20:55 +00:00
|
|
|
NULL);
|
1999-02-10 23:15:26 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE && !clist->selection &&
|
|
|
|
clist->focus_row >= 0)
|
1998-11-04 21:44:09 +00:00
|
|
|
gtk_clist_select_row (clist, clist->focus_row, -1);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-11 20:46:51 +00:00
|
|
|
auto_resize_columns (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_clist_clear (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
|
|
|
real_clear (GtkCList *clist)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
GtkCTree *ctree;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *ptr;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
ctree = GTK_CTREE (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* remove all rows */
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (clist->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
clist->row_list = NULL;
|
|
|
|
clist->row_list_end = NULL;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
1998-05-01 13:20:55 +00:00
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
ptr = work;
|
|
|
|
work = GTK_CTREE_ROW (work)->sibling;
|
1998-05-04 09:40:35 +00:00
|
|
|
gtk_ctree_post_recursive (ctree, ptr, GTK_CTREE_FUNC (tree_delete_row),
|
1998-05-01 13:20:55 +00:00
|
|
|
NULL);
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
parent_class->clear (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-05-04 09:40:35 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
/***********************************************************
|
|
|
|
* Generic recursive functions, querying / finding tree *
|
|
|
|
* information *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_ctree_post_recursive (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-01 13:20:55 +00:00
|
|
|
GtkCTreeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *tmp;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_if_fail (func != NULL);
|
1998-07-20 19:45:45 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
if (node)
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
|
|
|
gtk_ctree_post_recursive (ctree, work, func, data);
|
|
|
|
work = tmp;
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (node)
|
|
|
|
func (ctree, node, data);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-20 19:45:45 +00:00
|
|
|
gint depth,
|
|
|
|
GtkCTreeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *tmp;
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_if_fail (func != NULL);
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
if (depth < 0)
|
|
|
|
{
|
|
|
|
gtk_ctree_post_recursive (ctree, node, func, data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
if (work && GTK_CTREE_ROW (work)->level <= depth)
|
|
|
|
{
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
|
|
|
gtk_ctree_post_recursive_to_depth (ctree, work, depth, func, data);
|
|
|
|
work = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (node && GTK_CTREE_ROW (node)->level <= depth)
|
|
|
|
func (ctree, node, data);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_pre_recursive (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-05-01 13:20:55 +00:00
|
|
|
GtkCTreeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *tmp;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_if_fail (func != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (node)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
func (ctree, node, data);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
|
|
|
gtk_ctree_pre_recursive (ctree, work, func, data);
|
|
|
|
work = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node,
|
1998-07-20 19:45:45 +00:00
|
|
|
gint depth,
|
|
|
|
GtkCTreeFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *tmp;
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_if_fail (func != NULL);
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
if (depth < 0)
|
|
|
|
{
|
|
|
|
gtk_ctree_pre_recursive (ctree, node, func, data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
{
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
if (GTK_CTREE_ROW (node)->level <= depth)
|
|
|
|
func (ctree, node, data);
|
|
|
|
}
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
if (work && GTK_CTREE_ROW (work)->level <= depth)
|
|
|
|
{
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
|
|
|
gtk_ctree_pre_recursive_to_depth (ctree, work, depth, func, data);
|
|
|
|
work = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-10 17:05:39 +00:00
|
|
|
gboolean
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_is_viewable (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCTreeRow *work;
|
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_val_if_fail (ctree != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
|
|
|
g_return_val_if_fail (node != NULL, FALSE);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
work = GTK_CTREE_ROW (node);
|
|
|
|
|
|
|
|
while (work->parent && GTK_CTREE_ROW (work->parent)->expanded)
|
|
|
|
work = GTK_CTREE_ROW (work->parent);
|
|
|
|
|
|
|
|
if (!work->parent)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *
|
|
|
|
gtk_ctree_last (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
if (!node)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
while (GTK_CTREE_ROW (node)->sibling)
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->children)
|
|
|
|
return gtk_ctree_last (ctree, GTK_CTREE_ROW (node)->children);
|
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_find_node_ptr (GtkCTree *ctree,
|
|
|
|
GtkCTreeRow *ctree_row)
|
1998-06-22 17:00:21 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-06-22 17:00:21 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
|
|
|
g_return_val_if_fail (ctree_row != NULL, FALSE);
|
|
|
|
|
|
|
|
if (ctree_row->parent)
|
|
|
|
node = GTK_CTREE_ROW(ctree_row->parent)->children;
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
1998-06-22 17:00:21 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
while (GTK_CTREE_ROW (node) != ctree_row)
|
1998-06-22 17:00:21 +00:00
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
1998-11-18 23:55:10 +00:00
|
|
|
GtkCTreeNode *
|
|
|
|
gtk_ctree_node_nth (GtkCTree *ctree,
|
|
|
|
guint row)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
|
|
|
|
if ((row < 0) || (row >= GTK_CLIST(ctree)->rows))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return GTK_CTREE_NODE (g_list_nth (GTK_CLIST (ctree)->row_list, row));
|
|
|
|
}
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
gboolean
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_find (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *child)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-05 02:11:32 +00:00
|
|
|
if (!child)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!node)
|
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
if (node == child)
|
|
|
|
return TRUE;
|
|
|
|
if (GTK_CTREE_ROW (node)->children)
|
|
|
|
{
|
|
|
|
if (gtk_ctree_find (ctree, GTK_CTREE_ROW (node)->children, child))
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_is_ancestor (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *child)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_val_if_fail (node != NULL, FALSE);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
return gtk_ctree_find (ctree, GTK_CTREE_ROW (node)->children, child);
|
|
|
|
}
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *
|
|
|
|
gtk_ctree_find_by_row_data (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
if (!node)
|
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->row.data == data)
|
|
|
|
return node;
|
|
|
|
if (GTK_CTREE_ROW (node)->children &&
|
|
|
|
(work = gtk_ctree_find_by_row_data
|
|
|
|
(ctree, GTK_CTREE_ROW (node)->children, data)))
|
|
|
|
return work;
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-10-07 00:03:24 +00:00
|
|
|
GList *
|
|
|
|
gtk_ctree_find_all_by_row_data (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
|
|
|
|
/* if node == NULL then look in the whole tree */
|
|
|
|
if (!node)
|
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
|
|
|
|
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->row.data == data)
|
|
|
|
list = g_list_append (list, node);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->children)
|
|
|
|
{
|
|
|
|
GList *sub_list;
|
|
|
|
|
|
|
|
sub_list = gtk_ctree_find_all_by_row_data (ctree,
|
|
|
|
GTK_CTREE_ROW
|
|
|
|
(node)->children,
|
|
|
|
data);
|
|
|
|
list = g_list_concat (list, sub_list);
|
|
|
|
}
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
1998-08-03 19:50:23 +00:00
|
|
|
GtkCTreeNode *
|
|
|
|
gtk_ctree_find_by_row_data_custom (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data,
|
|
|
|
GCompareFunc func)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *work;
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
g_return_val_if_fail (func != NULL, NULL);
|
|
|
|
|
|
|
|
if (!node)
|
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
|
|
|
|
1998-08-03 19:50:23 +00:00
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
if (!func (GTK_CTREE_ROW (node)->row.data, data))
|
|
|
|
return node;
|
|
|
|
if (GTK_CTREE_ROW (node)->children &&
|
|
|
|
(work = gtk_ctree_find_by_row_data_custom
|
|
|
|
(ctree, GTK_CTREE_ROW (node)->children, data, func)))
|
|
|
|
return work;
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-10-07 00:03:24 +00:00
|
|
|
GList *
|
|
|
|
gtk_ctree_find_all_by_row_data_custom (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data,
|
|
|
|
GCompareFunc func)
|
|
|
|
{
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
g_return_val_if_fail (func != NULL, NULL);
|
|
|
|
|
|
|
|
/* if node == NULL then look in the whole tree */
|
|
|
|
if (!node)
|
|
|
|
node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list);
|
|
|
|
|
|
|
|
while (node)
|
|
|
|
{
|
|
|
|
if (!func (GTK_CTREE_ROW (node)->row.data, data))
|
|
|
|
list = g_list_append (list, node);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->children)
|
|
|
|
{
|
|
|
|
GList *sub_list;
|
|
|
|
|
|
|
|
sub_list = gtk_ctree_find_all_by_row_data_custom (ctree,
|
|
|
|
GTK_CTREE_ROW
|
|
|
|
(node)->children,
|
|
|
|
data,
|
|
|
|
func);
|
|
|
|
list = g_list_concat (list, sub_list);
|
|
|
|
}
|
|
|
|
node = GTK_CTREE_ROW (node)->sibling;
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
gboolean
|
|
|
|
gtk_ctree_is_hot_spot (GtkCTree *ctree,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-05-01 13:20:55 +00:00
|
|
|
gint column;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gint row;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
|
|
|
|
|
|
|
if (gtk_clist_get_selection_info (GTK_CLIST (ctree), x, y, &row, &column))
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
if ((node = GTK_CTREE_NODE(g_list_nth (GTK_CLIST (ctree)->row_list, row))))
|
1998-05-01 13:20:55 +00:00
|
|
|
return ctree_is_hot_spot (ctree, node, row, x, y);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Tree signals : move, expand, collapse, (un)select *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_move (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkCTreeNode *new_parent,
|
|
|
|
GtkCTreeNode *new_sibling)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_MOVE], node,
|
1998-05-01 13:20:55 +00:00
|
|
|
new_parent, new_sibling);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_expand (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_expand_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-20 19:45:45 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_expand), NULL);
|
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_expand_to_depth (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint depth)
|
1998-07-20 19:45:45 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-07-20 19:45:45 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_ctree_post_recursive_to_depth (ctree, node, depth,
|
|
|
|
GTK_CTREE_FUNC (tree_expand), NULL);
|
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_collapse (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-20 19:45:45 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
1998-05-01 13:20:55 +00:00
|
|
|
return;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_collapse), NULL);
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
gtk_clist_set_column_width (clist, i,
|
|
|
|
gtk_clist_optimal_column_width (clist, i));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-07-20 19:45:45 +00:00
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_collapse_to_depth (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint depth)
|
1998-07-20 19:45:45 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-07-20 19:45:45 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
1998-07-20 19:45:45 +00:00
|
|
|
gtk_ctree_post_recursive_to_depth (ctree, node, depth,
|
|
|
|
GTK_CTREE_FUNC (tree_collapse_to_depth),
|
|
|
|
GINT_TO_POINTER (depth));
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
gtk_clist_set_column_width (clist, i,
|
|
|
|
gtk_clist_optimal_column_width (clist, i));
|
1998-07-20 19:45:45 +00:00
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_toggle_expansion (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_toggle_expansion (ctree, node, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_ctree_post_recursive (ctree, node,
|
|
|
|
GTK_CTREE_FUNC (tree_toggle_expansion), NULL);
|
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_select (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->row.selectable)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW],
|
|
|
|
node, -1);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_unselect (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
1998-07-22 21:13:48 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW],
|
|
|
|
node, -1);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_select_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gtk_ctree_real_select_recursive (ctree, node, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_unselect_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gtk_ctree_real_select_recursive (ctree, node, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_real_select_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint state)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gboolean thaw = FALSE;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if ((state &&
|
1998-08-05 02:11:32 +00:00
|
|
|
(clist->selection_mode == GTK_SELECTION_BROWSE ||
|
|
|
|
clist->selection_mode == GTK_SELECTION_SINGLE)) ||
|
1998-05-01 13:20:55 +00:00
|
|
|
(!state && clist->selection_mode == GTK_SELECTION_BROWSE))
|
|
|
|
return;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node)))
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
thaw = TRUE;
|
|
|
|
}
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
if (state)
|
1998-05-10 17:05:39 +00:00
|
|
|
gtk_ctree_post_recursive (ctree, node,
|
|
|
|
GTK_CTREE_FUNC (tree_select), NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
else
|
1998-05-10 17:05:39 +00:00
|
|
|
gtk_ctree_post_recursive (ctree, node,
|
|
|
|
GTK_CTREE_FUNC (tree_unselect), NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (thaw)
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Analogons of GtkCList functions *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_text (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return;
|
1998-08-17 23:48:04 +00:00
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, &(GTK_CTREE_ROW(node)->row), column, GTK_CELL_TEXT,
|
|
|
|
text, 0, NULL, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_pixmap (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (pixmap != NULL);
|
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gdk_pixmap_ref (pixmap);
|
|
|
|
if (mask)
|
|
|
|
gdk_pixmap_ref (mask);
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_PIXMAP,
|
|
|
|
NULL, 0, pixmap, mask);
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_pixtext (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text,
|
1998-08-17 23:48:04 +00:00
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-08-17 23:48:04 +00:00
|
|
|
if (column != ctree->tree_column)
|
|
|
|
g_return_if_fail (pixmap != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return;
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (pixmap)
|
|
|
|
{
|
|
|
|
gdk_pixmap_ref (pixmap);
|
|
|
|
if (mask)
|
|
|
|
gdk_pixmap_ref (mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_PIXTEXT,
|
|
|
|
text, spacing, pixmap, mask);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_set_node_info (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
1998-09-03 07:28:37 +00:00
|
|
|
const gchar *text,
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap_closed,
|
|
|
|
GdkBitmap *mask_closed,
|
|
|
|
GdkPixmap *pixmap_opened,
|
|
|
|
GdkBitmap *mask_opened,
|
|
|
|
gboolean is_leaf,
|
|
|
|
gboolean expanded)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
gboolean old_leaf;
|
|
|
|
gboolean old_expanded;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
old_leaf = GTK_CTREE_ROW (node)->is_leaf;
|
|
|
|
old_expanded = GTK_CTREE_ROW (node)->expanded;
|
|
|
|
|
|
|
|
if (is_leaf && GTK_CTREE_ROW (node)->children)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
|
|
|
GtkCTreeNode *ptr;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
work = GTK_CTREE_ROW (node)->children;
|
|
|
|
while (work)
|
|
|
|
{
|
|
|
|
ptr = work;
|
|
|
|
work = GTK_CTREE_ROW(work)->sibling;
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_remove_node (ctree, ptr);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set_node_info (ctree, node, text, spacing, pixmap_closed, mask_closed,
|
1998-08-05 02:11:32 +00:00
|
|
|
pixmap_opened, mask_opened, is_leaf, expanded);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (!is_leaf && !old_leaf)
|
|
|
|
{
|
1998-08-05 02:11:32 +00:00
|
|
|
GTK_CTREE_ROW (node)->expanded = old_expanded;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (expanded && !old_expanded)
|
|
|
|
gtk_ctree_expand (ctree, node);
|
|
|
|
else if (!expanded && old_expanded)
|
|
|
|
gtk_ctree_collapse (ctree, node);
|
|
|
|
}
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
GTK_CTREE_ROW (node)->expanded = (is_leaf) ? FALSE : expanded;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_shift (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
gint vertical,
|
|
|
|
gint horizontal)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GtkRequisition requisition;
|
|
|
|
gboolean visible = FALSE;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (clist->column[column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
if (visible)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (node)->row, column, &requisition);
|
|
|
|
}
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.cell[column].vertical = vertical;
|
|
|
|
GTK_CTREE_ROW (node)->row.cell[column].horizontal = horizontal;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible)
|
|
|
|
column_auto_resize (clist, >K_CTREE_ROW (node)->row,
|
|
|
|
column, requisition.width);
|
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
static void
|
|
|
|
remove_grab (GtkCList *clist)
|
|
|
|
{
|
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
{
|
|
|
|
gtk_grab_remove (GTK_WIDGET (clist));
|
|
|
|
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->htimer)
|
|
|
|
{
|
|
|
|
gtk_timeout_remove (clist->htimer);
|
|
|
|
clist->htimer = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->vtimer)
|
|
|
|
{
|
|
|
|
gtk_timeout_remove (clist->vtimer);
|
|
|
|
clist->vtimer = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_node_set_selectable (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gboolean selectable)
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
if (selectable == GTK_CTREE_ROW (node)->row.selectable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
GTK_CTREE_ROW (node)->row.selectable = selectable;
|
|
|
|
|
|
|
|
if (!selectable && GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (clist->anchor >= 0 &&
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
{
|
1999-01-08 00:21:36 +00:00
|
|
|
clist->drag_button = 0;
|
|
|
|
remove_grab (clist);
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
}
|
|
|
|
gtk_ctree_unselect (ctree, node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gtk_ctree_node_get_selectable (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (node != NULL, FALSE);
|
|
|
|
|
|
|
|
return GTK_CTREE_ROW (node)->row.selectable;
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
GtkCellType
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_get_cell_type (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), -1);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_val_if_fail (node != NULL, -1);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return -1;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
return GTK_CTREE_ROW (node)->row.cell[column].type;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_get_text (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
gchar **text)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), 0);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_val_if_fail (node != NULL, 0);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return 0;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_TEXT)
|
1998-05-01 13:20:55 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (text)
|
1998-05-01 23:45:18 +00:00
|
|
|
*text = GTK_CELL_TEXT (GTK_CTREE_ROW (node)->row.cell[column])->text;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_get_pixmap (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
GdkPixmap **pixmap,
|
|
|
|
GdkBitmap **mask)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), 0);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_val_if_fail (node != NULL, 0);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return 0;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_PIXMAP)
|
1998-05-01 13:20:55 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (pixmap)
|
1998-05-01 23:45:18 +00:00
|
|
|
*pixmap = GTK_CELL_PIXMAP (GTK_CTREE_ROW(node)->row.cell[column])->pixmap;
|
|
|
|
if (mask)
|
|
|
|
*mask = GTK_CELL_PIXMAP (GTK_CTREE_ROW (node)->row.cell[column])->mask;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_get_pixtext (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
gchar **text,
|
|
|
|
guint8 *spacing,
|
|
|
|
GdkPixmap **pixmap,
|
|
|
|
GdkBitmap **mask)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), 0);
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_val_if_fail (node != NULL, 0);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return 0;
|
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_PIXTEXT)
|
1998-05-01 13:20:55 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (text)
|
1998-05-01 23:45:18 +00:00
|
|
|
*text = GTK_CELL_PIXTEXT (GTK_CTREE_ROW (node)->row.cell[column])->text;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (spacing)
|
1998-05-01 23:45:18 +00:00
|
|
|
*spacing = GTK_CELL_PIXTEXT (GTK_CTREE_ROW
|
|
|
|
(node)->row.cell[column])->spacing;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (pixmap)
|
1998-05-01 23:45:18 +00:00
|
|
|
*pixmap = GTK_CELL_PIXTEXT (GTK_CTREE_ROW
|
|
|
|
(node)->row.cell[column])->pixmap;
|
1998-05-01 13:20:55 +00:00
|
|
|
if (mask)
|
1998-05-01 23:45:18 +00:00
|
|
|
*mask = GTK_CELL_PIXTEXT (GTK_CTREE_ROW (node)->row.cell[column])->mask;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_get_node_info (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gchar **text,
|
|
|
|
guint8 *spacing,
|
|
|
|
GdkPixmap **pixmap_closed,
|
|
|
|
GdkBitmap **mask_closed,
|
|
|
|
GdkPixmap **pixmap_opened,
|
|
|
|
GdkBitmap **mask_opened,
|
|
|
|
gboolean *is_leaf,
|
|
|
|
gboolean *expanded)
|
1998-05-01 23:45:18 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), 0);
|
|
|
|
g_return_val_if_fail (node != NULL, 0);
|
|
|
|
|
|
|
|
if (text)
|
|
|
|
*text = GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->text;
|
|
|
|
if (spacing)
|
|
|
|
*spacing = GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->spacing;
|
|
|
|
if (pixmap_closed)
|
|
|
|
*pixmap_closed = GTK_CTREE_ROW (node)->pixmap_closed;
|
|
|
|
if (mask_closed)
|
|
|
|
*mask_closed = GTK_CTREE_ROW (node)->mask_closed;
|
|
|
|
if (pixmap_opened)
|
|
|
|
*pixmap_opened = GTK_CTREE_ROW (node)->pixmap_opened;
|
|
|
|
if (mask_opened)
|
|
|
|
*mask_opened = GTK_CTREE_ROW (node)->mask_opened;
|
|
|
|
if (is_leaf)
|
|
|
|
*is_leaf = GTK_CTREE_ROW (node)->is_leaf;
|
|
|
|
if (expanded)
|
|
|
|
*expanded = GTK_CTREE_ROW (node)->expanded;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_node_set_cell_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
|
|
|
gboolean visible = FALSE;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].style == style)
|
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
if (visible)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (node)->row, column, &requisition);
|
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].style)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[column].style);
|
|
|
|
gtk_style_unref (GTK_CTREE_ROW (node)->row.cell[column].style);
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CTREE_ROW (node)->row.cell[column].style = style;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.cell[column].style)
|
|
|
|
{
|
|
|
|
gtk_style_ref (GTK_CTREE_ROW (node)->row.cell[column].style);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
GTK_CTREE_ROW (node)->row.cell[column].style =
|
|
|
|
gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[column].style,
|
|
|
|
clist->clist_window);
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible)
|
|
|
|
column_auto_resize (clist, >K_CTREE_ROW (node)->row, column,
|
|
|
|
requisition.width);
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_draw_node (ctree, node);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkStyle *
|
|
|
|
gtk_ctree_node_get_cell_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
g_return_val_if_fail (node != NULL, NULL);
|
|
|
|
|
|
|
|
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return GTK_CTREE_ROW (node)->row.cell[column].style;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_ctree_node_set_row_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GtkStyle *style)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
|
|
|
gboolean visible;
|
|
|
|
gint *old_width = NULL;
|
|
|
|
gint i;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (node != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.style == style)
|
|
|
|
return;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
visible = gtk_ctree_is_viewable (ctree, node);
|
|
|
|
if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
old_width = g_new (gint, clist->columns);
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, >K_CTREE_ROW (node)->row, i, &requisition);
|
|
|
|
old_width[i] = requisition.width;
|
|
|
|
}
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.style)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gtk_style_detach (GTK_CTREE_ROW (node)->row.style);
|
|
|
|
gtk_style_unref (GTK_CTREE_ROW (node)->row.style);
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CTREE_ROW (node)->row.style = style;
|
|
|
|
|
|
|
|
if (GTK_CTREE_ROW (node)->row.style)
|
|
|
|
{
|
|
|
|
gtk_style_ref (GTK_CTREE_ROW (node)->row.style);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
GTK_CTREE_ROW (node)->row.style =
|
|
|
|
gtk_style_attach (GTK_CTREE_ROW (node)->row.style,
|
|
|
|
clist->clist_window);
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
column_auto_resize (clist, >K_CTREE_ROW (node)->row, i,
|
|
|
|
old_width[i]);
|
|
|
|
g_free (old_width);
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
tree_draw_node (ctree, node);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkStyle *
|
|
|
|
gtk_ctree_node_get_row_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
g_return_val_if_fail (node != NULL, NULL);
|
|
|
|
|
|
|
|
return GTK_CTREE_ROW (node)->row.style;
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_foreground (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GdkColor *color)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.foreground = *color;
|
|
|
|
GTK_CTREE_ROW (node)->row.fg_set = TRUE;
|
1998-10-16 15:00:05 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
|
|
|
|
>K_CTREE_ROW (node)->row.foreground);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.fg_set = FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_background (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
GdkColor *color)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.background = *color;
|
|
|
|
GTK_CTREE_ROW (node)->row.bg_set = TRUE;
|
1998-10-16 15:00:05 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (ctree)),
|
|
|
|
>K_CTREE_ROW (node)->row.background);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
else
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.bg_set = FALSE;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (ctree, node);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_row_data (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_row_data_full (ctree, node, data, NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_set_row_data_full (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data,
|
|
|
|
GtkDestroyNotify destroy)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1999-01-18 23:09:50 +00:00
|
|
|
g_return_if_fail (node != NULL);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-05-01 23:45:18 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.data = data;
|
|
|
|
GTK_CTREE_ROW (node)->row.destroy = destroy;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gpointer
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_get_row_data (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
return node ? GTK_CTREE_ROW (node)->row.data : NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-05-04 09:40:35 +00:00
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_node_moveto (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gint column,
|
|
|
|
gfloat row_align,
|
|
|
|
gfloat col_align)
|
1998-05-04 09:40:35 +00:00
|
|
|
{
|
1998-07-15 23:40:00 +00:00
|
|
|
gint row = -1;
|
1998-05-04 09:40:35 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
while (node && !gtk_ctree_is_viewable (ctree, node))
|
1998-07-15 23:40:00 +00:00
|
|
|
node = GTK_CTREE_ROW (node)->parent;
|
1998-05-04 09:40:35 +00:00
|
|
|
|
|
|
|
if (node)
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
row = g_list_position (clist->row_list, (GList *)node);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
gtk_clist_moveto (clist, row, column, row_align, col_align);
|
1998-05-04 09:40:35 +00:00
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
GtkVisibility gtk_ctree_node_is_visible (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
|
|
|
{
|
|
|
|
gint row;
|
|
|
|
|
|
|
|
g_return_val_if_fail (ctree != NULL, 0);
|
|
|
|
g_return_val_if_fail (node != NULL, 0);
|
|
|
|
|
|
|
|
row = g_list_position (GTK_CLIST (ctree)->row_list, (GList*) node);
|
|
|
|
return gtk_clist_row_is_visible (GTK_CLIST (ctree), row);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* GtkCTree specific functions *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_ctree_set_indent (GtkCTree *ctree,
|
|
|
|
gint indent)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
1998-05-01 23:45:18 +00:00
|
|
|
g_return_if_fail (indent >= 0);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (indent == ctree->tree_indent)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
ctree->tree_indent = indent;
|
|
|
|
|
|
|
|
if (clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, ctree->tree_column,
|
|
|
|
gtk_clist_optimal_column_width (clist, ctree->tree_column));
|
1998-11-28 01:56:09 +00:00
|
|
|
else
|
|
|
|
CLIST_REFRESH (ctree);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_set_spacing (GtkCTree *ctree,
|
|
|
|
gint spacing)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
gint old_spacing;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
g_return_if_fail (spacing >= 0);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (spacing == ctree->tree_spacing)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
old_spacing = ctree->tree_spacing;
|
|
|
|
ctree->tree_spacing = spacing;
|
|
|
|
|
|
|
|
if (clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
gtk_clist_set_column_width (clist, ctree->tree_column,
|
|
|
|
clist->column[ctree->tree_column].width +
|
|
|
|
spacing - old_spacing);
|
1998-11-28 01:56:09 +00:00
|
|
|
else
|
|
|
|
CLIST_REFRESH (ctree);
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_set_show_stub (GtkCTree *ctree,
|
|
|
|
gboolean show_stub)
|
1998-08-17 23:48:04 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
1998-09-03 07:28:37 +00:00
|
|
|
show_stub = show_stub != FALSE;
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (show_stub != ctree->show_stub)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
ctree->show_stub = show_stub;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && clist->rows &&
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_clist_row_is_visible (clist, 0) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row
|
|
|
|
(clist, NULL, 0, GTK_CLIST_ROW (clist->row_list));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_set_line_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeLineStyle line_style)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTreeLineStyle old_style;
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (line_style == ctree->line_style)
|
|
|
|
return;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
old_style = ctree->line_style;
|
|
|
|
ctree->line_style = line_style;
|
|
|
|
|
|
|
|
if (clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
|
|
|
{
|
|
|
|
if (old_style == GTK_CTREE_LINES_TABBED)
|
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, ctree->tree_column,
|
|
|
|
clist->column[ctree->tree_column].width - 3);
|
|
|
|
else if (line_style == GTK_CTREE_LINES_TABBED)
|
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, ctree->tree_column,
|
|
|
|
clist->column[ctree->tree_column].width + 3);
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
{
|
1998-05-01 13:20:55 +00:00
|
|
|
switch (line_style)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_LINES_SOLID:
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
|
|
|
|
None, None);
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_LINES_DOTTED:
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gdk_gc_set_line_attributes (ctree->lines_gc, 1,
|
|
|
|
GDK_LINE_ON_OFF_DASH, None, None);
|
1998-05-05 15:00:12 +00:00
|
|
|
gdk_gc_set_dashes (ctree->lines_gc, 0, "\1\1", 2);
|
1998-05-01 13:20:55 +00:00
|
|
|
break;
|
1998-06-22 17:00:21 +00:00
|
|
|
case GTK_CTREE_LINES_TABBED:
|
|
|
|
if (GTK_WIDGET_REALIZED (ctree))
|
|
|
|
gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID,
|
|
|
|
None, None);
|
|
|
|
break;
|
1998-05-01 13:20:55 +00:00
|
|
|
case GTK_CTREE_LINES_NONE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (ctree);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
void
|
|
|
|
gtk_ctree_set_expander_style (GtkCTree *ctree,
|
|
|
|
GtkCTreeExpanderStyle expander_style)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTreeExpanderStyle old_style;
|
|
|
|
|
1998-10-16 15:00:05 +00:00
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (expander_style == ctree->expander_style)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
|
|
|
old_style = ctree->expander_style;
|
|
|
|
ctree->expander_style = expander_style;
|
|
|
|
|
|
|
|
if (clist->column[ctree->tree_column].auto_resize &&
|
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
1998-10-16 15:00:05 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint new_width;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
new_width = clist->column[ctree->tree_column].width;
|
|
|
|
switch (old_style)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_EXPANDER_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_TRIANGLE:
|
|
|
|
new_width -= PM_SIZE + 3;
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_SQUARE:
|
|
|
|
case GTK_CTREE_EXPANDER_CIRCULAR:
|
|
|
|
new_width -= PM_SIZE + 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (expander_style)
|
|
|
|
{
|
|
|
|
case GTK_CTREE_EXPANDER_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_TRIANGLE:
|
|
|
|
new_width += PM_SIZE + 3;
|
|
|
|
break;
|
|
|
|
case GTK_CTREE_EXPANDER_SQUARE:
|
|
|
|
case GTK_CTREE_EXPANDER_CIRCULAR:
|
|
|
|
new_width += PM_SIZE + 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_clist_set_column_width (clist, ctree->tree_column, new_width);
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (GTK_WIDGET_DRAWABLE (clist))
|
|
|
|
CLIST_REFRESH (clist);
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Tree sorting functions *
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_sort (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
gpointer data)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *list_start;
|
1998-08-05 20:02:32 +00:00
|
|
|
GtkCTreeNode *cmp;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *work;
|
1998-08-05 20:02:32 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
if (node)
|
|
|
|
list_start = GTK_CTREE_ROW (node)->children;
|
|
|
|
else
|
1998-08-05 20:02:32 +00:00
|
|
|
list_start = GTK_CTREE_NODE (clist->row_list);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
while (list_start)
|
|
|
|
{
|
1998-08-05 20:02:32 +00:00
|
|
|
cmp = list_start;
|
|
|
|
work = GTK_CTREE_ROW (cmp)->sibling;
|
1998-05-01 13:20:55 +00:00
|
|
|
while (work)
|
|
|
|
{
|
1998-08-05 20:02:32 +00:00
|
|
|
if (clist->sort_type == GTK_SORT_ASCENDING)
|
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
if (clist->compare
|
|
|
|
(clist, GTK_CTREE_ROW (work), GTK_CTREE_ROW (cmp)) < 0)
|
1998-08-05 20:02:32 +00:00
|
|
|
cmp = work;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
if (clist->compare
|
|
|
|
(clist, GTK_CTREE_ROW (work), GTK_CTREE_ROW (cmp)) > 0)
|
1998-08-05 20:02:32 +00:00
|
|
|
cmp = work;
|
|
|
|
}
|
1998-05-01 13:20:55 +00:00
|
|
|
work = GTK_CTREE_ROW (work)->sibling;
|
|
|
|
}
|
1998-08-05 20:02:32 +00:00
|
|
|
if (cmp == list_start)
|
|
|
|
list_start = GTK_CTREE_ROW (cmp)->sibling;
|
1998-05-01 23:45:18 +00:00
|
|
|
else
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
1998-08-05 20:02:32 +00:00
|
|
|
gtk_ctree_unlink (ctree, cmp, FALSE);
|
|
|
|
gtk_ctree_link (ctree, cmp, node, list_start, FALSE);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
gtk_ctree_sort_recursive (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *focus_node = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (!node || (node && gtk_ctree_is_viewable (ctree, node)))
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
focus_node =
|
|
|
|
GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_sort), NULL);
|
|
|
|
|
1998-08-05 02:11:32 +00:00
|
|
|
if (!node)
|
|
|
|
tree_sort (ctree, NULL, NULL);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (focus_node)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
clist->focus_row = g_list_position (clist->row_list,(GList *)focus_node);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
static void
|
|
|
|
real_sort_list (GtkCList *clist)
|
|
|
|
{
|
|
|
|
gtk_ctree_sort_recursive (GTK_CTREE (clist), NULL);
|
|
|
|
}
|
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_sort_node (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node)
|
1998-05-01 13:20:55 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *focus_node = NULL;
|
1998-05-01 13:20:55 +00:00
|
|
|
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (ctree);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (!node || (node && gtk_ctree_is_viewable (ctree, node)))
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
focus_node = GTK_CTREE_NODE
|
|
|
|
(g_list_nth (clist->row_list, clist->focus_row));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-05-01 13:20:55 +00:00
|
|
|
tree_sort (ctree, node, NULL);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (focus_node)
|
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
clist->focus_row = g_list_position (clist->row_list,(GList *)focus_node);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-05-01 13:20:55 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
fake_unselect_all (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GList *focus_node = NULL;
|
|
|
|
|
|
|
|
if (row >= 0 && (focus_node = g_list_nth (clist->row_list, row)))
|
|
|
|
{
|
1998-09-11 13:52:42 +00:00
|
|
|
if (GTK_CTREE_ROW (focus_node)->row.state == GTK_STATE_NORMAL &&
|
|
|
|
GTK_CTREE_ROW (focus_node)->row.selectable)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (focus_node)->row.state = GTK_STATE_SELECTED;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) &&
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row,
|
|
|
|
GTK_CLIST_ROW (focus_node));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clist->undo_selection = clist->selection;
|
|
|
|
clist->selection = NULL;
|
|
|
|
clist->selection_end = NULL;
|
|
|
|
|
|
|
|
for (list = clist->undo_selection; list; list = list->next)
|
|
|
|
{
|
|
|
|
if (list->data == focus_node)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
GTK_CTREE_ROW ((GList *)(list->data))->row.state = GTK_STATE_NORMAL;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
tree_draw_node (GTK_CTREE (clist), GTK_CTREE_NODE (list->data));
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
selection_find (GtkCList *clist,
|
|
|
|
gint row_number,
|
|
|
|
GList *row_list_element)
|
|
|
|
{
|
|
|
|
return g_list_find (clist->selection, row_list_element);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
resync_selection (GtkCList *clist, GdkEvent *event)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GList *list;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
GtkCTreeNode *node;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint i;
|
|
|
|
gint e;
|
|
|
|
gint row;
|
|
|
|
gboolean unselect;
|
|
|
|
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
if (clist->anchor < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count++;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
i = MIN (clist->anchor, clist->drag_pos);
|
|
|
|
e = MAX (clist->anchor, clist->drag_pos);
|
|
|
|
|
|
|
|
if (clist->undo_selection)
|
|
|
|
{
|
|
|
|
list = clist->selection;
|
|
|
|
clist->selection = clist->undo_selection;
|
|
|
|
clist->selection_end = g_list_last (clist->selection);
|
|
|
|
clist->undo_selection = list;
|
|
|
|
list = clist->selection;
|
|
|
|
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
node = list->data;
|
|
|
|
list = list->next;
|
|
|
|
|
|
|
|
unselect = TRUE;
|
|
|
|
|
1998-08-17 23:48:04 +00:00
|
|
|
if (gtk_ctree_is_viewable (ctree, node))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
row = g_list_position (clist->row_list, (GList *)node);
|
1998-07-15 23:40:00 +00:00
|
|
|
if (row >= i && row <= e)
|
|
|
|
unselect = FALSE;
|
|
|
|
}
|
1998-09-11 13:52:42 +00:00
|
|
|
if (unselect && GTK_CTREE_ROW (node)->row.selectable)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
|
|
|
|
gtk_ctree_unselect (ctree, node);
|
|
|
|
clist->undo_selection = g_list_prepend (clist->undo_selection,
|
|
|
|
node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-02-02 01:57:11 +00:00
|
|
|
if (clist->anchor < clist->drag_pos)
|
|
|
|
{
|
|
|
|
for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, i)); i <= e;
|
|
|
|
i++, node = GTK_CTREE_NODE_NEXT (node))
|
|
|
|
if (GTK_CTREE_ROW (node)->row.selectable)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
if (g_list_find (clist->selection, node))
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
|
|
|
|
gtk_ctree_unselect (ctree, node);
|
|
|
|
clist->undo_selection =
|
|
|
|
g_list_prepend (clist->undo_selection, node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
|
|
|
|
clist->undo_unselection =
|
|
|
|
g_list_prepend (clist->undo_unselection, node);
|
1998-09-11 13:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
1999-02-02 01:57:11 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, e)); i <= e;
|
|
|
|
e--, node = GTK_CTREE_NODE_PREV (node))
|
|
|
|
if (GTK_CTREE_ROW (node)->row.selectable)
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
if (g_list_find (clist->selection, node))
|
|
|
|
{
|
|
|
|
if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
|
|
|
|
gtk_ctree_unselect (ctree, node);
|
|
|
|
clist->undo_selection =
|
|
|
|
g_list_prepend (clist->undo_selection, node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
|
|
|
|
clist->undo_unselection =
|
|
|
|
g_list_prepend (clist->undo_unselection, node);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1999-02-02 01:57:11 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
clist->undo_unselection = g_list_reverse (clist->undo_unselection);
|
|
|
|
for (list = clist->undo_unselection; list; list = list->next)
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_ctree_select (ctree, list->data);
|
|
|
|
|
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (!CLIST_UNFROZEN (clist))
|
|
|
|
clist->freeze_count--;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_undo_selection (GtkCList *clist)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GList *work;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-25 01:10:58 +00:00
|
|
|
g_return_if_fail (GTK_IS_CTREE (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
if (clist->selection_mode != GTK_SELECTION_EXTENDED)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!(clist->undo_selection || clist->undo_unselection))
|
|
|
|
{
|
|
|
|
gtk_clist_unselect_all (clist);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (clist);
|
|
|
|
|
|
|
|
for (work = clist->undo_selection; work; work = work->next)
|
1998-09-11 13:52:42 +00:00
|
|
|
if (GTK_CTREE_ROW (work->data)->row.selectable)
|
|
|
|
gtk_ctree_select (ctree, GTK_CTREE_NODE (work->data));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
for (work = clist->undo_unselection; work; work = work->next)
|
1998-09-11 13:52:42 +00:00
|
|
|
if (GTK_CTREE_ROW (work->data)->row.selectable)
|
|
|
|
gtk_ctree_unselect (ctree, GTK_CTREE_NODE (work->data));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (clist) && clist->focus_row != clist->undo_anchor)
|
|
|
|
{
|
|
|
|
gtk_widget_draw_focus (GTK_WIDGET (clist));
|
|
|
|
clist->focus_row = clist->undo_anchor;
|
|
|
|
gtk_widget_draw_focus (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist->focus_row = clist->undo_anchor;
|
|
|
|
|
|
|
|
clist->undo_anchor = -1;
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height >
|
|
|
|
clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
|
|
|
|
}
|
1998-08-15 07:30:01 +00:00
|
|
|
|
|
|
|
void
|
1998-08-17 23:48:04 +00:00
|
|
|
gtk_ctree_set_drag_compare_func (GtkCTree *ctree,
|
|
|
|
GtkCTreeCompareDragFunc cmp_func)
|
1998-08-15 07:30:01 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ctree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
|
|
|
|
|
|
|
ctree->drag_compare = cmp_func;
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static gboolean
|
|
|
|
check_drag (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *drag_source,
|
|
|
|
GtkCTreeNode *drag_target,
|
|
|
|
GtkCListDragPos insert_pos)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (ctree != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
|
|
|
|
|
|
|
if (drag_source && drag_source != drag_target &&
|
|
|
|
(!GTK_CTREE_ROW (drag_source)->children ||
|
|
|
|
!gtk_ctree_is_ancestor (ctree, drag_source, drag_target)))
|
|
|
|
{
|
|
|
|
switch (insert_pos)
|
|
|
|
{
|
|
|
|
case GTK_CLIST_DRAG_NONE:
|
|
|
|
return FALSE;
|
|
|
|
case GTK_CLIST_DRAG_AFTER:
|
|
|
|
if (GTK_CTREE_ROW (drag_target)->sibling != drag_source)
|
|
|
|
return (!ctree->drag_compare ||
|
|
|
|
ctree->drag_compare (ctree,
|
|
|
|
drag_source,
|
|
|
|
GTK_CTREE_ROW (drag_target)->parent,
|
|
|
|
GTK_CTREE_ROW(drag_target)->sibling));
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_BEFORE:
|
|
|
|
if (GTK_CTREE_ROW (drag_source)->sibling != drag_target)
|
|
|
|
return (!ctree->drag_compare ||
|
|
|
|
ctree->drag_compare (ctree,
|
|
|
|
drag_source,
|
|
|
|
GTK_CTREE_ROW (drag_target)->parent,
|
|
|
|
drag_target));
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_INTO:
|
|
|
|
if (!GTK_CTREE_ROW (drag_target)->is_leaf &&
|
|
|
|
GTK_CTREE_ROW (drag_target)->children != drag_source)
|
|
|
|
return (!ctree->drag_compare ||
|
|
|
|
ctree->drag_compare (ctree,
|
|
|
|
drag_source,
|
|
|
|
drag_target,
|
|
|
|
GTK_CTREE_ROW (drag_target)->children));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************/
|
|
|
|
static void
|
|
|
|
drag_dest_info_destroy (gpointer data)
|
|
|
|
{
|
|
|
|
GtkCListDestInfo *info = data;
|
1998-08-15 07:30:01 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
g_free (info);
|
1998-08-15 07:30:01 +00:00
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
static void
|
|
|
|
drag_dest_cell (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkCListDestInfo *dest_info)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (clist);
|
|
|
|
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
|
|
|
|
|
|
|
|
y -= (GTK_CONTAINER (widget)->border_width +
|
|
|
|
widget->style->klass->ythickness + clist->column_title_area.height);
|
|
|
|
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
|
|
|
|
|
|
|
|
if (dest_info->cell.row >= clist->rows)
|
|
|
|
{
|
|
|
|
dest_info->cell.row = clist->rows - 1;
|
|
|
|
y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height;
|
|
|
|
}
|
|
|
|
if (dest_info->cell.row < -1)
|
|
|
|
dest_info->cell.row = -1;
|
|
|
|
|
|
|
|
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
|
|
|
|
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
|
|
|
|
|
|
|
|
if (dest_info->cell.row >= 0)
|
|
|
|
{
|
|
|
|
gint y_delta;
|
|
|
|
gint h = 0;
|
|
|
|
|
|
|
|
y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row);
|
|
|
|
|
|
|
|
if (GTK_CLIST_DRAW_DRAG_RECT(clist) &&
|
|
|
|
!GTK_CTREE_ROW (g_list_nth (clist->row_list,
|
|
|
|
dest_info->cell.row))->is_leaf)
|
|
|
|
{
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_INTO;
|
|
|
|
h = clist->row_height / 4;
|
|
|
|
}
|
|
|
|
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
|
|
|
{
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
|
|
|
h = clist->row_height / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
|
|
|
{
|
|
|
|
if (y_delta < h)
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
|
|
|
else if (clist->row_height - y_delta < h)
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_AFTER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-08-15 07:30:01 +00:00
|
|
|
static void
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_ctree_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
1998-08-15 07:30:01 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTree *ctree;
|
1999-01-08 00:21:36 +00:00
|
|
|
gboolean use_icons;
|
1998-08-15 07:30:01 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
ctree = GTK_CTREE (widget);
|
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
use_icons = GTK_CLIST_USE_DRAG_ICONS (clist);
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_USE_DRAG_ICONS);
|
|
|
|
GTK_WIDGET_CLASS (parent_class)->drag_begin (widget, context);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
if (use_icons)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
GtkCTreeNode *node;
|
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS);
|
|
|
|
node = GTK_CTREE_NODE (g_list_nth (clist->row_list,
|
|
|
|
clist->click_cell.row));
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (node)
|
1998-08-17 23:48:04 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap)
|
|
|
|
{
|
|
|
|
gtk_drag_set_icon_pixmap
|
|
|
|
(context,
|
|
|
|
gtk_widget_get_colormap (widget),
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap,
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask,
|
|
|
|
-2, -2);
|
|
|
|
return;
|
|
|
|
}
|
1998-08-17 23:48:04 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_drag_set_icon_default (context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_ctree_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCTree *ctree;
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkCListDestInfo new_info;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCListDestInfo *dest_info;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CTREE (widget), FALSE);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
ctree = GTK_CTREE (widget);
|
|
|
|
|
|
|
|
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
|
|
|
|
|
|
|
|
if (!dest_info)
|
|
|
|
{
|
|
|
|
dest_info = g_new (GtkCListDestInfo, 1);
|
|
|
|
|
|
|
|
dest_info->cell.row = -1;
|
|
|
|
dest_info->cell.column = -1;
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
|
|
|
|
|
|
|
|
g_dataset_set_data_full (context, "gtk-clist-drag-dest", dest_info,
|
|
|
|
drag_dest_info_destroy);
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
drag_dest_cell (clist, x, y, &new_info);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_REORDERABLE (clist))
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
|
|
|
|
|
|
|
|
list = context->targets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
if (atom == GPOINTER_TO_INT (list->data))
|
|
|
|
break;
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
GtkCTreeNode *drag_source;
|
|
|
|
GtkCTreeNode *drag_target;
|
|
|
|
|
|
|
|
drag_source = GTK_CTREE_NODE (g_list_nth (clist->row_list,
|
|
|
|
clist->click_cell.row));
|
1999-04-30 11:48:42 +00:00
|
|
|
drag_target = GTK_CTREE_NODE (g_list_nth (clist->row_list,
|
|
|
|
new_info.cell.row));
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
if (gtk_drag_get_source_widget (context) != widget ||
|
1999-04-30 11:48:42 +00:00
|
|
|
!check_drag (ctree, drag_source, drag_target,
|
|
|
|
new_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (dest_info->cell.row < 0)
|
|
|
|
{
|
|
|
|
gdk_drag_status (context, GDK_ACTION_DEFAULT, time);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
if (new_info.cell.row != dest_info->cell.row ||
|
|
|
|
(new_info.cell.row == dest_info->cell.row &&
|
|
|
|
dest_info->insert_pos != new_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (dest_info->cell.row >= 0)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
|
|
|
(clist,
|
|
|
|
g_list_nth (clist->row_list, dest_info->cell.row)->data,
|
|
|
|
dest_info->cell.row, dest_info->insert_pos);
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info->insert_pos = new_info.insert_pos;
|
|
|
|
dest_info->cell.row = new_info.cell.row;
|
|
|
|
dest_info->cell.column = new_info.cell.column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
|
|
|
(clist,
|
|
|
|
g_list_nth (clist->row_list, dest_info->cell.row)->data,
|
|
|
|
dest_info->cell.row, dest_info->insert_pos);
|
|
|
|
|
|
|
|
gdk_drag_status (context, context->suggested_action, time);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info->insert_pos = new_info.insert_pos;
|
|
|
|
dest_info->cell.row = new_info.cell.row;
|
|
|
|
dest_info->cell.column = new_info.cell.column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_ctree_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint32 time)
|
|
|
|
{
|
|
|
|
GtkCTree *ctree;
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CTREE (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
g_return_if_fail (selection_data != NULL);
|
|
|
|
|
|
|
|
ctree = GTK_CTREE (widget);
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
if (GTK_CLIST_REORDERABLE (clist) &&
|
|
|
|
gtk_drag_get_source_widget (context) == widget &&
|
|
|
|
selection_data->target ==
|
|
|
|
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE) &&
|
|
|
|
selection_data->format == GTK_TYPE_POINTER &&
|
|
|
|
selection_data->length == sizeof (GtkCListCellInfo))
|
|
|
|
{
|
|
|
|
GtkCListCellInfo *source_info;
|
|
|
|
|
|
|
|
source_info = (GtkCListCellInfo *)(selection_data->data);
|
1999-04-30 11:48:42 +00:00
|
|
|
if (source_info)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkCListDestInfo dest_info;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCTreeNode *source_node;
|
|
|
|
GtkCTreeNode *dest_node;
|
1999-04-30 11:48:42 +00:00
|
|
|
|
|
|
|
drag_dest_cell (clist, x, y, &dest_info);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
source_node = GTK_CTREE_NODE (g_list_nth (clist->row_list,
|
|
|
|
source_info->row));
|
|
|
|
dest_node = GTK_CTREE_NODE (g_list_nth (clist->row_list,
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info.cell.row));
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
if (!source_node || !dest_node)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
return;
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
switch (dest_info.insert_pos)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
case GTK_CLIST_DRAG_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_INTO:
|
1999-04-30 11:48:42 +00:00
|
|
|
g_print ("drag into\n");
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (check_drag (ctree, source_node, dest_node,
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_ctree_move (ctree, source_node, dest_node,
|
|
|
|
GTK_CTREE_ROW (dest_node)->children);
|
|
|
|
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_BEFORE:
|
1999-04-30 11:48:42 +00:00
|
|
|
g_print ("drag before\n");
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (check_drag (ctree, source_node, dest_node,
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_ctree_move (ctree, source_node,
|
|
|
|
GTK_CTREE_ROW (dest_node)->parent, dest_node);
|
|
|
|
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_AFTER:
|
1999-04-30 11:48:42 +00:00
|
|
|
g_print ("drag after\n");
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (check_drag (ctree, source_node, dest_node,
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_ctree_move (ctree, source_node,
|
|
|
|
GTK_CTREE_ROW (dest_node)->parent,
|
|
|
|
GTK_CTREE_ROW (dest_node)->sibling);
|
|
|
|
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|