[printable version of this document (pdf)]| [308-304B Home]

308-304B Object-Oriented Design -- Assignment 3\\\ Due date: Wednesday March 20, 2002 before 23:55

308-304B Object-Oriented Design - Assignment 3
  Due date: Wednesday March 20, 2002 before 23:55

 


Practical information

Starting point

application.py (see Figure 1) implements

spreadsheetControl.jpg

Figure 1: Root (control) window of the spreadsheet application.

the controlling part of a prototype spreadsheet application. It allows one to open Grid View windows, Plot View (dummy implementation) windows, as well as quit the application.

SSGridView.py (see Figure 2) implements the

spreadsheetView.jpg

Figure 2: Grid View (includes Postscript printing)

core classes for the Grid View.

The functionality of the application was demonstrated in class and is described briefly in the source.

<shift><click> the links above to download the files.

Assignment

Extend the above with:

  1. The ability to specify from the application main interface (next to the Grid View button), parameters such as number of rows, number of columns, ... a new Grid View should have.

    Hint: a tiny example of the use of the Entry widget

       from Tkinter import *
       root=Tk()    # the root window
       typedText=StringVar()
       typedText.set("initial text")
       e=Entry(root, textvariable=typedText)
       e.pack()
    
       # you can get the text typed into the Entry field by means of
       typedText.get()
    
       # the main Tk event loop
       root.mainloop()
    
    
  2. The ability to move the selectedCell (framed by a thick black line) by means of the keyboard Up, Down, Left, and Right arrows. Note how selectedCell is where any typed in data will go.

    Hint: have a close at how onDrawareaMouseMove() and onDrawareaMouse1Click handle mouse motion and subsequent cell selection.

  3. The ability to enter data in a cell. Use the state automaton describing valid input from the solution of assignment 2 as the basis of your implementation. In particular, use wherever possible exactly the same names (e.g., for states and actions).

    Hint: you will have to modify the class DataElement to accommodate different types of data values.

Clearly identify and document your additions. ANY change you make to the code must be accompanied by comments containing the word MODIFIED literally (and some explanation).




Translated from TEX by TTH, version 3.02 (minor customizations by HV). On 13 Mar 2002, 00:10.