home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / WWW / CManager / Docs / Developer / MCCTest.c < prev   
Encoding:
C/C++ Source or Header  |  2000-05-27  |  2.6 KB  |  87 lines

  1. /// Include
  2. #include <exec/types.h>             //  exec
  3. #include <exec/libraries.h>
  4. #include <exec/memory.h>
  5. #include <dos/dos.h>                //  dos
  6. #include <libraries/mui.h>          //  libraries
  7. #include <clib/muimaster_protos.h>  //  clib
  8. #include <clib/alib_protos.h>
  9. #include <proto/exec.h>             //  proto
  10. #include <proto/dos.h>
  11. #include <proto/muimaster.h>
  12.  
  13. #include <string.h>
  14. #include <stdio.h>
  15. #include <ctype.h>
  16.  
  17. #include "CManager_mcc.h"
  18. ///
  19. /// Data
  20. struct Library *MUIMasterBase;
  21. ///
  22.  
  23. /// main
  24. int main( int argc, char *argv[] )
  25. {
  26.     Object *AppObj, *MainWin, *obj;
  27.  
  28.     if(!( MUIMasterBase = OpenLibrary( "muimaster.library", MUIMASTER_VMIN )))
  29.         return( 20 );
  30.  
  31.     if( AppObj = ApplicationObject,
  32.  
  33.                         MUIA_Application_Title,         "CMTest",
  34.                         MUIA_Application_Version,       "$VER: CMTest 1.0 (17.1.99)",
  35.                         MUIA_Application_Copyright,     "Copyright ©1999 by Simone Tellini",
  36.                         MUIA_Application_Author,        "Simone Tellini <wiz@vapor.com>",
  37.                         MUIA_Application_Description,   "CManager.mcc test program",
  38.                         MUIA_Application_Base,          "CMTEST",
  39.  
  40.                         SubWindow, MainWin = WindowObject,
  41.  
  42.                             MUIA_Window_ID,             MAKE_ID( 'M', 'A', 'I', 'N' ),
  43.                             MUIA_Window_Title,          "CMTest - ©1999 Simone Tellini",
  44.  
  45.                             WindowContents, VGroup,
  46.  
  47.                                 Child, obj = CManagerObject,
  48.                                     MUIA_CManager_HideFTP,          TRUE,
  49.                                 End,
  50.                             End,
  51.                         End,
  52.                    End ) {
  53.         ULONG   sigs = 0;
  54.  
  55.         DoMethod( MainWin, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, MUIV_Notify_Application, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit );
  56.  
  57.         // you MUST call the following
  58.         DoMethod( obj, MUIM_CManager_LoadData, NULL, NULL );
  59.  
  60.         set( MainWin, MUIA_Window_Open, TRUE );
  61.  
  62.         while( DoMethod( AppObj, MUIM_Application_NewInput, &sigs ) != MUIV_Application_ReturnID_Quit ) {
  63.             if( sigs ) {
  64.  
  65.                 sigs = Wait( sigs | SIGBREAKF_CTRL_C );
  66.  
  67.                 if( sigs & SIGBREAKF_CTRL_C )
  68.                     break;
  69.             }
  70.         }
  71.  
  72.         get( obj, MUIA_CManager_Changed, &sigs );
  73.  
  74.         if( sigs )
  75.             DoMethod( obj, MUIM_CManager_SaveData, TRUE, NULL );
  76.  
  77.         MUI_DisposeObject( AppObj );
  78.     }
  79.  
  80.     CloseLibrary( MUIMasterBase );
  81.  
  82.     return( 0 );
  83. }
  84. ///
  85.  
  86.  
  87.