GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags );
-
+
static GObjectClass *cell_parent_class = NULL;
wxDataViewCustomRenderer *cell = wxrenderer->cell;
if (!cell->HasEditorCtrl())
return NULL;
-
+
GdkRectangle rect;
gtk_wx_cell_renderer_get_size (renderer, widget, cell_area,
&rect.x,
gtk_tree_path_free( treepath );
cell->StartEditing( model_row, renderrect );
-
+
return NULL;
}
if (!event)
{
bool ret = false;
-
+
// activated by <ENTER>
if (cell->Activate( renderrect, model, model_col, model_row ))
ret = true;
-
+
return ret;
}
else if (event->type == GDK_BUTTON_PRESS)
{
public:
wxGtkDataViewListModelNotifier( GtkWxListStore* gtk_store, wxDataViewListModel *wx_model );
+ ~wxGtkDataViewListModelNotifier();
virtual bool RowAppended();
virtual bool RowPrepended();
virtual bool RowsReordered( unsigned int *new_order );
virtual bool Cleared();
- virtual bool Freed()
- {
- m_wx_model = NULL;
- m_gtk_store = NULL;
- return wxDataViewListModelNotifier::Freed();
- }
-
GtkWxListStore *m_gtk_store;
wxDataViewListModel *m_wx_model;
};
m_wx_model = wx_model;
}
+wxGtkDataViewListModelNotifier::~wxGtkDataViewListModelNotifier()
+{
+ m_wx_model = NULL;
+ m_gtk_store = NULL;
+}
+
bool wxGtkDataViewListModelNotifier::RowAppended()
{
unsigned int pos = m_wx_model->GetRowCount()-1;
gtk_tree_view_get_cell_area( widget, path, column, &cell_area );
gtk_tree_path_free( path );
+ GtkAdjustment* hadjust = gtk_tree_view_get_hadjustment( widget );
+ double d = gtk_adjustment_get_value( hadjust );
+ int xdiff = (int) d;
+
int ydiff = column->button->allocation.height;
// Redraw
gtk_widget_queue_draw_area( GTK_WIDGET(widget),
- cell_area.x, ydiff + cell_area.y, cell_area.width, cell_area.height );
+ cell_area.x - xdiff, ydiff + cell_area.y, cell_area.width, cell_area.height );
}
node = node->GetNext();
// Insert widget in GtkTreeView
if (GTK_WIDGET_REALIZED(treeview))
- gtk_widget_set_parent_window( child->m_widget,
+ gtk_widget_set_parent_window( child->m_widget,
gtk_tree_view_get_bin_window( GTK_TREE_VIEW(treeview) ) );
gtk_widget_set_parent( child->m_widget, treeview );
}
GtkAllocation *alloc,
wxDataViewCtrl *win )
{
-
+
wxWindowList::Node *node = win->GetChildren().GetFirst();
while (node)
{
wxWindow *child = node->GetData();
-
+
GtkRequisition req;
gtk_widget_size_request( child->m_widget, &req );
-
+
GtkAllocation alloc;
alloc.x = child->m_x;
alloc.y = child->m_y;
alloc.width = child->m_width;
alloc.height = child->m_height;
gtk_widget_size_allocate( child->m_widget, &alloc );
-
+
node = node->GetNext();
}
}
{
Init();
- m_needParent = true;
-
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator ))
{
m_treeview = gtk_tree_view_new();
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
-
+
g_signal_connect (m_treeview, "size_allocate",
G_CALLBACK (gtk_dataviewctrl_size_callback), this);
}
else
#endif
+ {
gtk_tree_view_set_rules_hint( GTK_TREE_VIEW(m_treeview), (style & wxDV_HORIZ_RULES) != 0 );
+ }
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);