home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / internet / stricq / demo.c next >
Encoding:
C/C++ Source or Header  |  1998-10-06  |  4.5 KB  |  137 lines

  1. #define _USE_SYSBASE
  2. #include <proto/exec.h>
  3. #include <proto/muimaster.h>
  4.  
  5. #include "textinput_mcc.h"
  6.  
  7. APTR app, win, ti1, ti2, ti3;
  8.  
  9. #define C1 "The quick brown fox jumps over the lazy dog"
  10. #define C2 "Registered Software License Agreement\n"\
  11. "-------------------------------------\n\n"\
  12. "This agreement governs the license for the software packages\n"\
  13. "AmIRC, AmigaNCP, AmFTP, AmTALK, AmTerm, AmTelnet, Voyager and\n"\
  14. "MicroDot, thereafter refered to as \"the product\".\n\n"\
  15. "AmIRC, AmigaNCP, AmTALK, Voyager and MicroDot are\n"\
  16. "Copyright © 1996-97 by Oliver Wagner, All Rights Reserved.\n\n"\
  17. "AmFTP, AmTerm and AmTelnet are\n"\
  18. "Copyright © 1996-97 by Mathias Mischler, All Rights Reserved.\n\n"\
  19. "AmIRC documentation and AmFTP documentation\n"\
  20. "are Copyright © 1996-97 by Laurence Walton, All Rights Reserved.\n\n"\
  21. "The producer of this software will grant the Licensee a limited,\n"\
  22. "non-exclusive right to use the product and it's associated files on\n"\
  23. "a single machine. The producer will hand out a special identification\n"\
  24. "file called the \"key file\" to the Licensee. This key file will\n"\
  25. "enable the Licensee to fully use the product package according to\n"\
  26. "the terms of this license.\n\n"\
  27. "The key file is strictly for personal use by the Licensee only.\n"\
  28. "Any disclosure of the key file will invalidate the license and\n"\
  29. "the key file itself. The Licensee will be held liable of any\n"\
  30. "damage arising out of the disclosure of the key file.\n\n"\
  31. "The product is provided \"as is\" without warranty of any kind,\n"\
  32. "either express or implied, statutory or otherwise, including\n"\
  33. "without limitation any implied warranties of non-infringement,\n"\
  34. "merchantability and fitness for a particular purpose.\n"\
  35. "The entire risk as to use, results and performance of the product\n"\
  36. "is assumed by the Licensee and should the product prove to be\n"\
  37. "defective, the Licensee assume the entire cost of all necessary\n"\
  38. "servicing, repair or other remediation.\n\n"\
  39. "In no event shall the producer of this product or it's resellers\n"\
  40. "be liable for any property damage, personal injury, loss of use\n"\
  41. "or other indirect, incidental or consequential damages, including\n"\
  42. "without limitation, any damages for lost profits, business\n"\
  43. "interruption  or data which may be lost or rendered inaccurate,\n"\
  44. "even if the producer has been advised of the possibility of such\n"\
  45. "damages.\n\n"\
  46. "This agreement shall exclusively be governed by the laws of the\n"\
  47. "Federal Republic of Germany."
  48.  
  49.  
  50. void main( void )
  51. {
  52.     int Done = FALSE;
  53.     ULONG sig;
  54.  
  55.     app = ApplicationObject,
  56.         MUIA_Application_Title, "TextInputDemo",
  57.         MUIA_Application_Version, "$VER: TextInput Demo 1.1",
  58.         MUIA_Application_Copyright, "© 1997 by Oliver Wagner, All Rights Reserved",
  59.         MUIA_Application_Author, "Oliver Wagner",
  60.         MUIA_Application_Description, "Demo for TextInput.mcc",
  61.         MUIA_Application_Base, "TI-DEMO",
  62.  
  63.         SubWindow, win = WindowObject,
  64.             MUIA_Window_ID, 42,
  65.             MUIA_Window_Title, "TextInput Demo",
  66.             MUIA_Window_RootObject, VGroup,
  67.  
  68.                 Child, HGroup, GroupFrameT( "Single line" ),
  69.  
  70.                     Child, ti1 = TextinputObject, StringFrame, MUIA_CycleChain, 1,
  71.                         MUIA_Textinput_Multiline, FALSE, 
  72.                         //MUIA_Textinput_Contents, C1,
  73.                     End,
  74.  
  75.                 End,
  76.  
  77.                 Child, HGroup, GroupFrameT( "Multi line" ),
  78.  
  79.                     Child, ti2 = TextinputObject, StringFrame, MUIA_CycleChain, 1,
  80.                         MUIA_Textinput_Multiline, TRUE, 
  81.                         MUIA_Textinput_Contents, C2,
  82.                     End,
  83.  
  84.                 End,
  85.  
  86.                 Child, HGroup, GroupFrameT( "Multi line with Scroll" ),
  87.  
  88.                     Child, ti3 = TextinputscrollObject, StringFrame, MUIA_CycleChain, 1,
  89.                         MUIA_Textinput_Multiline, TRUE, 
  90.                         MUIA_Textinput_AutoExpand, TRUE,
  91.                         //MUIA_Textinput_Contents, C2,
  92.                         MUIA_Textinput_MinVersion, 12,
  93.                         MUIA_Textinput_WordWrap, 60,
  94.                     End,
  95.                 End,
  96.  
  97.                 Child, HGroup, GroupFrameT( "Old stringgadget" ),
  98.                     Child, String( C1, 256 ),
  99.                 End,
  100.             End,
  101.         End,
  102.     End;
  103.  
  104.     if( !app )
  105.         exit( 20 );
  106.  
  107.     DoMethod( win, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
  108.         app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
  109.     );
  110.  
  111.     DoMethod( ti1, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
  112.         ti1, 3, MUIM_Set, MUIA_Textinput_Contents, ""
  113.     );
  114.  
  115.     set( win, MUIA_Window_Open, TRUE );
  116.  
  117.     while( !Done )
  118.     {
  119.         LONG id;
  120.  
  121.         id = DoMethod( app, MUIM_Application_Input, &sig );
  122.         switch( id )
  123.         {
  124.             case MUIV_Application_ReturnID_Quit:
  125.                 Done = TRUE;
  126.         }
  127.  
  128.         if( sig )
  129.             if( Wait( sig | SIGBREAKF_CTRL_C ) & SIGBREAKF_CTRL_C )
  130.                 Done = TRUE;
  131.     }
  132.  
  133.     MUI_DisposeObject( app );
  134.  
  135.     exit( 0 );
  136. }
  137.