forked from AuroraMiddleware/gtk
rearranged some functions (gtk_clist_set_column_auto_resize): new
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c: rearranged some functions (gtk_clist_set_column_auto_resize): new function. toggle auto_resize flag of column (gtk_clist_set_column_resizeable): if resizeable disable auto_resize (gtk_clist_set_border): deprecated function, use gtk_clist_set_shadow_type instead. (gtk_clist_set_shadow_type): replacement for gtk_clist_set_border (adjust_scrollbars): some cleanups (select_row) (unselect_row): removed. replaced by equivalent gtk_signal_emit calls (add_style_data): removed, use gtk_clist_style_set instead (gtk_clist_style_set): fill in size data, after style was set. (set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style) (gtk_clist_set_cell_style): auto_resize columns if needed (column_auto_resize): resize column if needed for auto_resize (real_clear): disable auto_resize while list destroy (resize_column): removed * gtk/gtkctree.c : (gtk_ctree_remove_node) (gtk_ctree_set_line_style) (gtk_ctree_set_expander_style) (gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style) (set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing) (real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node) (real_tree_collapse) (real_tree_expand) (column_auto_resize): auto_resize columns if needed (gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth) (real_clear): disable auto_resize while processing the tree * gtk/testgtk.c (create_clist) (create_ctree): set auto_resize for one column
This commit is contained in:
parent
b443f453ed
commit
e45890a616
33
ChangeLog
33
ChangeLog
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
@ -1,3 +1,36 @@
|
||||
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
|
||||
|
||||
* gtk/gtkclist.c: rearranged some functions
|
||||
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
|
||||
flag of column
|
||||
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
|
||||
(gtk_clist_set_border): deprecated function, use
|
||||
gtk_clist_set_shadow_type instead.
|
||||
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
|
||||
(adjust_scrollbars): some cleanups
|
||||
(select_row) (unselect_row): removed. replaced by equivalent
|
||||
gtk_signal_emit calls
|
||||
(add_style_data): removed, use gtk_clist_style_set instead
|
||||
(gtk_clist_style_set): fill in size data, after style was set.
|
||||
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
|
||||
(gtk_clist_set_cell_style): auto_resize columns if needed
|
||||
(column_auto_resize): resize column if needed for auto_resize
|
||||
(real_clear): disable auto_resize while list destroy
|
||||
(resize_column): removed
|
||||
|
||||
* gtk/gtkctree.c : (gtk_ctree_remove_node)
|
||||
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
|
||||
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
|
||||
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
|
||||
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
|
||||
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
|
||||
auto_resize columns if needed
|
||||
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
|
||||
(real_clear): disable auto_resize while processing the tree
|
||||
|
||||
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
|
||||
for one column
|
||||
|
||||
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
|
||||
|
5126
gtk/gtkclist.c
5126
gtk/gtkclist.c
File diff suppressed because it is too large
Load Diff
180
gtk/gtkclist.h
180
gtk/gtkclist.h
@ -36,15 +36,16 @@ extern "C" {
|
||||
/* clist flags */
|
||||
enum
|
||||
{
|
||||
GTK_CLIST_FROZEN = 1 << 0,
|
||||
GTK_CLIST_IN_DRAG = 1 << 1,
|
||||
GTK_CLIST_DRAG_SELECTION = 1 << 2,
|
||||
GTK_CLIST_ROW_HEIGHT_SET = 1 << 3,
|
||||
GTK_CLIST_SHOW_TITLES = 1 << 4,
|
||||
GTK_CLIST_CONSTRUCTED = 1 << 5,
|
||||
GTK_CLIST_CHILD_HAS_FOCUS = 1 << 6,
|
||||
GTK_CLIST_ADD_MODE = 1 << 7,
|
||||
GTK_CLIST_AUTO_SORT = 1 << 8
|
||||
GTK_CLIST_FROZEN = 1 << 0,
|
||||
GTK_CLIST_IN_DRAG = 1 << 1,
|
||||
GTK_CLIST_DRAG_SELECTION = 1 << 2,
|
||||
GTK_CLIST_ROW_HEIGHT_SET = 1 << 3,
|
||||
GTK_CLIST_SHOW_TITLES = 1 << 4,
|
||||
GTK_CLIST_CONSTRUCTED = 1 << 5,
|
||||
GTK_CLIST_CHILD_HAS_FOCUS = 1 << 6,
|
||||
GTK_CLIST_ADD_MODE = 1 << 7,
|
||||
GTK_CLIST_AUTO_SORT = 1 << 8,
|
||||
GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 << 9
|
||||
};
|
||||
|
||||
/* cell types */
|
||||
@ -76,6 +77,7 @@ typedef enum
|
||||
#define GTK_CLIST_DRAG_SELECTION(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAG_SELECTION)
|
||||
#define GTK_CLIST_ADD_MODE(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ADD_MODE)
|
||||
#define GTK_CLIST_AUTO_SORT(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_SORT)
|
||||
#define GTK_CLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_RESIZE_BLOCKED)
|
||||
|
||||
#define GTK_CLIST_ROW(_glist_) ((GtkCListRow *)((_glist_)->data))
|
||||
|
||||
@ -191,64 +193,68 @@ struct _GtkCListClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
|
||||
void (*select_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event);
|
||||
void (*unselect_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event);
|
||||
void (*click_column) (GtkCList *clist,
|
||||
gint column);
|
||||
void (*resize_column) (GtkCList *clist,
|
||||
gint column,
|
||||
gint width);
|
||||
void (*toggle_focus_row) (GtkCList *clist);
|
||||
void (*select_all) (GtkCList *clist);
|
||||
void (*unselect_all) (GtkCList *clist);
|
||||
void (*undo_selection) (GtkCList *clist);
|
||||
void (*start_selection) (GtkCList *clist);
|
||||
void (*end_selection) (GtkCList *clist);
|
||||
void (*extend_selection) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position,
|
||||
gboolean auto_start_selection);
|
||||
void (*scroll_horizontal) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position);
|
||||
void (*scroll_vertical) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position);
|
||||
void (*toggle_add_mode) (GtkCList *clist);
|
||||
void (*abort_column_resize) (GtkCList *clist);
|
||||
void (*resync_selection) (GtkCList *clist,
|
||||
GdkEvent *event);
|
||||
GList* (*selection_find) (GtkCList *clist,
|
||||
gint row_number,
|
||||
GList *row_list_element);
|
||||
void (*draw_row) (GtkCList *clist,
|
||||
GdkRectangle *area,
|
||||
gint row,
|
||||
GtkCListRow *clist_row);
|
||||
void (*clear) (GtkCList *clist);
|
||||
void (*fake_unselect_all) (GtkCList *clist,
|
||||
gint row);
|
||||
void (*sort_list) (GtkCList *clist);
|
||||
gint (*insert_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gchar *text[]);
|
||||
void (*remove_row) (GtkCList *clist,
|
||||
gint row);
|
||||
void (*set_cell_contents) (GtkCList *clist,
|
||||
GtkCListRow *clist_row,
|
||||
gint column,
|
||||
GtkCellType type,
|
||||
const gchar *text,
|
||||
guint8 spacing,
|
||||
GdkPixmap *pixmap,
|
||||
GdkBitmap *mask);
|
||||
|
||||
void (*select_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event);
|
||||
void (*unselect_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEvent *event);
|
||||
void (*click_column) (GtkCList *clist,
|
||||
gint column);
|
||||
void (*resize_column) (GtkCList *clist,
|
||||
gint column,
|
||||
gint width);
|
||||
void (*toggle_focus_row) (GtkCList *clist);
|
||||
void (*select_all) (GtkCList *clist);
|
||||
void (*unselect_all) (GtkCList *clist);
|
||||
void (*undo_selection) (GtkCList *clist);
|
||||
void (*start_selection) (GtkCList *clist);
|
||||
void (*end_selection) (GtkCList *clist);
|
||||
void (*extend_selection) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position,
|
||||
gboolean auto_start_selection);
|
||||
void (*scroll_horizontal) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position);
|
||||
void (*scroll_vertical) (GtkCList *clist,
|
||||
GtkScrollType scroll_type,
|
||||
gfloat position);
|
||||
void (*toggle_add_mode) (GtkCList *clist);
|
||||
void (*abort_column_resize) (GtkCList *clist);
|
||||
void (*resync_selection) (GtkCList *clist,
|
||||
GdkEvent *event);
|
||||
GList* (*selection_find) (GtkCList *clist,
|
||||
gint row_number,
|
||||
GList *row_list_element);
|
||||
void (*draw_row) (GtkCList *clist,
|
||||
GdkRectangle *area,
|
||||
gint row,
|
||||
GtkCListRow *clist_row);
|
||||
void (*clear) (GtkCList *clist);
|
||||
void (*fake_unselect_all) (GtkCList *clist,
|
||||
gint row);
|
||||
void (*sort_list) (GtkCList *clist);
|
||||
gint (*insert_row) (GtkCList *clist,
|
||||
gint row,
|
||||
gchar *text[]);
|
||||
void (*remove_row) (GtkCList *clist,
|
||||
gint row);
|
||||
void (*set_cell_contents) (GtkCList *clist,
|
||||
GtkCListRow *clist_row,
|
||||
gint column,
|
||||
GtkCellType type,
|
||||
const gchar *text,
|
||||
guint8 spacing,
|
||||
GdkPixmap *pixmap,
|
||||
GdkBitmap *mask);
|
||||
void (*cell_size_request) (GtkCList *clist,
|
||||
GtkCListRow *clist_row,
|
||||
gint column,
|
||||
GtkRequisition *requisition);
|
||||
|
||||
gint scrollbar_spacing;
|
||||
};
|
||||
|
||||
@ -265,9 +271,10 @@ struct _GtkCListColumn
|
||||
gint max_width;
|
||||
GtkJustification justification;
|
||||
|
||||
gint visible : 1;
|
||||
gint width_set : 1;
|
||||
gint resizeable : 1;
|
||||
guint visible : 1;
|
||||
guint width_set : 1;
|
||||
guint resizeable : 1;
|
||||
guint auto_resize : 1;
|
||||
};
|
||||
|
||||
struct _GtkCListRow
|
||||
@ -283,9 +290,9 @@ struct _GtkCListRow
|
||||
gpointer data;
|
||||
GtkDestroyNotify destroy;
|
||||
|
||||
gint fg_set : 1;
|
||||
gint bg_set : 1;
|
||||
gint selectable : 1;
|
||||
guint fg_set : 1;
|
||||
guint bg_set : 1;
|
||||
guint selectable : 1;
|
||||
};
|
||||
|
||||
/* Cell Structures */
|
||||
@ -381,10 +388,14 @@ GtkWidget *gtk_clist_new (gint columns);
|
||||
GtkWidget *gtk_clist_new_with_titles (gint columns,
|
||||
gchar *titles[]);
|
||||
|
||||
/* set the border style of the clist */
|
||||
/* deprecated function, use gtk_clist_set_shadow_type instead. */
|
||||
void gtk_clist_set_border (GtkCList *clist,
|
||||
GtkShadowType border);
|
||||
|
||||
/* set the border style of the clist */
|
||||
void gtk_clist_set_shadow_type (GtkCList *clist,
|
||||
GtkShadowType type);
|
||||
|
||||
/* set the clist's selection mode */
|
||||
void gtk_clist_set_selection_mode (GtkCList *clist,
|
||||
GtkSelectionMode mode);
|
||||
@ -444,6 +455,15 @@ void gtk_clist_set_column_resizeable (GtkCList *clist,
|
||||
gint column,
|
||||
gboolean resizeable);
|
||||
|
||||
/* resize column automatically to its optimal width */
|
||||
void gtk_clist_set_column_auto_resize (GtkCList *clist,
|
||||
gint column,
|
||||
gboolean auto_resize);
|
||||
|
||||
/* return the optimal column width, i.e. maximum of all cell widths */
|
||||
gint gtk_clist_optimal_column_width (GtkCList *clist,
|
||||
gint column);
|
||||
|
||||
/* set the pixel width of a column; this is a necessary step in
|
||||
* creating a CList because otherwise the column width is chozen from
|
||||
* the width of the column title, which will never be right
|
||||
@ -546,20 +566,20 @@ void gtk_clist_set_background (GtkCList *clist,
|
||||
|
||||
/* set / get cell styles */
|
||||
void gtk_clist_set_cell_style (GtkCList *clist,
|
||||
gint row,
|
||||
gint column,
|
||||
gint row,
|
||||
gint column,
|
||||
GtkStyle *style);
|
||||
|
||||
GtkStyle *gtk_clist_get_cell_style (GtkCList *clist,
|
||||
gint row,
|
||||
gint column);
|
||||
gint row,
|
||||
gint column);
|
||||
|
||||
void gtk_clist_set_row_style (GtkCList *clist,
|
||||
gint row,
|
||||
gint row,
|
||||
GtkStyle *style);
|
||||
|
||||
GtkStyle *gtk_clist_get_row_style (GtkCList *clist,
|
||||
gint row);
|
||||
gint row);
|
||||
|
||||
/* this sets a horizontal and vertical shift for drawing
|
||||
* the contents of a cell; it can be positive or negitive;
|
||||
|
516
gtk/gtkctree.c
516
gtk/gtkctree.c
@ -221,7 +221,14 @@ static void real_sort_list (GtkCList *clist);
|
||||
static void set_mouse_cursor (GtkCTree *ctree,
|
||||
gboolean enable);
|
||||
static void check_cursor (GtkCTree *ctree);
|
||||
|
||||
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);
|
||||
|
||||
enum
|
||||
{
|
||||
@ -369,6 +376,7 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
|
||||
clist_class->remove_row = real_remove_row;
|
||||
clist_class->sort_list = real_sort_list;
|
||||
clist_class->set_cell_contents = set_cell_contents;
|
||||
clist_class->cell_size_request = cell_size_request;
|
||||
|
||||
klass->tree_select_row = real_tree_select;
|
||||
klass->tree_unselect_row = real_tree_unselect;
|
||||
@ -2521,6 +2529,7 @@ real_tree_move (GtkCTree *ctree,
|
||||
GtkCList *clist;
|
||||
GtkCTreeNode *work;
|
||||
gboolean thaw = FALSE;
|
||||
gboolean visible = FALSE;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (node != NULL);
|
||||
@ -2537,6 +2546,8 @@ real_tree_move (GtkCTree *ctree,
|
||||
|
||||
clist = GTK_CLIST (ctree);
|
||||
|
||||
visible = gtk_ctree_is_viewable (ctree, node);
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
@ -2589,6 +2600,13 @@ real_tree_move (GtkCTree *ctree,
|
||||
clist->undo_anchor = clist->focus_row;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
if (thaw)
|
||||
gtk_clist_thaw (clist);
|
||||
}
|
||||
@ -2642,6 +2660,8 @@ real_tree_expand (GtkCTree *ctree,
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkCTreeNode *work;
|
||||
GtkRequisition requisition;
|
||||
gboolean visible;
|
||||
gint level;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
@ -2658,6 +2678,14 @@ real_tree_expand (GtkCTree *ctree,
|
||||
GTK_CTREE_ROW (node)->expanded = TRUE;
|
||||
level = GTK_CTREE_ROW (node)->level;
|
||||
|
||||
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 */
|
||||
if (GTK_CELL_PIXTEXT
|
||||
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap)
|
||||
{
|
||||
@ -2679,6 +2707,7 @@ real_tree_expand (GtkCTree *ctree,
|
||||
}
|
||||
}
|
||||
|
||||
/* set/ref opened pixmap */
|
||||
if (GTK_CTREE_ROW (node)->pixmap_opened)
|
||||
{
|
||||
GTK_CELL_PIXTEXT
|
||||
@ -2691,15 +2720,37 @@ real_tree_expand (GtkCTree *ctree,
|
||||
gdk_pixmap_ref (GTK_CTREE_ROW (node)->mask_opened);
|
||||
}
|
||||
|
||||
|
||||
work = GTK_CTREE_ROW (node)->children;
|
||||
if (work)
|
||||
{
|
||||
GList *list;
|
||||
gint *cell_width = NULL;
|
||||
gint tmp = 0;
|
||||
gint row;
|
||||
GList *list;
|
||||
gint i;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
while (GTK_CTREE_NODE_NEXT (work))
|
||||
{
|
||||
if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
||||
{
|
||||
/* 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]);
|
||||
}
|
||||
}
|
||||
|
||||
work = GTK_CTREE_NODE_NEXT (work);
|
||||
tmp++;
|
||||
}
|
||||
@ -2718,16 +2769,29 @@ real_tree_expand (GtkCTree *ctree,
|
||||
list = (GList *)node;
|
||||
list->next = (GList *)(GTK_CTREE_ROW (node)->children);
|
||||
|
||||
if (gtk_ctree_is_viewable (ctree, node))
|
||||
if (visible)
|
||||
{
|
||||
/* 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 */
|
||||
row = g_list_position (clist->row_list, (GList *)node);
|
||||
if (row < clist->focus_row)
|
||||
clist->focus_row += tmp + 1;
|
||||
|
||||
clist->rows += tmp + 1;
|
||||
if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (clist);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2736,12 +2800,15 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkCTreeNode *work;
|
||||
GtkRequisition requisition;
|
||||
gboolean visible;
|
||||
gint level;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
|
||||
if (!node || !GTK_CTREE_ROW (node)->expanded ||GTK_CTREE_ROW (node)->is_leaf)
|
||||
if (!node || !GTK_CTREE_ROW (node)->expanded ||
|
||||
GTK_CTREE_ROW (node)->is_leaf)
|
||||
return;
|
||||
|
||||
clist = GTK_CLIST (ctree);
|
||||
@ -2752,6 +2819,14 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
GTK_CTREE_ROW (node)->expanded = FALSE;
|
||||
level = GTK_CTREE_ROW (node)->level;
|
||||
|
||||
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 */
|
||||
if (GTK_CELL_PIXTEXT
|
||||
(GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap)
|
||||
{
|
||||
@ -2773,6 +2848,7 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
}
|
||||
}
|
||||
|
||||
/* set/ref closed pixmap */
|
||||
if (GTK_CTREE_ROW (node)->pixmap_closed)
|
||||
{
|
||||
GTK_CELL_PIXTEXT
|
||||
@ -2814,8 +2890,35 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
clist->row_list_end = (GList *)node;
|
||||
}
|
||||
|
||||
if (gtk_ctree_is_viewable (ctree, node))
|
||||
if (visible)
|
||||
{
|
||||
/* resize auto_resize columns if needed */
|
||||
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
||||
{
|
||||
GList *list;
|
||||
gint new_width;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].auto_resize)
|
||||
{
|
||||
/* run a "gtk_clist_optimal_column_width" but break, if
|
||||
* the column doesn't shrink */
|
||||
new_width = 0;
|
||||
for (list = clist->row_list; list; list = list->next)
|
||||
{
|
||||
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
||||
(clist, GTK_CLIST_ROW (list), i, &requisition);
|
||||
new_width = MAX (new_width, requisition.width);
|
||||
if (new_width == clist->column[i].width)
|
||||
break;
|
||||
}
|
||||
|
||||
if (new_width < clist->column[i].width)
|
||||
gtk_clist_set_column_width (clist, i, new_width);
|
||||
}
|
||||
}
|
||||
|
||||
row = g_list_position (clist->row_list, (GList *)node);
|
||||
if (row < clist->focus_row)
|
||||
clist->focus_row -= tmp;
|
||||
@ -2824,6 +2927,133 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
gtk_clist_thaw (clist);
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
||||
column, &requisition);
|
||||
|
||||
if (requisition.width > clist->column[column].width)
|
||||
{
|
||||
if (clist->column[column].max_width < 0)
|
||||
gtk_clist_set_column_width (clist, column, requisition.width);
|
||||
else if (clist->column[column].max_width > clist->column[column].width)
|
||||
gtk_clist_set_column_width (clist, column,
|
||||
MIN (requisition.width,
|
||||
clist->column[column].max_width));
|
||||
}
|
||||
else if (requisition.width < old_width &&
|
||||
old_width == clist->column[column].width)
|
||||
{
|
||||
GList *list;
|
||||
gint new_width = 0;
|
||||
|
||||
/* run a "gtk_clist_optimal_column_width" but break, if
|
||||
* the column doesn't shrink */
|
||||
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)
|
||||
gtk_clist_set_column_width
|
||||
(clist, column, MAX (new_width, clist->column[column].min_width));
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
get_cell_style (clist, clist_row, GTK_STATE_PRELIGHT, column, &style,
|
||||
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:
|
||||
gdk_window_get_size (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap,
|
||||
&width, &height);
|
||||
requisition->width = width +
|
||||
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing +
|
||||
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;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2836,7 +3066,9 @@ set_cell_contents (GtkCList *clist,
|
||||
GdkPixmap *pixmap,
|
||||
GdkBitmap *mask)
|
||||
{
|
||||
gboolean visible = FALSE;
|
||||
GtkCTree *ctree;
|
||||
GtkRequisition requisition;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (clist));
|
||||
@ -2844,6 +3076,21 @@ set_cell_contents (GtkCList *clist,
|
||||
|
||||
ctree = GTK_CTREE (clist);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
switch (clist_row->cell[column].type)
|
||||
{
|
||||
case GTK_CELL_EMPTY:
|
||||
@ -2852,13 +3099,11 @@ set_cell_contents (GtkCList *clist,
|
||||
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);
|
||||
@ -2871,7 +3116,6 @@ set_cell_contents (GtkCList *clist,
|
||||
(GTK_CELL_PIXTEXT (clist_row->cell[column])->mask);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_CELL_WIDGET:
|
||||
/* unimplimented */
|
||||
break;
|
||||
@ -2893,7 +3137,6 @@ set_cell_contents (GtkCList *clist,
|
||||
GTK_CELL_TEXT (clist_row->cell[column])->text = g_strdup (text);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_CELL_PIXMAP:
|
||||
if (pixmap)
|
||||
{
|
||||
@ -2903,7 +3146,6 @@ set_cell_contents (GtkCList *clist,
|
||||
GTK_CELL_PIXMAP (clist_row->cell[column])->mask = mask;
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_CELL_PIXTEXT:
|
||||
if (column == ctree->tree_column)
|
||||
{
|
||||
@ -2933,10 +3175,12 @@ set_cell_contents (GtkCList *clist,
|
||||
GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (visible)
|
||||
column_auto_resize (clist, clist_row, column, requisition.width);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3654,6 +3898,22 @@ gtk_ctree_insert_node (GtkCTree *ctree,
|
||||
|
||||
gtk_ctree_link (ctree, node, parent, sibling, TRUE);
|
||||
|
||||
if (text && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist) &&
|
||||
gtk_ctree_is_viewable (ctree, node))
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].auto_resize)
|
||||
{
|
||||
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist,
|
||||
&(new_row->row),
|
||||
i, &requisition);
|
||||
if (requisition.width > clist->column[i].width)
|
||||
gtk_clist_set_column_width (clist, i, requisition.width);
|
||||
}
|
||||
}
|
||||
|
||||
if (!GTK_CLIST_FROZEN (clist))
|
||||
gtk_clist_thaw (clist);
|
||||
|
||||
@ -3816,9 +4076,40 @@ gtk_ctree_remove_node (GtkCTree *ctree,
|
||||
|
||||
if (node)
|
||||
{
|
||||
gboolean visible;
|
||||
|
||||
visible = gtk_ctree_is_viewable (ctree, node);
|
||||
gtk_ctree_unlink (ctree, node, TRUE);
|
||||
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_delete),
|
||||
NULL);
|
||||
|
||||
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
GList *list;
|
||||
gint new_width;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
if (clist->column[i].auto_resize)
|
||||
{
|
||||
/* run a "gtk_clist_optimal_column_width" but break, if
|
||||
* the column doesn't shrink */
|
||||
new_width = 0;
|
||||
for (list = clist->row_list; list; list = list->next)
|
||||
{
|
||||
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
||||
(clist, GTK_CLIST_ROW (list), i, &requisition);
|
||||
new_width = MAX (new_width, requisition.width);
|
||||
if (new_width == clist->column[i].width)
|
||||
break;
|
||||
}
|
||||
|
||||
if (new_width < clist->column[i].width)
|
||||
gtk_clist_set_column_width (clist, i, new_width);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
gtk_clist_clear (clist);
|
||||
@ -3846,11 +4137,12 @@ real_clear (GtkCList *clist)
|
||||
ctree->drag_target = NULL;
|
||||
ctree->drag_icon = NULL;
|
||||
|
||||
/* remove all the rows */
|
||||
/* remove all rows */
|
||||
work = GTK_CTREE_NODE (clist->row_list);
|
||||
clist->row_list = NULL;
|
||||
clist->row_list_end = NULL;
|
||||
|
||||
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
||||
while (work)
|
||||
{
|
||||
ptr = work;
|
||||
@ -3858,6 +4150,7 @@ real_clear (GtkCList *clist)
|
||||
gtk_ctree_post_recursive (ctree, ptr, GTK_CTREE_FUNC (tree_delete_row),
|
||||
NULL);
|
||||
}
|
||||
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
||||
|
||||
(parent_class->clear) (clist);
|
||||
}
|
||||
@ -4353,6 +4646,7 @@ gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
||||
{
|
||||
GtkCList *clist;
|
||||
gboolean thaw = FALSE;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
@ -4369,7 +4663,13 @@ gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
||||
thaw = TRUE;
|
||||
}
|
||||
|
||||
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
||||
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_collapse), NULL);
|
||||
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));
|
||||
|
||||
if (thaw)
|
||||
gtk_clist_thaw (clist);
|
||||
@ -4382,6 +4682,7 @@ gtk_ctree_collapse_to_depth (GtkCTree *ctree,
|
||||
{
|
||||
GtkCList *clist;
|
||||
gboolean thaw = FALSE;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
@ -4398,9 +4699,15 @@ gtk_ctree_collapse_to_depth (GtkCTree *ctree,
|
||||
thaw = TRUE;
|
||||
}
|
||||
|
||||
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
||||
gtk_ctree_post_recursive_to_depth (ctree, node, depth,
|
||||
GTK_CTREE_FUNC (tree_collapse_to_depth),
|
||||
GINT_TO_POINTER (depth));
|
||||
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));
|
||||
|
||||
if (thaw)
|
||||
gtk_clist_thaw (clist);
|
||||
@ -4691,6 +4998,10 @@ gtk_ctree_node_set_shift (GtkCTree *ctree,
|
||||
gint vertical,
|
||||
gint horizontal)
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkRequisition requisition;
|
||||
gboolean visible = FALSE;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
g_return_if_fail (node != NULL);
|
||||
@ -4698,9 +5009,24 @@ gtk_ctree_node_set_shift (GtkCTree *ctree,
|
||||
if (column < 0 || column >= GTK_CLIST (ctree)->columns)
|
||||
return;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
GTK_CTREE_ROW (node)->row.cell[column].vertical = vertical;
|
||||
GTK_CTREE_ROW (node)->row.cell[column].horizontal = horizontal;
|
||||
|
||||
if (visible)
|
||||
column_auto_resize (clist, >K_CTREE_ROW (node)->row,
|
||||
column, requisition.width);
|
||||
|
||||
tree_draw_node (ctree, node);
|
||||
}
|
||||
|
||||
@ -4898,6 +5224,8 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
|
||||
GtkStyle *style)
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkRequisition requisition;
|
||||
gboolean visible = FALSE;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
@ -4911,6 +5239,15 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
|
||||
if (GTK_CTREE_ROW (node)->row.cell[column].style == style)
|
||||
return;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (GTK_CTREE_ROW (node)->row.cell[column].style)
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (ctree))
|
||||
@ -4930,6 +5267,10 @@ gtk_ctree_node_set_cell_style (GtkCTree *ctree,
|
||||
clist->clist_window);
|
||||
}
|
||||
|
||||
if (visible)
|
||||
column_auto_resize (clist, >K_CTREE_ROW (node)->row, column,
|
||||
requisition.width);
|
||||
|
||||
tree_draw_node (ctree, node);
|
||||
}
|
||||
|
||||
@ -4954,6 +5295,10 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
|
||||
GtkStyle *style)
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkRequisition requisition;
|
||||
gboolean visible;
|
||||
gint *old_width = NULL;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
@ -4963,6 +5308,19 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
|
||||
|
||||
if (GTK_CTREE_ROW (node)->row.style == style)
|
||||
return;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (GTK_CTREE_ROW (node)->row.style)
|
||||
{
|
||||
@ -4983,6 +5341,14 @@ gtk_ctree_node_set_row_style (GtkCTree *ctree,
|
||||
clist->clist_window);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
tree_draw_node (ctree, node);
|
||||
}
|
||||
|
||||
@ -5115,37 +5481,57 @@ GtkVisibility gtk_ctree_node_is_visible (GtkCTree *ctree,
|
||||
* GtkCTree specific functions *
|
||||
***********************************************************/
|
||||
|
||||
|
||||
void
|
||||
gtk_ctree_set_indent (GtkCTree *ctree,
|
||||
gint indent)
|
||||
{
|
||||
GtkCList *clist;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
g_return_if_fail (indent >= 0);
|
||||
|
||||
if (indent != ctree->tree_indent)
|
||||
{
|
||||
ctree->tree_indent = indent;
|
||||
if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
}
|
||||
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));
|
||||
else if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_ctree_set_spacing (GtkCTree *ctree,
|
||||
gint spacing)
|
||||
{
|
||||
GtkCList *clist;
|
||||
gint old_spacing;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
g_return_if_fail (spacing >= 0);
|
||||
|
||||
if (spacing != ctree->tree_spacing)
|
||||
{
|
||||
ctree->tree_spacing = spacing;
|
||||
if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
}
|
||||
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);
|
||||
else if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
}
|
||||
|
||||
void
|
||||
@ -5198,16 +5584,35 @@ void
|
||||
gtk_ctree_set_line_style (GtkCTree *ctree,
|
||||
GtkCTreeLineStyle line_style)
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkCTreeLineStyle old_style;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
|
||||
if (line_style != ctree->line_style)
|
||||
if (line_style == ctree->line_style)
|
||||
return;
|
||||
|
||||
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))
|
||||
{
|
||||
ctree->line_style = line_style;
|
||||
|
||||
if (!GTK_WIDGET_REALIZED (ctree))
|
||||
return;
|
||||
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);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_REALIZED (ctree))
|
||||
{
|
||||
switch (line_style)
|
||||
{
|
||||
case GTK_CTREE_LINES_SOLID:
|
||||
@ -5240,16 +5645,57 @@ void
|
||||
gtk_ctree_set_expander_style (GtkCTree *ctree,
|
||||
GtkCTreeExpanderStyle expander_style)
|
||||
{
|
||||
GtkCList *clist;
|
||||
GtkCTreeExpanderStyle old_style;
|
||||
|
||||
g_return_if_fail (ctree != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||
|
||||
if (expander_style != ctree->expander_style)
|
||||
{
|
||||
ctree->expander_style = expander_style;
|
||||
if (expander_style == ctree->expander_style)
|
||||
return;
|
||||
|
||||
if (!GTK_CLIST_FROZEN (ctree))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
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))
|
||||
{
|
||||
gint new_width;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (!GTK_CLIST_FROZEN (ctree) && GTK_WIDGET_DRAWABLE (clist))
|
||||
gtk_clist_thaw (GTK_CLIST (ctree));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3542,7 +3542,7 @@ add1000_clist (GtkWidget *widget, gpointer data)
|
||||
gtk_clist_freeze (GTK_CLIST (data));
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", rand() % 10000);
|
||||
sprintf (text[0], "CListRow %d", rand() % 10000);
|
||||
row = gtk_clist_append (clist, texts);
|
||||
gtk_clist_set_pixtext (clist, row, 3, "gtk+", 5, pixmap, mask);
|
||||
}
|
||||
@ -3572,7 +3572,7 @@ add10000_clist (GtkWidget *widget, gpointer data)
|
||||
gtk_clist_freeze (GTK_CLIST (data));
|
||||
for (i = 0; i < 10000; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", rand() % 10000 /*clist_rows++*/);
|
||||
sprintf (text[0], "CListRow %d", rand() % 10000);
|
||||
gtk_clist_append (GTK_CLIST (data), texts);
|
||||
}
|
||||
gtk_clist_thaw (GTK_CLIST (data));
|
||||
@ -3830,7 +3830,7 @@ clist_toggle_sel_mode (GtkWidget *widget, GtkCList *clist)
|
||||
static void
|
||||
clist_click_column (GtkCList *clist, gint column, gpointer data)
|
||||
{
|
||||
if (column == 5)
|
||||
if (column == 4)
|
||||
gtk_clist_set_column_visibility (clist, column, FALSE);
|
||||
else if (column == clist->sort_column)
|
||||
{
|
||||
@ -3853,8 +3853,8 @@ create_clist (void)
|
||||
|
||||
static char *titles[] =
|
||||
{
|
||||
"Title 0", "Title 1", "not resizeable", "max width 120",
|
||||
"min width 40", "hide column", "Title 6", "Title 7",
|
||||
"auto resize", "not resizeable", "max width 100", "min width 50",
|
||||
"hide column", "Title 5", "Title 6", "Title 7",
|
||||
"Title 8", "Title 9", "Title 10", "Title 11", "Title 12",
|
||||
"Title 13", "Title 14", "Title 15", "Title 16", "Title 17",
|
||||
"Title 18", "Title 19"
|
||||
@ -4008,9 +4008,10 @@ create_clist (void)
|
||||
for (i = 1; i < TESTGTK_CLIST_COLUMNS; i++)
|
||||
gtk_clist_set_column_width (GTK_CLIST (clist), i, 80);
|
||||
|
||||
gtk_clist_set_column_resizeable (GTK_CLIST (clist), 2, FALSE);
|
||||
gtk_clist_set_column_max_width (GTK_CLIST (clist), 3, 120);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (clist), 4, 40);
|
||||
gtk_clist_set_column_auto_resize (GTK_CLIST (clist), 0, TRUE);
|
||||
gtk_clist_set_column_resizeable (GTK_CLIST (clist), 1, FALSE);
|
||||
gtk_clist_set_column_max_width (GTK_CLIST (clist), 2, 100);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (clist), 3, 50);
|
||||
|
||||
gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_EXTENDED);
|
||||
gtk_clist_set_policy (GTK_CLIST (clist), GTK_POLICY_AUTOMATIC,
|
||||
@ -4047,7 +4048,7 @@ create_clist (void)
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", clist_rows++);
|
||||
sprintf (text[0], "CListRow %d", clist_rows++);
|
||||
gtk_clist_append (GTK_CLIST (clist), texts);
|
||||
|
||||
switch (i % 4)
|
||||
@ -4832,8 +4833,11 @@ void create_ctree (void)
|
||||
|
||||
button = gtk_button_new_with_label ("Rebuild tree");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
ctree = GTK_CTREE (gtk_ctree_new_with_titles (2, 0, title));
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (rebuild_tree), ctree);
|
||||
|
||||
gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED);
|
||||
line_style = GTK_CTREE_LINES_DOTTED;
|
||||
|
||||
@ -4866,12 +4870,10 @@ void create_ctree (void)
|
||||
gtk_clist_set_selection_mode (GTK_CLIST (ctree), GTK_SELECTION_EXTENDED);
|
||||
gtk_clist_set_policy (GTK_CLIST (ctree), GTK_POLICY_ALWAYS,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_clist_set_column_width (GTK_CLIST (ctree), 0, 200);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (ctree), 0, 50);
|
||||
gtk_clist_set_column_auto_resize (GTK_CLIST (ctree), 0, TRUE);
|
||||
gtk_clist_set_column_width (GTK_CLIST (ctree), 1, 200);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (rebuild_tree), ctree);
|
||||
|
||||
bbox = gtk_hbox_new (FALSE, 5);
|
||||
gtk_container_border_width (GTK_CONTAINER (bbox), 5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, TRUE, 0);
|
||||
@ -6264,7 +6266,7 @@ create_dnd (void)
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Shaped Windows
|
||||
|
@ -3542,7 +3542,7 @@ add1000_clist (GtkWidget *widget, gpointer data)
|
||||
gtk_clist_freeze (GTK_CLIST (data));
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", rand() % 10000);
|
||||
sprintf (text[0], "CListRow %d", rand() % 10000);
|
||||
row = gtk_clist_append (clist, texts);
|
||||
gtk_clist_set_pixtext (clist, row, 3, "gtk+", 5, pixmap, mask);
|
||||
}
|
||||
@ -3572,7 +3572,7 @@ add10000_clist (GtkWidget *widget, gpointer data)
|
||||
gtk_clist_freeze (GTK_CLIST (data));
|
||||
for (i = 0; i < 10000; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", rand() % 10000 /*clist_rows++*/);
|
||||
sprintf (text[0], "CListRow %d", rand() % 10000);
|
||||
gtk_clist_append (GTK_CLIST (data), texts);
|
||||
}
|
||||
gtk_clist_thaw (GTK_CLIST (data));
|
||||
@ -3830,7 +3830,7 @@ clist_toggle_sel_mode (GtkWidget *widget, GtkCList *clist)
|
||||
static void
|
||||
clist_click_column (GtkCList *clist, gint column, gpointer data)
|
||||
{
|
||||
if (column == 5)
|
||||
if (column == 4)
|
||||
gtk_clist_set_column_visibility (clist, column, FALSE);
|
||||
else if (column == clist->sort_column)
|
||||
{
|
||||
@ -3853,8 +3853,8 @@ create_clist (void)
|
||||
|
||||
static char *titles[] =
|
||||
{
|
||||
"Title 0", "Title 1", "not resizeable", "max width 120",
|
||||
"min width 40", "hide column", "Title 6", "Title 7",
|
||||
"auto resize", "not resizeable", "max width 100", "min width 50",
|
||||
"hide column", "Title 5", "Title 6", "Title 7",
|
||||
"Title 8", "Title 9", "Title 10", "Title 11", "Title 12",
|
||||
"Title 13", "Title 14", "Title 15", "Title 16", "Title 17",
|
||||
"Title 18", "Title 19"
|
||||
@ -4008,9 +4008,10 @@ create_clist (void)
|
||||
for (i = 1; i < TESTGTK_CLIST_COLUMNS; i++)
|
||||
gtk_clist_set_column_width (GTK_CLIST (clist), i, 80);
|
||||
|
||||
gtk_clist_set_column_resizeable (GTK_CLIST (clist), 2, FALSE);
|
||||
gtk_clist_set_column_max_width (GTK_CLIST (clist), 3, 120);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (clist), 4, 40);
|
||||
gtk_clist_set_column_auto_resize (GTK_CLIST (clist), 0, TRUE);
|
||||
gtk_clist_set_column_resizeable (GTK_CLIST (clist), 1, FALSE);
|
||||
gtk_clist_set_column_max_width (GTK_CLIST (clist), 2, 100);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (clist), 3, 50);
|
||||
|
||||
gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_EXTENDED);
|
||||
gtk_clist_set_policy (GTK_CLIST (clist), GTK_POLICY_AUTOMATIC,
|
||||
@ -4047,7 +4048,7 @@ create_clist (void)
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
sprintf (text[0], "Row %d", clist_rows++);
|
||||
sprintf (text[0], "CListRow %d", clist_rows++);
|
||||
gtk_clist_append (GTK_CLIST (clist), texts);
|
||||
|
||||
switch (i % 4)
|
||||
@ -4832,8 +4833,11 @@ void create_ctree (void)
|
||||
|
||||
button = gtk_button_new_with_label ("Rebuild tree");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
ctree = GTK_CTREE (gtk_ctree_new_with_titles (2, 0, title));
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (rebuild_tree), ctree);
|
||||
|
||||
gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED);
|
||||
line_style = GTK_CTREE_LINES_DOTTED;
|
||||
|
||||
@ -4866,12 +4870,10 @@ void create_ctree (void)
|
||||
gtk_clist_set_selection_mode (GTK_CLIST (ctree), GTK_SELECTION_EXTENDED);
|
||||
gtk_clist_set_policy (GTK_CLIST (ctree), GTK_POLICY_ALWAYS,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_clist_set_column_width (GTK_CLIST (ctree), 0, 200);
|
||||
gtk_clist_set_column_min_width (GTK_CLIST (ctree), 0, 50);
|
||||
gtk_clist_set_column_auto_resize (GTK_CLIST (ctree), 0, TRUE);
|
||||
gtk_clist_set_column_width (GTK_CLIST (ctree), 1, 200);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (rebuild_tree), ctree);
|
||||
|
||||
bbox = gtk_hbox_new (FALSE, 5);
|
||||
gtk_container_border_width (GTK_CONTAINER (bbox), 5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, TRUE, 0);
|
||||
@ -6264,7 +6266,7 @@ create_dnd (void)
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Shaped Windows
|
||||
|
Loading…
Reference in New Issue
Block a user