home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / misc / vcb10a.lha / vcxtest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-29  |  2.7 KB  |  106 lines

  1. /*
  2.  *    COPYRIGHT
  3.  *        The material published in this distribution is Freeware.
  4.  *        Copyright ⌐ 1992 remains at the author, Stefan Reisner.
  5.  *        
  6.  *        It may only be passed on unmodified and in its present
  7.  *        composition. In particular, this copyright notice must be
  8.  *        included and must be intact.
  9.  */
  10. #include <functions.h>
  11. #include <vcb/vcx.h>
  12.  
  13. /* #define VERTICAL */
  14.  
  15. struct Library *GfxBase, *IntuitionBase, *UtilityBase;
  16.  
  17. void main( void )
  18. {
  19.     Class *class;
  20.     Object *object;
  21.     struct Gadget *glist = NULL;
  22.     struct Screen *screen;
  23.     struct Window *window;
  24.  
  25.     if( GfxBase = OpenLibrary( "graphics.library", 0 ) )
  26.     {
  27.         if( IntuitionBase = OpenLibrary( "intuition.library", 0 ) )
  28.         {
  29.             if( UtilityBase = OpenLibrary( "utility.library", 0 ) )
  30.             {
  31.                 if( screen = LockPubScreen( NULL ) )
  32.                 {
  33.                     if( class = initVCXClass() )
  34.                     {
  35.                         if( object = NewObject( class, NULL,
  36. #ifdef VERTICAL
  37.                             GA_RelRight, -17,
  38.                             GA_Top, screen->WBorTop + screen->Font->ta_YSize + 1,
  39. #else
  40.                             GA_RelBottom, -9,
  41.                             GA_Left, screen->WBorLeft,
  42. #endif
  43. #ifdef VERTICAL
  44.                             GA_RelHeight, - screen->WBorTop - screen->Font->ta_YSize - 1 - 9,
  45. #else
  46.                             GA_RelWidth, - screen->WBorLeft - 17,
  47. #endif
  48.                             GA_Previous, (ULONG)&glist,
  49. #ifdef VERTICAL
  50.                             GA_RightBorder, 1,
  51. #else
  52.                             GA_BottomBorder, 1,
  53. #endif
  54.                             PGA_Total, 3,
  55.                             PGA_Top, 1,
  56.                             PGA_Visible, 1,
  57. #ifdef VERTICAL
  58.                             PGA_Freedom, FREEVERT,
  59. #else
  60.                             PGA_Freedom, FREEHORIZ,
  61. #endif
  62.                             SYSIA_DrawInfo, GetScreenDrawInfo( screen ),
  63.                             TAG_DONE ) )
  64.                         {
  65.                             if( window = OpenWindowTags( NULL,
  66.                                 WA_Gadgets, glist,
  67.                                 WA_Height, 250,
  68.                                 WA_MinWidth, 200,
  69.                                 WA_MinHeight, 100,
  70.                                 WA_CloseGadget, 1,
  71.                                 WA_SizeGadget, 1,
  72.                                 WA_DepthGadget, 1,
  73.                                 WA_DragBar, 1,
  74.                                 WA_IDCMP, IDCMP_CLOSEWINDOW,
  75.                                 TAG_DONE ) )
  76.                             {
  77.                                 WaitPort( window->UserPort );
  78.                                 ReplyMsg( GetMsg( window->UserPort ) );
  79.                                 SetGadgetAttrs( (struct Gadget *)object, window, NULL,
  80.                                     PGA_Total, 5, TAG_DONE );
  81.                                 WaitPort( window->UserPort );
  82.                                 ReplyMsg( GetMsg( window->UserPort ) );
  83.                                 SetGadgetAttrs( (struct Gadget *)object, window, NULL,
  84.                                     PGA_Total, 25, TAG_DONE );
  85.                                 WaitPort( window->UserPort );
  86.                                 ReplyMsg( GetMsg( window->UserPort ) );
  87.                                 SetGadgetAttrs( (struct Gadget *)object, window, NULL,
  88.                                     PGA_Top, 0, TAG_DONE );
  89.                                 WaitPort( window->UserPort );
  90.                                 ReplyMsg( GetMsg( window->UserPort ) );
  91.                                 CloseWindow( window );
  92.                             }
  93.                             DisposeObject( object );
  94.                         }
  95.                         freeVCXClass( class );
  96.                     }
  97.                     UnlockPubScreen( NULL, screen );
  98.                 }
  99.                 CloseLibrary( UtilityBase );
  100.             }
  101.             CloseLibrary( IntuitionBase );
  102.         }
  103.         CloseLibrary( GfxBase );
  104.     }
  105. }
  106.