Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::AspectFrame Class Reference

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

`#include <inti/gtk/aspectframe.h>`

Inheritance diagram for Inti::Gtk::AspectFrame:

List of all members.

## Public Member Functions

Constructors

- AspectFrame ()
    Construct an AspectFrame with xalign 0.5, yalign 0.5, ratio 1.0 and obey_child true.
- AspectFrame (float xalign, float yalign)
    Construct an AspectFrame with the specified xalign and yalign values.
- AspectFrame (float xalign, float yalign, float ratio)
    Construct an AspectFrame with the specified xalign, yalign and ratio values.
- AspectFrame (const String &label, float xalign, float yalign, float ratio)
    Construct a labelled AspectFrame with the specified xalign, yalign and ratio values.
- virtual ~AspectFrame ()
    Destructor.

Accessors

- GtkAspectFrame * gtk_aspect_frame () const
    Get a pointer to the GtkAspectFrame structure.
- GtkAspectFrameClass * gtk_aspect_frame_class () const
    Get a pointer to the GtkAspectFrameClass structure.
- operator GtkAspectFrame * () const
    Conversion operator; safely converts an AspectFrame to a GtkAspectFrame pointer.

Methods

- void set (float xalign, float yalign, float ratio, bool obey_child)
    Sets the parameters for an existing AspectFrame.

Property Proxies

- const XAlignPropertyProxy prop_xalign ()
    X alignment of the child (float : Read / Write).
- const YAlignPropertyProxy prop_yalign ()
    Y alignment of the child (float : Read / Write).
- const RatioPropertyProxy prop_ratio ()
    Aspect ratio if obey_child is false (float : Read / Write).
- const ObeyChildPropertyProxy prop_obey_child ()
    Force aspect ratio to match that of the frame's child (bool : Read / Write).

## Protected Member Functions

Constructors

- AspectFrame (GtkAspectFrame *aspect_frame, bool reference=false)
    Construct a new AspectFrame from an existing GtkAspectFrame.

## 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.

## Constructor & Destructor Documentation

Inti::Gtk::AspectFrame::AspectFrame | ( | GtkAspectFrame * | aspect_frame,
|  | bool | reference = false
| ) | `[explicit, protected]`

Construct a new AspectFrame from an existing GtkAspectFrame.

Parameters:

  aspect_frame | A pointer to a GtkAspectFrame.
  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).

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

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

Inti::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 Inti::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:

- aspectframe.h

Main Page - Footer