1 /*---------------------------------------------------------------------------- 2 -- 3 -- Module: xitParSet 4 -- 5 -- Project: xit - X Internal Toolkit 6 -- System: <> 7 -- Subsystem: <> 8 -- Function block: <> 9 -- 10 -- Description: 11 -- Interface for module xitParSet. 12 -- 13 -- Filename: xitParSet.h 14 -- 15 -- Authors: Roger Larsson, Ulrika Bornetun 16 -- Creation date: 1992-05-31 17 -- 18 -- 19 -- (C) Copyright Ulrika Bornetun, Roger Larsson (1995) 20 -- All rights reserved 21 -- 22 -- Permission to use, copy, modify, and distribute this software and its 23 -- documentation for any purpose and without fee is hereby granted, 24 -- provided that the above copyright notice appear in all copies. Ulrika 25 -- Bornetun and Roger Larsson make no representations about the usability 26 -- of this software for any purpose. It is provided "as is" without express 27 -- or implied warranty. 28 ----------------------------------------------------------------------------*/ 29 30 /* SCCS module identifier. */ 31 /* SCCSID = @(#) Module: xitParSet.h, Version: 1.1, Date: 95/02/18 15:10:43 */ 32 33 34 /* Only include this module once. */ 35 #ifndef define_xitParSet_h 36 # define define_xitParSet_h 37 38 39 /*---------------------------------------------------------------------------- 40 -- Include files 41 ----------------------------------------------------------------------------*/ 42 43 44 /*---------------------------------------------------------------------------- 45 -- Macro definitions 46 ----------------------------------------------------------------------------*/ 47 48 49 /*---------------------------------------------------------------------------- 50 -- Type declarations 51 ----------------------------------------------------------------------------*/ 52 53 /* Reasons when the action routine is called. */ 54 typedef enum { 55 XIT_PS_REASON_OK, 56 XIT_PS_REASON_CANCEL, 57 XIT_PS_REASON_DESTROY 58 } XIT_PS_REASON; 59 60 /* Callback when the summary window is destroyed. */ 61 typedef void ( *XIT_PS_ACTION_CB ) ( XIT_PS_REASON, void * ); 62 63 /* Tyoes of parameters we can do. */ 64 typedef enum { 65 XIT_PS_TYPE_INTEGER, 66 XIT_PS_TYPE_YES_NO, 67 XIT_PS_TYPE_YES_NO_FLAG, 68 XIT_PS_TYPE_ON_OFF, 69 XIT_PS_TYPE_ON_OFF_FLAG, 70 XIT_PS_TYPE_TEXT_FIELD, 71 XIT_PS_TYPE_INTEGER_FIELD, 72 XIT_PS_TYPE_DATE_FIELD, 73 XIT_PS_TYPE_TIME_FIELD, 74 XIT_PS_TYPE_DURATION_FIELD, 75 XIT_PS_TYPE_COLOR_FIELD, 76 XIT_PS_TYPE_SELECT_FIELD, 77 XIT_PS_TYPE_COLOR_INDEX_FIELD, 78 XIT_PS_TYPE_SELECT_INDEX_FIELD, 79 XIT_PS_TYPE_DATE_FORMAT_FIELD, 80 XIT_PS_TYPE_TIME_FORMAT_FIELD, 81 XIT_PS_TYPE_HIDDEN_TEXT_FIELD, 82 XIT_PS_TYPE_WORKDAYS_FIELD, 83 XIT_PS_TYPE_SEPARATOR 84 } XIT_PS_PAR_TYPES; 85 86 /* Strings to use in the parameter window. */ 87 typedef struct { 88 char *window_title; 89 char *parameter_list; 90 char *description; 91 char *parameter_value; 92 char *yes_label; 93 char *no_label; 94 char *on_label; 95 char *off_label; 96 char *msg_confirm_default; 97 char *msg_confirm_reset; 98 char *msg_invalid_value; 99 char *cancel_button; 100 char *defaults_button; 101 char *ok_button; 102 char *reset_button; 103 char *date_order_label; 104 char *mdy_label; 105 char *dmy_label; 106 char *ymd_label; 107 char *date_sep_label; 108 char *day_zero_label; 109 char *month_zero_label; 110 char *century_label; 111 char *hour12_label; 112 char *hour24_label; 113 char *time_sep_label; 114 char *hour_zero_label; 115 char *week_1st_day_label; 116 char *week_1st_days; 117 char *change_button; 118 char *change_hidden_label; 119 char *weekdays_short; 120 } XIT_PS_LABELS; 121 122 /* Structure for one parameter. */ 123 typedef struct { 124 char *parameter_label; 125 char *parameter_help; 126 XIT_PS_PAR_TYPES parameter_type; 127 int min; 128 int max; 129 int max_columns; 130 int max_length; 131 char *select_values; 132 UINT32 flag_offset; 133 void *value; 134 void *default_value; 135 size_t size; 136 } XIT_PAR_REC; 137 138 139 /*---------------------------------------------------------------------------- 140 -- Global definitions 141 ----------------------------------------------------------------------------*/ 142 143 144 145 /*---------------------------------------------------------------------------- 146 -- Functions 147 ----------------------------------------------------------------------------*/ 148 149 Widget 150 xitCreateParameterSet( Widget parent, 151 UINT32 flags, 152 XIT_PS_LABELS *labels, 153 XIT_PS_ACTION_CB actionCB, 154 XtPointer user_data ); 155 156 void 157 xitParameterSetDisplay( Widget parSetW, 158 XIT_PAR_REC par_rec_ref[], 159 int rec_no ); 160 161 #endif 162