gtkmm 4.17.0
|
A sorter implementation that is geared towards the needs of Gtk::ColumnView. More...
#include <gtkmm/columnviewsorter.h>
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
![]() | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
ColumnViewSorter () | |
![]() | |
Sorter () | |
virtual Ordering | compare_vfunc (gpointer item1, gpointer item2) |
virtual Order | get_order_vfunc () |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::ColumnViewSorter > | wrap (GtkColumnViewSorter *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
![]() | |
Glib::RefPtr< Gtk::Sorter > | wrap (GtkSorter *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Additional Inherited Members | |
![]() | |
enum class | Order { Order::PARTIAL , Order::NONE , Order::TOTAL } |
Describes the type of order that a Gtk::Sorter may produce. More... | |
enum class | Change { Change::DIFFERENT , Change::INVERTED , Change::LESS_STRICT , Change::MORE_STRICT } |
Describes changes in a sorter in more detail and allows users to optimize resorting. More... | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
A sorter implementation that is geared towards the needs of Gtk::ColumnView.
The sorter returned by Gtk::ColumnView::get_sorter() is a Gtk::ColumnViewSorter.
In column views, sorting can be configured by associating sorters with columns, and users can invert sort order by clicking on column headers. The API of Gtk::ColumnViewSorter is designed to allow saving and restoring this configuration.
If you are only interested in the primary sort column (i.e. the column where a sort indicator is shown in the header), then you can just look at property_primary_sort_column() and property_primary_sort_order().
If you want to store the full sort configuration, including secondary sort columns that are used for tie breaking, then you can use get_nth_sort_column(). To get notified about changes, use Gtk::Sorter::signal_changed().
To restore a saved sort configuration on a Gtk::ColumnView, use code like:
|
noexcept |
|
overridenoexcept |
|
protected |
unsigned int Gtk::ColumnViewSorter::get_n_sort_columns | ( | ) | const |
Returns the number of columns by which the sorter sorts.
If the sorter of the primary sort column does not determine a total order, then the secondary sorters are consulted to break the ties.
Use the Gtk::Sorter::signal_changed() signal to get notified when the number of sort columns changes.
std::pair< Glib::RefPtr< ColumnViewColumn >, SortType > Gtk::ColumnViewSorter::get_nth_sort_column | ( | unsigned int | position | ) |
Gets the position'th sort column and its associated sort order.
Use the Gtk::Sorter::signal_changed() signal to get notified when sort columns change.
position | The position of the sort column to retrieve (0 for the primary sort column). |
std::pair< Glib::RefPtr< const ColumnViewColumn >, SortType > Gtk::ColumnViewSorter::get_nth_sort_column | ( | unsigned int | position | ) | const |
See the non-const get_nth_sort_column().
Glib::RefPtr< ColumnViewColumn > Gtk::ColumnViewSorter::get_primary_sort_column | ( | ) |
Returns the primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Glib::RefPtr< const ColumnViewColumn > Gtk::ColumnViewSorter::get_primary_sort_column | ( | ) | const |
Returns the primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
SortType Gtk::ColumnViewSorter::get_primary_sort_order | ( | ) | const |
Returns the primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
If there is no primary sort column, then this function returns Gtk::SortType::ASCENDING
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkColumnViewSorter * Gtk::ColumnViewSorter::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ColumnViewColumn > > Gtk::ColumnViewSorter::property_primary_sort_column | ( | ) | const |
The primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Glib::PropertyProxy_ReadOnly< SortType > Gtk::ColumnViewSorter::property_primary_sort_order | ( | ) | const |
The primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
Default value: Gtk::SortType::ASCENDING
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |