![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
GimpNumberPairEntry; enum GimpAspectType; GtkWidget * gimp_number_pair_entry_new (const gchar *separators
,gboolean allow_simplification
,gdouble min_valid_value
,gdouble max_valid_value
); void gimp_number_pair_entry_set_default_values (GimpNumberPairEntry *entry
,gdouble left
,gdouble right
); void gimp_number_pair_entry_get_default_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
); void gimp_number_pair_entry_set_values (GimpNumberPairEntry *entry
,gdouble left
,gdouble right
); void gimp_number_pair_entry_get_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
); GimpAspectType gimp_number_pair_entry_get_aspect (GimpNumberPairEntry *entry
); void gimp_number_pair_entry_set_aspect (GimpNumberPairEntry *entry
,GimpAspectType aspect
); gdouble gimp_number_pair_entry_get_ratio (GimpNumberPairEntry *entry
); void gimp_number_pair_entry_set_ratio (GimpNumberPairEntry *entry
,gdouble ratio
); gboolean gimp_number_pair_entry_get_user_override (GimpNumberPairEntry *entry
); void gimp_number_pair_entry_set_user_override (GimpNumberPairEntry *entry
,gboolean user_override
); const gchar * gimp_number_pair_entry_get_default_text (GimpNumberPairEntry *entry
); void gimp_number_pair_entry_set_default_text (GimpNumberPairEntry *entry
,const gchar *string
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----GimpNumberPairEntry
GimpNumberPairEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
"allow-simplification" gboolean : Read / Write "aspect" GimpAspectType : Read / Write "default-left-number" gdouble : Read / Write "default-right-number" gdouble : Read / Write "default-text" gchar* : Read / Write "left-number" gdouble : Read / Write "max-valid-value" gdouble : Read / Write "min-valid-value" gdouble : Read / Write "ratio" gdouble : Read / Write "right-number" gdouble : Read / Write "separators" gchar* : Read / Write / Construct Only "user-override" gboolean : Read / Write
typedef enum { GIMP_ASPECT_SQUARE, /*< desc="Square" >*/ GIMP_ASPECT_PORTRAIT, /*< desc="Portrait" >*/ GIMP_ASPECT_LANDSCAPE /*< desc="Landscape" >*/ } GimpAspectType;
Aspect ratios.
GtkWidget * gimp_number_pair_entry_new (const gchar *separators
,gboolean allow_simplification
,gdouble min_valid_value
,gdouble max_valid_value
);
Creates a new GimpNumberPairEntry widget, which is a GtkEntry that accepts two numbers separated by a separator. Typical input example with a 'x' separator: "377x233".
The widget supports simplification of the entered ratio when the input ends in '=', if "allow-simplification" is TRUE.
The "separators" property contains a string of characters valid as separators when parsing input. The first separator is used when displaying the current values.
It is possible to specify what range of values that shall be considered as valid when parsing user input, by changing "min-valid-value" and "max-valid-value".
The first separator of separators
is used to display the current
value.
|
The allowed separators. |
|
Whether to do simplification on the entered term. |
|
The minimum allowed result value. |
|
The maximum allowed result value. |
Returns : |
The new GimpNumberPairEntry widget. |
Since GIMP 2.4
void gimp_number_pair_entry_set_default_values (GimpNumberPairEntry *entry
,gdouble left
,gdouble right
);
|
A GimpNumberPairEntry widget. |
|
Default left value in the entry. |
|
Default right value in the entry. |
Since GIMP 2.4
void gimp_number_pair_entry_get_default_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
);
|
A GimpNumberPairEntry widget. |
|
Pointer of where to put left value. |
|
Pointer of where to put right value. |
Since GIMP 2.4
void gimp_number_pair_entry_set_values (GimpNumberPairEntry *entry
,gdouble left
,gdouble right
);
Forces setting the numbers displayed by a GimpNumberPairEntry, ignoring if the user has set his/her own value. The state of user-override will not be changed.
|
A GimpNumberPairEntry widget. |
|
Left number in the entry. |
|
Right number in the entry. |
Since GIMP 2.4
void gimp_number_pair_entry_get_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
);
Gets the numbers displayed by a GimpNumberPairEntry.
|
A GimpNumberPairEntry widget. |
|
Pointer of where to store the left number (may be NULL ). |
|
Pointer of to store the right number (may be NULL ). |
Since GIMP 2.4
GimpAspectType gimp_number_pair_entry_get_aspect (GimpNumberPairEntry *entry
);
Gets the aspect of the ratio displayed by a GimpNumberPairEntry.
|
A GimpNumberPairEntry widget. |
Returns : |
The entry's current aspect. |
Since GIMP 2.4
void gimp_number_pair_entry_set_aspect (GimpNumberPairEntry *entry
,GimpAspectType aspect
);
Sets the aspect of the ratio by swapping the left_number and
right_number if necessary (or setting them to 1.0 in case that
aspect
is GIMP_ASPECT_SQUARE
).
|
A GimpNumberPairEntry widget. |
|
The new aspect. |
Since GIMP 2.4
gdouble gimp_number_pair_entry_get_ratio (GimpNumberPairEntry *entry
);
Retrieves the ratio of the numbers displayed by a GimpNumberPairEntry.
|
A GimpNumberPairEntry widget. |
Returns : |
The ratio value. |
Since GIMP 2.4
void gimp_number_pair_entry_set_ratio (GimpNumberPairEntry *entry
,gdouble ratio
);
Sets the numbers of the GimpNumberPairEntry to have the desired ratio. If the new ratio is different than the previous ratio, the "ratio-changed" signal is emitted.
An attempt is made to convert the decimal number into a fraction with left_number and right_number < 1000.
|
A GimpNumberPairEntry widget. |
|
Ratio to set in the widget. |
Since GIMP 2.4
gboolean gimp_number_pair_entry_get_user_override
(GimpNumberPairEntry *entry
);
|
A GimpNumberPairEntry widget. |
Returns : |
Wether or not the the widget is in user overridden mode. |
Since GIMP 2.4
void gimp_number_pair_entry_set_user_override (GimpNumberPairEntry *entry
,gboolean user_override
);
When the entry is not in user overridden mode, the values will change when the default values are changed. When in user overridden mode, setting default values will not affect the active values.
|
A GimpNumberPairEntry widget. |
|
TRUE sets the entry in user overridden mode,
FALSE disables. |
Since GIMP 2.4
const gchar * gimp_number_pair_entry_get_default_text
(GimpNumberPairEntry *entry
);
|
A GimpNumberPairEntry widget. |
Returns : |
the string manully set to be shown, or NULL if values are
shown in a normal fashion. |
Since GIMP 2.4
void gimp_number_pair_entry_set_default_text (GimpNumberPairEntry *entry
,const gchar *string
);
Causes the entry to show a given string when in automatic mode, instead of the default numbers. The only thing this does is making the GimpNumberPairEntry showing this string, the internal state and API calls are not affected.
Set the default string to NULL
to display default values as
normal.
|
A GimpNumberPairEntry widget. |
|
Default string. |
Since GIMP 2.4
"allow-simplification"
property "allow-simplification" gboolean : Read / Write
Whether to allow simplification.
Default value: FALSE
"default-left-number"
property "default-left-number" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
"default-right-number"
property "default-right-number" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
"default-text"
property "default-text" gchar* : Read / Write
String to show when in automatic mode.
Default value: NULL
"left-number"
property "left-number" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
"max-valid-value"
property "max-valid-value" gdouble : Read / Write
Maximum value valid when parsing input.
Allowed values: >= G_MINDOUBLE
Default value: 1.79769e+308
"min-valid-value"
property "min-valid-value" gdouble : Read / Write
Minimum value valid when parsing input.
Allowed values: >= G_MINDOUBLE
Default value: 2.22507e-308
"right-number"
property "right-number" gdouble : Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
"separators"
property "separators" gchar* : Read / Write / Construct Only
A string of valid separators.
Default value: NULL
"numbers-changed"
signalvoid user_function (GimpNumberPairEntry *gimpnumberpairentry,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"ratio-changed"
signalvoid user_function (GimpNumberPairEntry *gimpnumberpairentry,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |