| 1 | /* |
| 2 | * listbox.h |
| 3 | * |
| 4 | * [Generated from listbox, 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 __listbox_h |
| 15 | #define __listbox_h |
| 16 | |
| 17 | #ifndef __sapphire_h |
| 18 | #include "sapphire.h" |
| 19 | #endif |
| 20 | |
| 21 | /*----- Overview ----------------------------------------------------------* |
| 22 | * |
| 23 | * Functions provided: |
| 24 | * |
| 25 | * lb_create |
| 26 | * lb_destroy |
| 27 | * lb_eventHandler |
| 28 | * lb_plotString |
| 29 | * lb_update |
| 30 | * lb_updateItem |
| 31 | * lb_select |
| 32 | * lb_isSelected |
| 33 | * lb_clearSelection |
| 34 | * lb_clickS |
| 35 | * lb_clickM |
| 36 | * lb_drag |
| 37 | * lb_inserted |
| 38 | * lb_removed |
| 39 | * lb_init |
| 40 | */ |
| 41 | |
| 42 | /* --- lb_create --- * |
| 43 | * |
| 44 | * On entry: R0 == pointer to list manager description block |
| 45 | * R1 == pointer to the list |
| 46 | * R2 == pointer to a width function |
| 47 | * R3 == The height of each item |
| 48 | * R4 == parent window handle or |
| 49 | * pointer to window block if R5 == -1 |
| 50 | * R5 == parent icon handle or -1 if not a pane |
| 51 | * |
| 52 | * On exit: R0 == listbox handle |
| 53 | * R1 == window handle of list box |
| 54 | * May return an error (R1 corrupted) |
| 55 | */ |
| 56 | |
| 57 | extern routine lb_create; |
| 58 | |
| 59 | /* --- lb_destroy --- * |
| 60 | * |
| 61 | * On entry: R0 == listbox handle |
| 62 | * |
| 63 | * On exit: -- |
| 64 | * |
| 65 | * Use: Destroys the given listbox. |
| 66 | */ |
| 67 | |
| 68 | extern routine lb_destroy; |
| 69 | |
| 70 | /* --- lb_eventHandler --- * |
| 71 | * |
| 72 | * On entry: R0 == listbox handle |
| 73 | * R1 == handler function |
| 74 | * R2 == R10 value to pass |
| 75 | * R3 == R12 value to pass |
| 76 | * |
| 77 | * On exit: -- |
| 78 | * |
| 79 | * Use: Registers an event handler for the given listbox. |
| 80 | */ |
| 81 | |
| 82 | extern routine lb_eventHandler; |
| 83 | |
| 84 | /* --- lb_plotString --- * |
| 85 | * |
| 86 | * On entry: R0 == pointer to a string |
| 87 | * R1 == pointer to the list item |
| 88 | * R2-R5 == window coordinates to plot it |
| 89 | * R10 == pointer to the listbox |
| 90 | * |
| 91 | * On exit: -- |
| 92 | * |
| 93 | * Use: Plots a list item consisting of a single string. It assumes |
| 94 | * the default selection model. |
| 95 | */ |
| 96 | |
| 97 | extern routine lb_plotString; |
| 98 | |
| 99 | /* --- lb_update --- * |
| 100 | * |
| 101 | * On entry: R0 == listbox handle |
| 102 | * |
| 103 | * On exit: May return an error |
| 104 | * |
| 105 | * Use: Updates the entire listbox prettily |
| 106 | */ |
| 107 | |
| 108 | extern routine lb_update; |
| 109 | |
| 110 | /* --- lb_updateItem --- * |
| 111 | * |
| 112 | * On entry: R0 == list box handle |
| 113 | * R1 == list item handle |
| 114 | * |
| 115 | * On exit: -- |
| 116 | * |
| 117 | * Use: Redraws a list item to reflect a change in its state. |
| 118 | */ |
| 119 | |
| 120 | extern routine lb_updateItem; |
| 121 | |
| 122 | /* --- lb_select --- * |
| 123 | * |
| 124 | * On entry: R0 == listbox handle |
| 125 | * R1 == item handle |
| 126 | * R2 == 0 to unselect, 1 to select, or 2 to toggle |
| 127 | * |
| 128 | * On exit: -- |
| 129 | * |
| 130 | * Use: Selects or deselects a listbox item, nicely and without |
| 131 | * flickering it. |
| 132 | */ |
| 133 | |
| 134 | extern routine lb_select; |
| 135 | |
| 136 | /* --- lb_isSelected --- * |
| 137 | * |
| 138 | * On entry: R0 == listbox handle |
| 139 | * R1 == item handle |
| 140 | * |
| 141 | * On exit: CS if item is selected, else CC |
| 142 | * |
| 143 | * Use: Informs you whether an item is selected. |
| 144 | */ |
| 145 | |
| 146 | extern routine lb_isSelected; |
| 147 | |
| 148 | /* --- lb_clearSelection --- * |
| 149 | * |
| 150 | * On entry: R0 == listbox handle |
| 151 | * R1 == item handle of item to ignore (or 0 for none) |
| 152 | * |
| 153 | * On exit: -- |
| 154 | * |
| 155 | * Use: Deselects all items in the listbox. |
| 156 | */ |
| 157 | |
| 158 | extern routine lb_clearSelection; |
| 159 | |
| 160 | /* --- lb_clickS --- * |
| 161 | * |
| 162 | * On entry: R0 == listbox handle |
| 163 | * R1 == pointer to list item |
| 164 | * R3 == mouse button status |
| 165 | * |
| 166 | * On exit: -- |
| 167 | * |
| 168 | * Use: Provides a default action for clicking on an item in a |
| 169 | * list box. |
| 170 | * |
| 171 | * Only one selection is possible at any one time. |
| 172 | */ |
| 173 | |
| 174 | extern routine lb_clickS; |
| 175 | |
| 176 | /* --- lb_clickM --- * |
| 177 | * |
| 178 | * On entry: R0 == listbox handle |
| 179 | * R1 == pointer to list item |
| 180 | * R3 == mouse button status |
| 181 | * |
| 182 | * On exit: -- |
| 183 | * |
| 184 | * Use: Provides a default action for clicking on an item in a |
| 185 | * list box. |
| 186 | * |
| 187 | * The multiple selection model is used. |
| 188 | */ |
| 189 | |
| 190 | extern routine lb_clickM; |
| 191 | |
| 192 | /* --- lb_drag --- * |
| 193 | * |
| 194 | * On entry: R1 == pointer to list item |
| 195 | * R2 == window relative y position |
| 196 | * R3 == mouse button status |
| 197 | * R10 == listbox handle |
| 198 | * |
| 199 | * On exit: -- |
| 200 | * |
| 201 | * Use: Starts a drag operation to allow for easy multiple |
| 202 | * selection. |
| 203 | */ |
| 204 | |
| 205 | extern routine lb_drag; |
| 206 | |
| 207 | /* --- lb_inserted --- * |
| 208 | * |
| 209 | * On entry: R0 == pointer to the listbox |
| 210 | * R1 == pointer to the new item |
| 211 | * |
| 212 | * On exit: -- |
| 213 | * |
| 214 | * Use: Informs the listbox that an item has been inserted, |
| 215 | * and causes a flicker free insert to occur if possible. |
| 216 | */ |
| 217 | |
| 218 | extern routine lb_inserted; |
| 219 | |
| 220 | /* --- lb_removed --- * |
| 221 | * |
| 222 | * On entry: R0 == pointer to the listbox |
| 223 | * R1 == index of item removed |
| 224 | * |
| 225 | * On exit: -- |
| 226 | * |
| 227 | * Use: Informs the listbox that an item has been removed, and |
| 228 | * causes a flicker free remove to occur, if possible. |
| 229 | */ |
| 230 | |
| 231 | extern routine lb_removed; |
| 232 | |
| 233 | /* --- lb_window --- * |
| 234 | * |
| 235 | * On entry: R0 == listbox handle |
| 236 | * |
| 237 | * On exit: R0 == window handle |
| 238 | * |
| 239 | * Use: Returns the window handle of the listbox |
| 240 | */ |
| 241 | |
| 242 | extern routine lb_window; |
| 243 | |
| 244 | /* --- lb_init --- * |
| 245 | * |
| 246 | * On entry: -- |
| 247 | * |
| 248 | * On exit: -- |
| 249 | * |
| 250 | * Use: Initialises the listbox unit. |
| 251 | */ |
| 252 | |
| 253 | extern routine lb_init; |
| 254 | |
| 255 | /*----- List events -------------------------------------------------------*/ |
| 256 | |
| 257 | #define lbEvent_close 0 |
| 258 | |
| 259 | #define lbEvent_redraw 1 |
| 260 | #define lbEvent_click 2 |
| 261 | #define lbEvent_menu 3 |
| 262 | #define lbEvent_drag 4 |
| 263 | #define lbEvent_help 5 |
| 264 | #define lbEvent_drop 6 |
| 265 | |
| 266 | #define lbDrop_load 0 |
| 267 | #define lbDrop_save 1 |
| 268 | |
| 269 | /*----- That's all, folks -------------------------------------------------*/ |
| 270 | |
| 271 | #endif |