summaryrefslogtreecommitdiff
path: root/gtk/gtkclist.h
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1998-10-07 00:03:24 +0000
committerLars Hamann <lars@src.gnome.org>1998-10-07 00:03:24 +0000
commita2951281f36c08cd32df5bfa7e197c5b9f54fb40 (patch)
treee8add75cb72ce3dbd6e80061359e4efd59675808 /gtk/gtkclist.h
parentc3a163b021a672f92c182a6e20b246441d34bd92 (diff)
downloadgtk+-a2951281f36c08cd32df5bfa7e197c5b9f54fb40.tar.gz
new signal GtkCList::resize_column. don't draw invisible columns
Wed Oct 7 00:59:46 1998 Lars Hamann <lars@gtk.org> * gtk/gtkclist.h: new signal GtkCList::resize_column. * gtk/gtkclist.c (draw_row): don't draw invisible columns (size_allocate_title_buttons) (size_allocate_columns): skip invisible columns (new_column_width): take min/max_width into account (gtk_clist_button_release) (gtk_clist_motion): changes due to changed new_column_width function (LIST_WIDTH): changed define to inline function. (real_resize_column): class function for resize_column signal (gtk_clist_motion): fixed autoscrolling for column resizes (gtk_clist_set_column_visibility): don't hide last visible column, changed visible arg to gboolean (gtk_clist_set_column_min_width)(gtk_clist_set_column_max_width): new functions : set min/max width of a column (gtk_clist_set_column_resizeable): new function : enable/disable column resize operations by mouse * gtk/gtkctree.c (draw_row): don't draw invisible columns (ctree_is_hot_spot): return FALSE if tree_column is invisible (draw_xor_line) (draw_xor_rect): draw full rectangle/line if tree_column is invisible (gtk_ctree_find_all_by_row_data) (gtk_ctree_find_all_by_row_data_custom): new function from Ronan Bourlier <ronan@radioss.com>. Returns a GList of all GtkCTreeNodes with row->data == data.
Diffstat (limited to 'gtk/gtkclist.h')
-rw-r--r--gtk/gtkclist.h228
1 files changed, 123 insertions, 105 deletions
diff --git a/gtk/gtkclist.h b/gtk/gtkclist.h
index bfa4bbabeb..3d2e70466a 100644
--- a/gtk/gtkclist.h
+++ b/gtk/gtkclist.h
@@ -192,60 +192,63 @@ 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 (*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);
gint scrollbar_spacing;
};
@@ -259,10 +262,13 @@ struct _GtkCListColumn
GdkWindow *window;
gint width;
+ gint min_width;
+ gint max_width;
GtkJustification justification;
- gint visible : 1;
- gint width_set : 1;
+ gint visible : 1;
+ gint width_set : 1;
+ gint resizeable : 1;
};
struct _GtkCListRow
@@ -357,7 +363,7 @@ GtkType gtk_clist_get_type (void);
/* constructers useful for gtk-- wrappers */
void gtk_clist_construct (GtkCList *clist,
gint columns,
- gchar *titles[]);
+ gchar *titles[]);
/* create a new GtkCList */
GtkWidget *gtk_clist_new (gint columns);
@@ -365,24 +371,24 @@ GtkWidget *gtk_clist_new_with_titles (gint columns,
gchar *titles[]);
/* set the border style of the clist */
-void gtk_clist_set_border (GtkCList *clist,
- GtkShadowType border);
+void gtk_clist_set_border (GtkCList *clist,
+ GtkShadowType border);
/* set the clist's selection mode */
-void gtk_clist_set_selection_mode (GtkCList *clist,
- GtkSelectionMode mode);
+void gtk_clist_set_selection_mode (GtkCList *clist,
+ GtkSelectionMode mode);
/* set policy on the scrollbar, to either show them all the time
- * or show them only when they are needed, ie., when there is more than one page
- * of information
+ * or show them only when they are needed, ie., when there is more
+ * than one page of information
*/
-void gtk_clist_set_policy (GtkCList *clist,
- GtkPolicyType vscrollbar_policy,
- GtkPolicyType hscrollbar_policy);
+void gtk_clist_set_policy (GtkCList *clist,
+ GtkPolicyType vscrollbar_policy,
+ GtkPolicyType hscrollbar_policy);
-/* freeze all visual updates of the list, and then thaw the list after you have made
- * a number of changes and the updates wil occure in a more efficent mannor than if
- * you made them on a unfrozen list
+/* freeze all visual updates of the list, and then thaw the list after
+ * you have made a number of changes and the updates wil occure in a
+ * more efficent mannor than if you made them on a unfrozen list
*/
void gtk_clist_freeze (GtkCList *clist);
void gtk_clist_thaw (GtkCList *clist);
@@ -402,11 +408,6 @@ void gtk_clist_column_title_passive (GtkCList *clist,
void gtk_clist_column_titles_active (GtkCList *clist);
void gtk_clist_column_titles_passive (GtkCList *clist);
-/* set visibility of a column */
-void gtk_clist_set_column_visibility (GtkCList *clist,
- gint column,
- gint visible);
-
/* set the title in the column title button */
void gtk_clist_set_column_title (GtkCList *clist,
gint column,
@@ -418,9 +419,19 @@ void gtk_clist_set_column_widget (GtkCList *clist,
GtkWidget *widget);
/* set the justification on a column */
-void gtk_clist_set_column_justification (GtkCList *clist,
- gint column,
- GtkJustification justification);
+void gtk_clist_set_column_justification (GtkCList *clist,
+ gint column,
+ GtkJustification justification);
+
+/* set visibility of a column */
+void gtk_clist_set_column_visibility (GtkCList *clist,
+ gint column,
+ gboolean visible);
+
+/* enable/disable column resize operations by mouse */
+void gtk_clist_set_column_resizeable (GtkCList *clist,
+ gint column,
+ gboolean resizeable);
/* set the pixel width of a column; this is a necessary step in
* creating a CList because otherwise the column width is chozen from
@@ -430,17 +441,24 @@ void gtk_clist_set_column_width (GtkCList *clist,
gint column,
gint width);
+/* set column minimum/maximum width. min/max_width < 0 => no restriction */
+void gtk_clist_set_column_min_width (GtkCList *clist,
+ gint column,
+ gint min_width);
+void gtk_clist_set_column_max_width (GtkCList *clist,
+ gint column,
+ gint max_width);
+
/* change the height of the rows, the default is the hight
* of the current font
*/
void gtk_clist_set_row_height (GtkCList *clist,
gint height);
-/* scroll the viewing area of the list to the given column
- * and row; row_align and col_align are between 0-1 representing the
- * location the row should appear on the screnn, 0.0 being top or left,
- * 1.0 being bottom or right; if row or column is -1 then then there
- * is no change
+/* scroll the viewing area of the list to the given column and row;
+ * row_align and col_align are between 0-1 representing the location the
+ * row should appear on the screnn, 0.0 being top or left, 1.0 being
+ * bottom or right; if row or column is -1 then then there is no change
*/
void gtk_clist_moveto (GtkCList *clist,
gint row,
@@ -466,10 +484,10 @@ void gtk_clist_set_text (GtkCList *clist,
/* for the "get" functions, any of the return pointer can be
* NULL if you are not interested
*/
-gint gtk_clist_get_text (GtkCList *clist,
- gint row,
- gint column,
- gchar **text);
+gint gtk_clist_get_text (GtkCList *clist,
+ gint row,
+ gint column,
+ gchar **text);
/* sets a given cell's pixmap, replacing it's current contents */
void gtk_clist_set_pixmap (GtkCList *clist,
@@ -493,13 +511,13 @@ void gtk_clist_set_pixtext (GtkCList *clist,
GdkPixmap *pixmap,
GdkBitmap *mask);
-gint gtk_clist_get_pixtext (GtkCList *clist,
- gint row,
- gint column,
- gchar **text,
- guint8 *spacing,
- GdkPixmap **pixmap,
- GdkBitmap **mask);
+gint gtk_clist_get_pixtext (GtkCList *clist,
+ gint row,
+ gint column,
+ gchar **text,
+ guint8 *spacing,
+ GdkPixmap **pixmap,
+ GdkBitmap **mask);
/* sets the foreground color of a row, the colar must already
* be allocated
@@ -516,8 +534,8 @@ void gtk_clist_set_background (GtkCList *clist,
GdkColor *color);
/* this sets a horizontal and vertical shift for drawing
- * the contents of a cell; it can be positive or negitive; this is
- * particulary useful for indenting items in a column
+ * the contents of a cell; it can be positive or negitive;
+ * this is particulary useful for indenting items in a column
*/
void gtk_clist_set_shift (GtkCList *clist,
gint row,
@@ -540,8 +558,8 @@ gint gtk_clist_prepend (GtkCList *clist,
gint gtk_clist_append (GtkCList *clist,
gchar *text[]);
-/* inserts a row at index row and returns the row where it was actually
- * inserted (may be different from "row" in auto_sort mode)
+/* inserts a row at index row and returns the row where it was
+ * actually inserted (may be different from "row" in auto_sort mode)
*/
gint gtk_clist_insert (GtkCList *clist,
gint row,
@@ -557,10 +575,10 @@ void gtk_clist_set_row_data (GtkCList *clist,
gpointer data);
/* sets a data pointer for a given row with destroy notification */
-void gtk_clist_set_row_data_full (GtkCList *clist,
- gint row,
- gpointer data,
- GtkDestroyNotify destroy);
+void gtk_clist_set_row_data_full (GtkCList *clist,
+ gint row,
+ gpointer data,
+ GtkDestroyNotify destroy);
/* returns the data set for a row */
gpointer gtk_clist_get_row_data (GtkCList *clist,
@@ -585,8 +603,8 @@ void gtk_clist_unselect_row (GtkCList *clist,
/* undo the last select/unselect operation */
void gtk_clist_undo_selection (GtkCList *clist);
-/* clear the entire list -- this is much faster than removing each item
- * with gtk_clist_remove
+/* clear the entire list -- this is much faster than removing
+ * each item with gtk_clist_remove
*/
void gtk_clist_clear (GtkCList *clist);
@@ -617,8 +635,8 @@ void gtk_clist_set_sort_column (GtkCList *clist,
gint column);
/* how to sort : ascending or descending */
-void gtk_clist_set_sort_type (GtkCList *clist,
- GtkSortType sort_type);
+void gtk_clist_set_sort_type (GtkCList *clist,
+ GtkSortType sort_type);
/* sort the list with the current compare function */
void gtk_clist_sort (GtkCList *clist);