static function IsAppThemed()
return .F.
#include "FiveWin.ch"
function Main()
DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD
DEFINE FONT oFnt1 NAME "Verdana" SIZE 0, -12
DEFINE DIALOG oDlg SIZE 620, 294 FONT oFnt1 TRANSPARENT ;
STYLE nOr( WS_OVERLAPPEDWINDOW ) //COLOR CLR_BLACK,RGB(196,244,244)
oDlg:SetColor(,9425383)
@ 2, 3 GROUP oGrp TO 150, 150 PROMPT " Group Text " OF oDlg PIXEL TRANSPARENT;
FONT oFnt
@ 65, 3 GROUP oGrp1 TO 150, 150 PROMPT " Second Group Text " OF oDlg PIXEL TRANSPARENT;
FONT oFnt
@ 80, 10 SAY "XXXXXXXXXXXXXXXXXXXXXXXXXX" OF oDlg PIXEL FONT oFnt1 TRANSPARENT
@ 100,10 BUTTON obtnCancel PROMPT "&Cancel" OF oDlg PIXEL SIZE 50,13 ;
ACTION oDlg:End()
oDlg:bResized := {|| RESIZE_IT(oGrp, obtnCancel, oGrp1) }
ACTIVATE DIALOG oDlg CENTERED ON INIT RESIZE_IT(oGrp, obtnCancel, oGrp1)
oFnt:End()
oFnt1:End()
return nil
PROCEDURE RESIZE_IT(oGrp, obtnCancel, oGrp1)
oGrp:nHeight := oDlg:nHeight-80-oGrp:nTop
oGrp:nWidth := oDlg:nWidth-29
oGrp1:nHeight := oDlg:nHeight-80-oGrp1:nTop
oGrp1:nWidth := oDlg:nWidth-29
obtnCancel:nTop := oDlg:nHeight-70
obtnCancel:nLeft := oDlg:nWidth-120
return
METHOD Paint() CLASS TGroup
local aSize, hOldFont
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
if .F. //IsAppThemed() //EMG
aSize = GetLabelDim( ::hWnd, ::cCaption, ::oWnd:oFont:hFont )
hOldFont = SelectObject( ::hDC, ::oWnd:oFont:hFont )
SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
SetBkMode( ::hDC, 1 )
TextOut( ::hDC, 0, 9, ::cCaption, Len( ::cCaption ) )
SelectObject( ::hDC, hOldFont )
endif
return 1
METHOD Paint() CLASS TGroup
local aSize, hOldFont, oFont
CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
if IsAppThemed()
oFont = If( ::oFont != nil, ::oFont, ::oWnd:oFont )
ASize = GetLabelDim( ::hWnd, ::cCaption, oFont:hFont )
hOldFont = SelectObject( ::hDC, oFont:hFont )
SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
SetBkMode( ::hDC, 1 )
TextOut( ::hDC, 0, 9, ::cCaption, Len( ::cCaption ) )
SelectObject( ::hDC, hOldFont )
endif
return 1
//FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 35 guests