| Hildon Reference Manual | ||||
|---|---|---|---|---|
HildonCaptionHildonCaption — A single-child container widget that precedes the contained widget with a field label and an optional icon.  | 
![]()  | 
#include <hildon/hildon.h> enum HildonCaptionStatus; enum HildonCaptionIconPosition; HildonCaption; GtkWidget* hildon_caption_new (GtkSizeGroup *group, const gchar *value, GtkWidget *control, GtkWidget *icon, HildonCaptionStatus flag); GtkSizeGroup* hildon_caption_get_size_group (const HildonCaption *caption); void hildon_caption_set_size_group (const HildonCaption *caption, GtkSizeGroup *new_group); gboolean hildon_caption_is_mandatory (const HildonCaption *caption); void hildon_caption_set_status (HildonCaption *caption, HildonCaptionStatus flag); HildonCaptionStatus hildon_caption_get_status (const HildonCaption *caption); void hildon_caption_set_icon_position (HildonCaption *caption, HildonCaptionIconPosition pos); HildonCaptionIconPosition hildon_caption_get_icon_position (const HildonCaption *caption); void hildon_caption_set_icon_image (HildonCaption *caption, GtkWidget *icon); GtkWidget* hildon_caption_get_icon_image (const HildonCaption *caption); void hildon_caption_set_label (HildonCaption *caption, const gchar *label); gchar* hildon_caption_get_label (const HildonCaption *caption); void hildon_caption_set_separator (HildonCaption *caption, const gchar *separator); gchar* hildon_caption_get_separator (const HildonCaption *caption); void hildon_caption_set_label_alignment (HildonCaption *caption, gfloat alignment); gfloat hildon_caption_get_label_alignment (HildonCaption *caption); void hildon_caption_set_child_expand (HildonCaption *caption, gboolean expand); gboolean hildon_caption_get_child_expand (const HildonCaption *caption); void hildon_caption_set_label_markup (HildonCaption *caption, const gchar *markup);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkEventBox +----HildonCaption
"icon" GtkWidget* : Read / Write "icon-position" HildonCaptionIconPosition : Read / Write "label" gchar* : Read / Write "markup" gchar* : Write "separator" gchar* : Read / Write "size-group" GtkSizeGroup* : Read / Write "status" HildonCaptionStatus : Read / Write
HildonCaption is a single-child container widget that precedes the contained widget with a field label and an optional icon. It allows grouping of several controls together. When a captioned widget has focus, both widget and caption label are displayed with active focus.
typedef enum
{
    HILDON_CAPTION_OPTIONAL = 0,
    HILDON_CAPTION_MANDATORY
}                                               HildonCaptionStatus;
Keys to set the HildonCaption to be optional or mandatory.
typedef enum
{
    HILDON_CAPTION_POSITION_LEFT = 0,
    HILDON_CAPTION_POSITION_RIGHT
}                                               HildonCaptionIconPosition;
Keys to set the icon placement in HildonCaption.
GtkWidget* hildon_caption_new (GtkSizeGroup *group, const gchar *value, GtkWidget *control, GtkWidget *icon, HildonCaptionStatus flag);
Creates a new instance of HildonCaption widget, with a specific
control and image.
Note: Clicking on a focused caption will trigger the activate signal.
The default behaviour for the caption's activate signal is to call	 
gtk_widget_activate() on its control.
group : | 
 a GtkSizeGroup for controlling the size of related captions or NULL
 | 
value : | 
the caption text to accompany the text entry. The widget makes a copy of this text. | 
control : | 
the control that is to be captioned. | 
icon : | 
 an icon to accompany the label or NULL in case no icon should be displayed.
 | 
flag : | 
indicates whether this captioned control is mandatory or optional. | 
| Returns : | a new HildonCaption | 
GtkSizeGroup* hildon_caption_get_size_group (const HildonCaption *caption);
Queries given captioned control for the GtkSizeGroup assigned to it.
caption : | 
a HildonCaption | 
| Returns : | a GtkSizeGroup | 
void hildon_caption_set_size_group (const HildonCaption *caption, GtkSizeGroup *new_group);
Sets a GtkSizeGroup of a given captioned control.
caption : | 
a HildonCaption | 
new_group : | 
a GtkSizeGroup | 
gboolean hildon_caption_is_mandatory (const HildonCaption *caption);
Queries whether caption is mandatory.
caption : | 
a HildonCaption | 
| Returns : | Whether this captioned control is mandatory. | 
void hildon_caption_set_status (HildonCaption *caption, HildonCaptionStatus flag);
Sets caption's status.
caption : | 
a HildonCaption | 
flag : | 
one of the values from HildonCaptionStatus | 
HildonCaptionStatus hildon_caption_get_status (const HildonCaption *caption);
Gets caption's status.
caption : | 
a HildonCaption | 
| Returns : | one of the values from HildonCaptionStatus | 
void hildon_caption_set_icon_position (HildonCaption *caption, HildonCaptionIconPosition pos);
Sets caption's icon position.
caption : | 
a HildonCaption | 
pos : | 
one of the values from HildonCaptionIconPosition | 
HildonCaptionIconPosition hildon_caption_get_icon_position (const HildonCaption *caption);
Gets caption's icon position.
caption : | 
a HildonCaption | 
| Returns : | one of the values from HildonCaptionIconPosition. | 
void hildon_caption_set_icon_image (HildonCaption *caption, GtkWidget *icon);
Sets the icon image widget to be used by caption.
caption : | 
a HildonCaption | 
icon : | 
 the GtkImage to use as the icon. 
        Calls gtk_widget_show() on the icon if it is not visible.
 | 
GtkWidget* hildon_caption_get_icon_image (const HildonCaption *caption);
Gets the icon image widget used by caption.
caption : | 
a HildonCaption | 
| Returns : |  the GtkImage widget that is being used as the icon by
           caption, or NULL if no icon image is in use.
 | 
void hildon_caption_set_label (HildonCaption *caption, const gchar *label);
Sets the label text that appears before the control.  
Separator character is added to the end of the label string. By default
the separator is ":". See also hildon_caption_set_separator().
caption : | 
a HildonCaption | 
label : | 
the text to use | 
gchar* hildon_caption_get_label (const HildonCaption *caption);
Gets the label of caption
caption : | 
a HildonCaption | 
| Returns : |  the text currently being used as the label of caption.
The string is owned by the label and the caller should never
free or modify this value.
 | 
void hildon_caption_set_separator (HildonCaption *caption, const gchar *separator);
Sets the separator character that appears after the label. The default seaparator character is ":".
caption : | 
a HildonCaption | 
separator : | 
the separator to use | 
gchar* hildon_caption_get_separator (const HildonCaption *caption);
Gets the separator string of caption
caption : | 
a HildonCaption | 
| Returns : |  the text currently being used as the separator of the caption
 control. The string is owned by caption and the caller should
 never free or modify this value.
 | 
void hildon_caption_set_label_alignment (HildonCaption *caption, gfloat alignment);
Sets the vertical alignment to be used for the text part of the caption. Applications need to align the child control themselves.
caption : | 
a HildonCaption widget | 
alignment : | 
new vertical alignment | 
gfloat hildon_caption_get_label_alignment (HildonCaption *caption);
Gets current vertical alignment for the text part.
caption : | 
a HildonCaption widget | 
| Returns : | vertical alignment | 
void hildon_caption_set_child_expand (HildonCaption *caption, gboolean expand);
Sets child expandability.
caption : | 
a HildonCaption | 
expand : | 
whether the child is expandable. | 
gboolean hildon_caption_get_child_expand (const HildonCaption *caption);
Gets childs expandability.
caption : | 
a HildonCaption | 
| Returns : | wheter the child is expandable or not. | 
void hildon_caption_set_label_markup (HildonCaption *caption, const gchar *markup);
Sets the label markup text that appears before the control. It acts like
hildon_caption_set_label() but is using the markup text that allows to
specify text properties such as bold or italic.
caption : | 
a HildonCaption | 
markup : | 
the markup text to use | 
"icon-position" property"icon-position" HildonCaptionIconPosition : Read / Write
If the icon is positioned on the left or right side.
Default value: HILDON_CAPTION_POSITION_RIGHT
"markup" property"markup" gchar* : Write
Caption markup. Mutually exclusive with label.
Default value: NULL
"separator" property"separator" gchar* : Read / Write
The current separator.
Default value: "ecdg_ti_caption_separator"
"size-group" property"size-group" GtkSizeGroup* : Read / Write
Current size group the caption is in.
"status" property"status" HildonCaptionStatus : Read / Write
Mandatory or optional status.
Default value: HILDON_CAPTION_OPTIONAL
"expand" child property"expand" gboolean : Read / Write
Same as GtkBox expand. Wheter the child should be expanded or not.
Default value: FALSE
"activate" signalvoid user_function (HildonCaption *hildoncaption, gpointer user_data) : Run First / Action
hildoncaption : | 
the object which received the signal. | 
user_data : | 
user data set when the signal handler was connected. |