home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / aplusplus-1.01-src.lha / GNU / src / amiga / APlusPlus-1.01 / libsource / GadgetCV.cxx < prev    next >
C/C++ Source or Header  |  1994-04-23  |  2KB  |  73 lines

  1. /******************************************************************************
  2.  **
  3.  **    C++ Class Library for the Amiga© system software.
  4.  **
  5.  **    Copyright (C) 1994 by Armin Vogt  **  EMail: armin@uni-paderborn.de
  6.  **    All Rights Reserved.
  7.  **
  8.  **    $Source: apphome:APlusPlus/RCS/libsource/GadgetCV.cxx,v $
  9.  **    $Revision: 1.3 $
  10.  **    $Date: 1994/04/23 21:01:01 $
  11.  **    $Author: Armin_Vogt $
  12.  **
  13.  ******************************************************************************/
  14.  
  15.  
  16. extern "C" {
  17. #ifdef __GNUG__
  18. #include <inline/intuition.h>
  19. #endif
  20.  
  21. #ifdef __SASC
  22. #include <proto/intuition.h>
  23. #endif
  24. }
  25. #include <APlusPlus/intuition/GadgetCV.h>
  26.  
  27.  
  28. volatile static char rcs_id[] = "$Id: GadgetCV.cxx,v 1.3 1994/04/23 21:01:01 Armin_Vogt Exp Armin_Vogt $";
  29.  
  30.  
  31. GWindow *GadgetCV::redrawSelfHomeWindow = NULL;
  32.  
  33. struct Gadget *GadgetCV::storeGadget(struct Gadget *gadget)
  34. {
  35.     IObject() = gadget;
  36.     if (gadget) gadget->UserData = (APTR)this;
  37.     return gadget;
  38. }
  39.  
  40. struct Gadget *GadgetCV::getGT_Context()
  41. {
  42.     return getHomeWindow()->GT_last;
  43. }
  44.  
  45. BOOL GadgetCV::forceActiveGadget(const IntuiMessageC *imsg)
  46. {
  47.     if (!(imsg->isFakeMsg()))
  48.     {    
  49.         getHomeWindow()->activeGadget = this;
  50.         return TRUE;
  51.     }
  52.     else return FALSE;
  53. }
  54.  
  55. GWindow *GadgetCV::getHomeWindow()
  56. {    
  57.     if (redrawSelfHomeWindow) return redrawSelfHomeWindow;
  58.     else
  59.     {
  60.         GWindow *gwin;
  61.        if (gwin = (GWindow*)findRootOfKind(IOTYPE_GWINDOW))
  62.             return gwin;
  63.         else{ cerr << "Fatal error: no gwindow root!\n"; return NULL; }
  64.     }
  65. }
  66.    
  67. ULONG GadgetCV::getAttribute(Tag tag,ULONG& dataStore)
  68. {
  69.     return GraphicObject::getAttribute(tag,dataStore);
  70. }
  71.  
  72.  
  73.