Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Types | Public Member Functions | Static Protected Attributes
Xfc::Gtk::IconView Class Reference

A GtkIconView C++ wrapper class. More...

#include <xfc/gtk/iconview.hh>

Inheritance diagram for Xfc::Gtk::IconView:
Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable

List of all members.

Public Types

Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkIconView C++ wrapper class.

IconView provides an alternative view on a list model. It displays the model as a grid of icons with labels. Like TreeView, it allows to select one or multiple items (depending on the selection mode, see set_selection_mode()). In addition to selection with the arrow keys, IconView supports rubberband selection, which is controlled by dragging the pointer.


Member Typedef Documentation

typedef sigc::slot<void, const TreePath&> Xfc::Gtk::IconView::ForeachSlot

Signature of the callback slot to be called by selected_foreach() to map all selected rows.

Example: Method signature for ForeachSlot.

< void method(const Gtk::TreePath& path);
< // path: The TreePath of a selected row.
<

The slot is called on every selected row in the icon view.

Reimplemented from Xfc::Gtk::Container.


Constructor & Destructor Documentation

Xfc::Gtk::IconView::IconView ( GtkIconView *  icon_view,
bool  owns_reference = false 
) [explicit, protected]

Construct a new IconView from an existing GtkIconView.

Parameters:
icon_viewA pointer to a GtkIconView.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The icon_view can be a newly created GtkIconView or an existing GtkIconView. (see G::Object::Object).

Xfc::Gtk::IconView::IconView ( TreeModel model)

Constructs a new IconView widget with the model model.

Parameters:
modelThe model.

Member Function Documentation

Gets the space between grid columns in the icon view.

Returns:
The space to between grid columns.

Gets the number of columns to displayed in the icon view.

Returns:
The number of columns.

Gets the current width used for each item in the icon view.

Returns:
The item width to use.

Gets the space at the edges of the icon view.

Returns:
The space at the edges of the icon view.

Gets the column with markup text for the icon view.

Returns:
The markup column, or -1 if it's unset.

Gets the model the icon view is based on.

Returns:
A Gtk::TreeModel, or null if none is currently being used.

Gets the value of the "orientation" property which determines whether the labels are drawn beside the icons instead of below.

Returns:
The relative position of texts and icons.
Pointer<TreePath> Xfc::Gtk::IconView::get_path_at_pos ( int  x,
int  y 
) const

Finds the path at the point (x, y), relative to widget coordinates.

Parameters:
xThe x position to be identified.
yThe y position to be identified.
Returns:
The TreePath corresponding to the icon, or null if no icon exists at that position.

Gets the column with pixbufs for the icon view.

Returns:
The pixbuf column, or -1 if it's unset.

Gets the space between grid rows in the icon view.

Returns:
The space to between grid rows.
bool Xfc::Gtk::IconView::get_selected_items ( std::vector< TreePath > &  items) const

Fills a vector of TreePath with a list of the paths of all selected items.

Parameters:
itemsThe vector of TreePath that will hold the list of paths.
Returns:
true if the vector is not empty.

Additionally, if you are planning on modifying the model after calling this function, you may want to convert the returned list into a list of Gtk::TreeRowReferences. To do this use the constructor TreeRowReference(G::Object&, TreeModel&, const TreePath&).

Gets the selection mode of the icon view.

Returns:
The current selection mode.

Gets the space which is inserted between cells of an item.

Returns:
The space between cells of an item (e.g. pixbuf and text).

Gets the column with text for icon view.

Returns:
The text column, or -1 if it's unset.

Activates the item determined by path.

Parameters:
pathThe TreePath to be activated.
bool Xfc::Gtk::IconView::path_is_selected ( const TreePath path) const

Determines whether the icon pointed to by path is currently selected.

Parameters:
pathA TreePath to check selection on.
Returns:
true if the path is selected.

If icon does not point to a valid location, false is returned.

void Xfc::Gtk::IconView::select_path ( const TreePath path)

Selects the row at path.

Parameters:
pathThe TreePath to be selected.

Calls the ForeachSlot for each selected icon.

Parameters:
eachThe callback slot to call for each selected icon.

Note that the model or selection cannot be modified from within this function.

void Xfc::Gtk::IconView::set_column_spacing ( int  column_spacing)

Sets the space which is inserted between grid columns in the icon view.

Parameters:
column_spacingThe space to insert between grid columns.
void Xfc::Gtk::IconView::set_columns ( int  columns)

Sets the number of columns to display in the icon view.

Parameters:
columnsThe number of columns.
void Xfc::Gtk::IconView::set_item_width ( int  item_width)

Sets the width used for each item in the icon view.

Parameters:
item_widthThe item width to use.
void Xfc::Gtk::IconView::set_margin ( int  margin)

Sets the space which is inserted at the edges of the icon view.

Parameters:
marginThe space inserted at the edges of the icon view

Sets the column with markup information for the icon view to be column.

Parameters:
columnA column in the currently used model.

The markup column must be of type G_TYPE_STRING. If the markup column is set to something, it overrides the text column set by set_text_column().

Sets the model for the icon view.

Parameters:
modelThe model.

If the icon view already has a model set, it will remove it before setting the new model. If model is null, then it will unset the old model.

Sets the "orientation" property which determines whether the labels are drawn beside the icons instead of below.

Parameters:
orientationThe relative position of texts and icons.

Sets the column with pixbufs for the icon view to be column.

Parameters:
columnA column in the currently used model.

The pixbuf column must be of type GDK_TYPE_PIXBUF.

void Xfc::Gtk::IconView::set_row_spacing ( int  row_spacing)

Sets the space which is inserted between grid rows in the icon view.

Parameters:
row_spacingThe space to insert between grid rows.

Sets the selection mode of the icon view.

Parameters:
modeThe selection mode.
void Xfc::Gtk::IconView::set_spacing ( int  spacing)

Sets the space which is inserted between the cells of an item in the icon view.

Parameters:
spacingThe space to insert between cells (e.g. pixbuf and text).

Sets the column with text for the icon view to be column.

Parameters:
columnA column in the currently used model.

The text column must be of type G_TYPE_STRING.

Connect to the set_scroll_adjustments_signal; emitted when an icon view is added to a scrolling aware parent.

Unselects the row at path.

Parameters:
pathThe TreePath to be unselected.

Member Data Documentation

Item activated signal (see signal_item_activated()).

Calls a slot with the signature:

< void function(const TreePath& path);
< // path: The TreePath of the item being activated.
<

Selection changed signal (see signal_selection_changed()).

Calls a slot with the signature:

< void function();
<

Set scroll adjustments signal (see signal_set_scroll_adjustments()).

Calls a slot with the signature:

< void function(Adjustment *hadjustment, Adjustment *vadjustment);
< // hadjustment: The horizontal adjustment.
< // vadjustment: The vertical adjustment.
<

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC