Next: collapse
Up: Class Reference
Previous: switch-to
Superclass: wx:object%
A wx:style-delta% object encapsulates a style change. The changes expressible
by a delta include:
- changing the font family
- changing the font face
- changing the font size to a new value
- enlarging the font by an additive amount
- enlarging the font by a multiplicative amount, etc.
- changing the font style (normal, italic, or slant)
- toggling the font style
- changing the font to italic if it is currently slant, etc.
- changing the font weight, etc.
- changing the underline, etc.
- changing the vertical alignment, etc.
- changing the foreground color
- dimming or brightening the foreground color, etc.
- changing the background color, etc.
- changing text backing transparency
The
set-delta method is convenient for most style delta settings; it takes a
high-level delta specification and sets the internal delta information.
To take full advantage of a style delta, it is necessary to understand
the internal on/off settings that can be manipulated through methods such as
set-weight-on. For example, the font weight change is specified through the weight-on and
weight-off internal settings. Roughly, weight-on turns on a weight
setting when it is not present and weight-off turns off a weight setting
when it is present. These two interact precisely in the following way:
- If both weight-on and weight-off are set to wx:const-base,
then the font weight is not changed.
- If weight-on is not wx:const-base, then the weight is set to
weight-on.
- If weight-off is not wx:const-base, then the weight will be set back
to wx:const-normal when the base style has the weight weight-off.
- If both weight-on and weight-off are set to the same
value, then the weight is toggled with respect to that value: if
the base style has the weight weight-on, then weight is changed to
wx:const-normal; if the base style has a different weight, it is changed to
weight-on.
- If both weight-on and weight-off are set, but to
different values, then the weight is changed to weight-on
only when the base style has the weight weight-off.
Font styles, underlining, and alignment work in an analogous manner.
The possible values for alignment-on and alignment-off are:
- wx:const-base
- wx:const-align-top
- wx:const-align-center
- wx:const-align-bottom
The possible values for style-on and style-off are:
- wx:const-base
- wx:const-normal
- wx:const-italic
- wx:const-slant
The possible values for underlined-on and underlined-off are:
- #f (acts like wx:const-base)
- #t
The possible values for trasnparent-text-backing-on and
trasnparent-text-backing-off are:
- #f (acts like wx:const-base)
- #t
The possible values for weight-on and weight-off are:
- wx:const-base
- wx:const-normal
- wx:const-bold
- wx:const-light
The family and face settings in a style delta are not independent. If
both are set within a style delta, the face setting overrides the
family setting. However, if a style delta with a family setting and no
face setting is applied to a style with a face setting, then the delta
application overrides the face setting in the base style.
Methods:
Next: collapse
Up: Class Reference
Previous: switch-to
PLT