This widget is used to enter pixel distances/sizes and resolutions.
You can specify the number of fields the widget should provide. For each field automatic mappings are performed between the field's
"reference value" and its "value".
There is a UnitComboBox right of the entry fields which lets you specify the
Unit of the displayed values.
For each field, there can be one or two SpinButton's to enter "value" and
"reference value". If you specify show_refval as false in
SizeEntry there will be only one
SpinButton and the
UnitComboBox will contain an item for selecting GIMP_UNIT_PIXEL.
The "reference value" is either of GIMP_UNIT_PIXEL or dpi, depending on which
SizeEntryUpdatePolicy you specify in SizeEntry. The "value" is
either the size in pixels mapped to the size in a real-world-unit (see Unit) or
the dpi value mapped to pixels per real-world-unit.
- public void add_field (SpinButton value_spinbutton, SpinButton? refval_spinbutton)
Adds an input field to the SizeEntry.
- public unowned Widget attach_label (string text, int row, int column, float alignment)
Attaches a Label
to the SizeEntry (which is a Grid).
- public unowned Widget get_help_widget (int field)
You shouldn't fiddle with the internals of a
SizeEntry but if you want to set tooltips using help_set_help_data
you can use this function to get a pointer to the spinbuttons.
- public int get_n_fields ()
- public double get_refval (int field)
Returns the reference value for field # field of the
SizeEntry.
- public unowned Unit get_unit ()
- public unowned UnitComboBox get_unit_combo ()
- public SizeEntryUpdatePolicy get_update_policy ()
- public double get_value (int field)
Returns the value of field # field of the
SizeEntry.
- public void grab_focus ()
This function is rather ugly and just a workaround for the fact that
it's impossible to implement grab_focus for a
Grid (is this actually true after the Table->Grid conversion?).
- public void set_activates_default (bool setting)
- public void set_pixel_digits (int digits)
This function allows you set up a SizeEntry
so that sub-pixel sizes can be entered.
- public void set_refval (int field, double refval)
Sets the reference value for field # field of the
SizeEntry.
- public void set_refval_boundaries (int field, double lower, double upper)
Limits the range of possible reference values which can be entered in
field # field of the SizeEntry.
- public void set_refval_digits (int field, int digits)
Sets the decimal digits of field # field of the
SizeEntry to digits.
- public void set_resolution (int field, double resolution, bool keep_size)
Sets the resolution (in dpi) for field # field of the
SizeEntry.
- public void set_size (int field, double lower, double upper)
Sets the pixel values for field # field of the
SizeEntry which will be treated as 0% and 100%.
- public void set_unit (Unit unit)
Sets the SizeEntry's unit.
- public void set_value (int field, double value)
Sets the value for field # field of the
SizeEntry.
- public void set_value_boundaries (int field, double lower, double upper)
Limits the range of possible values which can be entered in field #
field of the SizeEntry.
- public void show_unit_menu (bool show)
Controls whether a unit menu is shown in the size entry.