Maeomm Reference Documentation: hildonmm |
Hildon::PannableArea is a container widget that can be "panned" (scrolled) up and down using the touchscreen with fingers. The widget has no scrollbars, but it rather shows small scroll indicators to give an idea of the part of the content that is visible at a time. The scroll indicators appear when a dragging motion is started on the pannable area.
The scrolling is "kinetic", meaning the motion can be "flicked" and it will continue from the initial motion by gradually slowing down to an eventual stop. The motion can also be stopped immediately by pressing the touchscreen over the pannable area.
Public Member Functions | |
virtual void | add (Gtk::Widget& widget) |
Convenience function used to add a child to a Gtk::Viewport, and add the viewport to the scrolled window. | |
const Gtk::Widget* | get_child_at (double x, double y) const |
Get the widget at the point (x, y) inside the pannable area. | |
Gtk::Widget* | get_child_at (double x, double y) |
Get the widget at the point (x, y) inside the pannable area. | |
const Gtk::Adjustment* | get_hadjustment () const |
returns: The horizontal Gtk::Adjustment | |
Gtk::Adjustment* | get_hadjustment () |
returns: The horizontal Gtk::Adjustment | |
SizeRequestPolicy | get_size_request_policy () const |
This function returns the current size request policy of the widget. | |
const Gtk::Adjustment* | get_vadjustment () const |
returns: The vertical Gtk::Adjustment | |
Gtk::Adjustment* | get_vadjustment () |
returns: The vertical Gtk::Adjustment | |
const HildonPannableArea* | gobj () const |
Provides access to the underlying C GtkObject. | |
HildonPannableArea* | gobj () |
Provides access to the underlying C GtkObject. | |
void | jump_to (int x, int y) |
Jumps the position of area to ensure that ( x, y) is a visible point in the widget. | |
void | jump_to_child (const Gtk::Widget& child) |
Jumps to make sure child is visible inside area. | |
PannableArea (PannableAreaMode mode, bool enabled, double velocity_min, double velocity_max, double deceleration, guint sps) | |
PannableArea () | |
void | scroll_to (int x, int y) |
Smoothly scrolls area to ensure that ( x, y) is a visible point on the widget. | |
void | scroll_to_child (const Gtk::Widget& child) |
Smoothly scrolls until child is visible inside area. | |
void | set_size_request_policy (SizeRequestPolicy size_request_policy) |
This function sets the pannable area size request policy. | |
Glib::SignalProxy3< void, MovementDirection, double, double > | signal_horizontal_movement () |
Glib::SignalProxy3< void, MovementDirection, double, double > | signal_vertical_movement () |
virtual | ~PannableArea () |
Related Functions | |
(Note that these are not member functions.) | |
Hildon::PannableArea* | wrap (HildonPannableArea* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
virtual Hildon::PannableArea::~PannableArea | ( | ) | [virtual] |
Hildon::PannableArea::PannableArea | ( | ) |
Hildon::PannableArea::PannableArea | ( | PannableAreaMode | mode, | |
bool | enabled, | |||
double | velocity_min, | |||
double | velocity_max, | |||
double | deceleration, | |||
guint | sps | |||
) | [explicit] |
virtual void Hildon::PannableArea::add | ( | Gtk::Widget & | widget | ) | [virtual] |
Convenience function used to add a child to a Gtk::Viewport, and add the viewport to the scrolled window.
child | Child widget to add to the viewport. |
Reimplemented from Gtk::Container.
const Gtk::Widget* Hildon::PannableArea::get_child_at | ( | double | x, | |
double | y | |||
) | const |
Get the widget at the point (x, y) inside the pannable area.
In case no widget found it returns 0
.
area | A Hildon::PannableArea. | |
x | Horizontal coordinate of the point. | |
y | Vertical coordinate of the point. |
0
in any other caseGtk::Widget* Hildon::PannableArea::get_child_at | ( | double | x, | |
double | y | |||
) |
Get the widget at the point (x, y) inside the pannable area.
In case no widget found it returns 0
.
area | A Hildon::PannableArea. | |
x | Horizontal coordinate of the point. | |
y | Vertical coordinate of the point. |
0
in any other caseconst Gtk::Adjustment* Hildon::PannableArea::get_hadjustment | ( | ) | const |
Gtk::Adjustment* Hildon::PannableArea::get_hadjustment | ( | ) |
SizeRequestPolicy Hildon::PannableArea::get_size_request_policy | ( | ) | const |
This function returns the current size request policy of the widget.
That policy controls the way the size_request is done in the pannable area. Check set_size_request_policy() for a more detailed explanation.
const Gtk::Adjustment* Hildon::PannableArea::get_vadjustment | ( | ) | const |
Gtk::Adjustment* Hildon::PannableArea::get_vadjustment | ( | ) |
const HildonPannableArea* Hildon::PannableArea::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin.
References Glib::ValueBase::gobject_.
HildonPannableArea* Hildon::PannableArea::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Bin.
References Glib::ValueBase::gobject_.
void Hildon::PannableArea::jump_to | ( | int | x, | |
int | y | |||
) |
Jumps the position of area to ensure that ( x, y) is a visible point in the widget.
In order to move in only one coordinate, you must set the other one to -1. See scroll_to() function for an example of how to calculate the position of children in scrollable widgets like Gtk::Treeview.
There is a precondition to this function: the widget must be already realized. Check the jump_to_child() for more tips regarding how to call this function during initialization.
x | The x coordinate of the destination point or -1 to ignore this axis. | |
y | The y coordinate of the destination point or -1 to ignore this axis. |
void Hildon::PannableArea::jump_to_child | ( | const Gtk::Widget & | child | ) |
Jumps to make sure child is visible inside area.
child must be a descendant of area. If you want to move inside a scrollable widget, like, Gtk::Treeview, see scroll_to().
There is a precondition to this function: the widget must be already realized. You can control if the widget is ready with the GTK_WIDGET_REALIZED macro. If you want to call this function during the initialization process of the widget do it inside a callback to the realize signal, using Glib::signal_connect_after() function.
child | A Gtk::Widget, descendant of area. |
void Hildon::PannableArea::scroll_to | ( | int | x, | |
int | y | |||
) |
Smoothly scrolls area to ensure that ( x, y) is a visible point on the widget.
To move in only one coordinate, you must set the other one to -1. Notice that, in Hildon::PANNABLE_AREA_MODE_PUSH mode, this function works just like jump_to().
This function is useful if you need to present the user with a particular element inside a scrollable widget, like Gtk::TreeView. For instance, the following example shows how to scroll inside a Gtk::TreeView to make visible an item, indicated by the Gtk::TreeIter iter.
<programlisting> GtkTreePath *path; GdkRectangle *rect;
path = gtk_tree_model_get_path (model, &iter); gtk_tree_view_get_background_area (GTK_TREE_VIEW (treeview), path, 0
, &rect); gtk_tree_view_convert_bin_window_to_tree_coords (GTK_TREE_VIEW (treeview), 0, rect.y, 0
, &y); hildon_pannable_area_scroll_to (panarea, -1, y); gtk_tree_path_free (path); </programlisting>
If you want to present a child widget in simpler scenarios, use scroll_to_child() instead.
There is a precondition to this function: the widget must be already realized. Check the jump_to_child() for more tips regarding how to call this function during initialization.
x | The x coordinate of the destination point or -1 to ignore this axis. | |
y | The y coordinate of the destination point or -1 to ignore this axis. |
void Hildon::PannableArea::scroll_to_child | ( | const Gtk::Widget & | child | ) |
Smoothly scrolls until child is visible inside area.
child must be a descendant of area. If you need to scroll inside a scrollable widget, e.g., Gtk::Treeview, see scroll_to().
There is a precondition to this function: the widget must be already realized. Check the jump_to_child() for more tips regarding how to call this function during initialization.
child | A Gtk::Widget, descendant of area. |
void Hildon::PannableArea::set_size_request_policy | ( | SizeRequestPolicy | size_request_policy | ) |
This function sets the pannable area size request policy.
That policy controls the way the size_request is done in the pannable area. Pannable can use the size request of its children (Hildon::SIZE_REQUEST_CHILDREN) or the minimum size required for the area itself (Hildon::SIZE_REQUEST_MINIMUM), the latter is the default. Recall this size depends on the scrolling policy you are requesting to the pannable area, if you set Gtk::POLICY_NEVER this parameter will not have any effect with Hildon::SIZE_REQUEST_MINIMUM set.
Deprecated: This method and the policy request is deprecated, DO NOT use it in future code, the only policy properly supported in gtk+ nowadays is the minimum size. Use gtk_window_set_default_size or gtk_window_set_geometry_hints with the proper size in your case to define the height of your dialogs.
size_request_policy | One of the allowed Hildon::SizeRequestPolicy. |
Glib::SignalProxy3<void,MovementDirection,double,double> Hildon::PannableArea::signal_horizontal_movement | ( | ) |
void on_my_horizontal_movement(MovementDirection direction, double x, double y)
Glib::SignalProxy3<void,MovementDirection,double,double> Hildon::PannableArea::signal_vertical_movement | ( | ) |
void on_my_vertical_movement(MovementDirection direction, double x, double y)
Hildon::PannableArea* wrap | ( | HildonPannableArea * | object, | |
bool | take_copy = false | |||
) | [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. |