%---------------- Functions ------------

\chapter{Popasl.mui/Popasl.mui}
\rule{\textwidth}{1mm}
\vspace{0.5cm}
\begin{deflist}{MMMMMMMM}
\item[\bf FUNCTION]
As a subclass of popstring class, popasl can be used to pop up
any kinds of standard system asl requesters. A seperate task is
spawned to handle these requesters, the application continues to
run.

Using an asl popup class, you don't need to worry about handling
asl requesters. MUI will automatically open one when the popup
button is pressed and update the corresponding string gadget
 when the user terminates the requester. From the programmers
point of view, all you have to do is to handle the string
gadgets contents.

IMPORTANT: At object creation time, you can use all ASL library
tags as well. They will be passed to the AllocAslRequest() call
without further interpretation.
\end{deflist}


\subsection{Popasl.mui/MUIA\_Popasl\_Active}
\rule{\textwidth}{1mm}
\vspace{0.5cm}
\begin{deflist}{MMMMMMMM}
\item[\bf NAME]
\begin{description}
\item[MUIA\_Popasl\_Active]  -- (V7 ) [..G], BOOL
\end{description}

\item[\bf FUNCTION]
Popasl creates asynchronous popups. Requesters are opened in a
seperately spawned task and don't disturb the rest of the
application. You can ask for the state of a requester by
querying the MUIA\_Popasl\_Active attribute. It will return
TRUE when the requester is currently open, FALSE otherwise.

Common use for this attribute is to prevent an application
from being terminated while a requester is open. If you
try to dispose the popasl object with a currently open
requester, MUI will freeze your task as long as the requester
stays there.

\item[\bf EXAMPLE]
\begin{flushleft}
\begin{verbatim}
case MUIV_Application_ReturnID_Quit:
{
   LONG active;

   get(pop1,MUIA_Popasl_Active,&active);
   if (!active) get(pop2,MUIA_Popasl_Active,&active);
   if (!active) get(pop3,MUIA_Popasl_Active,&active);
   if (!active) get(pop4,MUIA_Popasl_Active,&active);

   if (active)
      MUI_Request(app,window,0,NULL,"OK",
                  "Cannot quit now, still some asl popups opened.");
   else
      running = FALSE;
}
break;
\end{verbatim}
\end{flushleft}
\item[\bf SEE ALSO]
MUIA\_Popasl\_StartHook, MUIA\_Popasl\_StopHook, MUIA\_Popasl\_Type
\end{deflist}


\subsection{Popasl.mui/MUIA\_Popasl\_StartHook}
\rule{\textwidth}{1mm}
\vspace{0.5cm}
\begin{deflist}{MMMMMMMM}
\item[\bf NAME]
\begin{description}
\item[MUIA\_Popasl\_StartHook]  -- (V7 ) [ISG], struct Hook *
\end{description}

\item[\bf FUNCTION]
Before popasl class opens the asl requester, it has to
get some kind of parameters describing its initial contents.
A file popup would e.g. need to split the string gadgets
contents into path and file name part and pass these
as ASLFR\_InititalFile and ASLFR\_InitialDrawer to the
requester.

The MUIA\_Popasl\_StartHook tag describes a hook function
that will be called immediately before the requester is
opened. It will receive a pointer to itself in A0,
a pointer to the popasl object in A2 and a pointer to
a taglist in A1. This taglist already contains some
tags:

ASLFR/FO/...\_Screen          : parent screen
ASLFR/FO/...\_PrivateIDCMP    : TRUE
ASLFR/FO/...\_InititalLeftEdge: left edge of popasl object
ASLFR/FO/...\_InititalTopEdge : bottom edge of popasl object
ASLFR/FO/...\_InititalWidth   : width of popasl object, only
                               present when the popup is called
                               for the first time.

You may add other tags to the list, but beware that the
maximum allowed number of tags is 15. If you need more,
use the TAG\_MORE tag.

Since the asl requester will run in a seperate task, you should
not change the state of the ASLFR\_PrivateIDCMP tag!

If your hook returns TRUE, popasl class opens the requester
with the given taglist. A return value of FALSE should be
used when something went wrong, no requester will be opened
in this case.

For file and font requester, popasl class will fall back to a
default tag handling when no start hook is specified. A file
name is automatically split into path and file part and passed
to the requester a ASLFR\_InitialFile and ASLFR\_InitialDrawer.
A font requester splits a string like "'topaz/8"' into
font name and size for ASLFO\_InitialName and ASLFO\_InitialSize.

\item[\bf SEE ALSO]
MUIA\_Popasl\_StopHook, MUIA\_Popasl\_Type
\end{deflist}


\subsection{Popasl.mui/MUIA\_Popasl\_StopHook}
\rule{\textwidth}{1mm}
\vspace{0.5cm}
\begin{deflist}{MMMMMMMM}
\item[\bf NAME]
\begin{description}
\item[MUIA\_Popasl\_StopHook]  -- (V7 ) [ISG], struct Hook *
\end{description}

\item[\bf FUNCTION]
When the requester terminates, MUIA\_Popasl\_StopHook will be
called with a pointer to itself in A0, a pointer to the
popasl object in A2 and a pointer to the asl requester
structure in A1. The hook can then parse the requester
structure and set the string gadgets contents respectively.

For file and font requesters, a default handling is provided.

\item[\bf SEE ALSO]
MUIA\_Popasl\_StartHook, MUIA\_Popasl\_Type
\end{deflist}


\subsection{Popasl.mui/MUIA\_Popasl\_Type}
\rule{\textwidth}{1mm}
\vspace{0.5cm}
\begin{deflist}{MMMMMMMM}
\item[\bf NAME]
\begin{description}
\item[MUIA\_Popasl\_Type]  -- (V7 ) [I.G], ULONG
\end{description}

\item[\bf FUNCTION]
This tag allows to set the type of asl requester. Pass
the same value you would use for AllocAslRequest(), e.g.
ASL\_FileRequest, ASL\_FontRequest or ASL\_ScreenModeRequest.

For ASL\_FileRequest and ASL\_FontRequest, popasl class offers a
a standard start/stop handling. When a file requester is opened,
MUI splits the string gadgets contents into a path and a file
name and uses these as initial paremeters for the requester.
Font popups translate a font into a name/size pair, e.g.
"'topaz/8"'. You can override these translations by specifying
a MUIA\_Popasl\_StartHook and a MUIA\_Popasl\_StopHook.

For ASL\_ScreenModeRequest, no standard handling is available.
Using such a popup without Start and Stop hooks won't make
much sense.

\item[\bf SEE ALSO]
MUIA\_Popasl\_StartHook, MUIA\_Popasl\_StopHook
\end{deflist}


%---------------- End of File ----------
