FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Transparent Groups on a window
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Transparent Groups on a window

Posted: Sat Jul 11, 2009 01:08 PM
Working example:
Code (fw): Select all Collapse
#include "fivewin.ch"


function Main()

  local oWnd, oGrp1, oGrp2, oBrush

  OnDlg()

  DEFINE BRUSH oBrush STYLE 'TILED'
  DEFINE WINDOW oWnd ;
     TITLE 'Transparent Groups' BRUSH oBrush
     // Try with and without brush

  @ 20, 20 GROUP oGrp1 TO 120,220 PIXEL ;
     PROMPT 'Transparent' OF oWnd ;
     TRANSPARENT

  oGrp1:bEraseBkGnd = { | hDC | SetBrushOrgEx( hDC, 8 - oGrp1:nLeft() % 8, 8 - oGrp1:nTop() % 8 ), FillRect( hDC, GetClientRect( oGrp1:hWnd ), oBrush:hBrush ), 1 }
  
  @ 20,240 GROUP oGrp2 TO 120,440 PIXEL ;
     PROMPT 'Opaque' OF oWnd

  ACTIVATE WINDOW ownd ;
     VALID ( oBrush:End(), .t. )

return nil

function OnDlg()

  local oDlg, oGrp1, oGrp2, oBrush


  DEFINE BRUSH oBrush STYLE 'TILED'
  DEFINE DIALOG oDlg SIZE 460,140 PIXEL ;
     TITLE 'Transparent Groups' BRUSH oBrush


  @ 10, 10 GROUP oGrp1 TO 60,110 PIXEL ;
     PROMPT 'Transparent' OF oDlg ;
     TRANSPARENT
     
  @ 10,120 GROUP oGrp2 TO 60,220 PIXEL ;
     PROMPT 'Opaque' OF oDlg

  ACTIVATE DIALOG oDlg CENTERED ;
     VALID ( oBrush:End(), .t. )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion