1 /* ----------------------------------------------------------------- 2 FILE: dialog.h 3 DESCRIPTION:user insert file for dialog box routines. 4 CONTENTS: typedefs and definitions 5 DATE: Sep 16, 1989 - original coding. 6 REVISIONS: Dec 7, 1990 - added update function to dialog box. 7 ----------------------------------------------------------------- */ 8 #ifndef DIALOG_H 9 10 #define DIALOG_H 11 12 13 #include <yalecad/base.h> 14 15 #define LABELTYPE 0 16 #define INPUTTYPE 1 17 #define BUTTONTYPE 2 18 #define CASETYPE 3 19 20 typedef struct { 21 INT row, column, len ; 22 char *string ; 23 INT type ; 24 INT color ; 25 INT group ; /* used for CASETYPE - initial switch */ 26 /* used for BUTTONTYPE - member of case group */ 27 } TWDIALOGBOX, *TWDIALOGPTR ; 28 29 typedef struct { 30 INT type ; 31 char *string ; 32 BOOL bool ; 33 } TWDRETURNBOX, *TWDRETURNPTR ; 34 35 /* build a dialog box and get info */ 36 extern TWDRETURNPTR TWdialog( P3(TWDIALOGPTR fieldp, char *name, 37 INT (*user_function)() ) ) ; 38 /* 39 Arguments: 40 TWDIALOGPTR fieldp ; 41 char *name ; 42 INT (*user_function)() ; 43 Function: 44 Creates a dialog box for user to enter data. Return a pointer 45 to an array of type TWDRETURNPTR of the same size as input argument. 46 Name is the name given to the dialogbox for .Xdefault 47 control over the size of the dialog box upon creation. 48 The easier way to use this routine is to use the TWread_dialog 49 routine below to create a dialog.h file which has the necessary 50 input to create the correct input field array. See a sample 51 dialog file in graphics/example/example.dialog for more details. 52 User function allows an incremental calculation update. 53 */ 54 55 #ifdef DEBUG 56 extern TWDIALOGPTR TWread_dialog( P1(char *filename) ) ; 57 /* 58 Arguments: 59 char *filename ; 60 Function: 61 Reads file and builds correct data structure, output a dialog.h 62 file for inclusion in user program and then calls TWdialog. 63 This allows fast development of dialog boxes for the codes yet 64 the final result is stored in the program itself. 65 */ 66 #endif 67 68 #endif /* DIALOG_H */ 69