![]() This Document
|
1: prepareMovie
|
Public Handlers API INTO gWFSMultiSpriteList DETERMINING INTERSECTION DETERMINING ELEMENT NAME SEARCH See alsoAll API's
|
|
API INTO gWFSHighestLocZ |
API INTO gWFSHighestLocZ
AND gWFSOpenMultiSpriteList
This returns an integer indicating the highest locZ value of any window or menu element. Or any sprite that uses this API to set its locZ. theIntegerResult = wfsGetHighestLocZ() This increments gWFSHighestLocZ by gWFSLocZIncrement, which is a constant defined in "1: prepareMovie. Each time a multi-sprite is opened, the multi-sprite is brought to front. gWFSHighestLocZ is incremented by 25,000 and the individual elements of the multi-sprite are assigned a locZ that is incremented by gWFSLocZIncrement, which is 50. So there is locZ space between elements in WFS, and there is 25000 worth of locZ space between multi-sprites. wfsIncrementHighestLocZ()
This increments the highest locZ by gWFSLocZIncrement and returns the new value. This is used by the "3: Window Manager" and "Menu Manager" behaviors when windows or menus are opened to bring windows and menus to the front. theIntegerResult=wfsIncrementAndGetHighestLocZ() This boost gWFSHighestLocZ by 25000. The idea is that when you open a window, you put a space of 25000 locZ units between the window and the most recently opened window. The maxInteger=2147483647. So if the locZ values are getting precariously close to that value (which would take opening windows about 86,000 times), gWFSHighestLocZ is automatically reset and open windows are reopened (in the right order), which readjusts their locZ values. This handler is called in wfsBringWindowToFront in both the "3: Window Manager" and "Menu Manager" behaviors. So even if your app is a kiosk that is run continuously, we won't get integer overflow and all is well with the locZ space. wfsBoostHighestLocZ() This returns a duplicate copy of gWFSOpenMultiSpriteList. Changing what this handler returns does not change gWFSOpenMultiSpriteList. This list is sorted by locZ values of open windows and menus, ie, the last entry in the list is topmost. Suppose the open windows are two in number. One is managed by sprite 5 and the Manager has locZ=345. The other is managed by sprite 12 and has locZ=100. Then gWFSOpenMultiSpriteList=[100:12, 345:5], the list is sorted by locZ order. theListResult=wfsGetOpenMultiSpriteList() This returns the spriteNum of the Manager that has focus, ie, is topmost (and is visible) amongst windows or menus. It returns VOID if there are no open windows or menus. This is different from wfsGetHighestLocZ, which returns the maximal locZ value amongst window and menu elements. theResult = wfsGetFocusManager()
This adds the window or menu managed by managerSpriteNum to the gWFSOpenMultiSpriteList, which is a sorted property list of the open windows and menus and their locZ values. This list is sorted by locZ values of open windows and menus, ie, the last entry in the list is topmost. Suppose the open windows are two in number. One is managed by sprite 5 and the Manager has locZ=345. The other is managed by sprite 12 and has locZ=100. Then gWFSOpenMultiSpriteList=[100:12, 345:5], the list is sorted by locZ order. wfsAddToOpenMultiSpriteList returns 1 if the operation was successful, and 0 if it failed. It will fail if managerSpriteNum is not the spritenum of an instantiated Manager of a multi-sprite. theBooleanResult = wfsAddToOpenMultiSpriteList(managerSpriteNum)
Deletes managerSpritenum from the gWFSOpenMultiSpriteList. Returns 1 if the operation was successful. Returns 0 if managerSpriteNum was not a property value in the gWFSOpenMultiSpriteList. theBooleanResult = wfsDeleteFromOpenMultiSpriteList(managerSpriteNum)
This returns the position of managerSpritenum in gWFSOpenMultiSpriteList or 0 if it isn't in the list. It doesn't return the locZ, but the position in the gWFSOpenMultiSpriteList property list. theIntegerResult = wfsGetZOrdinal(managerSpriteNum)
Returns the number of open windows and menus. theIntegerResult = wfsGetNumberOfOpenMultiSprites()
Presupposes a positive integer parameter for theZOrdinal. This returns the manager spritenum of the window or menu in position theZOrdinal in gWFSOpenMultiSpriteList. It returns 0 if theZOrdinal is out of range of gWFSOpenMultiSpriteList. theIntegerResult = wfsGetManagerOfZOrdinal(theZOrdinal)
Presupposes a positive integer for theZOrdinal. Returns the locZ of the manager in position theZOrdinal in gWFSOpenMultiSpriteList, or returns 0 if theZOrdinal is out of range of gWFSOpenMultiSpriteList. theIntegerResult = wfsGetLocZOfZOrdinal(theZOrdinal)
|
DETERMINING INTERSECTION |
DETERMINING
INTERSECTION AND CONTAINMENT
Look at scene 8 of the demo for working use of these handlers. Search the source code of the demo for the handler names.
This returns a sorted property list of the same form as gWFSOpenMultiSpriteList which contains entries for each window or menu that theSpriteNum is within. For instance, if theSpriteNum=8 and sprite 8 is fully within a window managed by sprite 11 (which has locZ 234) and sprite 8 is fully within a window managed by sprite 3 (which has locZ 444) then wfsSpriteIsWithin(8) returns [234: 11, 444: 3]. Consequently, wfsSpriteIsWithin(8).getLast() returns 3, which is the spritenum of the topmost manager that sprite 8 is within. Note that what is checked for is whether theSpriteNum is within the second sprite of the window, the background sprite of the window or menu. theListResult = wfsSpriteIsWithin(theSpriteNum)
This returns a sorted property list of the same form as gWFSOpenMultiSpriteList which contains entries for each window or menu that theSpriteNum intersects. For instance, if theSpriteNum=8 and sprite 8 intersects with a window managed by sprite 11 (which has locZ 234) and sprite 8 intersects with a window managed by sprite 3 (which has locZ 444) then wfsSpriteIsWithin(8) returns [234: 11, 444: 3]. Consequently, wfsSpriteIsWithin(8).getLast() returns 3, which is the spritenum of the topmost manager that sprite 8 intersects. Note that what is checked for is whether theSpriteNum is within the second sprite of the window, the background sprite of the window or menu. theListResult = wfsSpriteIntersects(theSpriteNum)
|
DETERMINING |
DETERMINING ANCESTORS/DESCENDANTS
This returns an integer indicating whether theDescendantManager is indeed a descendant of theManager. theManager can be a manager's name or spritenum. Same with theDescendantManager. A manager is not a descendant of itself. If you call this with bad parameters, ie, either theManager or theDescendantManager are not instantiated, an alert dialog box is raised and 0 is returned. If theDescendantManager is indeed a descentdant of theManager, then the spritenum of the child of theManager from which theDescendantManager descends is returned. theIntegerResult = wfsIsADescendant(theManager, theDescendantManager)
This returns the spritenum of the root manager of theManager or returns 0 and raises an alert dialog if theManager is not an instantiated manager. theIntegerResult = wfsGetTheRootSpriteNum(theManager)
|
ELEMENT NAME SEARCH |
ELEMENT NAME SEARCH
FUNCTION Searches theDomain of multi-sprites for elements named theName. Do not confuse what is searched for with the Director ability to name sprites and channels. The WFS search is independent of these Director features. You name an element when you drop the "4: Window/Menu Element" behavior on a sprite, and any name you give it is independent of the name of the channel or the name of the sprite assignable via Director features. Also, the names of elements are not the same as the names of Managers. When you drop the "3: Window Manager" behavior on a sprite, you must name the Manager. But you don't have to name elements. Also, Manager names have to be unique among instantiated Managers. There is no such constraint concerning the names of elements. You can have as many repeats in the names of instantiated elements as you like. PARAMETERS theName: The name of the element(s) you want to search for. returnList: If this is unspecified or VOID or 0, then the handler will search theDomain of multi-sprites for the first occurence of an element named theName. If returnList =1, then the handler will search theDomain of multi-sprites for all occurrences of elements named theName. theDomain: if theDomain is unspecified or VOID or 0, then the domain of multi-sprites to be searched will be all multi-sprites. If theDomain=1, theDomain will be only open multi-sprites. If theDomain=2, then theDomain will be the multi-sprite that currently has focus (ie, is topmost in locZ) RETURN VALUE If returnList is unspecified or VOID or 0, then the handler will return an integer indicating the spritenum of the element first encountered that is named theName among theDomain of multi-sprites. If no such element is found, the handler returns 0. The search is conducted in such a way that the lowest-numbered channel containing an element named theName will be returned. If returnList = 1, then the handler will return a linear list of all the spritenums of elements in theDomain of multi-sprites that are named theName. If no such elements are encountered, an empty linear list [ ]. EXAMPLES Suppose that sprite 1 is a Manager that has sprites 6,7,8 as elements, and sprite 100 is a Manager that has sprites 101,102,103 as elements. Suppose also that sprites 6, 101, and 103 are named "bobo" (and that no other sprites are named "bobo"). Suppose that the multi-sprite managed by sprite 100 has focus, ie, is topmost among multi-sprites. Suppose, finally, that the multi-sprite managed by sprite 1 is not open (not visible). theResult=wfsGetElementNamed("bobo") The above will return 6. Since returnList is unspecified, the handler defaults to returning the first element named "bobo". Since theDomain is unspecified, it defaults to setting theDomain to all multi-sprites. This would be the same as calling wfsGetElementNamed("bobo", 0, 0) or also wfsGetElementNamed("bobo", VOID, VOID) or wfsGetElementNamed("bobo", 0) etc. theResult=wfsGetElementNamed("bobo", 1) The above will return [6, 101, 103], in other words, all elements named theName. Since theDomain is unspecified, the handler defaults to setting theDomain to all multi-sprites. This would be the same as calling wfsGetElementNamed("bobo", 1, VOID) or also wfsGetElementNamed("bobo", 1, 0). theResult=wfsGetElementNamed("bobo", 0, 1) The above will return 101. returnList=0, so the search is for the first occurrence of "bobo". theDomain=1, so only open multi-sprites will be searched. This would be the same as calling wfsGetElementNamed("bobo", VOID, 1) theResult=wfsGetElementNamed("bobo", 0, 2) The above will return 101. theDomain=2 means that only the multi-sprite with focus will be searched, and that is the multi-sprite managed by sprite 100. theResult=wfsGetElementNamed("bobo", 1, 2) The above will return [101, 103] NOTES If you want to search a particular multi-sprite that isn't necessarily the multi-sprite with focus, then use the same-named wfsGetElementNamed handler in the "3: Window Manager" and "Menu Manager" behaviors. The "4: Window/Menu Element" behavior has two handlers relevant to element names: wfsGetElementName and wfsSetElementName.
|
![]() |
|