(*************************************************************************** $RCSfile: IntuiSupUtil.mod $ Description: Support for clients of intuisup.library. Created by: fjc (Frank Copeland) $Revision: 1.3 $ $Author: fjc $ $Date: 1994/05/12 17:42:46 $ Copyright © 1994, Frank Copeland. This file is part of the Oberon-A Library. See Oberon-A.doc for conditions of use and distribution. Log entries are at the end of the file. ***************************************************************************) MODULE IntuiSupUtil; (* $L+ use absolute long addressing for global variables *) IMPORT T := Types, E := Exec, I := Intuition, ISup := IntuiSup, SYS := SYSTEM; (*------------------------------------------------------------------------*) (* Procedures for Gadgets *) CONST DisableFlag = {ISup.gdfDisabled}; NoFlag = {}; (*------------------------------------------------------------------------*) (* Procedures for AutoRequesters *) CONST NoIDCMPFlags = {}; AutoReqFlags = {ISup.arfBackFill, ISup.arfMovePointerNeg, ISup.arfDrawRaster}; AcceptText = "Accept"; CancelText = "Cancel"; ContinueText = "Continue"; (*------------------------------------------------------------------------*) (* Procedures for Gadgets *) (*------------------------------------*) PROCEDURE DisableGadget * ( gadgetList : T.APTR; gadget : INTEGER; disableIt : BOOLEAN); VAR ignore : LONGINT; BEGIN (* DisableGadget *) IF disableIt THEN ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, DisableFlag, DisableFlag, ISup.useCurrentValue, ISup.useCurrentValue, ISup.useCurrentValue); ELSE ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, DisableFlag, NoFlag, ISup.useCurrentValue, ISup.useCurrentValue, ISup.useCurrentValue); END; (* ELSE *) END DisableGadget; (*------------------------------------*) PROCEDURE SelectGadget * ( gadgetList : T.APTR; gadget : INTEGER; selectIt : BOOLEAN); VAR ignore, value : LONGINT; BEGIN (* SelectGadget *) IF selectIt THEN value := 1 ELSE value := 0 END; ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, NoFlag, NoFlag, value, ISup.useCurrentValue, ISup.useCurrentValue); END SelectGadget; (*------------------------------------*) PROCEDURE SetGadget * ( gadgetList : T.APTR; gadget : INTEGER; gadgetType : INTEGER; value : LONGINT); VAR ignore : LONGINT; BEGIN (* SetGadget *) CASE gadgetType OF ISup.gdtButton, ISup.gdtCheck : ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, NoFlag, NoFlag, value, ISup.useCurrentValue, ISup.useCurrentValue); | ISup.gdtMX, ISup.gdtCycle : ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, NoFlag, NoFlag, ISup.useCurrentValue, value, ISup.useCurrentValue); | ELSE ignore := ISup.Base.ISetGadgetAttributes ( gadgetList, gadget, NoFlag, NoFlag, ISup.useCurrentValue, ISup.useCurrentValue, value); END; (* CASE gadgetType *) END SetGadget; (*------------------------------------------------------------------------*) (* Procedures for AutoRequesters *) (*------------------------------------*) (* $D- disable copying of open arrays *) PROCEDURE DoRequest * ( reqWin : I.WindowPtr; title : T.STRPTR; bodyText : ARRAY OF CHAR ) : BOOLEAN; BEGIN (* DoRequest *) RETURN ISup.Base.IAutoRequest ( reqWin, title, bodyText, SYS.ADR(AcceptText), SYS.ADR(CancelText), NoIDCMPFlags, NoIDCMPFlags, AutoReqFlags, NIL); END DoRequest; (*------------------------------------*) (* $D- disable copying of open arrays *) PROCEDURE DoNotice * ( reqWin : I.WindowPtr; title : T.STRPTR; bodyText : ARRAY OF CHAR ); VAR ignore : BOOLEAN; BEGIN (* DoNotice *) ignore := ISup.Base.IAutoRequest ( reqWin, title, bodyText, NIL, SYS.ADR(ContinueText), NoIDCMPFlags, NoIDCMPFlags, AutoReqFlags, NIL); END DoNotice; END IntuiSupUtil. (*************************************************************************** $Log: IntuiSupUtil.mod $ Revision 1.3 1994/05/12 17:42:46 fjc - Removed code for ISupHandler and ISupDialog - Prepared for release Revision 1.2 1994/01/24 14:17:21 fjc - Changed to conform with changes in Handlers: - Assumes handler replied message unless it returned Pass - Installs IntuiSup-specific procedure in the Flush field Revision 1.1 1994/01/15 17:45:22 fjc - Start of revision control ***************************************************************************)