qubx :: toolspace :: SubLayer :: Class SubLayer
[hide private]
[frames] | no frames]

Class SubLayer

source code

object --+
         |
        SubLayer
Known Subclasses:

A specific display element or control on a Layer in a ToolSpace.

Instance Methods [hide private]
 
__init__(self, x=0, y=0, w=1, h=1, action=<__builtin__.function object>, scroll=<__builtin__.function object>, mouse_move=<__builtin__.function object>, mouse_drag=<__builtin__.function object>, enter=<__builtin__.function object>, exit=<__builtin__.function object>, border=0, cBorder=('toolspace.layer.border', (0.5, 0.5, 0.5, 0.5)), tooltip='', cBG=None, **kw)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_layer(self, layer) source code
 
set_x(self, x) source code
 
set_y(self, y) source code
 
set_w(self, w) source code
 
set_h(self, h) source code
 
set_tooltip(self, x) source code
 
set_cBG(self, x) source code
 
set_actual_x(self, x) source code
 
set_actual_y(self, y) source code
 
pt_in_rect(self, x, y, em)
Returns True if (x, y) Layer-relative coordinates are inside this SubLayer.
source code
 
invalidate(self)
Marks this SubLayer as needing a repaint, and calls OnInvalidate.
source code
 
draw(self, context, w, h, appearance)
Override this method to paint the SubLayer.
source code
 
button_press(self, x, y, e)
Override this method to handle mouse-down (by default, click: action(x,y,e)).
source code
 
button_release(self, x, y, e)
Override this method to handle mouse-up (by default, click: action(x,y,e)).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  action
when clicked, calls action(x, y, event)
  scroll
when mouse-scroll-wheeled upon, calls scroll(x, y, event, offset)
  mouse_move
when the mouse moves over it, calls mouse_move(x, y, event)
  mouse_drag
when the mouse moves with the button down, calls mouse_drag(x, y, event)
  enter
when the mouse enters, calls mouse_enter(x, y, event)
  exit
when the mouse leaves, calls mouse_exit()
  x
number of 'M' widths between Layer's left and SubLayer's left
  y
number of 'M' widths between Layer's top and SubLayer's top
  w
actual width, in pixels
  h
actual height, in pixels
  cBG
background COLORREF, or None for transparent
  OnChangeTooltip
WeakEvent(SubLayer)
  OnHideTooltip
WeakEvent(SubLayer) subclasses can call to request tooltip hide
  OnInvalidate
WeakEvent(SubLayer) called when it needs repainting
  border
width of border in pixels
  cBorder
border COLORREF
  invalid
True if it needs to be repainted
  rq_h
requested height, in 'M' units
  rq_w
requested width, in 'M' units
Properties [hide private]
  layer
  tooltip

Inherited from object: __class__

Method Details [hide private]

__init__(self, x=0, y=0, w=1, h=1, action=<__builtin__.function object>, scroll=<__builtin__.function object>, mouse_move=<__builtin__.function object>, mouse_drag=<__builtin__.function object>, enter=<__builtin__.function object>, exit=<__builtin__.function object>, border=0, cBorder=('toolspace.layer.border', (0.5, 0.5, 0.5, 0.5)), tooltip='', cBG=None, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • x - number of 'M' widths from the Layer's left edge
  • y - number of 'M' widths from the Layer's top edge
  • w - w >= 0: number of 'M' widths across; w < 0: number of 'M's between SubLayer's right and Layer's right
  • h - h >= 0: number of 'M' widths tall; h < 0: number of 'M's between SubLayer's bottom and Layer's bottom
  • action - when clicked, calls action(x, y, event)
  • scroll - when mouse-scroll-wheeled upon, calls scroll(x, y, event, offset)
  • mouse_move - when the mouse moves over it, calls mouse_move(x, y, event)
  • mouse_drag - when the mouse moves with the button down, calls mouse_drag(x, y, event)
  • enter - when the mouse enters, calls mouse_enter(x, y, event)
  • exit - when the mouse leaves, calls mouse_exit()
  • border - width in pixels of border
  • cBorder - COLORREF of border
  • cBG - COLORREF of background, or None for transparent
  • tooltip - mouse-over info
Overrides: object.__init__

pt_in_rect(self, x, y, em)

source code 

Returns True if (x, y) Layer-relative coordinates are inside this SubLayer.

Parameters:
  • em - width of 'M' in pixels

draw(self, context, w, h, appearance)

source code 

Override this method to paint the SubLayer. Don't forget to call SubLayer.draw(context, w, h, appearance).


Instance Variable Details [hide private]

action

when clicked, calls action(x, y, event)
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

scroll

when mouse-scroll-wheeled upon, calls scroll(x, y, event, offset)
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

mouse_move

when the mouse moves over it, calls mouse_move(x, y, event)
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

mouse_drag

when the mouse moves with the button down, calls mouse_drag(x, y, event)
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

enter

when the mouse enters, calls mouse_enter(x, y, event)
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

exit

when the mouse leaves, calls mouse_exit()
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

x

number of 'M' widths between Layer's left and SubLayer's left
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

y

number of 'M' widths between Layer's top and SubLayer's top
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

w

actual width, in pixels
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

h

actual height, in pixels
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

cBG

background COLORREF, or None for transparent
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

Property Details [hide private]

layer

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

tooltip

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)