Classes
Setter | A declarative class for defining a style field setter. |
Stylable | A mixin class for defining stylable declarative objects. |
Style | A declarative class for defining a style sheet style. |
StyleCache | An object which manages the styling caches. |
StyleSheet | A declarative class for defining a widget style sheet. |
Bases: enaml.core.declarative.Declarative
A declarative class for defining a style field setter.
A Setter is declared as a child of a Style. It defines the value to be applied to a style field.
The style field to which this setter applies.
The value to apply to the style field.
A reimplemented destructor.
This will notify the StyleCache when the setter is destroyed.
Bases: enaml.core.declarative.Declarative
A mixin class for defining stylable declarative objects.
This class can be used as a mixin with any Declarative class which wishes to support style sheets.
The style class to which this item belongs. Multiple classes can be separated with whitespace. An empty string indicates the widget does not belong to any style class.
A reimplemented destructor.
This will notify the StyleCache when the stylable item is destroyed.
Get the StyleSheet defined on the item.
Returns : | result : StyleSheet or None
|
---|
Restyle the object.
This method will be called when the style dependencies for the object have changed. It should be reimplemented in a subclass to take appropriate action for the restyle.
A reimplemented parent changed event handler.
This will notifiy the StyleCache if the parent of the item has changed.
A reimplemented child added event handler.
This will notify the StyleCache if the StyleSheet children of the item have changed.
A reimplemented child removed event handler.
This will notify the StyleCache if the StyleSheet children of the item have changed.
Bases: enaml.core.declarative.Declarative
A declarative class for defining a style sheet style.
A Style is declared as a child of a StyleSheet. It uses child Setter objects to define the style fields to apply to widgets which are a match for the style.
A Style may have an arbitrary number of Setter children.
The type name of the element which will match the style. An empty string will match all elements. Multiple elements can be separated by a comma and will match using logical OR semantics.
The name of the widget style class which will match the style. An empty string will match all style classes. Multiple classes can be separated by a comma and will match using logical OR semantics.
The object name of the widget which will match the style. An empty string will match all object names. Multiple object names can be separated by a comma and will match using logical OR semantics.
The pseudo-class which must be active for the style to apply. An empty string will apply the syle for all pseudo-classes. Multiple classes can be separated by a colon will match using logical AND semantics. Commas can be used to separate multiple classes which will match using logical OR semantics.
The pseudo-element to which the style applies. An empty string indicates the style applies to the primary element. Multiple pseudo elements can be separated comma and match using logical OR semantics.
Get the Setter objects declared for the style.
Returns : | result : list
|
---|
Get whether or not the style matches an item.
Parameters : | item : Stylable
|
---|---|
Returns : | result : int
|
A reimplemented destructor.
This will notify the StyleCache when the style is destroyed.
A reimplemented child added event handler.
This will notify the StyleCache if the Setter children of the style have changed.
A reimplemented child removed event handler.
This will notify the StyleCache if the Setter children of the style have changed.
Bases: object
An object which manages the styling caches.
All interaction with this class is through public class methods. This class should be used by code which implements the styling for a stylable item. The public API methods can be used to query for the Style object which matchs a Stylable item.
Get the StyleSheet objects which apply to an item.
Parameters : | item : Stylable
|
---|---|
Returns : | result : tuple
|
Get the Style objects which apply to an item.
Parameters : | item : Stylable
|
---|---|
Returns : | result : tuple
|
Get the toolkit representation of a setter.
This method will return the cached toolkit setter, if available, or invoke the translator to create the cached setter. The cached toolkit setter will be cleared when the setter is invalidated.
Parameters : | setter : Setter
translate : callable
|
---|---|
Returns : | result : object
|
list of weak references to the object (if defined)
Bases: enaml.core.declarative.Declarative
A declarative class for defining a widget style sheet.
A StyleSheet is declared as a child of a Stylable widget. It uses child Style objects to apply styling to its parent widget and all of the widget’s decendents. A StyleSheet can also be provided to the global Application, in which case the styling will be applied to all stylable widgets. The effective style sheet for a widget is the union of all its ancestor style sheets plus the application style sheet.
A StyleSheet may have an arbitrary number of Style children. The child style objects are applied to a widget in the order of their match specificity within the style sheet.
A reimplemented destructor.
This will notify the StyleCache when the style sheet is destroyed.
Get the Style objects declared for the style sheet.
Returns : | result : list
|
---|
A reimplemented child added event handler.
This will notify the StyleCache if the Style children of the style sheet have changed.
A reimplemented child removed event handler.
This will notify the StyleCache if the Style children of the style sheet have changed.