Trees | Index | Help |
|
---|
Package gui :: Module SSGridView :: Class SpreadsheetGridView_Static |
|
Misc
--+ |BaseWidget
--+ |Grid
--+ |Pack
--+ |Place
--+ |Widget
--+ |Frame
--+ |Observer
--+ | SpreadsheetGridView_Static
Method Summary | |
---|---|
Spreadsheet GridView's constructor | |
bool |
Commit data with respect to a particular cell in the subject. |
Method called to create a new gridview (observing the same subject as this object) | |
Method used to query the user about the size of the new gridview. | |
CellCoord
|
Utility method to convert mouse position (event.x, event.y) into cell coordinates (row, col) |
Method called to create a new subject. | |
Move and redraw the over cell to the specified coordinate. | |
Move and redraw the selected cell to the specified coordinate. | |
Method used to print the spreadsheet to .ps files | |
Method called by the subject to notify observers that they need to update themselves. | |
wmQuit(self)
| |
Create the menus: File, Edit, etc. | |
Function creating the GridView's widgets (at instantiation time). | |
Deletes the current cell selection | |
Draws the background of the column indexes (A,B,C, ...) | |
Draws the column indexes (A,B,C, ...) | |
Draws the vertical lines (columns). | |
Redraw the selected cell (thin blue rectangle) in its new position. | |
Draws the background of the row indexes (1,2,3, ...) | |
Draws the row indexes (1,2,3, ...) | |
Draws the horizontal lines (rows). | |
Redraw the selected cell (tick black rectangle) in its new position. | |
Draw a rectangle surrounding a selection of cells. | |
2D list of CellCoord
|
Get a list of cell coordinates contained in the specified range |
Get the char closest to event in cellCoost | |
Get the indexes values of the two lines surrounding mouseX. | |
Get the indexes values of the two rows surrounding mouseY. | |
Indicate which cell is selected | |
Delete the current cell selection, draw a new cell selection | |
Accessors | |
Update the display of the overcell (where the current viewed formula is displayed). | |
Update the current row/column display. | |
CellCoord
|
Return the currently selected cell. |
CellCoord
|
Return the cell the mouse is currently over. |
Spreadsheet size Info | |
Returns the height of the canvas (number of rows) | |
Returns the width of the canvas (number of columns) | |
Selection of cells | |
2D list of CellCoord
|
Returns a two dimensional list containing the selected cells |
Extend the current cell selection to encapsulate cellCoord. | |
Delete the current cell selection | |
Text editing | |
int |
Returns the cursor position |
tuple (CellCoord , tuple (int, int))
|
Return a tuple (cell coord, char range) describing the current text selection. |
string |
Querying the subject for the text to edit in the specified cell. |
Delete the text drawn at cellCoord | |
Draws text at a given cell in the spreadsheet. | |
Select text in a specified range. | |
Unselect current selected text | |
Increase the text selection by deltaX or up to an event position | |
Animate a cursor with respect to the text that is in cellCoord. | |
Move the cursor by a specified number of characters | |
Delete the current animated cursor. | |
Commands | |
Save the file using the previously specified filename. | |
Load spreadsheet's data from a .ds file. | |
Ask for a filename and save the spreadsheet. | |
Copy the selected cells | |
Cut the selected cells | |
Paste the cells into the current selection | |
Delete the contents of the selected cells | |
Undo/Redo | |
Undo the previous command | |
Redo the latest undone command | |
bool |
Returns true if the subject can undo |
bool |
Returns true if the subject can redo |
Enables the undo button | |
Disables the undo button | |
Enables the undo button | |
Disables the redo button | |
Timer | |
Change the foreground/background of the time counter to white/black (reverse video) | |
Change the foreground/background of the time counter to black/white | |
Increases the time counter string by 1 second. | |
Inherited from BaseWidget | |
Destroy this and all descendants widgets. | |
| |
Internal function. | |
Inherited from Misc | |
Set Tcl variable NAME to VALUE. | |
Return a boolean value for Tcl boolean values true and false given as parameter. | |
Return value of Tcl variable NAME. | |
Return the resource value for a KEY given as string. | |
| |
Return the window path name of this widget. | |
Return the Tkinter instance of a widget identified by its Tcl name NAME. | |
Call function once after given time. | |
Cancel scheduling of function identified with ID. | |
Call FUNC once if the Tcl main loop has no event to process. | |
Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid. | |
Ring a display's bell. | |
Bind to this widget at event SEQUENCE a call to function FUNC. | |
Bind to all widgets at an event SEQUENCE a call to function FUNC. | |
Bind to widgets with bindtag CLASSNAME at event SEQUENCE a call of function FUNC. | |
Set or get the list of bindtags for this widget. | |
Return the resource value for a KEY given as string. | |
Append STRING to the Tk clipboard. | |
Clear the data in the Tk clipboard. | |
Useless. | |
Configure column INDEX of a grid. | |
Configure resources of a widget. | |
Configure resources of a widget. | |
Internal function. | |
Bind a virtual event VIRTUAL (of the form <<Name>>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs. | |
Unbind a virtual event VIRTUAL from SEQUENCE. | |
Generate an event SEQUENCE. | |
Return a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL. | |
Direct input focus to this widget. | |
Return the widget which has currently the focus on the display where this widget is located. | |
Direct input focus to this widget even if the application does not have the focus. | |
Return the widget which has currently the focus in the application. | |
Return the widget which would have the focus if top level for this widget gets the focus from the window manager. | |
Direct input focus to this widget. | |
Return widget which has currently the grab in this application or None. | |
Release grab for this widget if currently set. | |
Set grab for this widget. | |
Set global grab for this widget. | |
Return None, "local" or "global" if this widget has no, a local or a global grab. | |
Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid. | |
Configure column INDEX of a grid. | |
Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located. | |
Set or get the status for propagation of geometry information. | |
Configure row INDEX of a grid. | |
Return a tuple of the number of column and rows in the grid. | |
Return a list of all slaves of this widget in its packing order. | |
Return a list of all existing image names. | |
Return a list of all available image types (e.g. | |
Return a list of all resource names of this widget. | |
Raise this widget in the stacking order. | |
Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located. | |
Lower this widget in the stacking order. | |
Call the mainloop of Tk. | |
Return the Tkinter instance of a widget identified by its Tcl name NAME. | |
Set a VALUE (second parameter) for an option PATTERN (first parameter). | |
Clear the option database. | |
Return the value for an option NAME for this widget with CLASSNAME. | |
Read file FILENAME into the option database. | |
Set or get the status for propagation of geometry information. | |
Return a list of all slaves of this widget in its packing order. | |
Return a list of all slaves of this widget in its packing order. | |
Set or get the status for propagation of geometry information. | |
Quit the Tcl interpreter. | |
Configure row INDEX of a grid. | |
Clear the current X selection. | |
Return the contents of the current X selection. | |
Specify a function COMMAND to call if the X selection owned by this widget is queried by another application. | |
Become owner of X selection. | |
Return owner of X selection. | |
Send Tcl command CMD to different interpreter INTERP to be executed. | |
Return a tuple of the number of column and rows in the grid. | |
Return a list of all slaves of this widget in its packing order. | |
Change the color scheme to light brown as used in Tk 3.6 and before. | |
The widget under mouse will get automatically focus. | |
Return the next widget in the focus order which follows widget which has currently the focus. | |
Return previous widget in the focus order. | |
Do not use. | |
Set a new color scheme for all widget elements. | |
Set Tcl internal variable, whether the look and feel should adhere to Motif. | |
Raise this widget in the stacking order. | |
Unbind for this widget for event SEQUENCE the function identified with FUNCID. | |
Unbind for all widgets for event SEQUENCE all functions. | |
Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE all functions. | |
Enter event loop until all idle callbacks have been called. | |
Wait until the variable is modified. | |
Wait until the visibility of a WIDGET changes (e.g. | |
Wait until a WIDGET is destroyed. | |
Wait until the variable is modified. | |
Return integer which represents atom NAME. | |
Return name of atom with identifier ID. | |
Return number of cells in the colormap for this widget. | |
Return a list of all widgets which are children of this widget. | |
Return window class name of this widget. | |
Return true if at the last color request the colormap was full. | |
Return the widget which is at the root coordinates ROOTX, ROOTY. | |
Return the number of bits per pixel. | |
Return true if this widget exists. | |
Return the number of pixels for the given distance NUMBER (e.g. | |
Return geometry string for this widget in the form "widthxheight+X+Y". | |
Return height of this widget. | |
Return identifier ID for this widget. | |
Return the name of all Tcl interpreters for this display. | |
Return true if this widget is mapped. | |
Return the window mananger name for this widget. | |
Return the name of this widget. | |
Return the name of the parent of this widget. | |
Return the pathname of the widget given by ID. | |
Rounded integer value of winfo_fpixels. | |
Return the x coordinate of the pointer on the root window. | |
Return a tuple of x and y coordinates of the pointer on the root window. | |
Return the y coordinate of the pointer on the root window. | |
Return requested height of this widget. | |
Return requested width of this widget. | |
Return tuple of decimal values for red, green, blue for COLOR in this widget. | |
Return x coordinate of upper left corner of this widget on the root window. | |
Return y coordinate of upper left corner of this widget on the root window. | |
Return the screen name of this widget. | |
Return the number of the cells in the colormap of the screen of this widget. | |
Return the number of bits per pixel of the root window of the screen of this widget. | |
Return the number of pixels of the height of the screen of this widget in pixel. | |
Return the number of pixels of the height of the screen of this widget in mm. | |
Return the number of pixels of the width of the screen of this widget in mm. | |
Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen. | |
Return the number of pixels of the width of the screen of this widget in pixel. | |
Return information of the X-Server of the screen of this widget in the form "XmajorRminor vendor vendorVersion". | |
Return the toplevel widget of this widget. | |
Return true if the widget and all its higher ancestors are mapped. | |
Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget. | |
Return the X identifier for the visual for this widget. | |
Return a list of all visuals available for the screen of this widget. | |
Return the height of the virtual root window associated with this widget in pixels. | |
Return the width of the virtual root window associated with this widget in pixel. | |
Return the x offset of the virtual root relative to the root window of the screen of this widget. | |
Return the y offset of the virtual root relative to the root window of the screen of this widget. | |
Return the width of this widget. | |
Return the x coordinate of the upper left corner of this widget in the parent. | |
Return the y coordinate of the upper left corner of this widget in the parent. | |
Internal function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Return a newly created Tcl function. | |
Internal function. | |
Internal function. | |
Internal function. | |
Return a newly created Tcl function. | |
Inherited from Pack | |
Unmap this widget and do not use it for the packing order. | |
Return information about the packing options for this widget. | |
Pack a widget in the parent widget. | |
Pack a widget in the parent widget. | |
Unmap this widget and do not use it for the packing order. | |
Return information about the packing options for this widget. | |
Inherited from Place | |
Place a widget in the parent widget. | |
Place a widget in the parent widget. | |
Unmap this widget. | |
Return information about the placing options for this widget. | |
Inherited from Grid | |
Position a widget in the parent widget in a grid. | |
Position a widget in the parent widget in a grid. | |
Unmap this widget. | |
Return information about the options for positioning this widget in a grid. | |
Unmap this widget but remember the grid options. |
Class Variable Summary | |
---|---|
Inherited from Misc | |
list |
_noarg_ = ['_noarg_']
|
tuple |
_subst_format = ('%#', '%b', '%f', '%h', '%k', '%s', '%t...
|
str |
_subst_format_str = '%# %b %f %h %k %s %t %w %x %y %A %E...
|
NoneType |
_tclCommands = None |
Method Details |
---|
setColRowDisplay(self, string)Update the current row/column display. Used for instance when the mouse is moved to update the current row/column display of the cell under the mouse. |
setOverCellDisplay(self, string)Update the display of the overcell (where the current viewed formula is displayed). Used for instance when the mouse is moved to display the formula expression of the cell under the mouse. |
setTimeBlack(self)Change the foreground/background of the time counter to white/black (reverse video) |
setTimeWhite(self)Change the foreground/background of the time counter to black/white |
getCursorPosition(self)Returns the cursor position
|
getHeight(self)Returns the height of the canvas (number of rows) |
getOverCell(self)Return the cell the mouse is currently over.
|
getSelectedCell(self)Return the currently selected cell.
|
getSelectedCells(self)Returns a two dimensional list containing the selected cells
|
getTextSelection(self)Return a tuple (cell coord, char range) describing the current text selection.
|
getTextToEdit(self, cellCoord)Querying the subject for the text to edit in the specified cell. i.e. The text to edit is usually a formula, if there is no formula, it is a string value.
|
getWidth(self)Returns the width of the canvas (number of columns) |
extendSelectedCells(self, cellCoord)Extend the current cell selection to encapsulate cellCoord.
|
unsetSelectedCells(self)Delete the current cell selection |
deleteText(self, cellCoord)Delete the text drawn at cellCoord
|
drawText(self, cellCoord, text, centered=0, font=None)Draws text at a given cell in the spreadsheet. NOTE: The canvas text objects are not the data holder ! They must be kept IN SYNCH with the subject, which is the datastructure maintaining the cell formulas. The text objects can also contain data that is currently being edited and not yet submitted to the subject (see acceptData).
|
selectText(self, cellCoord, charRange)Select text in a specified range.
|
unselectText(self)Unselect current selected text |
increaseTextSelection(self, cellCoord, deltaX=0, event=None)Increase the text selection by deltaX or up to an event position
|
drawCursor(self, cellCoord, position=0, event=None)Animate a cursor with respect to the text that is in cellCoord. Only one cursor is allowed at a given time in the spreadsheet. If one wants to create a cursor in another cell, ``deleteCursor'' must be called first. If drawCursor is called two times in a row it will become impossible to delete one of the cursors. The pattern ``deleteCursor'' & ``drawCursor'' needs to be used each time the current edited text is modified with drawText to move the cursor accordingly.(see drawText). Note: default position value is 0. If an event is specified, position is ignored.
|
moveCursor(self, deltaX)Move the cursor by a specified number of characters
|
deleteCursor(self)Delete the current animated cursor. Is used in conjunction with ``drawCursor'' and drawText to move the cursor within the same edited cell. |
save(self)Save the file using the previously specified filename. Disabled if no filename were specified yet. |
open(self)Load spreadsheet's data from a .ds file. |
saveAs(self)Ask for a filename and save the spreadsheet. Currently not saving any graphical information. Using built-in subject export() |
copySelectedCells(self)Copy the selected cells |
cutSelectedCells(self)Cut the selected cells |
pasteSelectedCells(self)Paste the cells into the current selection |
deleteSelectedCells(self)Delete the contents of the selected cells |
undo(self)Undo the previous command |
redo(self)Redo the latest undone command |
canUndo(self)Returns true if the subject can undo
|
canRedo(self)Returns true if the subject can redo
|
enableUndoButton(self)Enables the undo button |
disableUndoButton(self)Disables the undo button |
enableRedoButton(self)Enables the undo button |
disableRedoButton(self)Disables the redo button |
increaseTimeByOne(self)Increases the time counter string by 1 second. Note that the time counter does not include hours (only "MM:SS"). The counter is reset to "00:00" after "59:59". Note: A more efficient implementation would keep tsec and tmin as attributes rather than converting from the __timeData string every second. |
__init__(self,
subject=None,
master=None,
title='Spreadsheet View',
dataOffsetHor=0,
dataOffsetVer=0,
height=30,
width=7,
cellHeight=18,
cellWidth=70,
version='V0.8')
Spreadsheet GridView's constructor
|
acceptData(self, cell, data='')Commit data with respect to a particular cell in the subject. This method either succeeds or fails depending on whether there is a parse error when processing the formula. The data is NOT commited if the method returns false, it is commited otherwise. A message is printed to stout if there is a parse error. NOTE: Before, a tkMessageBox was used to display the error, but creating such an object from SVM freezes the system (GOD knows why: SVM is using threads and Tkinter does strange things with threads).
|
addGridView(self)Method called to create a new gridview (observing the same subject as this object) |
askGridViewInfo(self)Method used to query the user about the size of the new gridview. (information to be passed to addGridView) |
cellCoords(self, mouseX, mouseY)Utility method to convert mouse position (event.x, event.y) into cell coordinates (row, col)
|
createNewSubject(self)Method called to create a new subject. An observer is automatically attached to the newly created subject |
moveOverCellTo(self, cellCoord)Move and redraw the over cell to the specified coordinate.
|
moveSelectedCellTo(self, cellCoord)Move and redraw the selected cell to the specified coordinate.
|
printView(self)Method used to print the spreadsheet to .ps files |
update(self)Method called by the subject to notify observers that they need to update themselves.
|
__createPullDownMenus(self)Create the menus: File, Edit, etc. |
__createWidgets(self)Function creating the GridView's widgets (at instantiation time). |
__deleteSelectedCells(self)Deletes the current cell selection |
__drawColBackground(self, color='grey')Draws the background of the column indexes (A,B,C, ...)
|
__drawColIndex(self)Draws the column indexes (A,B,C, ...) |
__drawColumns(self)Draws the vertical lines (columns). For performance reasons each cell is not explicitely represented as a rectangle; instead, self.__rows horizontal and self.__cols vertical lines are drawn |
__drawOverCell(self)Redraw the selected cell (thin blue rectangle) in its new position. Called when the over cell is moved using moveOverCell |
__drawRowBackground(self, color='grey')Draws the background of the row indexes (1,2,3, ...)
|
__drawRowIndex(self)Draws the row indexes (1,2,3, ...) |
__drawRows(self)Draws the horizontal lines (rows). For performance reasons, each cell is not explicitely represented as a rectangle; instead, self.__rows horizontal and self.__cols vertical lines are drawn |
__drawSelectedCell(self)Redraw the selected cell (tick black rectangle) in its new position. Called when the selected cell is moved using moveSelectedCell |
__drawSelectedCells(self, cornerA, cornerB, color='#648BD8')Draw a rectangle surrounding a selection of cells. Order of the cell coordinates if not important. |
__getCellRange(self, cornerA, cornerB)Get a list of cell coordinates contained in the specified range |
__getCharPos(self, cellCoord, event)Get the char closest to event in cellCoost
|
__getColBoundary(self, mouseX)Get the indexes values of the two lines surrounding mouseX.
|
__getRowBoundary(self, mouseY)Get the indexes values of the two rows surrounding mouseY.
|
__indicateSelectedCell(self, color='#FFFFCC')Indicate which cell is selected
|
__setSelectedCells(self, cornerA, cornerB)Delete the current cell selection, draw a new cell selection |
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Aug 26 22:55:24 2004 | http://epydoc.sf.net |