v_sim.UiColorCombobox

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.CellEditable Gtk.CellEditable GObject.GInterface->Gtk.CellEditable Gtk.CellLayout Gtk.CellLayout GObject.GInterface->Gtk.CellLayout GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.ComboBox Gtk.ComboBox Gtk.Bin->Gtk.ComboBox Gtk.Buildable->Gtk.Widget Gtk.CellEditable->Gtk.ComboBox Gtk.CellLayout->Gtk.ComboBox v_sim.UiColorCombobox v_sim.UiColorCombobox Gtk.ComboBox->v_sim.UiColorCombobox Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.ComboBox (40), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.CellLayout (9)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (hasAlphaChannel)

class

newWithRanges (hasAlphaChannel)

getPixbufFromColor (color)

getRangeColor ()

getRangeMaterial ()

getRangeWidgets ()

getSelection ()

setExpanded (value)

setPrintValues (value)

setRangeColor (rgba, raiseSignal)

setRangeMaterial (material, raiseSignal)

setSelection (color)

Virtual Methods

Inherited:

Gtk.ComboBox (2), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.CellLayout (9)

Properties

Inherited:

Gtk.ComboBox (16), Gtk.Container (3), Gtk.Widget (39), Gtk.CellEditable (1)

Name

Type

Flags

Short Description

color

v_sim.Color

r/w

color of the current selection

material

r/w

material of the current selection

Style Properties

Inherited:

Gtk.ComboBox (4), Gtk.Widget (17)

Signals

Inherited:

Gtk.ComboBox (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Name

Short Description

color-selected

This signal is emitted when a new valid colour is selected, either an existing one or newly created one.

color-value-changed

This signal is emitted when the range of a colour is modified.

material-value-changed

This signal is emitted when the range of a material is modified.

Fields

Inherited:

Gtk.ComboBox (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Class Details

class v_sim.UiColorCombobox(**kwargs)
Bases:

Gtk.ComboBox

Abstract:

No

Structure:

v_sim.UiColorComboboxClass

Private structure to store informations of a v_sim.UiColorCombobox object.

New in version 3.1.

classmethod new(hasAlphaChannel)
Parameters:

hasAlphaChannel (bool) – a boolean.

Returns:

a newly created v_sim.UiColorCombobox widget.

Return type:

Gtk.Widget

A v_sim.UiColorCombobox widget is like a Gtk.ComboBox widget, but it is already filled with the colors stores in the structures adhoc in visu_tools.h. Using this widget is a convienient way to share colors between all part of V_Sim and to give a consistent look of all color selection. If the argument hasAlphaChannel is False, the widget display all colors but without their alpha channel, assuming it to be fully opaque.

New in version 3.1.

classmethod newWithRanges(hasAlphaChannel)
Parameters:

hasAlphaChannel (bool) – a boolean.

Returns:

a newly created v_sim.UiColorCombobox widget.

Return type:

Gtk.Widget

Create a color combo and several ranges.

New in version 3.3.

getPixbufFromColor(color)
Parameters:

color (v_sim.Color) – a v_sim.Color object.

Returns:

a pixbuf pointer corresponding to the little image shown on the self.

Return type:

GdkPixbuf.Pixbuf

The self has little pixbufs to represent the color. User methods can use these pixbufs but should considered them read-only.

New in version 3.1.

getRangeColor()
Returns:

a newly created array of size 4. Use GLib.free() to delete it.

Return type:

[float]

If the self uses ranges (see v_sim.UiColorCombobox.newWithRanges()), this method is used to get the values from the color ranges.

New in version 3.2.

getRangeMaterial()
Returns:

a newly created array of size v_sim.MaterialIds.N_VALUES (see v_sim.MaterialIds). Use GLib.free() to delete it.

Return type:

[float]

If the self uses ranges (see v_sim.UiColorCombobox.newWithRanges()), this method is used to get the values from the material ranges.

New in version 3.3.

getRangeWidgets()
Returns:

a widget owned by color.

Return type:

Gtk.Widget

Retrieve the wiodget using to represent the ranges, or None if the object has no ranges.

New in version 3.3.

getSelection()
Returns:

a pointer to the selected v_sim.Color object (or None). This object is read-only.

Return type:

v_sim.Color

The user can access to the selected v_sim.Color object using this method.

New in version 3.1.

setExpanded(value)
Parameters:

value (bool) – a boolean value.

Set the expanded state of the ranges. This is usable only if the colorComboBox has been created with ranges.

New in version 3.3.

setPrintValues(value)
Parameters:

value (bool) – a boolean.

Print or not the RGB values.

New in version 3.4.

setRangeColor(rgba, raiseSignal)
Parameters:
  • rgba (float) – 4 floating point values ;

  • raiseSignal (bool) – if True a material-value-changed can be raised.

Change the values for the ranges that control the color. If the color exists in the list, it is also selected. This is possible only if the self has been created with v_sim.UiColorCombobox.newWithRanges().

New in version 3.3.

setRangeMaterial(material, raiseSignal)
Parameters:

Change the values for the ranges that control the light (emission, diffuse…). This is possible only if the self has been created with v_sim.UiColorCombobox.newWithRanges().

New in version 3.3.

setSelection(color)
Parameters:

color (v_sim.Color) – a v_sim.Color object.

Returns:

True if the color already exists in the model.

Return type:

bool

Use this method to set the ComboBox on the given color. This emits a ‘color-channel’ signal if the color is changed, which means, a previous color has been modified, or a new color is selected.

New in version 3.1.

Signal Details

v_sim.UiColorCombobox.signals.color_selected(ui_color_combobox, color)
Signal Name:

color-selected

Flags:

RUN_FIRST, ACTION

Parameters:

This signal is emitted when a new valid colour is selected, either an existing one or newly created one.

New in version 3.1.

v_sim.UiColorCombobox.signals.color_value_changed(ui_color_combobox, RGBA)
Signal Name:

color-value-changed

Flags:

RUN_FIRST, ACTION

Parameters:
  • ui_color_combobox (v_sim.UiColorCombobox) – The object which received the signal

  • RGBA (int) – the modified channel.

This signal is emitted when the range of a colour is modified.

New in version 3.3.

v_sim.UiColorCombobox.signals.material_value_changed(ui_color_combobox, mat)
Signal Name:

material-value-changed

Flags:

RUN_FIRST, ACTION

Parameters:

This signal is emitted when the range of a material is modified.

New in version 3.3.

Property Details

v_sim.UiColorCombobox.props.color
Name:

color

Type:

v_sim.Color

Default Value:

None

Flags:

READABLE, WRITABLE

color of the current selection

v_sim.UiColorCombobox.props.material
Name:

material

Type:

Default Value:

None

Flags:

READABLE, WRITABLE

material of the current selection