| 1 | /* |
| 2 | * writable.h |
| 3 | * |
| 4 | * [Generated from writable, 25 September 1996] |
| 5 | */ |
| 6 | |
| 7 | #if !defined(__CC_NORCROFT) || !defined(__arm) |
| 8 | #error You must use the Norcroft ARM Compiler for Sapphire programs |
| 9 | #endif |
| 10 | |
| 11 | #pragma include_only_once |
| 12 | #pragma force_top_level |
| 13 | |
| 14 | #ifndef __writable_h |
| 15 | #define __writable_h |
| 16 | |
| 17 | #ifndef __sapphire_h |
| 18 | #include "sapphire.h" |
| 19 | #endif |
| 20 | |
| 21 | /*----- Overview ----------------------------------------------------------* |
| 22 | * |
| 23 | * Functions provided: |
| 24 | * |
| 25 | * writable |
| 26 | * wrt_init |
| 27 | * |
| 28 | * Macros provided: |
| 29 | * |
| 30 | * WRTABLE |
| 31 | */ |
| 32 | |
| 33 | /* --- writable --- * |
| 34 | * |
| 35 | * On entry: R0 == pointer to writable dialogue block |
| 36 | * R1 == pointer to default string to display, or 0 for null |
| 37 | * R2 == pointer to routine to call when string set |
| 38 | * R3 == value to pass to routine in R10 |
| 39 | * R4 == value to pass to routine in R12 |
| 40 | * |
| 41 | * On exit: R0 == dialogue handle of created dialogue box |
| 42 | * May return an error |
| 43 | * |
| 44 | * Use: Displays a writable dialogue box, i.e. one with a writable |
| 45 | * icon and OK button, used instead of writable menu items, |
| 46 | * for reasons to do with caret blinking and pointer changing. |
| 47 | * |
| 48 | * The writable dialogue block consists of: |
| 49 | * |
| 50 | * Size Meaning |
| 51 | * ~~~~ ~~~~~~~ |
| 52 | * 4 Flags (see below) |
| 53 | * n Validation string to use, may be null |
| 54 | * m Title string (message tag) to display |
| 55 | * |
| 56 | * The flags are: |
| 57 | * |
| 58 | * Bit Meaning |
| 59 | * ~~~ ~~~~~~~ |
| 60 | * 0-7 Maximum string length |
| 61 | * 8 Right align text in writable icon |
| 62 | * 9-31 Reserved; must be 0 |
| 63 | * |
| 64 | * The routine returns a dialogue handle because you may want |
| 65 | * to attach a numWrite control to the writable icon, which |
| 66 | * is icon number 0. |
| 67 | * |
| 68 | * The handler routine is passed: |
| 69 | * |
| 70 | * R0 == pointer to string typed in |
| 71 | * R1 == dialogue box handle (for numWrite again) |
| 72 | * R10, R12 as set up here |
| 73 | * |
| 74 | * It must preserve all registers. If the carry flag is set |
| 75 | * on exit, the dialogue box will not be closed. If it is |
| 76 | * clear, the dialogue may be closed depending on the button |
| 77 | * status. |
| 78 | * |
| 79 | * Note that this routine does *not* require a template -- |
| 80 | * a suitable window is generated at run-time. |
| 81 | */ |
| 82 | |
| 83 | extern routine writable; |
| 84 | |
| 85 | /* --- wrt_init --- * |
| 86 | * |
| 87 | * On entry: -- |
| 88 | * |
| 89 | * On exit: -- |
| 90 | * |
| 91 | * Use: Initialises the writable dialogue box for use. |
| 92 | */ |
| 93 | |
| 94 | extern routine wrt_init; |
| 95 | |
| 96 | /* --- Useful constants --- */ |
| 97 | |
| 98 | #define wrtFlag_rAlign ((1<<8)) |
| 99 | |
| 100 | /* --- Macro: WRTABLE --- * |
| 101 | * |
| 102 | * Arguments: len == maximum string length to allow |
| 103 |