#include "FiveWin.ch"
#include "Constant.ch"
#include "rfolder.ch"
function Main()
local oDlg
DEFINE DIALOG oDlg RESOURCE "SUCHFOLDER"
REDEFINE RFOLDER oFld ID 210 of oDlg ;
Prompts "Page 1", "Page 2", "Page 3" ;
DIALOGS "one", "two", "three" ;
Size 300, 300 Pixel POSICAO 3;
ORGANIZE 3, 2, 4 NAME "img1", "img2", "img3", "img4", "img1", "img2", "img3", "img4", "img1" ;
Color CLR_WHITE, nRGB( 117, 174, 162 )
ACTIVATE DIALOG oDlg CENTERED
return nil
#define COLOR_BTNFACE 15
#define FD_BORDER 8
//#define FD_HEIGHT 30
#define FD_TABMARGIN 40
#define DT_CENTER 1
#define TCM_FIRST 4864 // 0x1300
#define TCM_SETIMAGELIST ( TCM_FIRST + 3 )
#define TCM_SETCURSEL ( TCM_FIRST + 12 )
#define TCM_SETITEMSIZE ( TCM_FIRST + 41 )
#define TCM_SETPADDING ( TCM_FIRST + 43 )
#define TCN_FIRST -550
#define TCN_SELCHANGE ( TCN_FIRST - 1 )
#define TCN_SELCHANGING ( TCN_FIRST - 2 )
#define TCS_MULTILINE 512 // 0x0200
#define TCS_OWNERDRAWFIXED 8192 // 0x2000
#ifdef __XPP__
#define Super ::TControl
#define New _New
#endif
//----------------------------------------------------------------------------//
CLASS TRFolder FROM TControl
CLASSDATA lRegistered AS LOGICAL
DATA lStartDeg AS LOGIC INIT .f.
DATA bBlockWnd, nClrMove
DATA nOldOpt AS NUMERIC INIT 0
DATA nClrTextSel, nClrPaneSel, nOldText, nOldPane
DATA aMapaPix AS ARRAY INIT {}
DATA lExact
DATA aCores AS ARRAY INIT {}
DATA nClrFore2, nClrBack2
DATA nCor1, nCor2, nCor3
DATA nOldRow INIT 0
DATA nOldCol INIT 0
DATA aWSay AS ARRAY INIT {}
DATA aHSay AS ARRAY INIT {}
DATA aPrompts, aDialogs
DATA aSays AS ARRAY INIT {}
DATA nOption, nTabSize, nFdHeight
DATA oFont, oFont2, oFont3, oFont4
DATA aEnable
DATA aFiles
DATA aNames
DATA aNames
DATA nAbaPos
DATA oDlg2
DATA aImgs AS ARRAY INIT {}
DATA aLinhas AS ARRAY INIT {}
DATA nLinhas AS NUMERIC INIT 1
DATA aCords AS ARRAY INIT {}
DATA lAllWidth
DATA lDegrade As LOGIC INIT .f.
METHOD New( nTop, nLeft, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
nClrBack, lPixel, nWidth, nHeight,;
cMsg, lAllWidth, oFont, nAbaPos, lExact, aFiles, aNames, aLinhas ) CONSTRUCTOR
METHOD REDEFINE( nID, nTop, nLeft, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
nClrBack, lPixel, nWidth, nHeight,;
cMsg, lAllWidth, oFont, nAbaPos, lExact, aFiles, aNames, aLinhas ) CONSTRUCTOR
METHOD SetPrompts( aPrompts )
METHOD Initiate( hDlg )
METHOD Iniciar()
METHOD Display()
METHOD Disable( nOption )
METHOD Enable( nOption )
METHOD Paint()
METHOD ClickAba(n)
METHOD _Compile( n )
METHOD _Compile2( n )
METHOD PosCol()
METHOD PosRow(nPos)
METHOD ADD( cPrompt )
METHOD DEL( N )
METHOD CORES()
METHOD ClrD( nInd )
METHOD ClrW( nInd, nCor )
METHOD SetCores( aCores )
METHOD Exact()
METHOD NoExact()
METHOD MontaMapa()
METHOD MontaImg()
METHOD ColorSelected( nClrText, nClrPane )
METHOD ClickArea( nRow, nCol, lOK )
METHOD DrawText(hDC,cPrompt,Y,X,nClrText,nClrPane,oFont, i)
METHOD ReposHrz( n )
METHOD PosMove( nRow, nCol, n )
METHOD DrawLine( hDC, nRow, nCol, nWidth, nCor )
METHOD END() INLINE ::oWnd:bMMoved := ::bBlockWnd, Super:END()
METHOD BlockWnd()
METHOD DrawLineDeg( hDC, nCol, nRow, nColF, nRowF, nCor, nHeight )
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nTop, nLeft, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
nClrBack, lPixel, lDesign, nWidth, nHeight, cMsg, lAllWidth,;
oFont, nAbaPos, lExact, aFiles, aNames, aLinhas ) CLASS TRFolder
local n, x, i, aTemp
#ifdef __XPP__
#undef New
#endif
DEFAULT nTop := 0, nLeft := 0,;
aDialogs := {},;
aPrompts := { "&One", "&Two", "T&hree" },;
oWnd := GetWndDefault(),;
nOption := 1,;
nClrFore := CLR_BLACK,;
nClrBack := GetSysColor( COLOR_BTNFACE ),;
lPixel := .f.,;
lDesign := .f.,;
nWidth := 100, nHeight := 100,;
lAllWidth := .f.,;
aNames := {},;
aFiles := {},;
nAbaPos := 1,;
lExact := .f.
if Len( aDialogs ) < Len( aPrompts )
aDialogs = Array( Len( aPrompts ) )
endif
if Len( ::aSays ) < Len( aPrompts )
::aSays := Array( Len( aPrompts ) )
endif
if ::aEnable == nil
::aEnable = Array( Len( aPrompts ) )
AFill( ::aEnable, .t. )
endif
::nStyle = nOR( WS_CHILD, WS_VISIBLE,;
If( lDesign, WS_CLIPSIBLINGS, 0 ),;
WS_TABSTOP /* , TCS_OWNERDRAWFIXED */ )
::nId = ::GetNewId()
::oWnd = oWnd
::aPrompts = aPrompts
::aDialogs = aDialogs
::nOption = nOption
::cMsg = cMsg
::nTop = If( lPixel, nTop, nTop * SAY_CHARPIX_H )
::nLeft = If( lPixel, nLeft, nLeft * SAY_CHARPIX_W )
::nBottom = ::nTop + nHeight - 1
::nRight = ::nLeft + nWidth - 1
::lDrag = lDesign
::lCaptured = .f.
::nAbaPos = nAbaPos
::nClrFore2 = nClrFore
::nClrBack2 = nClrBack
::lExact = lExact
::aFiles = aFiles
::aNames = aNames
::lAllWidth = lAllWidth
if aLinhas <> NIL
if len( aLinhas ) > 1
::nLinhas := len( aLinhas )
i := 1
for n := 1 to ::nLinhas
aTemp := {}
for x := 1 to aLinhas[n]
AADD( aTemp, i )
i++
next
AADD( ::aLinhas, aTemp )
next
endif
endif
if len(::aFiles) > 0
if len(::aFiles) < Len( ::aDialogs )
for n := len(::aFiles) to Len( ::aDialogs )-1
AADD( ::aFiles, "")
next
endif
for n := 1 to len( ::aFiles )
AADD(::aMapaPix, {} )
next
endif
if len(::aNames) > 0
if len(::aNames) < Len( ::aDialogs )
for n := len(::aNames) to Len( ::aDialogs )-1
AADD( ::aNames, "")
next
endif
for n := 1 to len( ::aNames )
AADD(::aMapaPix, {} )
next
endif
::cVarName = ""
::nFdHeight = If( LargeFonts(), 25 , 22 )
::Register()
if oFont != nil
::SetFont( oFont )
elseif oWnd != nil .and. oWnd:oFont != nil
::SetFont( oWnd:oFont )
oFont := oWnd:oFont
else
oFont := ::GetFont()
endif
if ! Empty( oWnd:hWnd )
#ifdef __CLIPPER__
::Create()
::SetPrompts()
#else
::Create()
::SetPrompts()
#endif
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
endif
::oFont := oFont
define font ::oFont2 NAME ::oFont:cFaceName;
SIZE ::oFont:nInpWidth, ::oFont:nInpHeight BOLD
if nAbaPos = 5 .or. nAbaPos = 6
Define Font ::oFont3 Name "Arial" SIZE ::oFont:nInpWidth, ::oFont:nInpHeight NESCAPEMENT 90*10
Define Font ::oFont4 Name "Arial" SIZE ::oFont:nInpWidth, ::oFont:nInpHeight NESCAPEMENT 90*10 BOLD
::oFont3:nQuality := LF_QUALITY
::oFont4:nQuality := LF_QUALITY
else
::oFont3 := ::oFont
::oFont4 := ::oFont2
::oFont3:nQuality := LF_QUALITY
::oFont4:nQuality := LF_QUALITY
endif
SetWndDefault( oWnd )
::Iniciar()
if lExact
::SetColor( oWnd:nClrPane, oWnd:nClrPane )
::oDlg2:SetColor( oWnd:nClrPane, oWnd:nClrPane )
else
::SetColor( nClrFore, nClrBack )
endif
::oDlg2:bPainted := {|| ::Paint() }
::aSays[::nOption]:SetFont(::oFont4)
return Self
//---------------------------------------------------------------------------
METHOD REDEFINE( nID, nTop, nLeft, aPrompts, aDialogs, oWnd, nOption, nClrFore,;
nClrBack, lPixel, lDesign, nWidth, nHeight, cMsg, lAllWidth,;
oFont, nAbaPos, lExact, aFiles, aNames, aLinhas ) CLASS TRFolder
local n, x, i, aTemp
#ifdef __XPP__
#undef New
#endif
DEFAULT nTop := 0, nLeft := 0,;
aDialogs := {},;
aPrompts := { "&One", "&Two", "T&hree" },;
oWnd := GetWndDefault(),;
nOption := 1,;
nClrFore := CLR_BLACK,;
nClrBack := GetSysColor( COLOR_BTNFACE ),;
lPixel := .f.,;
lDesign := .f.,;
nWidth := 100, nHeight := 100,;
lAllWidth := .f.,;
aNames := {},;
aFiles := {},;
nAbaPos := 1,;
lExact := .f.
if Len( aDialogs ) < Len( aPrompts )
aDialogs = Array( Len( aPrompts ) )
endif
if Len( ::aSays ) < Len( aPrompts )
::aSays := Array( Len( aPrompts ) )
endif
if ::aEnable == nil
::aEnable = Array( Len( aPrompts ) )
AFill( ::aEnable, .t. )
endif
::nStyle = nOR( WS_CHILD, WS_VISIBLE,;
If( lDesign, WS_CLIPSIBLINGS, 0 ),;
WS_TABSTOP /* , TCS_OWNERDRAWFIXED */ )
::nId = ::GetNewId()
::oWnd = oWnd
::aPrompts = aPrompts
::aDialogs = aDialogs
::nOption = nOption
::cMsg = cMsg
::nTop = If( lPixel, nTop, nTop * SAY_CHARPIX_H )
::nLeft = If( lPixel, nLeft, nLeft * SAY_CHARPIX_W )
::nBottom = ::nTop + nHeight - 1
::nRight = ::nLeft + nWidth - 1
::lDrag = lDesign
::lCaptured = .f.
::nAbaPos = nAbaPos
::nClrFore2 = nClrFore
::nClrBack2 = nClrBack
::lExact = lExact
::aFiles = aFiles
::aNames = aNames
::lAllWidth = lAllWidth
if aLinhas <> NIL
if len( aLinhas ) > 1
::nLinhas := len( aLinhas )
i := 1
for n := 1 to ::nLinhas
aTemp := {}
for x := 1 to aLinhas[n]
AADD( aTemp, i )
i++
next
AADD( ::aLinhas, aTemp )
next
endif
endif
if len(::aFiles) > 0
if len(::aFiles) < Len( ::aDialogs )
for n := len(::aFiles) to Len( ::aDialogs )-1
AADD( ::aFiles, "")
next
endif
for n := 1 to len( ::aFiles )
AADD(::aMapaPix, {} )
next
endif
if len(::aNames) > 0
if len(::aNames) < Len( ::aDialogs )
for n := len(::aNames) to Len( ::aDialogs )-1
AADD( ::aNames, "")
next
endif
for n := 1 to len( ::aNames )
AADD(::aMapaPix, {} )
next
endif
::cVarName = ""
::nFdHeight = If( LargeFonts(), 25 , 22 )
::Register()
if oFont != nil
::SetFont( oFont )
elseif oWnd != nil .and. oWnd:oFont != nil
::SetFont( oWnd:oFont )
oFont := oWnd:oFont
else
oFont := ::GetFont()
endif
if ! Empty( oWnd:hWnd )
#ifdef __CLIPPER__
::Create()
::SetPrompts()
#else
::Create()
::SetPrompts()
#endif
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
endif
::oFont := oFont
define font ::oFont2 NAME ::oFont:cFaceName;
SIZE ::oFont:nInpWidth, ::oFont:nInpHeight BOLD
if nAbaPos = 5 .or. nAbaPos = 6
Define Font ::oFont3 Name "Arial" SIZE ::oFont:nInpWidth, ::oFont:nInpHeight NESCAPEMENT 90*10
Define Font ::oFont4 Name "Arial" SIZE ::oFont:nInpWidth, ::oFont:nInpHeight NESCAPEMENT 90*10 BOLD
::oFont3:nQuality := LF_QUALITY
::oFont4:nQuality := LF_QUALITY
else
::oFont3 := ::oFont
::oFont4 := ::oFont2
::oFont3:nQuality := LF_QUALITY
::oFont4:nQuality := LF_QUALITY
endif
SetWndDefault( oWnd )
// ::Iniciar()
if lExact
::SetColor( oWnd:nClrPane, oWnd:nClrPane )
::oDlg2:SetColor( oWnd:nClrPane, oWnd:nClrPane )
else
::SetColor( nClrFore, nClrBack )
endif
// ::oDlg2:bPainted := {|| ::Paint() }
// ::aSays[::nOption]:SetFont(::oFont4)
return Self
//---------------------------------------------------------------------------
METHOD SetPrompts( aPrompts ) CLASS TRFolder
local n
if ! Empty( aPrompts )
::aPrompts = aPrompts
endif
return nil
//---------------------------------------------------------------------------
METHOD Paint() Class TRFolder
local oDlg := ::aDialogs[ ::nOption ]
local hPen, hOldPen, nRow, nCol, i, n, nCor
if ::nAbaPos = 1 .or. ::nAbaPos = 3
if len(::aLinhas) > 0
::ReposHrz( ::nOption )
endif
endif
if len(::aImgs) > 0
::MontaMapa()
endif
oDlg:GetDC()
::CORES( ::nOption )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, oDlg:nWidth-1, 0 )
LineTo( oDlg:hDC, oDlg:nWidth-1, oDlg:nHeight-1 )
LineTo( oDlg:hDC, 0, oDlg:nHeight-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, oDlg:nWidth-2, 1 )
LineTo( oDlg:hDC, oDlg:nWidth-2, oDlg:nHeight-2 )
LineTo( oDlg:hDC, 1, oDlg:nHeight-2 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, 0, 0 )
LineTo( oDlg:hDC, oDlg:nWidth-1, 0 )
MoveTo( oDlg:hDC, 0, 0 )
LineTo( oDlg:hDC, 0, ::nHeight-1 )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, 1, 1 )
LineTo( oDlg:hDC, oDlg:nWidth-2, 1 )
MoveTo( oDlg:hDC, 1, 1 )
LineTo( oDlg:hDC, 1, ::nHeight-1 )
DeleteObject( hPen )
oDlg:ReleaseDC()
//*****************POSICAO 1********************//
if ::nAbaPos = 1
oDlg := ::oDlg2
oDlg:GetDC()
*nRow := 0
*nCol := 0
for i := 1 to len( ::aSays )
::CORES( i )
if i = ::nOption
if ::nClrPaneSel <> NIL
nCor := ::nClrPaneSel
else
nCor := ::aCores[i]
endif
else
nCor := ::aCores[i]
endif
nRow := ::aCords[i][1]
nCol := ::aCords[i][2]
::lStartDeg := .t.
hPen := CreatePen( 0, 1, nCor )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i], nRow )
for n := 1 to ::aHSay[i]-1
if n < 3
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+4-n , nRow+n, nCol+::aWSay[i]-4+n, nRow+n , nCor ,::aHSay[i] )
else
MoveTo( oDlg:hDC, nCol+4-n, nRow+n )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4+n, nRow+n )
endif
else
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol, nRow+n , nCol+::aWSay[i], nRow+n , nCor,::aHSay[i])
else
MoveTo( oDlg:hDC, nCol, nRow+n )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+n )
endif
endif
next
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow )
LineTo( oDlg:hDC, nCol+3, nRow )
LineTo( oDlg:hDC, nCol, nRow+3 )
LineTo( oDlg:hDC, nCol, nRow+::aHSay[i] )
*LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-3, nRow+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
if len(::aImgs) >= i
if len(::aMapaPix[i]) = 0
if len( ::aFiles ) > 0
::aImgs[i]:ReLoad( , ::aFiles[i] )
else
::aImgs[i]:LoadImage( ::aNames[i], )
endif
else
::MontaImg(i)
endif
endif
if !::aDialogs[i]:lActive
::aSays[i]:Disable()
if len(::aImgs) >= i
::aImgs[i]:Disable()
endif
else
::aSays[i]:Enable()
if len(::aImgs) >= i
::aImgs[i]:Enable()
endif
endif
if ::aDialogs[i]:lActive .and. !::lDegrade
::aSays[i]:SetColor( ::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane )
SetWindowText( ::aSays[i]:hWnd, ::aSays[i]:cCaption )
else
::DrawText( oDlg:hDC,;
::aPrompts[i],;
::aSays[i]:nTop, ::aSays[i]:nLeft,;
::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane,;
::aSays[i]:oFont, i )
endif
nCol+=::aWSay[i]
next
hPen := CreatePen( 0, 1, oDlg:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, ::nOldCol, ::nOldRow )
LineTo( oDlg:hDC, ::nOldCol, ::nOldRow+::aHSay[1] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
i := ::nOption
::CORES( i )
*nCol := ::PosCol(i)
*nRow := 0
nRow := ::aCords[i][1]
nCol := ::aCords[i][2]
hPen := CreatePen( 0, 1, ::aDialogs[i]:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i] )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i] )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]+1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+1 )
LineTo( oDlg:hDC, nCol+3, nRow+1 )
LineTo( oDlg:hDC, nCol+1, nRow+3 )
LineTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]+2 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i]+2 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-3, nRow)
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+3)
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
::nOldCol := nCol+::aWSay[i]
::nOldRow := nRow
oDlg:ReleaseDC()
endif
//*****************POSICAO 2 / POSICAO 5********************//
if ::nAbaPos = 2 .or. ::nAbaPos = 5
oDlg := ::oDlg2
oDlg:GetDC()
nRow := 0
nCol := 0
for i := 1 to len( ::aSays )
::CORES( i )
if i = ::nOption
if ::nClrPaneSel <> NIL
nCor := ::nClrPaneSel
else
nCor := ::aCores[i]
endif
else
nCor := ::aCores[i]
endif
::lStartDeg := .t.
hPen := CreatePen( 0, 1, nCor )
hOldPen := SelectObject( oDlg:hDc, hPen )
for n := 1 to ::aWSay[i]
if n < 3
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+n, nRow+4-n, nCol+n, nRow+::aHSay[i]-4+n, nCor, ::aWSay[i])
else
MoveTo( oDlg:hDC, nCol+n, nRow+4-n )
lineTo( oDlg:hDC, nCol+n, nRow+::aHSay[i]-4+n )
endif
else
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+n, nRow , nCol+n, nRow+::aHSay[i], nCor, ::aWSay[i])
else
MoveTo( oDlg:hDC, nCol+n, nRow )
lineTo( oDlg:hDC, nCol+n, nRow+::aHSay[i] )
endif
endif
next
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow )
lineTo( oDlg:hDC, nCol+3, nRow )
LineTo( oDlg:hDC, nCol, nRow+3 )
LineTo( oDlg:hDC, nCol, nRow+::aHSay[i]-3 )
*LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-3 )
lineTo( oDlg:hDC, nCol+3, nRow+::aHSay[i]-1 )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
if len(::aImgs) >= i
if len(::aMapaPix[i]) = 0
if len( ::aFiles ) > 0
::aImgs[i]:ReLoad( , ::aFiles[i] )
else
::aImgs[i]:ReLoad( ::aNames[i], )
endif
else
::MontaImg(i)
endif
endif
if !::aDialogs[i]:lActive
::aSays[i]:Disable()
if len(::aImgs) >= i
::aImgs[i]:Disable()
endif
else
::aSays[i]:Enable()
if len(::aImgs) >= i
::aImgs[i]:Enable()
endif
endif
if ::nAbaPos = 2 .and. ::aDialogs[i]:lActive .and. !::lDegrade
::aSays[i]:SetColor( ::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane )
SetWindowText( ::aSays[i]:hWnd, ::aSays[i]:cCaption )
else
*::aSays[i]:Hide()
::DrawText( oDlg:hDC,;
::aPrompts[i],;
::aSays[i]:nTop, ::aSays[i]:nLeft,;
::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane,;
::aSays[i]:oFont, i )
endif
nRow+=::aHSay[i]
next
hPen := CreatePen( 0, 1, oDlg:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, ::nOldCol+3, ::nOldRow )
LineTo( oDlg:hDC, ::nOldCol+::aWSay[1], ::nOldRow )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
i := ::nOption
::CORES( i )
nCol := 0
nRow := ::PosRow( i )
hPen := CreatePen( 0, 1, ::aDialogs[i]:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i], nRow+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i] )
MoveTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow+::aHSay[i] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+4, nRow+::aHSay[i] )
LineTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow+::aHSay[i] )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+3, nRow+::aHSay[i]-1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i], nRow )
lineTo( oDlg:hDC, nCol+3, nRow )
MoveTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow+1 )
lineTo( oDlg:hDC, nCol+3, nRow+1 )
LineTo( oDlg:hDC, nCol+1, nRow+3 )
LineTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
::nOldCol := nCol
::nOldRow := nRow+::aHSay[i]
oDlg:ReleaseDC()
endif
//*****************POSICAO 3********************//
if ::nAbaPos = 3
oDlg := ::oDlg2
oDlg:GetDC()
*nRow := 0
*nCol := 0
for i := 1 to len( ::aSays )
::CORES( i )
if i = ::nOption
if ::nClrPaneSel <> NIL
nCor := ::nClrPaneSel
else
nCor := ::aCores[i]
endif
else
nCor := ::aCores[i]
endif
nRow := ::aCords[i][1]
nCol := ::aCords[i][2]
::lStartDeg := .t.
hPen := CreatePen( 0, 1, nCor )
hOldPen := SelectObject( oDlg:hDc, hPen )
for n := 1 to ::aHSay[i]-if( nRow = 0, 2, 0 )
if n < 3
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+4-n, nRow+::aHSay[i]-n , nCol+::aWSay[i]-4+n, nRow+::aHSay[i]-n , nCor ,::aHSay[i] )
else
MoveTo( oDlg:hDC, nCol+4-n, nRow+::aHSay[i]-n )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4+n, nRow+::aHSay[i]-n )
endif
else
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+1, nRow+::aHSay[i]-n , nCol+::aWSay[i], nRow+::aHSay[i]-n , nCor ,::aHSay[i] )
else
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-n )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]-n )
endif
endif
next
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol, nRow+if( nRow = 0, 2, 0 ) )
LineTo( oDlg:hDC, nCol, nRow+::aHSay[i]-3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-3 )
lineTo( oDlg:hDC, nCol+3, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+3, nRow+::aHSay[i]-1 )
lineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+::aHSay[i]-1 )
lineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i]-4 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+if( nRow = 0, 2, 0 ) )
lineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i]-3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
if len(::aImgs) >= i
if len(::aMapaPix[i]) = 0
if len( ::aFiles ) > 0
::aImgs[i]:ReLoad( , ::aFiles[i] )
else
::aImgs[i]:ReLoad( ::aNames[i], )
endif
else
::MontaImg(i)
endif
endif
::aSays[i]:SetColor( ::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane )
if !::aDialogs[i]:lActive
::aSays[i]:Disable()
if len(::aImgs) >= i
::aImgs[i]:Disable()
endif
else
::aSays[i]:Enable()
if len(::aImgs) >= i
::aImgs[i]:Enable()
endif
endif
if ::aDialogs[i]:lActive .and. !::lDegrade
SetWindowText( ::aSays[i]:hWnd, ::aSays[i]:cCaption )
else
::DrawText( oDlg:hDC,;
::aPrompts[i],;
::aSays[i]:nTop, ::aSays[i]:nLeft,;
::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane,;
::aSays[i]:oFont, i )
endif
nCol+=::aWSay[i]
next
i := ::nOption
::CORES( i )
nRow := ::aCords[i][1]
nCol := ::aCords[i][2]
hPen := CreatePen( 0, 1, ::aDialogs[i]:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+2, nRow )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow )
MoveTo( oDlg:hDC, nCol+2, nRow+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i], nRow )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]-3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+1 )
LineTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-4 )
LineTo( oDlg:hDC, nCol+3, nRow+::aHSay[i]-2 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-3, nRow+::aHSay[i]-2 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i]-5 )
lineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow )
lineTo( oDlg:hDC, nCol+::aWSay[i]+1, nRow )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
oDlg:ReleaseDC()
::nOldCol := nCol+::aWSay[i]
::nOldRow := nRow
endif
//*****************POSICAO 4 / POSICAO 6********************//
if ::nAbaPos = 4 .or. ::nAbaPos = 6
oDlg := ::oDlg2
oDlg:GetDC()
nRow := 0
nCol := 0
for i := 1 to len( ::aSays )
::CORES( i )
if i = ::nOption
if ::nClrPaneSel <> NIL
nCor := ::nClrPaneSel
else
nCor := ::aCores[i]
endif
else
nCor := ::aCores[i]
endif
::lStartDeg := .t.
hPen := CreatePen( 0, 1, nCor )
hOldPen := SelectObject( oDlg:hDc, hPen )
for n := 1 to ::aWSay[i]-3
if n < 3
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow+4-n, nCol+::aWSay[i]-n-1, nRow+::aHSay[i]-4+n, nCor, ::aWSay[i]-3 )
else
MoveTo( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow+4-n )
LineTo( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow+::aHSay[i]-4+n )
endif
else
if ::lDegrade
::DrawLineDeg( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow, nCol+::aWSay[i]-n-1, nRow+::aHSay[i], nCor, ::aWSay[i]-3)
else
MoveTo( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow )
LineTo( oDlg:hDC, nCol+::aWSay[i]-n-1, nRow+::aHSay[i] )
endif
endif
next
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow )
LineTo( oDlg:hDC, nCol+1, nRow )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-3, nRow+1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+3 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-1, nRow+::aHSay[i]-4 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+2, nRow+::aHSay[i]-1)
LineTo( oDlg:hDC, nCol+::aWSay[i]-3, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
if len(::aImgs) >= i
if len(::aMapaPix[i]) = 0
if len( ::aFiles ) > 0
::aImgs[i]:ReLoad( , ::aFiles[i] )
else
::aImgs[i]:ReLoad( ::aNames[i], )
endif
else
::MontaImg(i)
endif
endif
::aSays[i]:SetColor( ::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane )
if !::aDialogs[i]:lActive
::aSays[i]:Disable()
if len(::aImgs) >= i
::aImgs[i]:Disable()
endif
else
::aSays[i]:Enable()
if len(::aImgs) >= i
::aImgs[i]:Enable()
endif
endif
if ::nAbaPos = 4 .and. ::aDialogs[i]:lActive .and. !::lDegrade
SetWindowText( ::aSays[i]:hWnd, ::aSays[i]:cCaption )
else
*::aSays[i]:Hide()
::DrawText( oDlg:hDC,;
::aPrompts[i],;
::aSays[i]:nTop, ::aSays[i]:nLeft,;
::aDialogs[i]:nClrText,;
::aDialogs[i]:nClrPane,;
::aSays[i]:oFont, i )
endif
nRow+=::aHSay[i]
next
*hPen := CreatePen( 0, 1, oDlg:nClrPane )
*hOldPen := SelectObject( oDlg:hDc, hPen )
*MoveTo( oDlg:hDC, ::nOldCol, ::nOldRow+::aHSay[1] )
*LineTo( oDlg:hDC, ::nOldCol+::aWSay[1]-6, ::nOldRow+::aHSay[1] )
*SelectObject( oDlg:hDc, hOldPen )
*DeleteObject( hPen )
i := ::nOption
::CORES( i )
nCol := 0
nRow := ::PosRow( i )
hPen := CreatePen( 0, 1, ::aDialogs[i]:nClrPane )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol, nRow+1 )
LineTo( oDlg:hDC, nCol, nRow+::aHSay[i]-1 )
MoveTo( oDlg:hDC, nCol+1, nRow+1 )
LineTo( oDlg:hDC, nCol+1, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor3 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+1, nRow+::aHSay[i] )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+::aHSay[i] )
LineTo( oDlg:hDC, nCol+::aWSay[i], nRow+::aHSay[i]-4 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol, nRow+::aHSay[i]-1 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+::aHSay[i]-1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor2 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-2, nRow+3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-2, nRow+::aHSay[i]-3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+::aHSay[i]-1 ) //<-
MoveTo( oDlg:hDC, nCol+::aWSay[i]-2, nRow+3 )
LineTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+1 )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
hPen := CreatePen( 0, 1, ::nCor1 )
hOldPen := SelectObject( oDlg:hDc, hPen )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow+1 )
LineTo( oDlg:hDC, nCol-1, nRow+1 )
MoveTo( oDlg:hDC, nCol+::aWSay[i]-4, nRow )
LineTo( oDlg:hDC, nCol, nRow )
SelectObject( oDlg:hDc, hOldPen )
DeleteObject( hPen )
::nOldCol := nCol
::nOldRow := nRow
oDlg:ReleaseDC()
endif
::DrawLine( ::oDlg2:GetDC(), ::aCords[::nOption][1], ::aCords[::nOption][2],;
::aWSay[::nOption], ::aHSay[::nOption], NIL, ::nOption, .t. )
Return NIL
//----------------------------------------------------------------------------//
METHOD Iniciar() CLASS TRFolder
local n, x, nMark, nFols, oDlg, oDlg2, oSay, nRow, nCol, nW, nH, oImg
local nComp := 0, nTemp := 0
if Len(::aFiles ) > 0
nComp := 20
endif
if Len(::aNames ) > 0
nComp := 20
endif
//**********POSICAO 1***********//
if ::nAbaPos = 1
if ::nLinhas = 1
if !::lAllWidth
nW := 0
for n := 1 to len( ::aPrompts )
AADD( ::aWSay, len(::aPrompts[n]) * SAY_CHARPIX_W+16 + nComp )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nW += len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
next
nW+=1
if nW > ::nWidth
nW := ::nWidth
endif
else
nW := Int( (::nWidth)/Len(::aPrompts) )
nTemp := 0
for x := 1 to Len(::aPrompts)-1
AADD( ::aWSay, nW )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nTemp+=nW
next
AADD( ::aWSay, ::nWidth-nTemp-1)
AADD( ::aHSay, SAY_CHARPIX_H+10 )
endif
else
for n := 1 to ::nLinhas
nW := Int( (::nWidth)/Len(::aLinhas[n]) )
nTemp := 0
for x := 1 to Len(::aLinhas[n])-1
AADD( ::aWSay, nW )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nTemp+=nW
next
AADD( ::aWSay, ::nWidth-nTemp-1)
AADD( ::aHSay, SAY_CHARPIX_H+10 )
next
nMark := 1
endif
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM 0, 0 TO ::aHSay[1]*::nLinhas, ::nWidth PIXEL ;
FONT Self:oFont Color ::nClrFore2, ::nClrBack2 STYLE ::nStyle
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+3, nCol+3+nComp Say oSay Var ::aPrompts[n] Size ::aWSay[n]-4-nComp, 16;
of oDlg2 Pixel CENTER Color ::nClrFore2, ::nClrBack2
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
::aSays[n] := oSay
AADD( ::aCords, { nRow, nCol } )
nCol += ::aWSay[n]
if ::nLinhas > 1
nFols := Len(::aLinhas[nMark])
if n >= ::aLinhas[nMark][nFols]
nCol := 0
nRow+=::aHSay[1]
nMark++
endif
endif
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM oDlg2:nBottom-3, 0 TO ::nHeight-2, ::nWidth-2 PIXEL ;
FONT Self:oFont Color ::nClrFore2, ::nClrBack2 STYLE ::nStyle
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
//***************POSICAO 2****************//
if ::nAbaPos = 2
nW := 0
nH := 0
nTemp := 0
for n := 1 to len( ::aPrompts )
if !::lAllWidth
AADD( ::aHSay, SAY_CHARPIX_H+10 )
else
if n < len( ::aPrompts )
AADD( ::aHSay, int(::nHeight/len(::aPrompts)) )
nTemp +=int(::nHeight/len(::aPrompts))
else
AADD( ::aHSay, ::nHeight-nTemp-1 )
endif
endif
if nW < len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
nW := len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
endif
next
for n := 1 to len( ::aPrompts )
AADD( ::aWSay, nW )
next
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM 0, 0 TO ::nHeight, nW PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+5, nCol+5+nComp Say oSay Var ::aPrompts[n] Size ::aWSay[n]-6-nComp, ::aHSay[n]-6;
of oDlg2 Pixel Color ::nClrFore2, ::nClrBack2
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
AADD( ::aCords, { nRow, nCol } )
nRow += ::aHSay[n]
::aSays[n] := oSay
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM 0, oDlg2:nRight-2 TO ::nHeight-2, ::nWidth-2 PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
//****************POSICAO 3********************//
if ::nAbaPos = 3
if ::nLinhas = 1
if !::lAllWidth
nW := 0
for n := 1 to len( ::aPrompts )
AADD( ::aWSay, len(::aPrompts[n]) * SAY_CHARPIX_W+16 + nComp )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nW += len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
next
nW+=1
if nW > ::nWidth
nW := ::nWidth
endif
else
nW := Int( (::nWidth)/Len(::aPrompts) )
nTemp := 0
for x := 1 to Len(::aPrompts)-1
AADD( ::aWSay, nW )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nTemp+=nW
next
AADD( ::aWSay, ::nWidth-nTemp-1)
AADD( ::aHSay, SAY_CHARPIX_H+10 )
endif
else
for n := 1 to ::nLinhas
nW := Int( (::nWidth)/Len(::aLinhas[n]) )
nTemp := 0
for x := 1 to Len(::aLinhas[n])-1
AADD( ::aWSay, nW )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
nTemp+=nW
next
AADD( ::aWSay, ::nWidth-nTemp-1)
AADD( ::aHSay, SAY_CHARPIX_H+10 )
next
nMark := 1
endif
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM ::nHeight-::aHSay[1]*::nLinhas-1 , 0 TO ::nHeight-1, ::nWidth PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+3, nCol+3+nComp Say oSay Var ::aPrompts[n] Size ::aWSay[n]-4-nComp, 16;
of oDlg2 Pixel CENTER Color ::nClrFore2, ::nClrBack2
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
::aSays[n] := oSay
AADD( ::aCords, { nRow, nCol } )
nCol += ::aWSay[n]
if ::nLinhas > 1
nFols := Len(::aLinhas[nMark])
if n >= ::aLinhas[nMark][nFols]
nCol := 0
nRow+=::aHSay[1]
nMark++
endif
endif
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM 0, 0 TO oDlg2:nTop, ::nWidth-2 PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
//***************POSICAO 4****************//
if ::nAbaPos = 4
nW := 0
nH := 0
for n := 1 to len( ::aPrompts )
AADD( ::aHSay, SAY_CHARPIX_H+10 )
if nW < len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
nW := len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp
endif
nH += SAY_CHARPIX_H+10
next
for n := 1 to len( ::aPrompts )
AADD( ::aWSay, nW )
next
nH += 1
if nH > ::nHeight
nH := ::nHeight
endif
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM 0, ::nWidth-nW TO ::nHeight-1, ::nWidth-1 PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+5, nCol+5+nComp Say oSay Var ::aPrompts[n] Size nW-6-nComp, 16;
of oDlg2 Pixel Color ::nClrFore2, ::nClrBack2
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
AADD( ::aCords, { nRow, nCol } )
nRow += ::aHSay[n]
::aSays[n] := oSay
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM 0, 0 TO ::nHeight-2, oDlg2:nLeft PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
//***************POSICAO 5****************//
if ::nAbaPos = 5
nW := 0
nH := 0
nTemp := 0
for n := 1 to len( ::aPrompts )
if !::lAllWidth
AADD( ::aHSay, len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp )
else
if n < len( ::aPrompts )
AADD( ::aHSay, Int(::nHeight/len(::aPrompts)) )
nTemp+=Int(::nHeight/len(::aPrompts) )
else
AADD( ::aHSay, ::nHeight-nTemp-1 )
endif
endif
AADD( ::aWSay, SAY_CHARPIX_H+10 )
next
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM 0, 0 TO ::nHeight, ::aWSay[1] PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+::aHSay[n]-5, nCol+5 Say oSay Var ::aPrompts[n] Size 1, 1;
of oDlg2 Pixel Color ::nClrFore2, ::nClrBack2 Font ::oFont3
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
AADD( ::aCords, { nRow, nCol } )
nRow += ::aHSay[n]
::aSays[n] := oSay
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM 0, oDlg2:nRight-3 TO ::nHeight-2, ::nWidth-2 PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
//***************POSICAO 6****************//
if ::nAbaPos = 6
nW := 0
nH := 0
nTemp := 0
for n := 1 to len( ::aPrompts )
if !::lAllWidth
AADD( ::aHSay, len(::aPrompts[n]) * SAY_CHARPIX_W+16+nComp )
else
if n < len( ::aPrompts )
AADD( ::aHSay, int(::nHeight/len(::aPrompts)) )
nTemp+=int(::nHeight/len(::aPrompts) )
else
AADD( ::aHSay, ::nHeight-nTemp-1 )
endif
endif
AADD( ::aWSay, SAY_CHARPIX_H+12 )
next
DEFINE DIALOG oDlg2 Title "" OF Self;
FROM 0, ::nWidth-::aWSay[1]-1 TO ::nHeight-1, ::nWidth-1 PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
oDlg2:bLClicked := {|nCol, nRow| ::ClickArea( nCol, nRow ) }
ACTIVATE DIALOG oDlg2 NoWait
nRow := 0 ; nCol := 0
for n := 1 to len( ::aPrompts )
if len(::aFiles) >= n .or. len(::aNames) >= n
@ nRow+5, nCol+5 Image oImg Size 16,16 of oDlg2;
NoBorder Pixel ADJUST Transparent
*oImg:lTransparent := .t.
oImg:Progress(.f.)
oImg:bLClicked := ::_Compile( n )
oImg:bMMoved := ::_Compile2( n )
AADD( ::aImgs, oImg )
endif
@ nRow+::aHSay[n]-5, nCol+5 Say oSay Var ::aPrompts[n] Size 1, 1;
of oDlg2 Pixel Color ::nClrFore2, ::nClrBack2 Font ::oFont3
oSay:lWantClick := .t.
oSay:bLClicked := ::_Compile( n )
oSay:bMMoved := ::_Compile2( n )
AADD( ::aCords, { nRow, nCol } )
nRow += ::aHSay[n]
::aSays[n] := oSay
next
for n := 1 to Len( ::aDialogs )
AADD( ::aCores, ::nClrBack2 )
DEFINE DIALOG oDlg Title "" OF Self;
FROM 0, 0 TO ::nHeight-2, oDlg2:nLeft PIXEL ;
FONT Self:oFont STYLE ::nStyle Color ::nClrFore2, ::nClrBack2
::aDialogs[ n ] = oDlg
oDlg:cVarName = "Page" + AllTrim( Str( n ) )
oDlg:bPainted := {|| ::Paint() }
oDlg:bMMoved := {|| ::PosMove( 0, 0 )}
ACTIVATE DIALOG oDlg NoWait
if n <> ::nOption
::aDialogs[n]:Hide()
endif
next
endif
oDlg2:bMMoved := {|nCol, nRow| ::PosMove( nCol, nRow ) }
::oDlg2 := oDlg2
if ::oWnd:bMMoved <> NIL
::bBlockWnd := ::oWnd:bMMoved
endif
::oWnd:bMMoved := { || ::BlockWnd() }
return nil
//---------------------------------------------------------------------------
METHOD Display() CLASS TRFolder
::BeginPaint()
::Paint()
::EndPaint()
return 0
//---------------------------------------------------------------------------
METHOD ClickAba( N ) CLASS TRFolder
local i
if n = ::nOption
Return NIL
endif
if ::nOldText <> NIL
::aDialogs[::nOption]:nClrText := ::nOldText
endif
if ::nOldPane <> NIL
::aDialogs[::nOption]:nClrPane := ::nOldPane
endif
if ::nClrTextSel <> NIL
::nOldText := ::aDialogs[::nOption]:nClrText
::aDialogs[N]:nClrText := ::nClrTextSel
endif
if ::nClrPaneSel <> NIL
::nOldPane := ::aDialogs[::nOption]:nClrPane
::aDialogs[N]:nClrPane := ::nClrPaneSel
endif
::aDialogs[N]:SetColor(::aDialogs[N]:nClrText, ::aDialogs[N]:nClrPane)
::aSays[N]:SetFont( ::oFont4 )
::aDialogs[::nOption]:Hide()
::aSays[::nOption]:SetFont( ::oFont3 )
::nOption := N
::aDialogs[N]:Show()
//::Paint()
Return NIL
//---------------------------------------------------------------------------
METHOD _Compile( n ) CLASS TRFolder
Return {|| ::ClickAba(n) }
//---------------------------------------------------------------------------
METHOD _Compile2( n ) CLASS TRFolder
Return {|| ::PosMove(, ,n) }