Listing 1. Interface Information and Event Routines for Create_Accounts Card in CanDo 2.0 1 ************* 2 * Deck "CanDo-Part2-Program" 3 * Time 13:19:34 4 * Date 06/27/93 5 ************* 6 7 ************* 8 * Card(s) in deck. 9 * Card "Create_Accounts" 10 ************* 11 * 1 Card(s), 1 were printed. 12 ************* 13 14 ************* 15 * Natural order of Cards 16 * Card "Create_Accounts" 17 ************* 18 19 ************* 20 * Global Routine(s) in deck. 21 * Routine "Cancel Accounts" (was not printed) 22 * Routine "Display Categories" (was not printed) 23 * Routine "OK Accounts" (was not printed) 24 * Routine "Print Num Accts" (was not printed) 25 * Routine "Print Num Cats" (was not printed) 26 * Routine "Sort the Document" (was not printed) 27 * Routine "Update Categories" (was not printed) 28 ************* 29 * 7 Global routines(s), 0 were printed. 30 ************* 31 32 ************* 33 * Card "Create_Accounts" 34 BeforeAttachment ; used to be OnStartup 35 WorkWithDocument "Accounts" 36 Clear DOCUMENT 37 Let NumAccounts = Budget.NumAccounts 38 Let I = 1 39 While I <= NumAccounts 40 Type Budget.Account[I].Name,NEWLINE 41 WorkWithDocument "Categories."||Budget.Account[I].Name 42 Clear DOCUMENT 43 Let NumCategories = Budget.Account[I].NumCategories 44 Let J = 1 45 While J <= NumCategories 46 Type Budget.Account[I].Category[J].Name,NEWLINE 47 Let J = J+1 48 EndLoop 49 WorkWithDocument "Accounts" 50 Let I = I+1 51 EndLoop 52 EndScript 53 AfterAttachment ; used to be AfterStartup 54 SetPrintFont "topaz",9 55 SetPrintStyle BOLD ,2,3 56 SetPen 1,0 57 SetDrawMode JAM1 58 PrintText "Enter Accounts:",102,18 59 PrintText "Enter Categories:",410,18 60 Do "Print Num Accts" 61 Do "Print Num Cats" 62 SetObjectState "Field_Account",ON 63 EndScript 64 Window "UserWindow" 65 Definition 66 Origin 0,0 67 Size 640,200 68 Title "SimpleBudget v1.00 ©1992 RKA Productions ACCOUNTS and CATEGORIES" 69 NumberOfColors 4 70 WindowColors 3,1,0 ; Detail, Block, Background 71 WindowObjects CLOSEBUTTON 72 WindowFlags ACTIVATE SEPARATESCREEN TOFRONT 73 EndScript 74 OnCloseButton 75 Quit 76 EndScript 77 EndObject 78 List "Document_Accounts" 79 Definition 80 Origin 106,45 81 Size 209,120 82 Font "topaz",8 ; FontName, PointSize 83 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 84 TextColors 1,0,JAM2 ; PenA, PenB, DrawMode 85 Border DOUBLEBEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen 86 Document "Accounts" ; where the text comes from 87 EndScript 88 OnClick 89 Do "Update Categories" 90 Do "Display Categories" 91 Do "Print Num Cats" 92 EndScript 93 OnRelease 94 SetObjectState "Field_Category",ON 95 EndScript 96 EndObject 97 TextField "Field_Account" 98 Definition 99 Origin 106,32 100 Size 185,8 101 Justification LEFT 102 MaxFieldLength 22 103 InitialText "" 104 Border DOUBLEBEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen 105 EndScript 106 OnRelease 107 Let AcctName = TextFrom("Field_Account") 108 Type AcctName,NEWLINE 109 SetText "Field_Account","" 110 SetObjectState "Field_Account",ON 111 Do "Print Num Accts" 112 EndScript 113 OnClick 114 WorkWithDocument "Accounts" 115 MoveCursorTo ENDOF DOCUMENT 116 Do "Update Categories" 117 Do "Display Categories" 118 Do "Print Num Cats" 119 EndScript 120 EndObject 121 TextButton "OK" 122 Definition 123 Origin 463,181 124 Font "topaz",8 ; FontName, PointSize 125 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 126 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 127 Text " OK " 128 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 129 Highlight OUTLINE 130 ButtonFlags NONE 131 EndScript 132 OnRelease 133 Do "OK Accounts" 134 EndScript 135 EndObject 136 TextButton "Cancel" 137 Definition 138 Origin 557,181 139 Font "topaz",8 ; FontName, PointSize 140 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 141 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 142 Text " CANCEL " 143 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 144 Highlight OUTLINE 145 ButtonFlags NONE 146 EndScript 147 OnRelease 148 Nop ;Change nairy a thing!! 149 GotoCard "Intro" 150 EndScript 151 EndObject 152 TextButton "DeleteAccount" 153 Definition 154 Origin 19,54 155 Font "topaz",8 ; FontName, PointSize 156 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 157 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 158 Text "Delete->" 159 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 160 Highlight OUTLINE 161 ButtonFlags NONE 162 EndScript 163 OnRelease 164 WorkWithDocument "Accounts" 165 Let DeletedAccount = TheLine 166 Delete LINE 167 Do "Print Num Accts" 168 Nop ;Clear the document associated with the deleted account 169 WorkWithDocument "Categories."||DeletedAccount 170 Clear DOCUMENT 171 Do "Display Categories" 172 Do "Print Num Cats" 173 WorkWithDocument "Accounts" 174 EndScript 175 EndObject 176 TextButton "SortAccount" 177 Definition 178 Origin 19,74 179 Font "topaz",8 ; FontName, PointSize 180 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 181 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 182 Text " Sort-> " 183 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 184 Highlight OUTLINE 185 ButtonFlags NONE 186 EndScript 187 OnRelease 188 Do "Update Categories" 189 WorkWithDocument "Accounts" 190 Do "Sort the Document" 191 SetObjectState "Field_Account",ON 192 EndScript 193 EndObject 194 List "Document_Categories" 195 Definition 196 Origin 414,45 197 Size 209,120 198 Font "topaz",8 ; FontName, PointSize 199 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 200 TextColors 1,0,JAM2 ; PenA, PenB, DrawMode 201 Border DOUBLEBEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen 202 Document "Categories" ; where the text comes from 203 EndScript 204 OnClick 205 WorkWithDocument "Categories" 206 EndScript 207 EndObject 208 TextButton "DeleteCategory" 209 Definition 210 Origin 333,54 211 Font "topaz",8 ; FontName, PointSize 212 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 213 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 214 Text "Delete->" 215 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 216 Highlight OUTLINE 217 ButtonFlags NONE 218 EndScript 219 OnRelease 220 WorkWithDocument "Categories" 221 Delete LINE 222 Let ChangedCategories = TRUE 223 Do "Print Num Cats" 224 Do "Update Categories" 225 SetObjectState "Field_Category",ON 226 EndScript 227 EndObject 228 TextButton "SortCategory" 229 Definition 230 Origin 333,74 231 Font "topaz",8 ; FontName, PointSize 232 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 233 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode 234 Text " Sort-> " 235 Border EMBOSSED ,2,1 ; BorderStyle, MainPen, ExtraPen 236 Highlight OUTLINE 237 ButtonFlags NONE 238 EndScript 239 OnRelease 240 WorkWithDocument "Categories" 241 Do "Sort the Document" 242 Let ChangedCategories = TRUE 243 Do "Update Categories" 244 SetObjectState "Field_Category",ON 245 EndScript 246 EndObject 247 TextField "Field_Category" 248 Definition 249 Origin 414,32 250 Size 185,8 251 Justification LEFT 252 MaxFieldLength 22 253 InitialText "" 254 Border DOUBLEBEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen 255 EndScript 256 OnRelease 257 Let CatName = TextFrom("Field_Category") 258 Type CatName,NEWLINE 259 Let ChangedCategories = TRUE 260 SetText "Field_Category","" 261 SetObjectState "Field_Category",ON 262 Do "Print Num Cats" 263 Do "Update Categories" 264 EndScript 265 OnClick 266 WorkWithDocument "Categories" 267 MoveCursorTo ENDOF DOCUMENT 268 EndScript 269 EndObject 270 TextMenu "Okay " 271 Definition 272 AttachTo MENU ,"Options" 273 Font "topaz",8 ; FontName, PointSize 274 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 275 TextColors 0,1,NORMAL ; PenA, PenB, DrawMode 276 Text "Okay " 277 MenuFlags NONE 278 Highlight COMPLEMENT 279 ShortCutKey "" 280 EndScript 281 Occurred 282 Do "OK Accounts" 283 EndScript 284 EndObject 285 TextMenu "Cancel " 286 Definition 287 AttachTo MENU ,"Options" 288 Font "topaz",8 ; FontName, PointSize 289 PrintStyle PLAIN ,2,3 ; Style, Pen1, Pen2 290 TextColors 0,1,NORMAL ; PenA, PenB, DrawMode 291 Text "Cancel " 292 MenuFlags NONE 293 Highlight COMPLEMENT 294 ShortCutKey "" 295 EndScript 296 Occurred 297 Do "Cancel Accounts" 298 EndScript 299 EndObject 300 * End of Card "Create_Accounts" 301 *************