26 #ifndef YMGA_GCBTable_h
27 #define YMGA_GCBTable_h
30 #include <yui/mga/YMGA_CBTable.h>
31 #include <yui/gtk/ygtktreeview.h>
34 #include <yui/gtk/YGSelectionStore.h>
35 #include <yui/gtk/YGWidget.h>
49 YMGA_GTreeView (YWidget *ywidget, YWidget *parent,
const std::string &label,
bool tree);
53 inline GtkTreeView *getView()
55 return GTK_TREE_VIEW (getWidget());
57 inline GtkTreeSelection *getSelection()
59 return gtk_tree_view_get_selection (getView());
62 void addTextColumn (
int iconCol,
int textCol);
63 void addTextColumn (
const std::string &header, YAlignmentType align,
int icon_col,
int text_col);
65 void addCheckColumn (
int check_col);
66 void addCheckColumn (
const std::string& header,
int check_col );
70 void addCountWidget (YWidget *yparent);
74 void focusItem (YItem *item,
bool select);
76 void unfocusAllItems();
80 YItem *getFocusItem();
82 virtual bool _immediateMode() {
85 virtual bool _shrinkable() {
88 virtual bool _recursiveSelection() {
92 void setMark (GtkTreeIter *iter, YItem *yitem, gint column,
bool state,
bool recursive);
94 void toggleMark (GtkTreePath *path, gint column);
96 virtual unsigned int getMinSize (YUIDimension dim);
99 static gboolean block_selected_timeout_cb (gpointer data);
101 void blockSelected();
103 static void block_init_cb (GtkWidget *widget,
YMGA_GTreeView *pThis);
105 static bool all_marked (GtkTreeModel *model, GtkTreeIter *iter,
int mark_col);
107 static void inconsistent_mark_cb (GtkTreeViewColumn *column,
108 GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data);
110 static void selection_changed_cb (GtkTreeSelection *selection,
YMGA_GTreeView *pThis);
112 static void activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
115 static void toggled_cb (GtkCellRendererToggle *renderer, gchar *path_str,
117 static void right_click_cb (YGtkTreeView *view, gboolean outreach,
YMGA_GTreeView *pThis);
125 YMGA_GCBTable (YWidget *parent, YTableHeader *headers, YCBTableMode mode);
127 void setSortable (
bool sortable);
129 void setCell (GtkTreeIter *iter,
int column,
const YTableCell *cell);
132 virtual bool _immediateMode();
135 virtual void setKeepSorting (
bool keepSorting);
137 virtual void cellChanged (
const YTableCell *cell);
140 void doAddItem (YItem *_item);
142 void doSelectItem (YItem *item,
bool select);
144 void doDeselectAllItems();
146 virtual void checkItem( YItem * item,
bool checked =
true );
149 static void activateButton (YWidget *button);
151 static void hack_right_click_cb (YGtkTreeView *view, gboolean outreach,
YMGA_GCBTable *pThis);
153 static gboolean key_press_event_cb (GtkWidget *widget, GdkEventKey *event,
YMGA_GCBTable *pThis);
155 static gint tree_sort_cb (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer _index);
159 YGLABEL_WIDGET_IMPL (YMGA_CBTable)
160 YGSELECTION_WIDGET_IMPL (YMGA_CBTable)