"4: Window/Menu Element" Public Handlers
To see code in which these handlers are called, open up the DIR that
comes with WFS and do a search for the handler name.
wfsGetInitialVisibility
()
Returns the boolean indicating whether the element is visible when
the multi-sprite it's an element of is opened.
theBoolean=sprite(elementSpriteNum).wfsGetInitialVisibility() or
theBoolean=sendSprite(elementSpriteNum, #wfsGetInitialVisibility)
wfsSetInitialVisibility
(theBoolean)
Sets the boolean indicating whether the element is visible when
the multi-sprite it's an element of is opened. This doesn't affect
the visibility of the element until the multi-sprite is opened.
sprite(elementSpriteNum).wfsSetInitialVisibility(theBoolean) or
sendSprite(elementSpriteNum, #wfsSetInitialVisibility,
theBoolean)
wfsGetElementName
()
Returns the (string) name of the element. The default value is the
empty string.
elementName=sprite(elementSpriteNum).wfsGetElementName() or
elementName=sendSprite(elementSpriteNum, #wfsGetElementName)
wfsSetElementName
(theName)
Sets the (string) value of the element name.
sprite(elementSpriteNum).wfsSetElementName(theName) or
sendSprite(elementSpriteNum, #wfsSetElementName,
theName)
wfsGetMyManagerName ()
Returns the name (string) of the manager of the element with spritenum=elementSpriteNum.
There is a similar handler called wfsGetManagerName
in "1: prepareMovie". It is called differently, however. Here
we have two ways of getting the same information. The difference is
in the information you feed these handlers to get what you want.
This handler is called in the "Show Manager Name 1" behavior
in the demo.
The "Show Manager Name 1" behavior is attached to the text
in windows where you see the name of the window.
managerName=sprite(elementSpriteNum).wfsGetMyManagerName()
or
managerName=sendSprite(elementSpriteNum,
#wfsGetMyManagerName)
wfsGetMyManagerSpriteNum ()
Returns the spriteNum (integer) of the manager of the element with
spritenum=elementSpriteNum.There is a similar handler called wfsGetManagerSpriteNum
in "1: prepareMovie". It is called differently, however. Here
we have two ways of getting the same information. The difference is
in the information you feed these handlers to get what you want.
managerSpritenum=sprite(elementSpriteNum).wfsGetMyManagerSpriteNum()
or
managerSpritenum=sendSprite(elementSpriteNum,
#wfsGetMyManagerSpriteNum)
wfsAddElementToManager (managerNameOrSpriteNum)
See scene 8
in the demo for an example of this handler and check out tutorial
4 for exposition about this handler.
This handler is also called on beginsprite of window and menu elements.
It adds the window or menu element to the Manager specified by managerNameOrSpriteNum.
It returns 1 if the operation was successful, 0 if the operation was
unsuccessful and was cancelled. The operation can be unsuccessful if
the specified managerNameOrSpriteNum is not instantiated when the call
is made. managerNameOrSpriteNum is the name or spriteNum of the Manager
of the window or menu you want to add the element to.
An element can only be an element of at most one window or menu. This
handler also deletes the element from any other window or menu it's
part of before it adds it to the specified multi-sprite.
This handler also updates the data in the Manager that you add the
element to. In other words, it does all that needs doing if you want
to add an element to a Manager.
If you want to make the element part of no window or menu, then
use managerNameOrSpriteNum="" or managerNameOrSpriteNum=0
as the parameter for this handler. But it is better to do the following:
if you want to delete a window or menu element from a window or menu,
add it to a dummy window in which you store unused elements, basically
an unused element Manager. That way, you don't lose track of unused
elements.
Window and menu elements are not normally added and deleted. But, as
noted elsewhere, WFS is not just about windows and menus, but about
multi-sprite objects.
booleanResult=sprite(elementSpriteNum).wfsAddElementToManager(managerNameOrSpriteNum)
or
booleanResult=sendSprite(elementSpriteNum,
#wfsAddElementToManager,
managerNameOrSpriteNum)
wfsChangeRegPointToTopLeft ()
This is automatically executed on the background sprite of a window
or menu, which is the first element after the Manager. This handler
changes the regPoint of the element to be the top left point of the
element.
Note that this cannot execute on some media types in Director such
as Shapes created with the ToolBar. This means that Shapes created with
the ToolBar cannot be WFS backgrounds to windows or menus. Instead,
use Vector Shapes created via Window>Insert>Vector Shape.
sprite(elementSpriteNum).wfsChangeRegPointToTopLeft()
or
sendSprite(elementSpriteNum,
#wfsChangeRegPointToTopLeft)
|