TITLE
    HyperCard: Handler to Select Multiple Objects (7/92)
Article ID:
Created:
Modified:
14169
12/8/93
12/8/93

TOPIC


    This handler allows you to select multiple parts (buttons and fields) by
    specifying the rectangle that contains them. After you've selected them,
    you can perform operations on all of them using alignParts, deleteParts,
    offsetParts, and pasteParts.


DISCUSSION


    on rectSelectParts
    -- Group selection by specifying a rectangle.
    -- Select a group of parts by clicking at topLeft and bottomRight
    -- of enclosing rectangle.

    global selectedParts,selectedPartsCard
    put empty into selectedParts
    put long name of this card into selectedPartsCard
    put "Click at top left..."
    wait until the mouseClick
    put the clickLoc into topLeft
    put "Click at bottom right..."
    wait until the mouseClick
    put the clickLoc into botRight
    put topLeft & "," & botRight into selectionRect
    repeat with i = 1 to the number of buttons
    if loc of button i is within selectionRect
    then put "card button id " & id of button i & return after selectedParts
    end repeat
    repeat with i = 1 to the number of bkgnd buttons
    if loc of bkgnd button i is within selectionRect
    then put "bg btn id " & id of bg btn i & return after selectedParts
    end repeat
    repeat with i = 1 to the number of fields
    if loc of field i is within selectionRect
    then put "bkgnd field id " & id of field i & return after selectedParts
    end repeat
    repeat with i = 1 to the number of card fields
    if loc of card field i is within selectionRect
    then put "card field id " & id of card field i & return after selectedParts
    end repeat
    put the number of lines in selectedParts & " parts selected."
    end rectSelectParts


    This article is adapted from the Claris Tech Info database.

Document Information
Product Area: Apple Software
Category: HyperCard
Sub Category: About HyperCard

Copyright © 2000 Apple Computer, Inc. All rights reserved.