Top |
GtkWidget * | gimp_number_pair_entry_new () |
void | gimp_number_pair_entry_set_default_values () |
void | gimp_number_pair_entry_get_default_values () |
void | gimp_number_pair_entry_set_values () |
void | gimp_number_pair_entry_get_values () |
GimpAspectType | gimp_number_pair_entry_get_aspect () |
void | gimp_number_pair_entry_set_aspect () |
gdouble | gimp_number_pair_entry_get_ratio () |
void | gimp_number_pair_entry_set_ratio () |
gboolean | gimp_number_pair_entry_get_user_override () |
void | gimp_number_pair_entry_set_user_override () |
const gchar * | gimp_number_pair_entry_get_default_text () |
void | gimp_number_pair_entry_set_default_text () |
gboolean | allow-simplification | Read / Write |
GimpAspectType | aspect | Read / Write |
double | default-left-number | Read / Write |
double | default-right-number | Read / Write |
char * | default-text | Read / Write |
double | left-number | Read / Write |
double | max-valid-value | Read / Write |
double | min-valid-value | Read / Write |
double | ratio | Read / Write |
double | right-number | Read / Write |
char * | separators | Read / Write / Construct Only |
gboolean | user-override | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkEntry ╰── GimpNumberPairEntry
GimpNumberPairEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
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.
separators |
The allowed separators. |
|
allow_simplification |
Whether to do simplification on the entered term. |
|
min_valid_value |
The minimum allowed result value. |
|
max_valid_value |
The maximum allowed result value. |
Since: 2.4
void gimp_number_pair_entry_set_default_values (GimpNumberPairEntry *entry
,gdouble left
,gdouble right
);
entry |
A GimpNumberPairEntry widget. |
|
left |
Default left value in the entry. |
|
right |
Default right value in the entry. |
Since: 2.4
void gimp_number_pair_entry_get_default_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
);
entry |
A GimpNumberPairEntry widget. |
|
left |
Pointer of where to put left value. |
|
right |
Pointer of where to put right value. |
Since: 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.
entry |
A GimpNumberPairEntry widget. |
|
left |
Left number in the entry. |
|
right |
Right number in the entry. |
Since: 2.4
void gimp_number_pair_entry_get_values (GimpNumberPairEntry *entry
,gdouble *left
,gdouble *right
);
Gets the numbers displayed by a GimpNumberPairEntry.
entry |
A GimpNumberPairEntry widget. |
|
left |
Pointer of where to store the left number (may be |
|
right |
Pointer of to store the right number (may be |
Since: 2.4
GimpAspectType
gimp_number_pair_entry_get_aspect (GimpNumberPairEntry *entry
);
Gets the aspect of the ratio displayed by a GimpNumberPairEntry.
Since: 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
).
Since: 2.4
gdouble
gimp_number_pair_entry_get_ratio (GimpNumberPairEntry *entry
);
Retrieves the ratio of the numbers displayed by a GimpNumberPairEntry.
Since: 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.
Since: 2.4
gboolean
gimp_number_pair_entry_get_user_override
(GimpNumberPairEntry *entry
);
Since: 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.
entry |
A GimpNumberPairEntry widget. |
|
user_override |
|
Since: 2.4
const gchar *
gimp_number_pair_entry_get_default_text
(GimpNumberPairEntry *entry
);
Since: 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.
Since: 2.4
“allow-simplification”
property “allow-simplification” gboolean
Whether to allow simplification.
Owner: GimpNumberPairEntry
Flags: Read / Write
Default value: FALSE
“aspect”
property“aspect” GimpAspectType
The value as aspect.
Owner: GimpNumberPairEntry
Flags: Read / Write
Default value: GIMP_ASPECT_SQUARE
“default-left-number”
property “default-left-number” double
The default left number.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
“default-right-number”
property “default-right-number” double
The default right number.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
“default-text”
property “default-text” char *
String to show when in automatic mode.
Owner: GimpNumberPairEntry
Flags: Read / Write
Default value: NULL
“left-number”
property “left-number” double
The left number.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
“max-valid-value”
property “max-valid-value” double
Maximum value valid when parsing input.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 1.79769e+308
“min-valid-value”
property “min-valid-value” double
Minimum value valid when parsing input.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 2.22507e-308
“ratio”
property “ratio” double
The value as ratio.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 1
“right-number”
property “right-number” double
The right number.
Owner: GimpNumberPairEntry
Flags: Read / Write
Allowed values: >= G_MINDOUBLE
Default value: 100
“separators”
property “separators” char *
A string of valid separators.
Owner: GimpNumberPairEntry
Flags: Read / Write / Construct Only
Default value: NULL
“numbers-changed”
signalvoid user_function (GimpNumberPairEntry *gimpnumberpairentry, gpointer user_data)
Flags: Run First
“ratio-changed”
signalvoid user_function (GimpNumberPairEntry *gimpnumberpairentry, gpointer user_data)
Flags: Run First