home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / utils / dialoglib / vbumper.c < prev    next >
C/C++ Source or Header  |  1993-03-06  |  1KB  |  62 lines

  1. #include <libraries/gadtools.h>
  2. #include <proto/utility.h>
  3. #include "dialog.h"
  4. #ifdef DEBUG1
  5.     #include <stdio.h>
  6. #endif
  7.  
  8. static VOID setupVBumper( DialogElement *de )
  9. {
  10.     LONG height;
  11.  
  12.     if( !de )
  13.         return;
  14.     if( !de->root )
  15.         return;
  16.  
  17.     height = GetTagData( DA_YSpacing, INTERHEIGHT, de->root->taglist );
  18.     setMinHeight( de, height );
  19.     setMaxHeight( de, height );
  20.     setMinLeftExtent( de, 0 );
  21.     setMaxLeftExtent( de, 0 );
  22.     setMinRightExtent( de, 0 );
  23.     setMaxRightExtent( de, 0 );
  24. }
  25.  
  26. #ifdef DEBUG1
  27. VOID debug_layoutVBumper( DialogElement *de, LayoutMessage *lm )
  28. {
  29.     printf(
  30.     "layoutVBumper : x %d, y %d, width %d, height %d, left %d, right %d, top %d, bottom %d\n",
  31.         lm->lm_X, lm->lm_Y, lm->lm_Width, lm->lm_Height,
  32.         lm->lm_Left, lm->lm_Right, lm->lm_Top, lm->lm_Bottom );
  33. }
  34. #endif
  35.  
  36. ULONG dispatchVBumper( struct Hook *hook, DialogElement *de, DialogMessage *dm )
  37. {
  38.     ULONG result;
  39.  
  40.     switch( dm->dm_MethodID )
  41.     {
  42.     case DIALOGM_GETSTRUCT:
  43.         result = DESF_VBaseline;
  44.         break;
  45.     case DIALOGM_SETUP:
  46.         setupVBumper( de );
  47.         break;
  48.     case DIALOGM_LAYOUT:
  49. #ifdef DEBUG1
  50.         debug_layoutVBumper( de, (LayoutMessage *)dm );
  51. #endif
  52.         result = DIALOGERR_OK;
  53.         break;
  54.     case DIALOGM_MATCH:
  55.         result = 0;
  56.         break;
  57.     case DIALOGM_CLEAR:
  58.         break;
  59.     }
  60.     return result;
  61. }
  62.