home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / utils / vcb / vcxtest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-08  |  2.8 KB  |  105 lines

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