GtkWxListStore *list_store = (GtkWxListStore *) tree_model;
g_return_if_fail (GTK_IS_WX_LIST_STORE (tree_model) );
+#if 0
wxDataViewListModel *model = list_store->model;
wxString mtype = model->GetColType( (unsigned int) column );
if (mtype == wxT("string"))
else
{
}
+#endif
#if 0
GtkTreeDataList *list;
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
+#if wxUSE_UNICODE
g_value_set_string( &gvalue, wxGTK_CONV( tmp ) );
+#else
+ g_value_set_string( &gvalue, wxGTK_CONV_FONT( tmp, GetOwner()->GetOwner()->GetFont() ) );
+#endif
g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue );
g_value_unset( &gvalue );
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
- g_value_set_boolean( &gvalue, wxGTK_CONV(m_label) );
+#if wxUSE_UNICODE
+ g_value_set_string( &gvalue, wxGTK_CONV(m_label) );
+#else
+ g_value_set_string( &gvalue, wxGTK_CONV_SYS(m_label) );
+#endif
g_object_set_property( G_OBJECT(m_renderer), "text", &gvalue );
g_value_unset( &gvalue );
}
#ifdef __WXGTK26__
if (!gtk_check_version(2,6,0))
{
- gint tmp = (int) value;
+ gint tmp = (long) value;
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_INT );
- g_value_set_boolean( &gvalue, tmp );
+ g_value_set_int( &gvalue, tmp );
g_object_set_property( G_OBJECT(m_renderer), "value", &gvalue );
g_value_unset( &gvalue );
}
gtk_tree_view_column_set_sort_indicator( column, true );
if (width > 0)
- {
gtk_tree_view_column_set_fixed_width( column, width );
- gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_FIXED );
- }
+ else
+ gtk_tree_view_column_set_fixed_width( column, 70 ); // FIXME
+
+ gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_FIXED );
gtk_tree_view_column_pack_end( column, renderer, FALSE );
gtk_tree_view_column_set_sort_indicator( column, true );
if (width > 0)
- {
gtk_tree_view_column_set_fixed_width( column, width );
- gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_FIXED );
- }
+ else
+ gtk_tree_view_column_set_fixed_width( column, 70 ); // FIXME
+
+ gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_FIXED );
gtk_tree_view_column_pack_end( column, renderer, FALSE );
}
}
+void wxDataViewColumn::SetOwner( wxDataViewCtrl *owner )
+{
+ wxDataViewColumnBase::SetOwner( owner );
+
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+
+#if wxUSE_UNICODE
+#else
+ gtk_tree_view_column_set_title( column, wxGTK_CONV_FONT(GetTitle(), GetOwner()->GetFont() ) );
+#endif
+}
+
void wxDataViewColumn::SetTitle( const wxString &title )
{
wxDataViewColumnBase::SetTitle( title );
m_isConnected = false;
}
+#if wxUSE_UNICODE
gtk_tree_view_column_set_title( column, wxGTK_CONV(title) );
+#else
+ if (GetOwner())
+ gtk_tree_view_column_set_title( column, wxGTK_CONV_FONT(title, GetOwner()->GetFont() ) );
+ else
+ gtk_tree_view_column_set_title( column, "" );
+#endif
gtk_tree_view_column_set_widget( column, NULL );
}
static void
wxdataview_selection_changed_callback( GtkTreeSelection* selection, wxDataViewCtrl *dv )
{
+ if (!GTK_WIDGET_REALIZED(dv->m_widget))
+ return;
+
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ROW_SELECTED, dv->GetId() );
event.SetRow( dv->GetSelection() );
event.SetModel( dv->GetModel() );
m_treeview = gtk_tree_view_new();
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
+#ifdef __WXGTK26__
+ if (!gtk_check_version(2,6,0))
+ gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(m_treeview), TRUE );
+#endif
+
if (style & wxDV_MULTIPLE)
{
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
m_parent->DoAddChild( this );
+ PostCreation(size);
+
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
g_signal_connect_after (selection, "changed",
G_CALLBACK (wxdataview_selection_changed_callback), this);
g_signal_connect_after (m_treeview, "row_activated",
G_CALLBACK (wxdataview_row_activated_callback), this);
- PostCreation(size);
-
return true;
}
return 0;
}
+// static
+wxVisualAttributes
+wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+ return GetDefaultAttributesFromGTKWidget(gtk_tree_view_new);
+}
+
#endif
// !wxUSE_GENERICDATAVIEWCTRL