Page 1 of 1
Bug in TFolderEx
Posted: Mon Feb 14, 2011 1:35 pm
by IBTC
Hello!
In METHOD Redefine of CLASS TFolderEx this is missing:
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 1:42 pm
by ukoenig
Hello,
I couldn't detect any Problems.
You can Download my new Tools for testing.
The different Folder-Settings
Best Regards
Uwe
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 2:19 pm
by IBTC
Hi Uwe!
ukoenig wrote:
I couldn't detect any Problems.
Did you try to make FolderEx from resource file with REDEFINE?
Code: Select all
FUNCTION MAIN()
local oDlg, oFld1
DEFINE DIALOG oDlg RESOURCE "DIALOG0"
REDEFINE FOLDEREX oFld1 ID 110 OF oDlg ;
PROMPT "&Clipper", "&and", "&Windows", "&Magic" ;
DIALOGS "Sub1", "Sub2"
ACTIVATE DIALOG oDlg CENTERED
return(0)
with rc-file:
Code: Select all
DIALOG0 DIALOGEX 44, 23, 220, 110
STYLE 0x4L | DS_MODALFRAME| WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "MS Sans Serif"
{
CONTROL "", 110, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 4, 5, 213, 93
}
sub1 DIALOGEX 18, 18, 142, 67
STYLE 0x4L | WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
CONTROL "Text", 101, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 37, 30, 28, 12
}
sub2 DIALOGEX 18, 18, 142, 67
STYLE 0x4L | WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
{
CONTROL "Text", 102, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 37, 30, 28, 12
}
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 2:30 pm
by ukoenig
Yes, the Screenshot shows Folders from resource.
REDEFINE FOLDEREX oFld OF oWndFld ID 110 ;
PROMPT "T&est","&Tabs", "&Bmp", "Br&ush" ;
ON PAINT TAB PaintTab( Self, nOption ) ;
BITMAPS c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp ;
DIALOGS "Sub1", "Sub2", "Sub3", "Sub4" ;
ROUND 5 ;
ON CHANGE ( nTabPos := oFld:nOption )
oFld:lTransparent := .T.
oFld:nFolderHeight := nTabH
oFld:nSeparator := nTabS
oFld:bClrText := {| o, n | nTColor3 }
oFld:oFont := oTextFont
REDEFINE SAY oSay3 ID 110 PROMPT cTEXTFONT1 OF oFld:aDialogs[1] FONT oTextFont PIXEL
oSay3:SetColor( nTColor2, )
oSay3:lTransparent := .T.
REDEFINE RADIO oRadio3 VAR nRadio3 OF oFld:aDialogs[1] ID 120, 121 ;
ON CHANGE MsgBeep() ;
COLOR nTColor2
oRadio3:SetFont( oTextFont )
AEval( oRadio3:aItems, { | oRad | oRad:lTransparent := .T. } )
REDEFINE CHECKBOX oCheck3 VAR lCheck3 ID 130 OF oFld:aDialogs[1] ;
ON CHANGE oCheck3:SetText( "New Text" )
oCheck3:lTransparent := .T.
oCheck3:SetFont( oTextFont )
oCheck3:SetColor( nTColor2 )
I think, Your problem comes from here :
ACTIVATE DIALOG oWndFld NOWAIT ;
ON INIT ( oWndFld:Move( 50, 580, NIL, NIL, .T. ), ;
IIF( nOption2 = 2, GRADBRU2(), NIL ), ; // Dialog-Gradient
oFld:SetOption( nTabpos ) ) ;
ON PAINT F_BACKGRD(oFld)
RETURN NIL
Code: Select all
// --- Folder - Backgrounds ( Color, Gradient, Brush and Image ) ---
// FOLDER-vars in use :
// -------------------------
//nOption3 := 3 // FOLDER-Background : Color, Gradient, Brush or Image
//nMove3 := 0.50 // Gradient Position 2. Color
//nColor3a := 14853684 // 1. Color
//nColor3b := 16312263 // 2. Color Gradient
//aColors3 := { { nMove3, nColor3a, nColor3b }, { nMove3, nColor3b, nColor3a } }
//lDirect3 := .T. // Vertical or Horizontal
//cBrush3 := "Marble.bmp" // Brush
//cImage3 := "Back1.jpg" // Image
FUNCTION F_BACKGRD(oFld)
LOCAL n, oDlg, oBrush2, hDC1
LOCAL aColors := { { nMOVE3, nCOLOR3a, nCOLOR3b }, ;
{ nMOVE3, nCOLOR3b, nCOLOR3a } }
LOCAL aRect := GetClientRect( oFld:hWnd )
FOR n := 1 to Len( oFld:aDialogs )
oDlg := oFld:aDialogs[ n ]
hDC1 = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
hBmpOld = SelectObject( hDC1, hBmp )
IF nOption3 = 1 // Color
DEFINE BRUSH oBrush2 COLOR nColor3a
FillRect( hDC1, aRect, oBrush2:hBrush )
ENDIF
IF nOption3 = 2 // Gradient
GradientFill( hDC1, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lDirect )
ENDIF
IF nOption3 = 3 // Brush
DEFINE BRUSH oBrush2 FILENAME c_Path + "\bitmaps\" + cBrush3
FillRect( hDC1, aRect, oBrush2:hBrush )
ENDIF
IF nOption3 = 4 // Image
DEFINE IMAGE oTmp FILENAME c_Path + "\bitmaps\" + cImage3
oBrush2 := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, oDlg:nWidth, oDlg:nHeight, .T. ) )
oTmp:End()
FillRect( hDC1, aRect, oBrush2:hBrush )
ENDIF
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC1, hBmpOld )
oDlg:ReleaseDC()
NEXT
RETURN( NIL )
Best regards
Uwe
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 2:39 pm
by IBTC
Hi Uwe,
And what happens if you don't have this line?
ukoenig wrote:
oFld:lTransparent := .T.
Did you tried my sample code?
IMO the sample code should work without insert oFld:lTransparent := .T./.F. in it.
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 2:42 pm
by IBTC
ukoenig wrote:
I think, Your problem comes from here :
ACTIVATE DIALOG oWndFld NOWAIT ;
ON INIT ( oWndFld:Move( 50, 580, NIL, NIL, .T. ), ;
IIF( nOption2 = 2, GRADBRU2(), NIL ), ; // Dialog-Gradient
oFld:SetOption( nTabpos ) ) ;
ON PAINT F_BACKGRD(oFld)
RETURN NIL
I didn't use this code, only the sample code I showed above. I informed about a problem (and also the solution!) with a reduced sample code. I can't understand why you show me a more complex code.
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 3:03 pm
by ukoenig
Ruediger,
Many Tests I found, are not tested to the End with all possible Combinations.
In all of my Tools, I have to cover nearly everything, what can be done.
Sometimes, it makes it very complicated and many Tests are needed.
That is the Reason, that my Solutions are maybe looking a bit different.
Best regards
Uwe
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 3:13 pm
by IBTC
Hi Uwe!
ukoenig wrote:
That is the Reason, that my Solutions are maybe looking a bit different.
I understand. But if there is a bug in FWH source code obviously (missing line "::lTransparent := lTransparent" in METHOD Redefine of CLASS TFolderEx) this should IMO be fixed in FWH source code and not in the code of FWH user by inserting always/everyway "oFld:lTransparent := .T." or "oFld:lTransparent := .F.".
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 4:53 pm
by James Bott
Ruediger,
What version of FWH are you using?
I have the TFolderx.prg file dated 8/31/2010 and there is no passed parameter lTransparent to either the New() nor the Redefine() method.
Regards,
James
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 6:14 pm
by IBTC
Hi James,
James Bott wrote:
What version of FWH are you using?
FWH 10.10, the TFoldex.prg file is dated 10/27/2010:
Code: Select all
METHOD Redefine( nID, oWnd, aDialogs, aBitmaps, aPrompts, nFolderHeight, ;
aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
lAdjust, nSeparator, nOption, bPopUp, lStretch, cLayout, bBmpAction,;
nBright, lAnimate, nSpeed, oFont, lTransparent ) CLASS TFolderEx //-->> byte-one 2010
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 6:26 pm
by ukoenig
Ruediger,
SURPRISE !!!
with my Functions, it works also without
oFld:lTransparent := .T.
( I didn't test it before ) :
REDEFINE FOLDEREX oFld OF oWndFld ID 110 ;
PROMPT "T&est","&Tabs", "&Bmp", "Br&ush" ;
ON PAINT TAB PaintTab( Self, nOption ) ;
BITMAPS c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp, ;
c_Path + "\bitmaps\" + cTabBmp ;
DIALOGS "Sub1", "Sub2", "Sub3", "Sub4" ;
ROUND 5 ;
ON CHANGE ( nTabPos := oFld:nOption )
// oFld:lTransparent := .T.
oFld:nFolderHeight := nTabH
oFld:nSeparator := nTabS
oFld:bClrText := {| o, n | nTColor3 }
oFld:oFont := oTextFont
Best Regards
Uwe
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 6:28 pm
by James Bott
Uwe,
Regardless if your sample code works or not, there seems to be a missing default setting in the class which should be fixed. I agree with Ruediger.
Regards,
James
Re: Bug in TFolderEx
Posted: Mon Feb 14, 2011 7:47 pm
by IBTC
Hi James,
James Bott wrote:a missing default setting in the class which should be fixed.
With FWH 11.01 it is fixed (the TFoldex.prg file is dated 12/18/2010).