Antonio Linares wrote:Manuel,
La Clase TBtnBmp ya tiene soporte para bitmaps "deshabilitados"
Es la DATA cBmpFile3 y opcionalmente la cBmpFile4 (al pasar el ratón por encima del deshabilitado).
El método GetBmp() de la Clase TBtnBmp selecciona el bitmap correcto a pintar
Static aPnels
//----------------------------------------------------------------------------//
function Main( P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 )
local i, oBrush, oIni, aTest, nTime1, nTime2, cTest, oIcon, cDateFormat
local cOldDir := hb_CurDrive() + ":\" + GetCurDir()
local cDefFile := ""
local oSpl
local nAltoSpl := 680
local cControl := "TPanel"
aPnels := {}
lChDir( cFilePath( GetModuleFileName( GetInstance() ) ) )
if P1 <> nil ; cDefFile += P1 + " " ; endif
if P2 <> nil ; cDefFile += P2 + " " ; endif
if P3 <> nil ; cDefFile += P3 + " " ; endif
if P4 <> nil ; cDefFile += P4 + " " ; endif
if P5 <> nil ; cDefFile += P5 + " " ; endif
if P6 <> nil ; cDefFile += P6 + " " ; endif
if P7 <> nil ; cDefFile += P7 + " " ; endif
if P8 <> nil ; cDefFile += P8 + " " ; endif
if P9 <> nil ; cDefFile += P9 + " " ; endif
if P10 <> nil ; cDefFile += P10 + " " ; endif
if P11 <> nil ; cDefFile += P11 + " " ; endif
if P12 <> nil ; cDefFile += P12 + " " ; endif
if P13 <> nil ; cDefFile += P13 + " " ; endif
if P14 <> nil ; cDefFile += P14 + " " ; endif
if P15 <> nil ; cDefFile += P15 + " " ; endif
cDefFile := STRTRAN( AllTrim( cDefFile ), '"' )
EP_TidyUp()
EP_LinkedToApp()
EP_SetPath( ".\" )
//Einf�ge-Modus einschalten
ReadInsert( .T. )
PUBLIC oER := TEasyReport():new()
//Publics deklarieren
DeclarePublics( cDefFile )
SET DELETED ON
SET CONFIRM ON
SET 3DLOOK ON
SET MULTIPLE OFF
SET DATE FORMAT to "dd.mm.yyyy"
cDateFormat := LOWER(AllTrim( oEr:GetGeneralIni( "General", "DateFormat", "")) )
SET DATE FORMAT IIF( Empty( cDateFormat ), "dd.mm.yyyy", cDateFormat )
//Open Undo database
OpenUndo()
SET HELPFILE to "VRD.HLP"
DEFINE ICON oIcon FILE ".\vrd.ico"
DEFINE BRUSH oBrush RESOURCE "background"
SetDlgGradient( oER:aClrDialogs )
DEFINE WINDOW oEr:oMainWnd VSCROLL ; //FROM 0, 0 to 50, 200 VSCROLL ;
TITLE MainCaption() ;
BRUSH oBrush MDI ;
ICON oIcon ;
MENU BuildMenu()
SET MESSAGE OF oEr:oMainWnd CENTERED 2010
DEFINE MSGITEM oMsgInfo OF oEr:oMainWnd:oMsgBar SIZE 280
oEr:oMainWnd:oMsgBar:KeybOn()
oEr:oMainWnd:oWndClient:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | ;
ER_MouseWheel( nKey, nDelta, nXPos, nYPos ) }
BarMenu()
AAdd( aPnels, nil ) // Esto
aPnels[Len(aPnels)] := TPanel():New( 34, 0, nAltoSpl, 262, oEr:oMainWnd )
oEr:oMainWnd:oLeft := aPnels[Len(aPnels)]
@ 34, 262 SPLITTER oSpl ;
VERTICAL ; // PREVIOUS CONTROLS aPnels[1];
SIZE 0, nAltoSpl ;
PIXEL ;
OF oEr:oMainWnd
ACTIVATE WINDOW oEr:oMainWnd ;
MAXIMIZED ;
ON INIT ( SetMainWnd(), IniMainWindow(), ;
IIF( Empty( oER:cDefIni ), OpenFile(), SetScrollBar() ), ;
StartMessage(), SetSave( .T. ), ClearUndoRedo() ) ;
VALID ( AEVal( aWnd, { |o| if( o <> nil, o:End(), ) } ), AskSaveFiles() )
oEr:oAppFont:End()
oBrush:End()
oGenVar:oAreaBrush:End()
oGenVar:oBarBrush:End()
AEval( oGenVar:aAppFonts, {|x| x:End() } )
AEval( aFonts, {|x| IIF( x <> nil, x:End(), ) } )
CloseUndo()
lChDir( cOldDir )
return nil
//----------------------------------------------------------------------------//
function ClientWindows()
local i, nWnd, cItemDef, cTitle, nWidth, nHeight, nDemoWidth
local lFirstWnd := .F.
local nTop := 0
local nWindowNr := 0
local aIniEntries := GetIniSection( "Areas", oER:cDefIni )
local cAreaFilesDir := CheckPath( oEr:GetDefIni( "General", "AreaFilesDir", "" ) )
local lReticule
nDemoWidth := 0
//Sichern
aVRDSave := ARRAY( 102, 2 )
aVRDSave[101, 1 ] := oER:cDefIni
aVRDSave[101, 2 ] := MEMOREAD( oER:cDefIni )
aVRDSave[102, 1 ] := oER:cGeneralIni
aVRDSave[102, 2 ] := MEMOREAD( oER:cGeneralIni )
//? oEr:oMainWnd:oWndClient:nHeight
for i := 1 to LEN( aIniEntries )
nWnd := EntryNr( aIniEntries[ i ] )
cItemDef := GetIniEntry( aIniEntries,, "",, i )
if nWnd <> 0 .and. !Empty( cItemDef )
if lFirstWnd = .F.
nAktArea := nWnd
lFirstWnd := .T.
endif
if Empty( cAreaFilesDir )
cAreaFilesDir := cDefaultPath
endif
if Empty( cAreaFilesDir )
cAreaFilesDir := cDefIniPath
endif
cItemDef := VRD_LF2SF( AllTrim( cAreaFilesDir + cItemDef ) )
aVRDSave[nWnd, 1 ] := cItemDef
aVRDSave[nWnd, 2 ] := MEMOREAD( cItemDef )
nWindowNr += 1
aAreaIni[nWnd] := IIF( AT( "\", cItemDef ) = 0, ".\", "" ) + cItemDef
cTitle := AllTrim( GetPvProfString( "General", "Title" , "", aAreaIni[nWnd] ) )
oGenVar:aAreaSizes[nWnd] := ;
{ Val( GetPvProfString( "General", "Width", "600", aAreaIni[nWnd] ) ), ;
Val( GetPvProfString( "General", "Height", "300", aAreaIni[nWnd] ) ) }
nWidth := ER_GetPixel( oGenVar:aAreaSizes[nWnd, 1 ] )
nHeight := ER_GetPixel( oGenVar:aAreaSizes[nWnd, 2 ] )
//nDemoWidth := nWidth
//if oGenVar:lFixedAreaWidth = .T.
// nWidth := 1200
//else
nWidth += oEr:nRuler + nAreaZugabe2
//endif
nDemoWidth := Max( nDemoWidth, nWidth )
aWnd[ nWnd ] = ER_MdiChild():New( nTop, oEr:oMainWnd:oWndClient:nLeft + 2 , nHeight + nAreaZugabe,;
nDemoWidth, cTitle, nOr( WS_BORDER ),, oEr:oMainWnd,, .F.,,,,;
oGenVar:oAreaBrush, .T., .F. ,,, , , , , 1 ) // Esto
aWnd[ nWnd ]:nArea = nWnd
aWndTitle[ nWnd ] = cTitle
lReticule = oGenVar:lShowReticule
oGenVar:lShowReticule = .F.
FillWindow( nWnd, aAreaIni[nWnd] )
ACTIVATE WINDOW aWnd[ nWnd ] ;
VALID !GETKEYSTATE( VK_ESCAPE )
oGenVar:lShowReticule := lReticule
nTop += nHeight + nAreaZugabe
endif
next
nTotalHeight := nTop
nTotalWidth := nWidth
ItemList( aPnels[1] ) // Esto
return .T.
//----------------------------------------------------------------------------//
function ItemList( oDlg )
//local oDlg
local oTree
local oImageList, oBmp1, oBmp2
local lDlg := .T.
if empty( oDlg )
DEFINE DIALOG oDlg RESOURCE "Itemlist" TITLE GL("Item List")
oTree := TTreeView():ReDefine( 201, oDlg, 0, , .F. ,"" )
oTree:bLDblClick = { | nRow, nCol, nKeyFlags | ClickListTree( oTree ) }
oTree:bEraseBkGnd = { || nil } // to properly erase the tree background
REDEFINE BUTTON PROMPT GL("&OK") ID 101 OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ON INIT FillTree( oTree, oDlg ) //ListTrees( oTree )
else
oTree := TTreeView():New( 0, 0, oDlg, 0, , .T., .F., 262, 680 ,"",, )
oTree:bLDblClick = { | nRow, nCol, nKeyFlags | ClickListTree( oTree ) }
oTree:bEraseBkGnd = { || nil } // to properly erase the tree background
FillTree( oTree, oDlg )
endif
return nil
Return to EasyReport, EasyDialog y EasyPreview
Users browsing this forum: No registered users and 4 guests