| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module Entry :: Class Entry |
|
object--+ |INotifyable--+ |BaseObject--+ |object--+ | | |Sprite--+ |BaseWidget--+ |Editable--+ | Entry
Entry (text="") -> Entry
A widget class suitable for a single line of text input.
The Entry widget is a text input box for a single line of text. It
allows an unlimited amount of text input, but is usually more
suitable for a small or medium amount, which can be scrolled, if the
text size exceeds the visible widget size.
The 'padding' attribute and set_padding() method are used to place a
certain amount of pixels between the text and the outer edges of the
Entry.
entry.padding = 10
entry.set_padding (10)
The Entry supports different border types by setting its 'border'
attribute to a valid value of the BORDER_TYPES constants.
entry.border = BORDER_SUNKEN
entry.set_border (BORDER_SUNKEN)
It also features a password mode, which will cause it to display the
text as asterisks ('*'). It will not encrypt or protect the internal
text attribute however. The password mode can be set using the
'password' attribute and set_password() method.
entry.password = True
entry.set_password (False)
The Entry uses a default size for itself by setting the 'size'
attribute to a width of 94 pixels and a height of 24 pixels.
Default action (invoked by activate()):
See the Editable class.
Mnemonic action (invoked by activate_mnemonic()):
None
Signals:
SIG_MOUSEDOWN - Invoked, when a mouse button gets pressed on the
Entry.
SIG_MOUSEMOVE - Invoked, when the mouse moves over the Entry.
Attributes:
password - Characters will be drawn as '*' (asterisk).
padding - Additional padding between text and borders. Default is 2.
border - The border style to set for the Entry.
| Method Summary | |
|---|---|
__init__(self,
text)
| |
E.draw () -> None | |
E.draw_bg () -> Surface | |
E.notify (...) -> None | |
E.set_border (...) -> None | |
E.set_padding (...) -> None | |
E.set_password (...) -> None | |
E._calculate_offset (...) -> int | |
E._get_text_overhang (...) -> (int, int), (int, int), (int, int) | |
W._set_caret_position (...) -> None | |
| Inherited from Editable | |
E.activate () -> None | |
E.set_caret (...) -> None | |
E.set_editable (...) -> None | |
E.set_focus (...) -> bool | |
E.set_text (...) -> None | |
E._input (...) -> bool | |
E._set_caret_visible (...) -> None | |
| Inherited from BaseWidget | |
W.activate_mnemonic (...) -> bool | |
W.check_sizes (...) -> int, int | |
W.create_style () -> WidgetStyle | |
For debugging usage only | |
W.destroy () -> None | |
W.get_style () -> WidgetStyle | |
B.initclass () -> None (Class method) | |
W.lock () -> None | |
W.rect_to_client (...) -> pygame.Rect | |
W.set_depth (...) -> None | |
W.set_dirty (...) -> None | |
W.set_entered (...) -> None | |
W.set_event_area (...) -> None | |
W.set_event_manager (...) -> None | |
W.set_index (...) -> None | |
W.set_indexable (...) -> None | |
W.set_maximum_size (...) -> None | |
W.set_minimum_size (...) -> None | |
W.set_opacity (...) -> None | |
W.set_position (...) -> None | |
W.set_sensitive (...) -> None | |
W.set_size (...) -> None | |
W.set_state (...) -> None | |
W.set_style (...) -> None | |
W.set_tooltip (...) -> None | |
W.unlock () -> None | |
W.update (...) -> None | |
W._get_rect () -> pygame.Rect | |
W._get_rect_attr (...) -> var | |
W._set_rect_attr (...) -> None | |
| Inherited from BaseObject | |
B.connect_signal (...) -> EventCallback | |
B.disconnect_signal (...) -> None | |
B.emit (...) -> bool | |
B.run_signal_handlers (...) -> None | |
| Inherited from Sprite | |
| |
add(group or list of of groups, ...) add a sprite to container | |
| |
alive() -> bool check to see if the sprite is in any groups | |
groups() -> list of groups list used sprite containers | |
kill() remove this sprite from all groups | |
remove(group or list of groups, ...) remove a sprite from container | |
| |
| 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 | |
x.__str__() <==> str(x) | |
| Property Summary | |
|---|---|
border: The border style to set for the Entry. | |
padding: The additional padding for the Entry. | |
password: Indicates the password mode for the Entry. | |
| Inherited from Editable | |
caret: The caret position. | |
caret_visible: Indicates, if the caret is currently visible. | |
editable: Indicates, if the text can be edited or not. | |
text: The text to display on the Editable. | |
| Inherited from BaseWidget | |
bottom | |
bottomleft | |
bottomright | |
center | |
centerx | |
centery | |
controls: Widgets associated with the widget. | |
depth: The z-axis layer depth of the widget. | |
dirty: Indicates, whether the widget need to be redrawn. | |
entered: Indicates, whether the widget is entered. | |
eventarea: The area, which gets the events. | |
focus: The focus of the widget. | |
h | |
height | |
image: The visible surface of the widget. | |
index: The tab index position of the widget. | |
indexable: The IIndexable, the widget is attached to. | |
left | |
locked: Indicates, whether the widget is locked. | |
maxsize: The maximum size to occupy by the widget. | |
midbottom | |
midleft | |
midright | |
midtop | |
minsize: The guaranteed size of the widget. | |
opacity: The opacity of the widget. | |
position: The position of the topleft corner. | |
rect: The area occupied by the widget. | |
right | |
sensitive: The sensitivity of the widget. | |
size | |
state: The current state of the widget. | |
style: The style of the widget. | |
tooltip: The tool tip text to display for the widget. | |
top | |
topleft | |
topright | |
w | |
width | |
x | |
y | |
| Inherited from BaseObject | |
manager: The event manager to use by the object. | |
| Instance Method Details |
|---|
draw(self)E.draw () -> None Draws the Entry surface.
|
draw_bg(self)E.draw_bg () -> Surface Draws the surface of the Entry and returns it. Draws the background surface of the Entry and returns it. Creates the visible background surface of the Entry and returns it to the caller. |
notify(self, event)E.notify (...) -> None Notifies the Entry about an event.
|
set_border(self, border)E.set_border (...) -> None Sets the border type to be used by the Entry. Raises a ValueError, if the passed argument is not a value from BORDER_TYPES |
set_padding(self, padding)E.set_padding (...) -> None Sets the padding between the edges and text of the Entry. The padding value is the amount of pixels to place between the edges of the Entry and the displayed text. Raises a TypeError, if the argument is not a positive integer. |
set_password(self, password)E.set_password (...) -> None When this is set this to True, the entry's content will be drawn with '*' (asterisk) characters instead of the actual characters. This is useful for password dialogs, where it is undesirable for the password to be displayed on-screen. |
_calculate_offset(self, textwidth, font)E._calculate_offset (...) -> int Calculates the left pixel offset for the Entry text. |
_get_text_overhang(self, pos)E._get_text_overhang (...) -> (int, int), (int, int), (int, int) Gets the pixel sizes to the left and right of the caret and the character size the caret is at in this order.. |
_set_caret_position(self, eventarea, position)W._set_caret_position (...) -> None Sets the position of the caret based on the given pixel position. |
| Property Details |
|---|
borderThe border style to set for the Entry.
|
paddingThe additional padding for the Entry.
|
passwordIndicates the password mode for the Entry.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:45 2008 | http://epydoc.sf.net |