Bug in TFolderEx

Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 1:35 pm

Hello!

In METHOD Redefine of CLASS TFolderEx this is missing:

Code: Select all  Expand view
::lTransparent := lTransparent
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby ukoenig » Mon Feb 14, 2011 1:42 pm

Hello,

I couldn't detect any Problems.
You can Download my new Tools for testing.

The different Folder-Settings

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 2:19 pm

Hi Uwe!

ukoenig wrote:I couldn't detect any Problems.


Did you try to make FolderEx from resource file with REDEFINE?

Code: Select all  Expand view
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  Expand view
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
}
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby ukoenig » Mon Feb 14, 2011 2:30 pm

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  Expand view

// ---  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 :lol:
Last edited by ukoenig on Mon Feb 14, 2011 2:52 pm, edited 4 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 2:39 pm

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.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 2:42 pm

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.
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby ukoenig » Mon Feb 14, 2011 3:03 pm

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 :lol:
Last edited by ukoenig on Mon Feb 14, 2011 3:32 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 3:13 pm

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.".
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby James Bott » Mon Feb 14, 2011 4:53 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 6:14 pm

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  Expand view
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
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany

Re: Bug in TFolderEx

Postby ukoenig » Mon Feb 14, 2011 6:26 pm

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 :lol:
Last edited by ukoenig on Mon Feb 14, 2011 6:33 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bug in TFolderEx

Postby James Bott » Mon Feb 14, 2011 6:28 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Bug in TFolderEx

Postby IBTC » Mon Feb 14, 2011 7:47 pm

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). :D
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
IBTC
 
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Horizon and 39 guests