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

  1. TABLE OF CONTENTS
  2.  
  3. Popobject.mui/Popobject.mui
  4. Popobject.mui/MUIA_Popobject_Follow
  5. Popobject.mui/MUIA_Popobject_Light
  6. Popobject.mui/MUIA_Popobject_Object
  7. Popobject.mui/MUIA_Popobject_ObjStrHook
  8. Popobject.mui/MUIA_Popobject_StrObjHook
  9. Popobject.mui/MUIA_Popobject_Volatile
  10. Popobject.mui/MUIA_Popobject_WindowHook
  11. Popobject.mui/Popobject.mui
  12.  
  13.     Popobject class takes a MUI object as parameter uses this one
  14.     as popup. You can e.g. simply create a listview object with
  15.     some entries and the popobject class will create a window
  16.     around it and display it when the user hits the popup button.
  17.  
  18.     Using this class instead of creating the popup windows yourself
  19.     prevents you from having lots of problems. Think twice before
  20.     deciding to make you own popups!
  21. Popobject.mui/MUIA_Popobject_Follow
  22.  
  23.     NAME
  24.     MUIA_Popobject_Follow -- (V7 ) [ISG], BOOL
  25.  
  26.     FUNCTION
  27.     Setting this attribute causes the popup window to follow its
  28.     parent window when its moved. Defaults to TRUE.
  29.  
  30.     SEE ALSO
  31.     MUIA_Popobject_Light, MUIA_Popobject_Volatile.
  32. Popobject.mui/MUIA_Popobject_Light
  33.  
  34.     NAME
  35.     MUIA_Popobject_Light -- (V7 ) [ISG], BOOL
  36.  
  37.     FUNCTION
  38.     This attribute causes the popup window to be border and
  39.     titleless. Defaults to TRUE
  40.  
  41.     SEE ALSO
  42.     MUIA_Popobject_Follow, MUIA_Popobject_Volatile
  43. Popobject.mui/MUIA_Popobject_Object
  44.  
  45.     NAME
  46.     MUIA_Popobject_Object -- (V7 ) [I.G], Object *
  47.  
  48.     FUNCTION
  49.     Specify the object to pop up. Usually this is a relatively simple
  50.     thing like a single listview, but you can of course use group
  51.     class here and make rather complex popups. As with all other
  52.     MUI classes, the object here gets disposed when the popobject
  53.     is disposed.
  54.  
  55.     EXAMPLE
  56.     pop = PopobjectObject,
  57.        MUIA_Popstring_String, KeyString(0,60,'n'),
  58.        MUIA_Popstring_Button, PopButton(MUII_PopUp),
  59.        MUIA_Popobject_StrObjHook, &StrObjHook,
  60.        MUIA_Popobject_ObjStrHook, &ObjStrHook,
  61.        MUIA_Popobject_Object, ListviewObject,
  62.           MUIA_Listview_List, ListObject,
  63.              InputListFrame,
  64.              MUIA_List_SourceArray, PopNames,
  65.              End,
  66.           End,
  67.        End;
  68.  
  69.    SEE ALSO
  70.     MUIA_Popobject_StrObjHook, MUIA_Popobject_ObjStrHook,
  71.     MUIA_Popobject_Light
  72. Popobject.mui/MUIA_Popobject_ObjStrHook
  73.  
  74.     NAME
  75.     MUIA_Popobject_ObjStrHook -- (V7 ) [ISG], struct Hook *
  76.  
  77.     FUNCTION
  78.     When a popup is closed, this hook is called. You can examine
  79.     the state of your MUIA_Popobject_Object and set the contents
  80.     of the string gadget respectively. The hook receives a pointer
  81.     to itself in A0, a pointer to your MUIA_Popobject_Object
  82.     in A2 and a pointer to the embedded string object in A1.
  83.  
  84.     The hook will only be called when your popup is closed with
  85.     a success value of TRUE. Otherwise, MUI closes the popup
  86.     without taking further actions, just as if had never opened.
  87.  
  88.     Since MUI doesn't know anything about your MUIA_Popobject_Object,
  89.     it's your task to tell when your popup is finished. You can
  90.     terminate popups at anytime by sending a MUIM_Popstring_Close
  91.     method:
  92.  
  93.     /* A double click terminates the popping list with a successful 
  94.        return value. */
  95.  
  96.     DoMethod(plist,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE,
  97.         pop,2,MUIM_Popstring_Close,TRUE);
  98.  
  99.     EXAMPLE
  100.     SAVEDS ASM VOID ObjStrFunc(REG(a2) Object *list,REG(a1) Object *str)
  101.     {
  102.        char *x;
  103.        DoMethod(list,MUIM_List_GetEntry,MUIV_List_GetEntry_Active,&x);
  104.        set(str,MUIA_String_Contents,x);
  105.     }
  106. Popobject.mui/MUIA_Popobject_StrObjHook
  107.  
  108.     NAME
  109.     MUIA_Popobject_StrObjHook -- (V7 ) [ISG], struct Hook *
  110.  
  111.     FUNCTION
  112.     Before the popup opens, this hook is called. You can use it
  113.     to prepare your MUIA_Popobject_Object according to the
  114.     contents of the string gadget. The hook receives a pointer
  115.     to itself in A0, a pointer to your MUIA_Popobject_Object
  116.     in A2 and a pointer to the embedded string object in A1.
  117.  
  118.     Return TRUE if you want the popup to appear,
  119.     FALSE otherwise.
  120.  
  121.     EXAMPLE
  122.     SAVEDS ASM LONG StrObjFunc(REG(a2) Object *list,REG(a1) Object *str)
  123.     {
  124.        char *x,*s;
  125.        int i;
  126.  
  127.        get(str,MUIA_String_Contents,&s);
  128.  
  129.        for (i=0;;i++)
  130.        {
  131.           DoMethod(list,MUIM_List_GetEntry,i,&x);
  132.           if (!x)
  133.           {
  134.              set(list,MUIA_List_Active,MUIV_List_Active_Off);
  135.              break;
  136.           }
  137.           else if (!stricmp(x,s))
  138.           {
  139.              set(list,MUIA_List_Active,i);
  140.              break;
  141.           }
  142.        }
  143.        return(TRUE);
  144.     }
  145.  
  146.     SEE ALSO
  147.     MUIA_Popobject_ObjStrHook, MUIA_Popobject_Object, 
  148.     MUIA_Popobject_WindowHook
  149. Popobject.mui/MUIA_Popobject_Volatile
  150.  
  151.     NAME
  152.     MUIA_Popobject_Volatile -- (V7 ) [ISG], BOOL
  153.  
  154.     FUNCTION
  155.     Setting this attribute causes the popup window to disappear when the
  156.     corresponding popobject disappears, e.g. because its in a page group
  157.     and the user toggled the page. When the popobject appears again,
  158.     the popup window appears also. Defaults to TRUE.
  159.  
  160.     SEE ALSO
  161.     MUIA_Popobject_Light, MUIA_Popobject_Follow
  162. Popobject.mui/MUIA_Popobject_WindowHook
  163.  
  164.     NAME
  165.     MUIA_Popobject_WindowHook -- (V9 ) [ISG], struct Hook *
  166.  
  167.     FUNCTION
  168.     If specified, this hook is called immediately after the
  169.     popups window objects has been created but before this
  170.     window is opened. You might e.g. want to add a cycle
  171.     chain for the popup window here.
  172.  
  173.     The hook is called with a pointer to the pop object
  174.     (MUIA_Popobject_Object) in A2 and with a pointer
  175.     to the window object that MUI generated to
  176.     handle the popup in A1.
  177.  
  178.     EXAMPLE
  179.     /* pop is a simple listview, just set the windows
  180.     ** default object to this to enable keyboard control */
  181.  
  182.     SAVEDS ASM VOID WindowFunc(REG(a2) Object *pop,REG(a1) Object *win)
  183.     {
  184.        set(win,MUIA_Window_DefaultObject,pop);
  185.     }
  186.  
  187.     SEE ALSO
  188.     MUIA_Popobject_ObjStrHook, MUIA_Popobject_Object
  189.