Maemomm Reference Documentation: hildonmm
Main Page   Namespaces   Book  

Hildon::PannableArea Class Reference
[Widgets]

A scrolling widget designed for touch screens. More...

Inheritance diagram for Hildon::PannableArea:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~PannableArea ()
HildonPannableArea * gobj ()
 Provides access to the underlying C GtkObject.
const HildonPannableArea * gobj () const
 Provides access to the underlying C GtkObject.
 PannableArea ()
 PannableArea (PannableAreaMode mode, bool enabled, double velocity_min, double velocity_max, double deceleration, guint sps)
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.
void scroll_to (int x, int y)
 Smoothly scrolls area to ensure that ( x, y) is a visible point on the widget.
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 scroll_to_child (const Gtk::Widget &child)
 Smoothly scrolls until child is visible inside area.
void jump_to_child (const Gtk::Widget &child)
 Jumps to make sure child is visible inside area.
Gtk::Widgetget_child_at (double x, double y)
 Get the widget at the point (x, y) inside the pannable area.
const Gtk::Widgetget_child_at (double x, double y) const
 Get the widget at the point (x, y) inside the pannable area.
Gtk::Adjustmentget_hadjustment ()
 returns: The horizontal Gtk::Adjustment
const Gtk::Adjustmentget_hadjustment () const
 returns: The horizontal Gtk::Adjustment
Gtk::Adjustmentget_vadjustment ()
 returns: The vertical Gtk::Adjustment
const Gtk::Adjustmentget_vadjustment () const
 returns: The vertical Gtk::Adjustment
Glib::SignalProxy3< void,
MovementDirection, double,
double > 
signal_horizontal_movement ()
Glib::SignalProxy3< void,
MovementDirection, double,
double > 
signal_vertical_movement ()

Related Functions

(Note that these are not member functions.)

Hildon::PannableAreawrap (HildonPannableArea *object, bool take_copy=false)
 A Glib::wrap() method for this object.


Detailed Description

A scrolling widget designed for touch screens.

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.

See also:
Gtk::ScrolledWindow

Constructor & Destructor Documentation

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]


Member Function Documentation

HildonPannableArea* Hildon::PannableArea::gobj (  )  [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

const HildonPannableArea* Hildon::PannableArea::gobj (  )  const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

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.

{2,2}

Parameters:
child Child widget to add to the viewport.

Reimplemented from Gtk::Container.

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.

{2,2}

Parameters:
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 ( 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.

{2,2}

Parameters:
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.

{2,2}

Parameters:
child A Gtk::Widget, descendant of area.

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.

{2,2}

Parameters:
child A Gtk::Widget, descendant of area.

Gtk::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.

Parameters:
area A Hildon::PannableArea.
x Horizontal coordinate of the point.
y Vertical coordinate of the point.
Returns:
The Gtk::Widget if we find a widget, 0 in any other case
{2,2}.

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.

Parameters:
area A Hildon::PannableArea.
x Horizontal coordinate of the point.
y Vertical coordinate of the point.
Returns:
The Gtk::Widget if we find a widget, 0 in any other case
{2,2}.

Gtk::Adjustment* Hildon::PannableArea::get_hadjustment (  ) 

returns: The horizontal Gtk::Adjustment

Returns:
The horizontal Gtk::Adjustment
{2,2}.

const Gtk::Adjustment* Hildon::PannableArea::get_hadjustment (  )  const

returns: The horizontal Gtk::Adjustment

Returns:
The horizontal Gtk::Adjustment
{2,2}.

Gtk::Adjustment* Hildon::PannableArea::get_vadjustment (  ) 

returns: The vertical Gtk::Adjustment

Returns:
The vertical Gtk::Adjustment
{2,2}.

const Gtk::Adjustment* Hildon::PannableArea::get_vadjustment (  )  const

returns: The vertical Gtk::Adjustment

Returns:
The vertical Gtk::Adjustment
{2,2}.

Glib::SignalProxy3< void,MovementDirection,double,double > Hildon::PannableArea::signal_horizontal_movement (  ) 

Prototype:
void on_my_horizontal_movement(MovementDirection direction, double x, double y)

Glib::SignalProxy3< void,MovementDirection,double,double > Hildon::PannableArea::signal_vertical_movement (  ) 

Prototype:
void on_my_vertical_movement(MovementDirection direction, double x, double y)


Friends And Related Function Documentation

Hildon::PannableArea * wrap ( HildonPannableArea *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
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.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:

Generated for hildonmm by Doxygen 1.5.6 © 1997-2001