Added sort order and alignement for column headers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -267,6 +267,9 @@ public:
|
||||
|
||||
virtual void SetBitmap( const wxBitmap &bitmap );
|
||||
virtual const wxBitmap &GetBitmap();
|
||||
|
||||
virtual void SetAlignment( wxAlignment align ) = 0;
|
||||
virtual void SetSortOrder( bool ascending ) = 0;
|
||||
|
||||
wxDataViewRenderer* GetRenderer() { return m_renderer; }
|
||||
|
||||
|
@@ -221,6 +221,10 @@ public:
|
||||
virtual ~wxDataViewColumn();
|
||||
|
||||
virtual void SetTitle( const wxString &title );
|
||||
virtual void SetBitmap( const wxBitmap &bitmap );
|
||||
|
||||
virtual void SetAlignment( wxAlignment align );
|
||||
virtual void SetSortOrder( bool ascending );
|
||||
|
||||
virtual int GetWidth();
|
||||
|
||||
|
@@ -196,7 +196,10 @@ public:
|
||||
|
||||
virtual void SetTitle( const wxString &title );
|
||||
virtual void SetBitmap( const wxBitmap &bitmap );
|
||||
|
||||
|
||||
virtual void SetAlignment( wxAlignment align );
|
||||
virtual void SetSortOrder( bool ascending );
|
||||
|
||||
virtual int GetWidth();
|
||||
|
||||
virtual void SetFixedWidth( int width );
|
||||
|
@@ -612,6 +612,16 @@ wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *
|
||||
m_width = 30;
|
||||
}
|
||||
|
||||
void wxDataViewColumn::SetAlignment( wxAlignment WXUNUSED(align) )
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDataViewColumn::SetSortOrder( bool WXUNUSED(ascending) )
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
wxDataViewColumn::~wxDataViewColumn()
|
||||
{
|
||||
}
|
||||
@@ -622,6 +632,12 @@ void wxDataViewColumn::SetTitle( const wxString &title )
|
||||
|
||||
}
|
||||
|
||||
void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap )
|
||||
{
|
||||
wxDataViewColumnBase::SetBitmap( bitmap );
|
||||
|
||||
}
|
||||
|
||||
int wxDataViewColumn::GetWidth()
|
||||
{
|
||||
return m_width;
|
||||
|
@@ -1527,6 +1527,29 @@ void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap )
|
||||
}
|
||||
}
|
||||
|
||||
void wxDataViewColumn::SetAlignment( wxAlignment align )
|
||||
{
|
||||
GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
|
||||
|
||||
gfloat xalign = 0.0;
|
||||
if (align == wxALIGN_RIGHT)
|
||||
xalign = 1.0;
|
||||
if (align == wxALIGN_CENTER)
|
||||
xalign = 0.5;
|
||||
|
||||
gtk_tree_view_column_set_alignment( column, xalign );
|
||||
}
|
||||
|
||||
void wxDataViewColumn::SetSortOrder( bool ascending )
|
||||
{
|
||||
GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
|
||||
|
||||
if (ascending)
|
||||
gtk_tree_view_column_set_sort_order( column, GTK_SORT_ASCENDING );
|
||||
else
|
||||
gtk_tree_view_column_set_sort_order( column, GTK_SORT_DESCENDING );
|
||||
}
|
||||
|
||||
int wxDataViewColumn::GetWidth()
|
||||
{
|
||||
return gtk_tree_view_column_get_width( (GtkTreeViewColumn *)m_column );
|
||||
|
Reference in New Issue
Block a user