1 Overview
Windowing
Drawing
Editor
2 Reference
Windowing Classes
Windowing Functions
Drawing Classes
Drawing Functions
Editor Classes
Editor Functions
WXME Decoding
3 Configuration
4 Dynamic Loading
Index
On this page:
collapse
copy
equal?
get-alignment-off
get-alignment-on
get-background-add
get-background-mult
get-face
get-family
get-foreground-add
get-foreground-mult
get-size-add
get-size-in-pixels-off
get-size-in-pixels-on
get-size-mult
get-smoothing-off
get-smoothing-on
get-style-off
get-style-on
get-transparent-text-backing-off
get-transparent-text-backing-on
get-underlined-off
get-underlined-on
get-weight-off
get-weight-on
set-alignment-off
set-alignment-on
set-delta
set-delta-background
set-delta-face
set-delta-foreground
set-face
set-family
set-size-add
set-size-in-pixels-off
set-size-in-pixels-on
set-size-mult
set-smoothing-off
set-smoothing-on
set-style-off
set-style-on
set-transparent-text-backing-off
set-transparent-text-backing-on
set-underlined-off
set-underlined-on
set-weight-off
set-weight-on
Version: 4.0.2

 

style-delta% : class?

  superclass: object%

A style-delta% object encapsulates a style change. The changes expressible by a delta include:

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:

Font styles, smoothing, underlining, and alignment work in an analogous manner.

The possible values for alignment-on and alignment-off are:

The possible values for style-on and style-off are:

The possible values for smoothing-on and smoothing-off are:

The possible values for underlined-on and underlined-off are:

The possible values for size-in-pixels-on and size-in-pixels-off are:

The possible values for transparent-text-backing-on and transparent-text-backing-off are:

The possible values for weight-on and weight-off are:

The family and face settings in a style delta are interdependent:

(make-object style-delta% [change-command])

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-nothing

          'change-normal

          'change-toggle-underline

          'change-toggle-size-in-pixels

          'change-normal-color

          'change-bold)

 

 

 

=

 

'change-nothing

(make-object style-delta% change-command v)

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-family

          'change-style

          'change-toggle-style

          'change-weight

          'change-toggle-weight

          'change-smoothing

          'change-toggle-smoothing

          'change-alignment)

  v : symbol

(make-object style-delta% change-command v)

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-size

          'change-bigger

          'change-smaller)

  v : (integer-in 0 255)

(make-object style-delta% change-command v)

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-underline

          'change-size-in-pixels)

  v : any/c

The initialization arguments are passed on to set-delta.

(send a-style-delta collapse delta)  boolean?

  delta : (is-a?/c style-delta%)

Tries to collapse into a single delta the changes that would be made by applying this delta after a given delta. If the return value is #f, then it is impossible to perform the collapse. Otherwise, the return value is #t and this delta will contain the collapsed change specification.

(send a-style-delta copy delta)  void?

  delta : (is-a?/c style-delta%)

Copies the given style delta’s settings into this one.

(send a-style-delta equal? delta)  boolean?

  delta : (is-a?/c style-delta%)

Returns #t if the given delta is equivalent to this one in all contexts or #f otherwise.

(send a-style-delta get-alignment-off)

  (one-of/c 'base 'top 'center 'bottom)

See style-delta%.

(send a-style-delta get-alignment-on)

  (one-of/c 'base 'top 'center 'bottom)

See style-delta%.

(send a-style-delta get-background-add)

  (is-a?/c add-color<%>)

Gets the object additive color shift for the background (applied after the multiplicative factor). Call this add-color<%> object’s methods to change the style delta’s additive background color shift.

(send a-style-delta get-background-mult)

  (is-a?/c mult-color<%>)

Gets the multiplicative color shift for the background (applied before the additive factor). Call this mult-color<%> object’s methods to change the style delta’s multiplicative background color shift.

(send a-style-delta get-face)  (or/c string? false/c)

Gets the delta’s font face string. If this string is #f and the family is 'base when the delta is applied to a style, the style’s face and family are not changed. However, if the face string is #f and the family is not 'base, then the style’s face is changed to #f.

See also get-family.

(send a-style-delta get-family)

 

 

(one-of/c 'base 'default 'decorative 'roman 'script

          'swiss 'modern 'symbol 'system)

Returns the delta’s font family. The possible values are

See also get-face.

(send a-style-delta get-foreground-add)

  (is-a?/c add-color<%>)

Gets the additive color shift for the foreground (applied after the multiplicative factor). Call this add-color<%> object’s methods to change the style delta’s additive foreground color shift.

(send a-style-delta get-foreground-mult)

  (is-a?/c mult-color<%>)

Gets the multiplicative color shift for the foreground (applied before the additive factor). Call this mult-color<%> object’s methods to change the style delta’s multiplicative foreground color shift.

(send a-style-delta get-size-add)  (integer-in 0 255)

Gets the additive font size shift (applied after the multiplicative factor).

(send a-style-delta get-size-in-pixels-off)  boolean?

See style-delta%.

(send a-style-delta get-size-in-pixels-on)  boolean?

See style-delta%.

(send a-style-delta get-size-mult)  real?

Gets the multiplicative font size shift (applied before the additive factor).

(send a-style-delta get-smoothing-off)

  (one-of/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)

See style-delta%.

(send a-style-delta get-smoothing-on)

  (one-of/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)

See style-delta%.

(send a-style-delta get-style-off)

  (one-of/c 'base 'normal 'italic 'slant)

See style-delta%.

(send a-style-delta get-style-on)

  (one-of/c 'base 'normal 'italic 'slant)

See style-delta%.

(send a-style-delta get-transparent-text-backing-off)

  boolean?

See style-delta%.

(send a-style-delta get-transparent-text-backing-on)

  boolean?

See style-delta%.

(send a-style-delta get-underlined-off)  boolean?

See style-delta%.

(send a-style-delta get-underlined-on)  boolean?

See style-delta%.

(send a-style-delta get-weight-off)

  (one-of/c 'base 'normal 'bold 'light)

See style-delta%.

(send a-style-delta get-weight-on)

  (one-of/c 'base 'normal 'bold 'light)

See style-delta%.

(send a-style-delta set-alignment-off v)  void?

  v : (one-of/c 'base 'top 'center 'bottom)

See style-delta%.

(send a-style-delta set-alignment-on v)  void?

  v : (one-of/c 'base 'top 'center 'bottom)

See style-delta%.

(send a-style-delta set-delta [change-command])

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-nothing

          'change-normal

          'change-toggle-underline

          'change-toggle-size-in-pixels

          'change-normal-color

          'change-bold)

 

 

 

=

 

'change-nothing

(send a-style-delta set-delta

 

change-command

 

 

 

param)

 

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-family

          'change-style

          'change-toggle-style

          'change-weight

          'change-toggle-weight

          'change-smoothing

          'change-toggle-smoothing

          'change-alignment)

  param : symbol

(send a-style-delta set-delta

 

change-command

 

 

 

param)

 

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-size

          'change-bigger

          'change-smaller)

  param : (integer-in 0 255)

(send a-style-delta set-delta

 

change-command

 

 

 

on?)

 

  (is-a?/c style-delta%)

  

change-command

 

:

 

(one-of/c 'change-underline

          'change-size-in-pixels)

  on? : any/c

Configures the delta with high-level specifications. The return value is the delta itself.

Except for 'change-nothing and 'change-normal, the command only changes part of the delta. Thus, applying 'change-bold and then 'change-italic sets the delta for both the style and weight change.

The change-command argument specifies how the delta is changed; the possible values are:

(send a-style-delta set-delta-background name)

  (is-a?/c style-delta%)

  name : string?

(send a-style-delta set-delta-background color)

  (is-a?/c style-delta%)

  color : (is-a?/c color%)

Makes the delta encode a background color change to match the absolute color given; that is, it sets the multiplicative factors to 0.0 in the result of get-background-mult, and it sets the additive values in the result of get-background-add to the specified color’s values. The return value of the method is the delta itself.

For the case that a string color name is supplied, see color-database<%>.

(send a-style-delta set-delta-face

 

name

 

 

 [

family])

 

  (is-a?/c style-delta%)

  name : string?

  

family

 

:

 

(one-of/c 'base 'default 'decorative 'roman

          'script 'swiss 'modern 'symbol 'system)

 

 

 

=

 

'default

Like set-face, but sets the family at the same time.

The return value is a-style-delta.

(send a-style-delta set-delta-foreground name)

  (is-a?/c style-delta%)

  name : string?

(send a-style-delta set-delta-foreground color)

  (is-a?/c style-delta%)

  color : (is-a?/c color%)

Makes the delta encode a foreground color change to match the absolute color given; that is, it sets the multiplicative factors to 0.0 in the result of get-foreground-mult, and it sets the additive values in the result of get-foreground-add to the specified color’s values. The return value of the method is the delta itself.

For the case that a string color name is supplied, see color-database<%>.

(send a-style-delta set-face v)  void?

  v : (or/c string? false/c)

See get-face. See also set-delta-face.

(send a-style-delta set-family v)  void?

  

v

 

:

 

(one-of/c 'base 'default 'decorative 'roman 'script

          'swiss 'modern 'symbol 'system)

Sets the delta’s font family. See get-family.

(send a-style-delta set-size-add v)  void?

  v : (integer-in 0 255)

Sets the additive font size shift (applied after the multiplicative factor).

(send a-style-delta set-size-in-pixels-off v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-size-in-pixels-on v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-size-mult v)  void?

  v : real?

Sets the multiplicative font size shift (applied before the additive factor).

(send a-style-delta set-smoothing-off v)  void?

  v : (one-of/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)

See style-delta%.

(send a-style-delta set-smoothing-on v)  void?

  v : (one-of/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)

See style-delta%.

(send a-style-delta set-style-off v)  void?

  v : (one-of/c 'base 'normal 'italic 'slant)

See style-delta%.

(send a-style-delta set-style-on v)  void?

  v : (one-of/c 'base 'normal 'italic 'slant)

See style-delta%.

(send a-style-delta set-transparent-text-backing-off v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-transparent-text-backing-on v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-underlined-off v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-underlined-on v)  void?

  v : any/c

See style-delta%.

(send a-style-delta set-weight-off v)  void?

  v : (one-of/c 'base 'normal 'bold 'light)

See style-delta%.

(send a-style-delta set-weight-on v)  void?

  v : (one-of/c 'base 'normal 'bold 'light)

See style-delta%.