| |
- Errorwin
- Inputline
- Messagewin
- Multiactionwin
-
- Actionwin
- Multipleselectwin
- Scrollwin
- Selectwin
- Statuswin
class Actionwin(Multiactionwin) |
|
A window that performs one constant action on whichever item is
selected.
When an item is chosen by the user, the action is called with the
first argument passed being the selected item. The selected item
is passed in the form of a list, where the first element is the
line it is on, and the second element is the text from the original
items list.
items - a list containing the menu items
title - the window title
action - the funtion to call
*args - additional arguements for the funtion |
|
Methods defined here:
- __init__(self, items, title, action, *args)
- additem(self, item)
- Adds an item to the Actionwin
- setaction(self, action, *args)
- Sets the action for the Actionwin
Data and other attributes defined here:
- action = None
- args = None
Methods inherited from Multiactionwin:
- getaction(self, index)
- Returns the action associated with a given index
- uiloop(self, height, y, x, posy, posx, scrollpad, win)
Data and other attributes inherited from Multiactionwin:
- actionlist = []
- itemlist = []
- title = ''
|
class Errorwin |
|
Makes an error window.
The user presses any key to clear the window. The caption can only
be a single line message.
title - the window's title
caption - the window's caption |
|
Methods defined here:
- __init__(self, title='Error', caption='Please press the any key to continue')
|
class Inputline |
|
Makes a window that grabs a line of user input.
title - the window title
caption - the window caption
line - the minimum length of the input line
maxline - the maximum length of the user input (default 1024 chars) |
|
Methods defined here:
- __init__(self, title='', caption='', line=None, maxline=1024)
- getinput(self)
- Returns the user's input as a string
- userinput(self, x, inpad, win, ypos, xpos, maxline)
- user input loop
Data and other attributes defined here:
- text = ''
|
class Messagewin |
|
Makes a window to present a message to the user.
The user presses any key to clear the window. The caption can only
be a single line message.
title - the window's title
caption - the window's caption |
|
Methods defined here:
- __init__(self, title='Message', caption='Please press the any key to continue')
|
class Multiactionwin |
|
Makes a menu window with each item associated with a (possibly)
unique action.
The items are passed in the form of a list of tuples of at least
two items. The first item is the text of the item, the second
is the action, any following elements are passed to the action,
after the item.
If the action for a menu item is None, this function returns.
actions - the dictionary containing the items and actions
title - title for the menu window |
|
Methods defined here:
- __init__(self, actions, title=None)
- additem(self, item)
- Adds an item to the Multiactionwin
- getaction(self, index)
- Returns the action associated with a given index
- setaction(self, index, action, *args)
- Sets the action of a given index to the specified action
- uiloop(self, height, y, x, posy, posx, scrollpad, win)
Data and other attributes defined here:
- actionlist = []
- itemlist = []
- title = ''
|
class Multipleselectwin |
|
A window type that allows the user to select a number of items.
This funtion returns a list of the items to choose between, where
each item is represented by a list where the first element is the
line number, the second is 0 if the item is not selected and 1 if it
is selected, and the third is the text of the item passed to
multipleselect.
items - the items for the user to select
title - the window title
caption - the window's caption
selectmessage - the message to show on the line of a selected item |
|
Methods defined here:
- __init__(self, items, title, caption, selectmessage='<selected>')
- prepare the window
- getselection(self)
- Returns the selection
Data and other attributes defined here:
- items = []
|
class Scrollwin |
|
Makes a window with static content that the user can scroll through.
The window is centred on the screen and is closed by the user
pressing 'b'. The width of the content can be greater than the
width of the window.
content - the text for the user to scroll through
title - the window's title
minx - the minimum width for the window
maxx - the maximum width for the window, but not the content
miny - the minimum height of the window
maxy - the maximum height of the window |
|
Methods defined here:
- __init__(self, content, title=None, minx=60, maxx=148, miny=20, maxy=48)
- make sure that the arguments make sense
|
class Selectwin |
|
A window that allows the user to select one item.
When getselection is called, the item chosen by the user is
returned in the form of a list, where the first element is the
line it is on, and the second element is the text from the original
items list.
items - a list containing the menu items
title - the window title
caption - the caption to show |
|
Methods defined here:
- __init__(self, items, title, caption)
- getselection(self)
- Returns the selected item from the menu
Data and other attributes defined here:
- item = None
- items = None
|
class Statuswin |
|
Makes a status window.
The caption can only be a single line message.
title - the window's title
caption - the window's caption
size - the width of the window |
|
Methods defined here:
- __init__(self, title=None, caption='', size=60)
- hidewin(self)
- Hides the statuswin.
- newstatus(self, caption=None)
- Changes the caption of the statuswin.
caption - the new caption
| |