home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / Triton / Source / classes / dropbox.c < prev    next >
C/C++ Source or Header  |  1998-05-23  |  3KB  |  97 lines

  1. /*
  2.  *  OpenTriton -- A free release of the triton.library source code
  3.  *  Copyright (C) 1993-1998  Stefan Zeiger
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  */
  20.  
  21.  
  22. /****** triton.library/class_DropBox ******
  23. *
  24. *   NAME    
  25. *    class_DropBox -- An icon drop box
  26. *
  27. *   SUPERCLASS
  28. *    class_DisplayObject
  29. *
  30. *   SYNOPSIS
  31. *    TROB_DropBox
  32. *
  33. *   ATTRIBUTES
  34. *    <Default>        : <unused>
  35. *
  36. ******/
  37.  
  38.  
  39. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  40. //////////////////////////////////////////////////////////////////////////////////////// Include our stuff //
  41. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  42.  
  43. #define TR_THIS_IS_TRITON
  44.  
  45. #include <clib/alib_protos.h>
  46. #include <libraries/triton.h>
  47. #include <clib/triton_protos.h>
  48. #include "/internal.h"
  49. #include "dropbox.def"
  50.  
  51.  
  52. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  53. ////////////////////////////////////////////////////////////////////////////////////////////// Object data //
  54. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  55.  
  56. #define OBJECT (&(object->DO.O))
  57. #define DISPLAYOBJECT (&(object->DO))
  58. #define DROPBOX object
  59.  
  60.  
  61. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  62. ////////////////////////////////////////////////////////////////////////////////////////////////// Methods //
  63. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  64.  
  65. TR_METHOD(DropBox,NEW,NewData)
  66. {
  67.   if(!TRDP_DisplayObject_NEW(object,messageid,data,metaclass->trc_SuperClass)) return NULL;
  68.   data->project->trp_Flags|=TRWF_APPWINDOW;
  69.  
  70.   DISPLAYOBJECT->MinWidth=84;
  71.   DISPLAYOBJECT->MinHeight=42;
  72.   DISPLAYOBJECT->XResize=TRUE;
  73.   DISPLAYOBJECT->YResize=TRUE;
  74.  
  75.   return (ULONG)object;
  76. }
  77.  
  78.  
  79. TR_SIMPLEMETHOD(DropBox,INSTALL_REFRESH)
  80. {
  81.   ULONG left,top,width,height;
  82.   struct TR_Project *project;
  83.  
  84.   TR_SUPERMETHOD;
  85.   project=OBJECT->Project;
  86.  
  87.   left=DISPLAYOBJECT->Left;
  88.   top=DISPLAYOBJECT->Top;
  89.   width=DISPLAYOBJECT->Width;
  90.   height=DISPLAYOBJECT->Height;
  91.  
  92.   TR_InternalAreaFill(project,NULL,left+1,top+1,left+width-2,top+height-2,TRBF_NONE);
  93.  
  94.   TR_DrawFrame(project,NULL,left,top,width,height,TRFT_ABSTRACT_ICONDROPBOX,FALSE);
  95.   return 1L;
  96. }
  97.