Removed some irritating flags.
Implmented the remaining ones under GTK. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -253,18 +253,11 @@ enum wxDataViewColumnFlags
|
|||||||
wxDATAVIEW_COL_HIDDEN = 4
|
wxDATAVIEW_COL_HIDDEN = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wxDataViewColumnSizing
|
|
||||||
{
|
|
||||||
wxDATAVIEW_COL_WIDTH_FIXED,
|
|
||||||
wxDATAVIEW_COL_WIDTH_AUTO,
|
|
||||||
wxDATAVIEW_COL_WIDTH_GROW
|
|
||||||
};
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
|
class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
||||||
int fixed_width = 80, wxDataViewColumnSizing sizing = wxDATAVIEW_COL_WIDTH_FIXED, int flags = 0 );
|
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
virtual ~wxDataViewColumnBase();
|
virtual ~wxDataViewColumnBase();
|
||||||
|
|
||||||
virtual void SetTitle( const wxString &title );
|
virtual void SetTitle( const wxString &title );
|
||||||
@@ -279,9 +272,6 @@ public:
|
|||||||
|
|
||||||
virtual int GetWidth() = 0;
|
virtual int GetWidth() = 0;
|
||||||
|
|
||||||
virtual void SetFixedWidth( int width ) = 0;
|
|
||||||
virtual int GetFixedWidth() = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDataViewCtrl *m_ctrl;
|
wxDataViewCtrl *m_ctrl;
|
||||||
wxDataViewCell *m_cell;
|
wxDataViewCell *m_cell;
|
||||||
|
@@ -215,19 +215,15 @@ class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
||||||
int fixed_width = 80, wxDataViewColumnSizing sizing = wxDATAVIEW_COL_WIDTH_FIXED, int flags = 0 );
|
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
virtual ~wxDataViewColumn();
|
virtual ~wxDataViewColumn();
|
||||||
|
|
||||||
virtual void SetTitle( const wxString &title );
|
virtual void SetTitle( const wxString &title );
|
||||||
|
|
||||||
virtual int GetWidth();
|
virtual int GetWidth();
|
||||||
|
|
||||||
virtual void SetFixedWidth( int width );
|
|
||||||
virtual int GetFixedWidth();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_width;
|
int m_width;
|
||||||
wxDataViewColumnSizing m_sizing;
|
|
||||||
int m_fixedWidth;
|
int m_fixedWidth;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -189,7 +189,7 @@ class WXDLLIMPEXP_CORE wxDataViewColumn: public wxDataViewColumnBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
||||||
int fixed_width = 80, wxDataViewColumnSizing sizing = wxDATAVIEW_COL_WIDTH_FIXED, int flags = 0 );
|
int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
virtual ~wxDataViewColumn();
|
virtual ~wxDataViewColumn();
|
||||||
|
|
||||||
virtual void SetTitle( const wxString &title );
|
virtual void SetTitle( const wxString &title );
|
||||||
|
@@ -696,9 +696,8 @@ IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
|
|||||||
wxDataViewColumnBase::wxDataViewColumnBase(const wxString& title,
|
wxDataViewColumnBase::wxDataViewColumnBase(const wxString& title,
|
||||||
wxDataViewCell *cell,
|
wxDataViewCell *cell,
|
||||||
size_t model_column,
|
size_t model_column,
|
||||||
int WXUNUSED(fixed_width),
|
int WXUNUSED(width),
|
||||||
wxDataViewColumnSizing WXUNUSED(sizing),
|
int flags )
|
||||||
int flags )
|
|
||||||
{
|
{
|
||||||
m_cell = cell;
|
m_cell = cell;
|
||||||
m_model_column = model_column;
|
m_model_column = model_column;
|
||||||
|
@@ -595,13 +595,12 @@ bool wxDataViewDateCell::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *m
|
|||||||
IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
|
IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
|
||||||
|
|
||||||
wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
||||||
int fixed_width, wxDataViewColumnSizing sizing, int flags ) :
|
int width, int flags ) :
|
||||||
wxDataViewColumnBase( title, cell, model_column, flags )
|
wxDataViewColumnBase( title, cell, model_column, width, flags )
|
||||||
{
|
{
|
||||||
m_sizing = sizing;
|
m_width = width;
|
||||||
|
if (m_width < 0)
|
||||||
m_width = fixed_width;
|
m_width = 80;
|
||||||
m_fixedWidth = fixed_width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataViewColumn::~wxDataViewColumn()
|
wxDataViewColumn::~wxDataViewColumn()
|
||||||
@@ -619,22 +618,6 @@ int wxDataViewColumn::GetWidth()
|
|||||||
return m_width;
|
return m_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataViewColumn::SetFixedWidth( int width )
|
|
||||||
{
|
|
||||||
m_fixedWidth = width;
|
|
||||||
|
|
||||||
if (m_sizing == wxDATAVIEW_COL_WIDTH_FIXED)
|
|
||||||
{
|
|
||||||
m_width = width;
|
|
||||||
// Set dirty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxDataViewColumn::GetFixedWidth()
|
|
||||||
{
|
|
||||||
return m_fixedWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDataViewHeaderWindow
|
// wxDataViewHeaderWindow
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@@ -1420,8 +1420,8 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column,
|
|||||||
IMPLEMENT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
|
IMPLEMENT_CLASS(wxDataViewColumn, wxDataViewColumnBase)
|
||||||
|
|
||||||
wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column,
|
||||||
int fixed_width, wxDataViewColumnSizing sizing, int flags ) :
|
int width, int flags ) :
|
||||||
wxDataViewColumnBase( title, cell, model_column, flags )
|
wxDataViewColumnBase( title, cell, model_column, width, flags )
|
||||||
{
|
{
|
||||||
GtkCellRenderer *renderer = (GtkCellRenderer *) cell->GetGtkHandle();
|
GtkCellRenderer *renderer = (GtkCellRenderer *) cell->GetGtkHandle();
|
||||||
|
|
||||||
@@ -1429,17 +1429,20 @@ wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewCell *cell,
|
|||||||
|
|
||||||
gtk_tree_view_column_set_title( column, wxGTK_CONV(title) );
|
gtk_tree_view_column_set_title( column, wxGTK_CONV(title) );
|
||||||
|
|
||||||
if (sizing == wxDATAVIEW_COL_WIDTH_FIXED)
|
if (flags & wxDATAVIEW_COL_RESIZABLE)
|
||||||
|
gtk_tree_view_column_set_resizable( column, true );
|
||||||
|
if (flags & wxDATAVIEW_COL_HIDDEN)
|
||||||
|
gtk_tree_view_column_set_visible( column, false );
|
||||||
|
if (flags & wxDATAVIEW_COL_SORTABLE)
|
||||||
|
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 );
|
gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_FIXED );
|
||||||
else if (sizing == wxDATAVIEW_COL_WIDTH_GROW)
|
}
|
||||||
gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_GROW_ONLY );
|
|
||||||
else
|
|
||||||
gtk_tree_view_column_set_sizing( column, GTK_TREE_VIEW_COLUMN_AUTOSIZE );
|
|
||||||
|
|
||||||
if (fixed_width > 0)
|
gtk_tree_view_column_pack_end( column, renderer, FALSE );
|
||||||
gtk_tree_view_column_set_fixed_width( column, fixed_width );
|
|
||||||
|
|
||||||
gtk_tree_view_column_pack_start( column, renderer, TRUE );
|
|
||||||
|
|
||||||
gtk_tree_view_column_set_cell_data_func( column, renderer,
|
gtk_tree_view_column_set_cell_data_func( column, renderer,
|
||||||
wxGtkTreeCellDataFunc, (gpointer) cell, NULL );
|
wxGtkTreeCellDataFunc, (gpointer) cell, NULL );
|
||||||
|
Reference in New Issue
Block a user