home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 18 / amigaformatcd18.iso / mui / mui_developer / autodocs / mui_popstring.doc < prev    next >
Text File  |  1997-03-10  |  6KB  |  182 lines

  1. TABLE OF CONTENTS
  2.  
  3. Popstring.mui/Popstring.mui
  4. Popstring.mui/MUIA_Popstring_Button
  5. Popstring.mui/MUIA_Popstring_CloseHook
  6. Popstring.mui/MUIA_Popstring_OpenHook
  7. Popstring.mui/MUIA_Popstring_String
  8. Popstring.mui/MUIA_Popstring_Toggle
  9. Popstring.mui/MUIM_Popstring_Close
  10. Popstring.mui/MUIM_Popstring_Open
  11. Popstring.mui/Popstring.mui
  12.  
  13.     Popstring class is the base class for creating so called
  14.     popup objects. Usually, a popup consists of a string or
  15.     text gadget, followed by a little button. Pressing this
  16.     button brings up a little window with a listview and lets
  17.     the user choose an entry with the mouse.
  18.  
  19.     Popstring class features the basic functions for creating
  20.     such objects. Given a string object and a button object,
  21.     it places them horizontally and sets up some notification.
  22.     Whenever the popup button is pressed, a hook will be called 
  23.     which itself should open and prepare the popup window.
  24.  
  25.     The string and the button object are not created by popstring
  26.     class, they have to be supplied as attributes during object
  27.     creation time. This makes popstring class very flexible,
  28.     one could e.g. use a text object instead of a string or
  29.     a popup button with some text in it.
  30.  
  31.     However, creating simple popups with popstring class would
  32.     be too much overhead. Instead of using it directly, you
  33.     should have a look at one of its subclasses. They offer
  34.     a more specialized set of popups and are a lot easier
  35.     to use.
  36. Popstring.mui/MUIA_Popstring_Button
  37.  
  38.     NAME
  39.     MUIA_Popstring_Button -- (V7 ) [I.G], Object *
  40.  
  41.     FUNCTION
  42.     Specify the button object to be used in the popup. Depending
  43.     on the type of your popup, you should use an image button
  44.     with MUII_PopUp, MUII_PopFile or MUII_PopDrawer here.
  45.     However, its also possible to have a button with some
  46.     text or other things in it.
  47.  
  48.     When the popstring object is disposed, the string
  49.     and the button objects are disposed as well.
  50.  
  51.     EXAMPLE
  52.     pop = PopstringObject,
  53.        MUIA_Popstring_String, KeyString(0,60,'n'),
  54.        MUIA_Popstring_Button, PopButton(MUII_PopUp),
  55.        MUIA_Popstring_OpenHook, &OpenHook,
  56.        MUIA_Popstring_CloseHook, &CloseHook,
  57.        End;
  58.  
  59.     SEE ALSO
  60.     MUIA_Popstring_String, MUIA_Popstring_OpenHook, MUIA_Popstring_CloseHook
  61. Popstring.mui/MUIA_Popstring_CloseHook
  62.  
  63.     NAME
  64.     MUIA_Popstring_CloseHook -- (V7 ) [ISG], struct Hook *
  65.  
  66.     FUNCTION
  67.     Whenever the popup receives a MUIM_Popstring_Close method and
  68.     the popup is currently opened, this hook will be called. 
  69.     It will receive a pointer to itself in register A0, a pointer
  70.     to the complete popup object in A2 and a pointer to a
  71.     struct
  72.     {
  73.        Object *stringobject;
  74.        LONG success;
  75.     },
  76.     in A1. The success parameter is a copy of the methods success
  77.     parameter and indicates whether the popup was closed successfully
  78.     (e.g. with a double click in a listview) or was just cancelled
  79.     (e.g. by pressing the popup button again for toggle popups).
  80.  
  81.     Due to internal message handling issues, calling the close hook is
  82.     delayed until the next MUIM_HandleInput method is called. This
  83.     allows you to remove and dispose windows without danger.
  84.  
  85.     SEE ALSO
  86.     MUIA_Popstring_OpenHook, MUIM_Popstring_Open, MUIM_Popstring_Close
  87. Popstring.mui/MUIA_Popstring_OpenHook
  88.  
  89.     NAME
  90.     MUIA_Popstring_OpenHook -- (V7 ) [ISG], struct Hook *
  91.  
  92.     FUNCTION
  93.     Whenever the popup receives a MUIM_Popstring_Open method,
  94.     this hook will be called. It will receive a pointer to itself in
  95.     register A0, a pointer to the complete popup object in A2 and
  96.     a pointer to a pointer (!) to the string object contained in
  97.     the popup object in A1.
  98.  
  99.     When this hook returns TRUE, MUI assumes the popup was opened
  100.     succesfully and will disabled the popup button (as long as
  101.     MUIA_Popstring_Toggle is not set). Return FALSE to indicate
  102.     that something went wrong and the popup could not be opened.
  103.  
  104.     SEE ALSO
  105.     MUIA_Popstring_CloseHook, MUIM_Popstring_Open, MUIM_Popstring_Close
  106. Popstring.mui/MUIA_Popstring_String
  107.  
  108.     NAME
  109.     MUIA_Popstring_String -- (V7 ) [I.G], Object *
  110.  
  111.     FUNCTION
  112.     Specify the string object to be used in the popup.
  113.     This does not necessarily need to be a real string
  114.     object, using text objects or even complete groups
  115.     of other objects is perfectly ok.
  116.  
  117.     When the popstring object is disposed, the string
  118.     and the button objects are disposed as well.
  119.  
  120.     EXAMPLE
  121.     pop = PopstringObject,
  122.        MUIA_Popstring_String, KeyString(0,60,'n'),
  123.        MUIA_Popstring_Button, PopButton(MUII_PopUp),
  124.        MUIA_Popstring_OpenHook, &OpenHook,
  125.        MUIA_Popstring_CloseHook, &CloseHook,
  126.        End;
  127.  
  128.     SEE ALSO
  129.     MUIA_Popstring_Button, MUIA_Popstring_OpenHook, MUIA_Popstring_CloseHook
  130. Popstring.mui/MUIA_Popstring_Toggle
  131.  
  132.     NAME
  133.     MUIA_Popstring_Toggle -- (V7 ) [ISG], BOOL
  134.  
  135.     FUNCTION
  136.     Set/Clear the toggle mode for a popstring object.
  137.     With toggling disabled, the popup button will get
  138.     disabled whenever the user hits it and the popup
  139.     opens. With toggling enabled, the popup button
  140.     always stays enabled and can be used to cancel
  141.     (== close with a FALSE return value) the popup.
  142.  
  143.     SEE ALSO
  144.     MUIA_Popstring_OpenHook
  145. Popstring.mui/MUIM_Popstring_Close
  146.  
  147.     NAME
  148.     MUIM_Popstring_Close (V7 )
  149.  
  150.     SYNOPSIS
  151.     DoMethod(obj,MUIM_Popstring_Close,LONG result);
  152.  
  153.     FUNCTION
  154.     This method closes the popup. In fact, it only calls the
  155.     predefined MUIA_Popstring_CloseHook with the supplied
  156.     success parameter.
  157.  
  158.     EXAMPLE
  159.     DoMethod(poplist,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE,
  160.        popobj,2,MUIM_Popstring_Close,TRUE);
  161. Popstring.mui/MUIM_Popstring_Open
  162.  
  163.     NAME
  164.     MUIM_Popstring_Open (V7 )
  165.  
  166.     SYNOPSIS
  167.     DoMethod(obj,MUIM_Popstring_Open);
  168.  
  169.     FUNCTION
  170.     This method opens the popup. In fact, it only calls the
  171.     predefined MUIA_Popstring_OpenHook and checks its return
  172.     value. In case of TRUE, the popup button object is disabled
  173.     as long as MUIA_Popstring_Toggle is unset.
  174.  
  175.     If the toggle mode is enabled, using MUIA_Popstring_Open on
  176.     a currently opened popup will result in closing this popup
  177.     (i.e. calling the close hook) with a success value of FALSE.
  178.  
  179.     EXAMPLE
  180.     DoMethod(popbutton,MUIM_Notify,MUIA_Pressed,FALSE,
  181.        popobj,1,MUIM_Popstring_Open);
  182.