home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 038 / dho_9a.zip / WINBASE.CC < prev    next >
Text File  |  1995-01-02  |  3KB  |  119 lines

  1. // Developer Helper Object Set, (C) 1994 Thomas E. Bednarz, Jr.
  2. //  All rights reserved
  3.  
  4.  
  5. #include "winbase.h"
  6.  
  7. //-------------------------------------------------------------------
  8. //  getScreenPS
  9. HPS TWinBase::getScreenPS()
  10. {
  11.    WinGetPS( getFrame() );
  12. }
  13.  
  14. //-------------------------------------------------------------------
  15. //  TWinBase
  16. TWinBase::TWinBase(ULONG resource)
  17. {
  18.    fResource = resource;
  19. }
  20.  
  21. //-------------------------------------------------------------------
  22. //  ~TWinBase
  23. TWinBase::~TWinBase(void)
  24. {
  25.    if (hwndFrame!=(HWND)NULL)
  26.       WinDestroyWindow(hwndFrame);
  27. }
  28.  
  29. //-------------------------------------------------------------------
  30. //   getClassName
  31. const char *TWinBase::getClassName(void)
  32. {
  33.    return "TWinBase";
  34. }
  35.  
  36. //-------------------------------------------------------------------
  37. //   GetFrame
  38. HWND TWinBase::getFrame(void)
  39. {
  40.    return hwndFrame;
  41. }
  42.  
  43.  
  44. //-------------------------------------------------------------------
  45. //   isEnabled
  46. BOOL TWinBase::isEnabled()
  47. {
  48.    return WinIsWindowEnabled( getFrame() );
  49. }
  50.  
  51. //-------------------------------------------------------------------
  52. //   enableUpdate
  53. BOOL TWinBase::enableUpdate(BOOL enable)
  54. {
  55.    WinEnableWindowUpdate( getFrame(),enable);
  56. }
  57.  
  58. //-------------------------------------------------------------------
  59. //   isVisible
  60. BOOL TWinBase::isVisible()
  61. {
  62.    return WinIsWindowVisible( getFrame() );
  63. }
  64.  
  65.  
  66. //-------------------------------------------------------------------
  67. //   setParent
  68. BOOL TWinBase::setParent(TWinBase *parent, BOOL redraw)
  69. {
  70.    BOOL res = WinSetParent( getFrame(), parent->getFrame(), redraw);
  71.    //fParent = parent;
  72.  
  73.    return res;
  74. }
  75.  
  76.  
  77. //-------------------------------------------------------------------
  78. //   isChild
  79. BOOL TWinBase::isChild(TWinBase *parent)
  80. {
  81.    return WinIsChild(getFrame() , parent->getFrame() );
  82. }
  83.  
  84.  
  85. //-------------------------------------------------------------------
  86. //   setWindowPosition
  87. void TWinBase::setWindowPosition(LONG x, LONG y, LONG cx, LONG cy, ULONG fl)
  88. {
  89.    WinSetWindowPos(getFrame(), (HWND) NULL,  x, y, cx, cy, fl);
  90.  
  91. }
  92.  
  93.  
  94. //-------------------------------------------------------------------
  95. //   getWindowPosition
  96. void TWinBase::getWindowPosition(LONG &x, LONG &y, LONG &cx, LONG &cy)
  97. {
  98.    SWP swp;
  99.  
  100.    WinQueryWindowPos( getFrame(),&swp);
  101.    x = swp.x;
  102.    y = swp.y;
  103.    cx = swp.cx;
  104.    cy = swp.cy;
  105.  
  106. }
  107.  
  108.  
  109. //-------------------------------------------------------------------
  110. //   Update
  111. void TWinBase::Update()
  112. {
  113.    WinUpdateWindow(getFrame());
  114.  
  115. }
  116.  
  117.  
  118.  
  119.