home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BK-SC1_4.DMS / in.adf / MUIClass.Lha / Demo / Demo3 / HP.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-07-10  |  1.8 KB  |  71 lines

  1. //
  2. //    c 1996 Thomas Wilhelmi
  3. //
  4. //
  5. // Address : Taunusstrasse 14
  6. //           61138 Niederdorfelden
  7. //           Germany
  8. //
  9. //  E-Mail : willi@twi.rhein-main.de
  10. //
  11. //   Phone : +49 (0)6101 531060
  12. //   Fax   : +49 (0)6101 531061
  13. //
  14.  
  15. //
  16. // Dieses Demo-Programm öfnnet ein kleines Fenster
  17. // mit drei Buttons. Wenn das Close-Gadget gedrückt
  18. // wird, wird es wieder geschloßen.
  19. // Hier wird auch demonstriert wie einfach ein eigener
  20. // Dispatcher mit eigenen Methoden für die einzelnen
  21. // Objekte realisiert werden kann.
  22. // Ausserdem wird
  23. //
  24.  
  25. #include <classes/twimui/application.h>
  26. #include <storm/libbase.h>
  27. #include <iostream.h>
  28. #include "Class.h"
  29.  
  30. LibBaseC MUIMasterBase(MUIMASTER_NAME,MUIMASTER_VMIN,FALSE);
  31.  
  32. void main()
  33.     {
  34.     if (LibBaseC::areAllOpen())
  35.         {
  36.         try
  37.             {
  38.             TWiWin Win();
  39.             MUIApplication App(
  40.                 MUIA_Application_Title,       "TWiDVI",
  41.                 MUIA_Application_Version,     "$VER: TWiDVI 1.0 (12.01.96)",
  42.                 MUIA_Application_Copyright,   "c1996, Thomas Wilhelmi",
  43.                 MUIA_Application_Author,      "Thomas Wilhelmi",
  44.                 MUIA_Application_Description, "Little GUI for DVIPrint",
  45.                 MUIA_Application_Base,        "TWIDVI",
  46.                 MUIA_Application_SingleTask,  TRUE,
  47.                 SubWindow,                    (Object *)Win,
  48.                 TAG_DONE);
  49.             Win.Notify(MUIA_Window_CloseRequest, TRUE, App, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  50.             App.Notify(MUIA_Application_DoubleStart, TRUE, App, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  51.             Win.Open(TRUE);
  52.             App.Loop();
  53.             Win.Open(FALSE);
  54.             }
  55.         catch (MUIT(m))
  56.             {
  57.             cout << "MUIErrRequest r(Mui_throw): " << m.typ() << endl;
  58.             }
  59.         catch (TWiMemX(x))
  60.             {
  61.             cout << "TWiMemX size: " << x.size() << endl;
  62.             }
  63.         catch (...)
  64.             {
  65.             cout << "unbekannte Exception" << endl;
  66.             }
  67.         }
  68.       else
  69.         cout << "Problem mit Library" << endl;
  70.     };
  71.