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


Xfc::Gtk::AspectFrame Class Reference

A GtkAspectFrame C++ wrapper class. More...

#include <xfc/gtk/aspectframe.hh>

Inheritance diagram for Xfc::Gtk::AspectFrame:

Xfc::Gtk::Frame 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

Accessors
Methods

Detailed Description

A GtkAspectFrame C++ wrapper class.

The AspectFrame is useful when you want pack a widget so that it can resize but always retains the same aspect ratio. For instance, one might be drawing a small preview of a larger image. AspectFrame derives from Frame, so it can draw a label and a frame around the child. The frame will be "shrink-wrapped" to the size of the child.

See also: the AspectFrame HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::AspectFrame::AspectFrame ( GtkAspectFrame *  aspect_frame,
bool  owns_reference = false 
) [explicit, protected]

Construct a new AspectFrame from an existing GtkAspectFrame.

Parameters:
aspect_frame A pointer to a GtkAspectFrame.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The aspect_frame can be a newly created GtkAspectFrame or an existing GtkAspectFrame. (see G::Object::Object).

Xfc::Gtk::AspectFrame::AspectFrame ( float  xalign,
float  yalign 
)

Construct an AspectFrame with the specified xalign and yalign values.

Parameters:
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
This constructor takes the aspect ratio from the requistion of the child. This is the same as setting obey_child to true.

Xfc::Gtk::AspectFrame::AspectFrame ( float  xalign,
float  yalign,
float  ratio 
)

Construct an AspectFrame with the specified xalign, yalign and ratio values.

Parameters:
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
ratio The desired aspect ratio.
This constructor takes the aspect ratio from ratio and sets obey_child to false.

Xfc::Gtk::AspectFrame::AspectFrame ( const String label,
float  xalign,
float  yalign,
float  ratio 
)

Construct a labelled AspectFrame with the specified xalign, yalign and ratio values.

Parameters:
label The label text.
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
ratio The desired aspect ratio.
This constructor takes the aspect ratio from ratio and sets obey_child to false.

Xfc::Gtk::AspectFrame::AspectFrame ( GtkAspectFrame *  aspect_frame,
bool  owns_reference = false 
) [explicit, protected]

Construct a new AspectFrame from an existing GtkAspectFrame.

Parameters:
aspect_frame A pointer to a GtkAspectFrame.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The aspect_frame can be a newly created GtkAspectFrame or an existing GtkAspectFrame. (see G::Object::Object).

Xfc::Gtk::AspectFrame::AspectFrame ( float  xalign,
float  yalign 
)

Construct an AspectFrame with the specified xalign and yalign values.

Parameters:
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
This constructor takes the aspect ratio from the requistion of the child. This is the same as setting obey_child to true.

Xfc::Gtk::AspectFrame::AspectFrame ( float  xalign,
float  yalign,
float  ratio 
)

Construct an AspectFrame with the specified xalign, yalign and ratio values.

Parameters:
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
ratio The desired aspect ratio.
This constructor takes the aspect ratio from ratio and sets obey_child to false.

Xfc::Gtk::AspectFrame::AspectFrame ( const String label,
float  xalign,
float  yalign,
float  ratio 
)

Construct a labelled AspectFrame with the specified xalign, yalign and ratio values.

Parameters:
label The label text.
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
ratio The desired aspect ratio.
This constructor takes the aspect ratio from ratio and sets obey_child to false.


Member Function Documentation

void Xfc::Gtk::AspectFrame::set ( float  xalign,
float  yalign,
float  ratio,
bool  obey_child 
)

Sets the parameters for an existing AspectFrame.

Parameters:
xalign The horizontal alignment of the child within the allocation of the AspectFrame; this ranges from 0.0 (left aligned) to 1.0 (right aligned).
yalign The vertical alignment of the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
ratio The desired aspect ratio.
obey_child If true, ratio is ignored, and the aspect ratio is taken from the requistion of the child.


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