home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / CLASSES / GROUP.PRG < prev    next >
Text File  |  1994-06-10  |  2KB  |  76 lines

  1. #include "FiveWin.ch"
  2. #include "Constant.ch"
  3. //----------------------------------------------------------------------------//
  4.  
  5. CLASS TGroup FROM TControl
  6.  
  7.    METHOD New( nTop, nLeft, nBottom, nRight, cLabel, oWnd, nClrText,;
  8.                nClrPane ) CONSTRUCTOR
  9.  
  10.    METHOD ReDefine( nId, cLabel, oWnd, nClrText, nClrPane ) CONSTRUCTOR
  11.  
  12.    METHOD cToChar() INLINE  Super:cToChar( "BUTTON" )
  13.  
  14.    METHOD Init( hDlg )
  15.  
  16. ENDCLASS
  17.  
  18. //----------------------------------------------------------------------------//
  19.  
  20. METHOD New( nTop, nLeft, nBottom, nRight, cLabel, oWnd, nClrText, nClrPane ) ;
  21.                                                                   CLASS TGroup
  22.  
  23.    DEFAULT nClrText := oWnd:nClrText, nClrPane := oWnd:nClrPane
  24.  
  25.    ::nTop     = nTop    * GRP_CHARPIX_H  // 14
  26.    ::nLeft    = nLeft   *  GRP_CHARPIX_W // 7
  27.    ::nBottom  = nBottom * GRP_CHARPIX_H  // 14
  28.    ::nRight   = nRight  * GRP_CHARPIX_W  // 7
  29.    ::cCaption = cLabel
  30.    ::oWnd     = oWnd
  31.    ::nStyle   = nOR( WS_CHILD, WS_VISIBLE, BS_GROUPBOX )
  32.    ::nId      = ::GetNewId()
  33.  
  34.    ::SetColor( nClrText, nClrPane )
  35.  
  36.    if oWnd:lVisible
  37.       ::Create( "BUTTON" )
  38.       oWnd:AddControl( Self )
  39.    else
  40.       oWnd:DefControl( Self )
  41.    endif
  42.  
  43. return nil
  44.  
  45. //----------------------------------------------------------------------------//
  46.  
  47. METHOD ReDefine( nId, cLabel, oWnd, nClrText, nClrPane ) CLASS TGroup
  48.  
  49.    DEFAULT nId      := ::GetNewId(),;
  50.            nClrText := oWnd:nClrText, nClrPane := oWnd:nClrPane
  51.  
  52.    ::nId      = nId
  53.    ::cCaption = cLabel
  54.    ::hWnd     = 0
  55.    ::oWnd     = oWnd
  56.  
  57.    ::SetColor( nClrText, nClrPane )
  58.  
  59.    oWnd:DefControl( Self )
  60.  
  61. return nil
  62.  
  63. //----------------------------------------------------------------------------//
  64.  
  65. METHOD Init( hDlg ) CLASS TGroup
  66.  
  67.    Super:Init( hDlg )
  68.  
  69.    if Empty( ::cCaption )
  70.       ::cCaption = GetWindowText( ::hWnd )
  71.    endif
  72.  
  73. return nil
  74.  
  75. //----------------------------------------------------------------------------//
  76.