In METHOD Redefine of CLASS TFolderEx this is missing:
Code: Select all
::lTransparent := lTransparent
Code: Select all
::lTransparent := lTransparent
Did you try to make FolderEx from resource file with REDEFINE?ukoenig wrote: I couldn't detect any Problems.
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)
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
}
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 )
Did you tried my sample code?ukoenig wrote: oFld:lTransparent := .T.
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.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 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.".ukoenig wrote: That is the Reason, that my Solutions are maybe looking a bit different.
FWH 10.10, the TFoldex.prg file is dated 10/27/2010:James Bott wrote: What version of FWH are you using?
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
With FWH 11.01 it is fixed (the TFoldex.prg file is dated 12/18/2010).James Bott wrote:a missing default setting in the class which should be fixed.