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

Class SubLayer_DropDown

source code

object --+    
         |    
  SubLayer --+
             |
            SubLayer_DropDown

A combo-box in the style of csDropDownList (enumerated choices only). Uses Tool_DropDown to show the menu items. Displays the menu using a Tool, therefore can't be used in Tool.layers, only in ToolSpace proper.

Instance Methods [hide private]
 
__init__(self, label, justify=0, vcenter=1, color=('toolspace.dropdown', (0.1, 1, 0.1, 0.9)), *args, **kw)
See also: SubLayer.__init__
source code
 
set_label(self, label) source code
 
set_color(self, color) source code
 
draw(self, context, w, h, appearance)
Override this method to paint the SubLayer.
source code
 
_action(self, x, y, e) source code

Inherited from SubLayer: button_press, button_release, invalidate, pt_in_rect, set_actual_x, set_actual_y, set_cBG, set_h, set_layer, set_tooltip, set_w, set_x, set_y

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

Instance Variables [hide private]
  label
string that's showing when the menu is not open
  OnDropDown
WeakEvent(SubLayer_DropDown) before the menu is shown
  menu
you directly edit this list of menu items (label, action), where label is a string, and action() is called when clicked.

Inherited from SubLayer: OnChangeTooltip, OnHideTooltip, OnInvalidate, action, border, cBG, cBorder, enter, exit, h, invalid, mouse_drag, mouse_move, rq_h, rq_w, scroll, w, x, y

Properties [hide private]
  color

Inherited from SubLayer: layer, tooltip

Inherited from object: __class__

Method Details [hide private]

__init__(self, label, justify=0, vcenter=1, color=('toolspace.dropdown', (0.1, 1, 0.1, 0.9)), *args, **kw)
(Constructor)

source code 

See also: SubLayer.__init__

Parameters:
  • label - string that shows when the menu is not open
  • justify - negative: left-justify; zero: center: positive; right-justify
  • vcenter - True/nonzero to center text vertically
  • color - COLORREF for the inscribed triangle
Overrides: object.__init__

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).

Overrides: SubLayer.draw
(inherited documentation)

Instance Variable Details [hide private]

label

string that's showing when the menu is not open
Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

Property Details [hide private]

color

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