testing the new VTitle Painter, I noticed a reduced Memory
after switching between 2 Dialog-Previews. After 15 Switches, there is a Memory-Problem
I included a Memory-display to control the Values.
Is it possible, something from the VTitle stays in Memory ?
I used SYSREFRESH after closing Dialog 1 and reopen Dialog 2, but it doesn't help
I start with a free Memory of : 1146412
I open the Painter and choose Preview or Project-Skip
The VTitle-Dialog includes only Buttons ( BMP's )
After Closing the VTitle-Preview-Dialog, the Memory is reduced to : 1122900
Each reopen of the VTitle-Dialog reduces the Memory.
A Window with a Start-Button for the VTitle-Dialog :
- Code: Select all Expand view
#include "FiveWin.ch"
#include "TTitle.ch"
#include "Image.ch"
static oWnd, oButtFont
FUNCTION Main()
LOCAL oBtn1, oBtn2, hDC, oBrush, oImage
LOCAL nWidth := GetSysMetrics(0)
LOCAL nHeight := GetSysMetrics(1)
SET _3DLOOK ON
SetBalloon( .T. )
c_path := CURDRIVE() + ":\" + GETCURDIR()
oProgFont := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. )
DEFINE WINDOW oWnd TITLE "VTitle Test"
oButtFont := TFont():New("Arial",0,-16,.F.,.T.,0,0,0,.T. )
DEFINE IMAGE oImage FILENAME c_path + "\Images\BACKGRD.JPG"
@ nHeight - 160, nWidth - 420 BTNBMP oBtn1 SIZE 200, 60 OF oWnd 2007 ;
FILENAME c_path + "\Images\select.bmp" ;
LEFT ;
PROMPT " &Preview VTitle " ;
FONT oButtFont ;
ACTION Tools(oWnd)
oBtn1:lTransparent = .t.
oBtn1:cTooltip := { "Open" + CRLF + ;
"the VTitlt-Painter","VTitle-Painter", 1, CLR_BLACK, 14089979 }
@ nHeight - 160, nWidth - 200 BTNBMP oBtn2 SIZE 150, 60 OF oWnd 2007 ;
FILENAME c_path + "\Images\exit.bmp" ;
LEFT ;
PROMPT " &Exit " ;
FONT oButtFont ;
ACTION oWnd:End()
oBtn2:lTransparent = .t.
oBtn2:cTooltip := { "Close" + CRLF + ;
"the VTitle-Painter","Close Window", 1, CLR_BLACK, 14089979 }
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( DRAWBITMAP( hdc, oImage:hbitmap, 0, 0, nWidth, nHeight ) ) ;
VALID MsgYesNo( "Do you want to end?" )
RETURN( NIL )
// ------------- DIALOG --------------------------------
FUNCTION Tools(oWnd)
LOCAL oDlg, oBtn1, oTextFont, oBrush
DEFINE DIALOG oDlg RESOURCE "VTitle" OF oWnd TRANSPARENT ;
TITLE "VTitle-Test" FONT oProgFont
REDEFINE BTNBMP oBtn1 ID 70 OF oDlg 2007 ;
FILENAME c_path + "\Images\exit.bmp" ;
LEFT ;
PROMPT " &Exit " ;
FONT oProgFont ;
ACTION ( oDlg:End(), oWnd:End() )
oBtn1:lTransparent = .t.
oBtn1:cTooltip := { "Close" + CRLF + ;
"the VTitle-Test","Close Test", 1, CLR_BLACK, 14089979 }
oTextFont := TFont():New( "Arial",27,-47,.F.,.T.,0,0,0,.T.)
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT SHOW_TITLE(oDlg,oTextFont,oBrush) ;
ON PAINT D_GRAD( oDlg, hDC ) ;
oBrush:End()
oTextFont:End()
RETURN NIL
// ----------------------------------------------------
STATIC FUNCTION D_GRAD( oDlg, hDC )
LOCAL aGrad := { { 0.20, 8388608, 16777215 }, ;
{ 0.20, 16777215, 8388608 } }
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, .T. )
RETURN NIL
// -------------------------------------------
FUNCTION SHOW_TITLE(oDlg,oTextFont,oBrush)
LOCAL oBar
LOCAL nSCR1 := oDlg:nWidth() // Screen-Width
LOCAL nSCR2 := oDlg:nHeight() // Screen-Hight - Title-Height
@ 100,100 TITLE oBar SIZE 496,268 of oDlg SHADOW BOTTOMRIGHT SHADOWSIZE 25
oBar:aGrdBack := { { 0.87,8388608,16777215 }, ;
{ 0.87,16777215,8388608 } }
oBar:nClrLine1 := 8388608
oBar:nClrLine2 := 128
oBar:lRound := .T.
@ 181,276 TITLETEXT OF oBar TEXT "Logo" FONT oTextFont COLOR 8388608 SHADOW BOTTOMRIGHT
@ 0, 0 TITLEIMG OF oBar BITMAP "E:\T_VTITLE_T\IMAGES\__Deco1.bmp" TRANSPARENT
@ 20, 280 TITLEIMG OF oBar BITMAP "E:\T_VTITLE\IMAGES\Delete.bmp" REFLEX TRANSPARENT ANIMA LEVEL 255;
ACTION MsgAlert( "Button with Action","Attention" )
@ 20, 360 TITLEIMG OF oBar BITMAP "E:\T_VTITLE\IMAGES\Preview.bmp" REFLEX TRANSPARENT ANIMA LEVEL 255;
ACTION MsgAlert( "Button with Action","Attention" )
@ 100, 280 TITLEIMG OF oBar BITMAP "E:\T_VTITLE\IMAGES\Select.bmp" REFLEX TRANSPARENT ANIMA LEVEL 255;
ACTION MsgAlert( "Button with Action","Attention" )
@ 100, 360 TITLEIMG OF oBar BITMAP "E:\T_VTITLE_T\IMAGES\user.bmp" SIZE 150, 0 REFLEX TRANSPARENT ANIMA LEVEL 255;
ACTION MsgAlert( "Button with Action","Attention" )
RETURN NIL
Best Regards
Uwe