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


Public Member Functions
Xfc::Gtk::Alignment Class Reference

A GtkAlignment C++ wrapper class. More...

#include <xfc/gtk/alignment.hh>

Inheritance diagram for Xfc::Gtk::Alignment:
Xfc::Gtk::Bin 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 Member Functions

Constructors


Detailed Description

A GtkAlignment C++ wrapper class.

The Alignment widget controls the alignment and size of its child widget. It has four settings: xscale, yscale, xalign, and yalign.

The scale settings are used to specify how much the child widget should expand to fill the space allocated to the Alignment. The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space).

The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.

See also: the Alignment Widget and ProgressBar HOWTOs and examples.


Constructor & Destructor Documentation

Xfc::Gtk::Alignment::Alignment ( GtkAlignment *  alignment,
bool  owns_reference = false 
) [explicit, protected]

Construct a new Alignment from an existing GtkAlignment.

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

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

Xfc::Gtk::Alignment::Alignment ( )

Construct an Alignment with the default values 0.5 for xalign and yalign and 1.0 for xscale and yscale.

Xfc::Gtk::Alignment::Alignment ( float  xalign,
float  yalign,
float  xscale = 0.0,
float  yscale = 0.0 
)

Construct a new Alignment.

Parameters:
xalignThe horizontal alignment of the child widget, from 0 (left) to 1 (right).
yalignThe vertical alignment of the child widget, from 0 (top) to 1 (bottom).
xscaleThe amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the GtkAlignment.
yscaleThe amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.

Member Function Documentation

void Xfc::Gtk::Alignment::get_padding ( unsigned int *  top,
unsigned int *  bottom,
unsigned int *  left,
unsigned int *  right 
) const

Gets the padding on the different sides of the widget (see set_padding()).

Parameters:
topThe location to store the padding for the top of the widget, or null.
bottomThe location to store the padding for the bottom of the widget, or null.
leftThe location to store the padding for the left of the widget, or null.
rightThe ocation to store the padding for the right of the widget, or null.
void Xfc::Gtk::Alignment::set ( float  xalign,
float  yalign,
float  xscale,
float  yscale 
)

Sets the Alignment values.

Parameters:
xalignThe horizontal alignment of the child widget, from 0 (left) to 1 (right).
yalignThe vertical alignment of the child widget, from 0 (top) to 1 (bottom).
xscaleThe amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the GtkAlignment.
yscaleThe amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xscale.
void Xfc::Gtk::Alignment::set_padding ( unsigned int  top,
unsigned int  bottom,
unsigned int  left,
unsigned int  right 
)

Sets the padding on the different sides of the widget.

Parameters:
topThe padding at the top of the widget.
bottomThe padding at the bottom of the widget.
leftThe padding at the left of the widget.
rightThe padding at the right of the widget.

The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.


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