/* @(#)42 1.1 src/dtuimx/ibmr2/dtscriptdir/contrib/TimeSheet/README, uimx, dtuimx720 8/8/94 20:09:47 */ /* * COMPONENT_NAME: DT UIM/X * * ORIGINS: 58 * * * Copyright IBM Corporation 1991, 1994 * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of IBM not be * used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ Desktop Script contrib Name: TimeSheet Abstract: This contrib is a time sheet entry form. It allows you to enter hours spent working on a specific project. It automatically calculates total hours for each day, each project and for the entire week. The Desktop Script User's Guide, Chapter 5, "Building Your First Dialog Box", includes a step by step tutorial that builds this contrib. Getting Started: i. load the contrib, TimeSheet.i into Desktop Script and try it in Test Mode (click on the "Test" radio button of the main window titled "Desktop Script"). - or - ii. load the contrib, TimeSheet.i, into Desktop Script, generate interface code and run it as a standalone application. To generate interface code, select "Generate Interface Code As..." from the "File" pulldown of the main window titled "Desktop Script"). Description: The tutorial provides detailed information on how to build and use the interface found in this directory. You can use the interface in this directory as a reference when doing the tutorial exercise. The TimeSheet.i found in this directory is a more complete version of the TimeSheet script you build in the tutorial. It includes callback code for the "Clear", "Save" and "Print" buttons. If you invoke this dtksh script by typing the name followed by a filename, the data is automatically loaded and displayed. By default the "Print" button sends the output to the screen. You can modify it to actually send the output to a printer. Load TimeSheet.i into Desktop Script, bring up the Widget Property Editor for the dialogWindow. Edit the DialogInitialCode callback. Change #typeset PrintCommand=lp typeset PrintCommand=cat to typeset PrintCommand=lp #typeset PrintCommand=cat If necessary, change "lp" to the command you use to print an ascii file. There are many enhancements you can make to this script. You can add error checking when loading the saved data, you can display a message if "Exit" is pressed and the data is not saved. You can add a load button to load and display the data. (This is currently provided only at the command line.) If you add a load button you will want to display a file selection box. Look at the callback code for the "Save" button to see how to do this. Purpose: By combining some of the widgets provided in Desktop Script and some dtksh code, this contrib demonstrates the type of interfaces you can create. The interface is built using a Group Box, Text Field, Pushbutton, Label, and Separator widgets. It demonstrates the type of interface that can be easily and quickly created using Desktop Script. Contents: README - this file. TimeSheet.i - the interface file. InitialCode - dtksh code used in the DialogInitialCode resource of the dialogWindow widget.