Path: utzoo!attcan!uunet!decwrl!sdd.hp.com!samsung!cs.utexas.edu!rutgers!cbmvax!jjszucs From: jjszucs@cbmvax.commodore.com (John J. Szucs) Newsgroups: comp.sys.amiga Subject: Re: Activating Gadgets in C Message-ID: <13577@cbmvax.commodore.com> Date: 2 Aug 90 13:12:05 GMT References: <2384@ryn.esg.dec.com> Reply-To: jjszucs@cbmvax (John J. Szucs) Organization: Commodore, West Chester, PA Lines: 59 In article <2384@ryn.esg.dec.com> barrett@meridn.enet.dec.com (Keith Barrett) writes: >I need help with gadgets in C. I created a database that uses string gadgets >as input. The problem is I can't get the gadgets to auto-activate so that you >don't have to click the mouse on the string gadget to activate it. So you >should just be able to type and when you hit return it should activate the next >gadget. I set the SELECTED bit in the gadget but all this does is make the >cursor appear but you still have to click on the gadget. > The only method I can think of would be feeding INTUITION false mouse >movement, but that seems a little messy. Any help would be appreciated. The correct method to auto-activate a string gadget is to call the function ActivateGadget in intuition.library, which has the following syntax: ActivateGadget(struct Gadget *Gadget,struct Window *Window,struct Requester *Requester); If the gadget is not in a requester, the Requester argument should be NULL. So, for example, to activate the gadget FirstGadget, which is in the window DataEntryWindow and is not in a requester, the call would be: ActivateGadget(FirstGadget,DataEntryWindow,NULL); For more information on this call, check the ROM Kernel Manuals or the AutoDocs (printed in the "Includes and Autodocs" volume of the RKM or available on disk (very convenient if you have a hard disk) from CATS). A good idea for a database program would be to automatically activate the next string gadget when you receive a GADGETUP message from another string gadget. This allows the user to press and automatically move to the next field. So, if you have a name and address database, the flow (given below with field names on the left and user input on the right) might be: Name: John Q. Public (cursor automatically moves to Address field) Address: 123 Main Street (cursor automatically moves to City field) City: West Chester (cursor automatically moves to State field) State: PA (cursor automatically moves to ZIP field) ZIP: 19380 (cursor automatically moves to Telephone field) Telephone: (215)-431-1234 >Keith G. Barrett - Software Specialist Internet: barrett@meridn.enet.dec.com >Digital Equipment Corp. "DEC has it now" UUCP: decwrl!meridn.enet!barrett ================================================================================ || John J. Szucs || The opinions expressed are my own and || || Systems Evaluation Group || in no way represent the opinions or || || Product Assurance Department || policies of Commodore Technology, Inc. || || Commodore Technology, Inc. || or any associated entity. || ================================================================================ ...{rutgers|uunet|pyramid}!cbmvax!jjszucs jjszucs@cbmvax.commodore.com "Everything is deeply intertwingled." - Ted Nelson, Computer Lib/Dream Machines