Package pygsear :: Module Widget :: Class Dialog_ColorSelector
[show private | hide private]
[frames | no frames]

Class Dialog_ColorSelector

object --+                    
         |                    
    Sprite --+                
             |                
      Drawable --+            
                 |            
         Layer --+            
                 |            
             Layer --+        
                     |        
            Widget --+        
                     |        
                Dialog --+    
                         |    
                 Dialog_OK --+
                             |
                            Dialog_ColorSelector


Used to choose a color interactively
Method Summary
  __init__(self, window)
Initialize the color selector
  modal(self)
  mousebutton_action(self)
Actions to perform any time the mouse button is held down.
  mousebuttondown(self, ev)
Set a flag indicating the mouse button is held down.
  mousebuttonup(self, ev)
Reset the mouse button held down flag.
  set_color_chosen(self, color)
Set the chosen color, and update the display of the chosen color.
  set_color_rect(self)
Set up the chooser for the red value of the color.
  set_color_square(self)
Paint a square with possible colors.
    Inherited from Dialog_OK
  ok(self, pygame_event)
    Inherited from Dialog
  cancel(self, pygame_event)
  teardown(self)
    Inherited from Layer
  center(self, x, y, dx, dy)
center the Drawable in its layer
  clear(self, surface)
erase image to background, returning affected rect
  draw(self, surface)
draw image, returning affected rect
  updateContents(self)
move and re-draw all the sprites that use this layer
    Inherited from Drawable
bool can_see(self, target, blocking_rects_list)
Performs a los (line of sight) check from the center of the source to the center of the target.
bool collide(self, other)
return True if this sprite and other sprite overlap.
Drawable or False collidelist(self, lothers)
return True if this sprite and any in list of others collide.
List collidelistall(self, lothers)
return True if this sprite and any in list of others collide.
  direction(self, point)
return the direction from the sprite to a point
  distance(self, point)
return the distance from the sprite to a point
  get_position(self)
return a copy of the sprite's position
  get_size(self)
return size of sprite's rect.
  move(self)
set position to next position on path
  nudge(self, dx, dy)
Move sprite.
  onscreen(self, slack, **kw)
return True if image is on the screen or layer.
  pause(self)
stop moving along Path
  runPath(self, frames)
call move() continuously
  set_crect(self, crect)
set the collision pygame.Rect used for collision checking.
  set_path(self, path)
set which path to follow
  set_position(self, location, *args)
Move sprite to location.
  set_positionRandom(self, slack)
Move sprite to a random location on screen
  set_size(self, size)
Set size of sprite's rect.
  solid(self, other, move_both)
move sprite so that it does not overlap with other sprite
  stretch(self, dx, dy, size, keepAspectRatio)
Change the size of sprite's image, and rect.
  uclear(self, surface)
clear sprite and update display
  udraw(self, surface)
Draw image and update display.
  unpause(self)
start moving along Path
    Inherited from Sprite
  __repr__(self)
  add(self, *groups)
add(group or list of of groups, ...) add a sprite to container
  add_internal(self, group)
  alive(self)
alive() -> bool check to see if the sprite is in any groups
  groups(self)
groups() -> list of groups list used sprite containers
  kill(self)
kill() remove this sprite from all groups
  remove(self, *groups)
remove(group or list of groups, ...) remove a sprite from container
  remove_internal(self, group)
  update(self, *args)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from Layer
  border(self, width, color, left, right, top, bottom)
Draw a border around the screen
  set_background(self, filename, img, tilename, tile, color)
Set the background.
    Inherited from Widget
  activate(self)
  deactivate(self)
  nop(self, arg)
  set_callback(self, callback)
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Class Variable Summary
    Inherited from Dialog_OK
NoneType message = None                                                                  

Method Details

__init__(self, window=None)
(Constructor)

Initialize the color selector
Overrides:
pygsear.Widget.Dialog_OK.__init__

mousebutton_action(self)

Actions to perform any time the mouse button is held down.

Checks to see if the mouse is inside either of the color_square or the color_rect and either sets the chosen color, or sets the red value for possible colors and updates the color_square.

mousebuttondown(self, ev)

Set a flag indicating the mouse button is held down.

mousebuttonup(self, ev)

Reset the mouse button held down flag.

set_color_chosen(self, color)

Set the chosen color, and update the display of the chosen color.

set_color_rect(self)

Set up the chooser for the red value of the color.

set_color_square(self)

Paint a square with possible colors.

This uses the ColorSelector hue property for the hue of the color, then ranges over all possible saturations and values to make a square.

This is way too slow.

Generated by Epydoc 2.0 on Sat Dec 9 14:11:20 2006 http://epydoc.sf.net