home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / demos / programme / StormC / Mui-Class-Lib / Include / Classes / TWiMUI / Popstring.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-06  |  3.1 KB  |  109 lines

  1. //
  2. //  $VER: Popstring.h   1.0 (16 Jun 1996)
  3. //
  4. //    c 1996 Thomas Wilhelmi
  5. //
  6. //
  7. // Address : Taunusstrasse 14
  8. //           61138 Niederdorfelden
  9. //           Germany
  10. //
  11. //  E-Mail : willi@twi.rhein-main.de
  12. //
  13. //   Phone : +49 (0)6101 531060
  14. //   Fax   : +49 (0)6101 531061
  15. //
  16. //
  17. //  $HISTORY:
  18. //
  19. //  16 Jun 1996 :   1.0 : first public Release
  20. //
  21.  
  22. #ifndef CPP_TWIMUI_POPSTRING_H
  23. #define CPP_TWIMUI_POPSTRING_H
  24.  
  25. #ifndef CPP_TWIMUI_GROUP_H
  26. #include <classes/twimui/group.h>
  27. #endif
  28.  
  29. #ifndef UTILITY_HOOKS_H
  30. #include <utility/hooks.h>
  31. #endif
  32.  
  33. class MUIPopstringCloseHook
  34.     {
  35.     private:
  36.         struct MUI_Popstring_CloseHook { Object *str; LONG success; };
  37.         struct Hook closehook;
  38.         static void CloseHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 struct MUI_Popstring_CloseHook *);
  39.         virtual void CloseHookFunc(struct Hook *, Object *, struct MUI_Popstring_CloseHook *);
  40.     protected:
  41.         MUIPopstringCloseHook();
  42.         MUIPopstringCloseHook(const MUIPopstringCloseHook &p);
  43.         ~MUIPopstringCloseHook();
  44.         MUIPopstringCloseHook &operator= (const MUIPopstringCloseHook &);
  45.     public:
  46.         struct Hook *close() { return(&closehook); };
  47.     };
  48.  
  49. class MUIPopstringOpenHook
  50.     {
  51.     private:
  52.         struct Hook openhook;
  53.         static BOOL OpenHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 Object **);
  54.         virtual BOOL OpenHookFunc(struct Hook *, Object *, Object **);
  55.     protected:
  56.         MUIPopstringOpenHook();
  57.         MUIPopstringOpenHook(const MUIPopstringOpenHook &p);
  58.         ~MUIPopstringOpenHook();
  59.         MUIPopstringOpenHook &operator= (const MUIPopstringOpenHook &);
  60.     public:
  61.         struct Hook *open() { return(&openhook); };
  62.     };
  63.  
  64. class MUIPopstring
  65.     :   public MUIGroup,
  66.         public MUIPopstringCloseHook,
  67.         public MUIPopstringOpenHook
  68.     {
  69.     protected:
  70.         MUIPopstring(STRPTR cl)
  71.             :   MUIGroup(cl),
  72.                 MUIPopstringCloseHook(),
  73.                 MUIPopstringOpenHook()
  74.             { };
  75.     public:
  76.         MUIPopstring(const struct TagItem *t)
  77.             :   MUIGroup(MUIC_Popstring),
  78.                 MUIPopstringCloseHook(),
  79.                 MUIPopstringOpenHook()
  80.             {
  81.             init(t);
  82.             };
  83.         MUIPopstring(const Tag, ...);
  84.         MUIPopstring()
  85.             :   MUIGroup(MUIC_Popstring),
  86.                 MUIPopstringCloseHook(),
  87.                 MUIPopstringOpenHook()
  88.             { };
  89.         MUIPopstring(MUIPopstring &p)
  90.             :   MUIGroup(p),
  91.                 MUIPopstringCloseHook(p),
  92.                 MUIPopstringOpenHook(p)
  93.             { };
  94.         virtual ~MUIPopstring();
  95.         MUIPopstring &operator= (MUIPopstring &);
  96.         Object *ButtonO() const { return((Object *)get(MUIA_Popstring_Button)); };
  97.         void CloseHook(const struct Hook *p) { set(MUIA_Popstring_CloseHook,(ULONG)p); };
  98.         struct Hook *CloseHook() const { return((struct Hook *)get(MUIA_Popstring_CloseHook)); };
  99.         void OpenHook(const struct Hook *p) { set(MUIA_Popstring_OpenHook,(ULONG)p); };
  100.         struct Hook *OpenHook() const { return((struct Hook *)get(MUIA_Popstring_OpenHook)); };
  101.         Object *StringO() const { return((Object *)get(MUIA_Popstring_String)); };
  102.         void Toggle(const BOOL p) { set(MUIA_Popstring_Toggle,(ULONG)p); };
  103.         BOOL Toggle() const { return((BOOL)get(MUIA_Popstring_Toggle,FALSE)); };
  104.         void Close(const LONG p) { dom(MUIM_Popstring_Close,(ULONG)p); };
  105.         void Open() { dom(MUIM_Popstring_Open,0); };
  106.     };
  107.  
  108. #endif
  109.