[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

2177.0. "select string gadgets?" by JFRSON::OSBORNE (Blade Walker) Tue Jan 31 1989 09:49

A quick technical question:

Is there a way to "select" a string gadget from within the application?
This is probably a stupid question, but my doc set is not current to 1.3,
and I can't find any examples in C. What I want to do is make it simpler
for the user of a window by "selecting" the next string gadget (without
the point-n-click) when the user completes a previous string gadget.

Thanks
John O.
T.RTitleUserPersonal
Name
DateLines
2177.1Inquiring minds...WJG::GUINEAUTue Jan 31 1989 17:165
Ditto!  I tried setting the SELECTED flag and doing a RefreshGadgets()
but all that gets me is a ghosted cursor in the gadget!

John
2177.2WJG::GUINEAUWed Feb 01 1989 08:219
John,

I just saw reference to a ActivateGadget() function in a USENET posting.

I'll check the AutoDocs tonight, but it sounds like this either does what
we want, or simulates the user selecting a gadget.

John
2177.3BAGELS::BRANNONDave BrannonWed Feb 01 1989 18:329
    that "auto" selecting is a new feature of 1.2, should be documented
    in the 1.2 enhancer manual somewhere.  There were code examples
    floating around about the time 1.2 came out that showed how to kludge
    that behavior to be backward compatible with 1.1, or just doing
    an OS check to make sure you were running 1.2 or greater before
    doing the new call.  Might be something on a Fred Fish disk about
    it.
    
    -Dave
2177.4ActivateGadget() (from heaven)WJG::GUINEAUThu Feb 02 1989 07:0947
Here it is:

    NAME
        ActivateGadget -- Activate a (String) Gadget.

    SYNOPSIS
        Success = ActivateGadget(Gadget, Window, Request)
        D0                       A0      A1      A2

        BOOL   Success;
        struct Gadget *Gadget;
        struct Window *Window;
        struct Requester 
    FUNCTION
        Activates a String Gadget.  If successful, this means that the user
        does not need to click in the gadget before typing.

        The Window parameter must point to the window which contains the Gadget.
        If the gadget is actually in a Requester, the Window must contain
        the Requester, and a pointer to the Requester must also be
        passed. The Requester parameter must only be valid if the Gadget
        has the REQGADGET flag set, a requirement for all Requester Gadgets. 
        The success of this function depends on a rather complex set
        of conditions.  The intent is that the user is never interrupted from
        what interactions he may have underway.

        The current set of conditions includes:
        -   The Window must be active. (Use the ACTIVEWINDOW IDCMP).
        -   No other gadgets may be in use.  This includes system gadgets,
            such as those for window sizing, dragging, etc.
        -   If the gadget is in a Requester, that Requester must
            be active. (Use the REQSET and REQCLEAR IDCMP).
        -   The right mouse button cannot be held down (e.g. menus

    INPUTS
        Gadget = pointer to the Gadget that you want activated.
        Window = pointer to a Window structure containing the Gadget.
        Requester = pointer to a Requester (may by NULL if this isn't
           a Requester Gadget (i.e. REQGADGET is not set)).

    RESULT
        If the conditions above are met, and the Gadget is in fact a String
        Gadget, then this function will return TRUE, else FALSE.

    BUGS

    SEE ALSO
2177.5thanks, its a big helpJFRSON::OSBORNEBlade WalkerThu Feb 02 1989 08:576
re: .4

Thanks, John, for tracking it down. This will make my programs much
more "user-friendly".

John O.