Home | Trees | Index | Help |
|
---|
Module eagle :: Class Canvas |
|
object
--+ |_EGObject
--+ |_EGWidget
--+ | Canvas
The drawing area.
Eagle's drawing area (Canvas) is provided with a frame and an optional label, together with scrollbars, to make it fit everywhere.Method Summary | |
---|---|
Canvas Constructor. | |
Convert from color to internal representation. (Static method) | |
__configure_gc__(self,
fgcolor,
bgcolor,
fill,
line_width,
line_style)
| |
Return a tuple with ( horizontal, vertical ) resize mode | |
__repr__(self)
| |
__set_useful_attributes__(self)
| |
__setup_connections__(self)
| |
__setup_gui__(self,
width,
height)
| |
__str__(self)
| |
__to_gtk_color__(self,
color)
| |
Clear using bgcolor. | |
Draw arc on canvas. | |
Draw image on canvas. | |
Draw line. | |
Draw lines connecting points. | |
Draw point. | |
Draw points. | |
Draw polygon on canvas. | |
Draw rectagle. | |
Draw line segments. | |
Draw text on canvas. | |
fill(self,
color)
| |
Get the Image that represents this drawing
area. | |
get_size(self)
| |
Resize the drawing area. | |
Inherited from _EGWidget | |
Return a list of internal widgets this Eagle widget contains. | |
Make widget invisible. | |
Set the widget as active. | |
Same as set_active ( False ) | |
Make widget visible. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value |
Property Summary | |
---|---|
label | |
Inherited from _EGWidget | |
app | |
Inherited from _EGObject | |
id |
Class Variable Summary | |
---|---|
str |
bgcolor = 'black'
|
int |
CENTER = 0 |
str |
FONT_NAME_MONO = 'monospace'
|
str |
FONT_NAME_NORMAL = 'normal'
|
str |
FONT_NAME_SANS = 'sans'
|
str |
FONT_NAME_SERIF = 'serif'
|
int |
FONT_OPTION_BOLD = 1 |
int |
FONT_OPTION_ITALIC = 4 |
int |
FONT_OPTION_OBLIQUE = 2 |
int |
LEFT = -1 |
int |
MOUSE_BUTTON_1 = 1 |
int |
MOUSE_BUTTON_2 = 2 |
int |
MOUSE_BUTTON_3 = 4 |
int |
MOUSE_BUTTON_4 = 8 |
int |
MOUSE_BUTTON_5 = 16 |
int |
padding = 5 |
int |
RIGHT = 1 |
Instance Method Details |
---|
__init__(self,
id,
width,
height,
label='',
bgcolor=None,
callback=None)
Canvas Constructor.
|
__get_resize_mode__(self)Return a tuple with ( horizontal, vertical ) resize mode
|
clear(self)Clear using bgcolor. |
draw_arc(self, x, y, width, height, start_angle, end_angle, color=None, size=1, fillcolor=None, filled=False)Draw arc on canvas. Arc will be the part of an ellipse that starts at (
If color is provided, it will draw the arc's
frame, even if filled is True . Frame here
is just the curve, not the straight lines that are limited by start_angle and end_angle .
|
draw_image(self, image, x=0, y=0, width=None, height=None, src_x=0, src_y=0)Draw image on canvas. By default it draws entire image at top canvas corner. You may restrict which image areas to use with src_x, src_y, width and height. You may choose position on canvas with x and y. |
draw_line(self, x0, y0, x1, y1, color=None, size=1)Draw line. |
draw_lines(self, points, color=None, size=1)Draw lines connecting points. Points are connected using lines, but first and last points are not connected, usedraw_polygon instead.
|
draw_point(self, x, y, color=None)Draw point. |
draw_points(self, points, color=None)Draw points. Efficient way to draw more than one point with the same characteristics. |
draw_polygon(self, points, color=None, size=1, fillcolor=None, filled=False)Draw polygon on canvas. If color is provided, it will draw the
polygon's frame, even if filled is True .
|
draw_rectangle(self, x, y, width, height, color=None, size=1, fillcolor=None, filled=False)Draw rectagle. If color is provided, it will draw the
rectangle's frame, even if filled is True .
|
draw_segments(self, segments, color=None, size=1)Draw line segments. Efficient way to draw more than one line with the same characteristics. Lines are not connected, usedraw_lines instead.
|
draw_text(self, text, x=0, y=0, fgcolor=None, bgcolor=None, font_name=None, font_size=None, font_options=0, font_family=None, width=None, wrap_word=False, alignment=-1, justify=True)Draw text on canvas. By default text is draw with current font and colors at top canvas corner. You may limit width providing a value and choose if it should wrap at words (wrap_word=True) or characters (wrap_word=False). Colors can be specified with fgcolor an bgcolor. If not provided, the system foreground color is used and no background color is used. Font name, family, size and options may be specified using font_name, font_family, font_size and font_options, respectively. Try to avoid using system specific font fames, use those provided by FONT_NAME_*. Font options is OR'ed values from FONT_OPTIONS_*. Font name is a string that have all the information, like "sans
bold 12". This is returned by |
get_image(self)Get theImage that represents this drawing
area.
|
resize(self, width, height)Resize the drawing area. |
Static Method Details |
---|
__color_from__(color)Convert from color to internal representation. Gets a string, integer or tuple/list arguments and converts into internal color representation. |
Property Details |
---|
label
|
Class Variable Details |
---|
bgcolor
|
CENTER
|
FONT_NAME_MONO
|
FONT_NAME_NORMAL
|
FONT_NAME_SANS
|
FONT_NAME_SERIF
|
FONT_OPTION_BOLD
|
FONT_OPTION_ITALIC
|
FONT_OPTION_OBLIQUE
|
LEFT
|
MOUSE_BUTTON_1
|
MOUSE_BUTTON_2
|
MOUSE_BUTTON_3
|
MOUSE_BUTTON_4
|
MOUSE_BUTTON_5
|
padding
|
RIGHT
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Apr 27 16:28:55 2006 | http://epydoc.sf.net |