1 / 18

Examples with controls

IS 8726---Summer 2008. Examples with controls. Using the calendar control to make a very simple appointment book Creating an amortization table. A Few Examples. Display a calendar Click on a date causes display of appointment for that day Only one per day

dong
Download Presentation

Examples with controls

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IS 8726---Summer 2008 Examples with controls

  2. Using the calendar control to make a very simple appointment book Creating an amortization table IS 8726, Summer 2008, 5/16/2008 A Few Examples

  3. Display a calendar • Click on a date causes display of appointment for that day • Only one per day • User can add an appointment if there is none on that day or change the appointment • Data is saved in a file IS 8726, Summer 2008, 5/16/2008 Appointment Calendar

  4. File structure, loading and saving Internal storage of data Planning event handling The interface IS 8726, Summer 2008, 5/16/2008 Order of ‘Attack’

  5. Use a text file • An appointment will be stored on two lines • The first line is the date • The second line is the text of the appointment • This is not a good structure for processing, but the application won’t process the file other than reading and writing IS 8726, Summer 2008, 5/16/2008 File Structure

  6. The file will be located in the application directory • It will have the name appointments.txt • Saving the file will remove any data in the file • Loading the file will be accomplished by reading a date and an appointment with ReadLine and storing the pair IS 8726, Summer 2008, 5/16/2008 Loading and Saving

  7. The appointments will be stored for use in the program using a HashTable • The date string will be the key • This is possibly a problem due to the different ways dates can be represented • We could, possibly, use a date object • The appointment text will be the value IS 8726, Summer 2008, 5/16/2008 Internal Data Storage

  8. User chooses a date User clicks Add/Change button IS 8726, Summer 2008, 5/16/2008 Event Handling

  9. Display a header identifying the date • States if there is no appointment for that date • Display the text of the appointment if there is one for that date • Display a button with Add or Change • Provide a text box for entering an appointment IS 8726, Summer 2008, 5/16/2008 User Chooses a Date

  10. The appointment is stored in the HashTable The button and text box are hidden The appointment header and message are adjusted The appointment data is saved to disk IS 8726, Summer 2008, 5/16/2008 User Clicks Add/Change Button

  11. A label as a page header • A calendar • Two labels for displaying the appointment data • A label and textbox for entering an appointment • A label displaying the full path name of the appointments file • When stored using a relative path, it was difficult to find it,otherwise IS 8726, Summer 2008, 5/16/2008 The Interface

  12. User enters data for a loan A table of the interest paid and the loan balance is displayed IS 8726, Summer 2008, 5/16/2008 Amortization Table

  13. Balance Interest owed for month Payment for month New balance There are formulas, but we won’t need them IS 8726, Summer 2008, 5/16/2008 Theory of Compound Interest

  14. How to create a table programmatically Using a loop to create the rows of the table Setting class attribute dynamically for negative values IS 8726, Summer 2008, 5/16/2008 Design

  15. Area for data entry • Styling to make it look better? • Header for the table and an empty table element IS 8726, Summer 2008, 5/16/2008 The Web Page

  16. Classes involved • Table • TableRow • TableCell • Collections • table.Rows • row.Cells IS 8726, Summer 2008, 5/16/2008 CREATING A Table Programmatically

  17. Step through each month Compute interest and new balance Create a new row of the table and add to the table IS 8726, Summer 2008, 5/16/2008 Main Processing loop

  18. Using cssclass to note negative cells Using cssclass to note header cells IS 8726, Summer 2008, 5/16/2008 Setting Styles

More Related