home *** CD-ROM | disk | FTP | other *** search
- /* StringGadgets.c */
- /* 04 Feb 1996 14:12:16 */
-
- #ifndef BACKUP_INCLUDE
- #include "IncludeAll.c"
- #endif
- #include "Backup.h"
- #include "Backup_proto.h"
- #include "BackupStrings.h"
-
-
- static void __interrupt StrGadHookFunction(struct Hook *hook, struct SGWork *sgw, ULONG *msg);
-
-
- /* Ersatz für struct Hook, mit Funktions-Prototyp */
- struct myHook
- {
- struct MinNode h_MinNode;
- ULONG (*h_Entry)(); /* assembler entry point */
- ULONG (*h_SubEntry)(struct Hook *, struct SGWork *, ULONG *);/* often HLL entry point */
- VOID *h_Data; /* owner specific */
- };
-
-
- struct Hook StrGadEditHook =
- {
- { NULL },
- HookEntry,
- (ULONG (*)()) StrGadHookFunction,
- NULL
- };
-
-
- /* kein Stack Check, daher __interrupt !!! */
- static void __interrupt StrGadHookFunction(struct Hook *hook, struct SGWork *sgw, ULONG *msg)
- {
- if (*msg == SGH_KEY)
- {
- if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_RCOMMAND)
- {
- /* Menu-Kürzel am String-Gadget vorbeileiten */
- sgw->Code = (USHORT) GADCODE_NOP;
- sgw->Actions |= SGA_END | SGA_REUSE;
- }
- else
- {
- switch (sgw->IEvent->ie_Code)
- {
- case 0x4c: /* Up Arrow */
- if (sgw->IEvent->ie_Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
- sgw->Code = GADCODE_PAGEUP;
- else if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_CONTROL)
- sgw->Code = GADCODE_TOP;
- else
- sgw->Code = GADCODE_UP;
-
- sgw->Actions |= SGA_END;
- break;
- case 0x4d: /* Down Arrow */
- if (sgw->IEvent->ie_Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
- sgw->Code = GADCODE_PAGEDOWN;
- else if (sgw->IEvent->ie_Qualifier & IEQUALIFIER_CONTROL)
- sgw->Code = GADCODE_BOTTOM;
- else
- sgw->Code = GADCODE_DOWN;
-
- sgw->Actions |= SGA_END;
- break;
- case 0x45: /* Escape */
- sgw->Actions |= SGA_END;
- sgw->Code = GADCODE_CANCEL;
- break;
- }
- }
- }
- }
-