Error when testing FolderEx

Error when testing FolderEx

Postby PeterHarmes » Fri Mar 04, 2011 10:14 am

Hi,

Just testing folderex and i'm getting the following error:

Code: Select all  Expand view


Application
===========
   Path and name: C:\6.00\Exe\Patch.exe (32 bits)
   Size: 1,809,920 bytes
   Time from start: 0 hours 0 mins 2 secs
   Error occurred at: 03/04/11, 10:08:02
   Error description: Error BASE/1111  Argument error: LEN
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => LEN(0)
   Called from: .\source\internal\FLDEX.PRG => CALPOS(81)
   Called from: .\source\classes\TFOLDEX.PRG => (b)TFOLDEREX:TFOLDEREX(102)
   Called from: .\source\internal\FLDEX.PRG => TFOLDEREX:CALPOS(0)
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:DEFAULT(664)
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:INITIATE(878)
   Called from:  => __OBJSENDMSG(0)
   Called from:  => HB_EXECFROMARRAY(0)
   Called from: .\source\function\HARBOUR.PRG => OSEND(219)
   Called from:  => HB_EXECFROMARRAY(0)
   Called from: .\source\function\HARBOUR.PRG => ASEND(197)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(664)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(928)
   Called from:  => DIALOGBOX(0)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
   Called from: PATCH.PRG => GROUPTEXTERROR(100)
   Called from: PATCH.PRG => (b)BUILDMENU(35)
   Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
   Called from: C:\FWH\source\classes\window.prg => TWINDOW:COMMAND(1029)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: C:\FWH\source\classes\window.prg => _FWH(3394)
   Called from:  => WINRUN(0)
   Called from: C:\FWH\source\classes\window.prg => TWINDOW:ACTIVATE(978)
   Called from: PATCH.PRG => MAIN(23)

 

I've tried to copy the testfx3.prg example but cannot fix the above problem - Any ideas what is causing this?

FW - 10.11, xHarbour Commercial

Best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Error when testing FolderEx

Postby ukoenig » Fri Mar 04, 2011 5:30 pm

Hello Peter,

can You try to comile this complete sample, created with the new Tools ?
( change the Pathdefines for the Bmp's )

Image

Code: Select all  Expand view

#include "fivewin.ch"

STATIC hDC, oWndMain, oFont1
STATIC c_path

FUNCTION MAIN()
LOCAL oBar, aColors1,aColors2,aColors3
LOCAL oBtn1, oBtn2, oBtn3, oBtn4
LOCAL oTmp, oBrush1, oBrush2, oBrush3, oBrush4
LOCAL aRect3 := GetSysmetrics( 1 ) // Screen-Height
LOCAL aRect4 := GetSysmetrics( 0 ) // Screen-Width

c_path := CURDRIVE() + ":\" + GETCURDIR()
oFont1 := TFont():New( "
Arial",0,-14,.F.,.T.,0,0,0,.T.,.F.)

// ---- MDI - FRAME -----------
// ----------------------------------

DEFINE WINDOW oWndMain FROM 0, 0 TO aRect3, aRect4;
TITLE "
Window- and Dialog-test"  PIXEL

aColors1    := { { 0.5, 14853684, 16312263 }, { 0.5, 16312263, 14853684 } }
hDC = CreateCompatibleDC( oWndMain:GetDC() )
hBmp = CreateCompatibleBitMap( oWndMain:hDC, oWndMain:nWidth(), oWndMain:nHeight() )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, -50, 0, oWndMain:nHeight(), oWndMain:nWidth(), aColors1, .T. )
DeleteObject( oWndMain:oBrush:hBrush )
oWndMain:oBrush:hBitmap = hBmp
oWndMain:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oWndMain:ReleaseDC()

DEFINE BITMAP oAlpha FILENAME c_Path + "
\bitmaps\Logo.bmp"

ACTIVATE WINDOW oWndMain MAXIMIZED ;
ON INIT MDI_DIALOG() ;
ON PAINT ABPaint( hDC, 30, 380, oAlpha:hBitmap, 255 )  // Horiz / Vertical

SET MESSAGE OF oWndMain TO FWVERSION + "
 TechData Software " ;
CENTERED 2007

oFont1:End()

RETURN NIL

// --------- DIALOG ----------

FUNCTION MDI_DIALOG()
LOCAL oWndDlg, oFld, hDC, oBtn1
LOCAL oSay1, oSay2, oRadio1, oRadio2, oCheck1, oCheck2
LOCAL nRadio1 := 1, nRadio2 := 1, lCheck1 := .T., lCheck2 := .T.

DEFINE DIALOG oWndDlg FROM 180, 180 TO 580, 880 OF oWndMain  PIXEL TRANSPARENT ;
TITLE "
Dialog-Test"

@ 15, 20 SAY oSay1 PROMPT "
Transparent Say" OF oWndDlg SIZE 80, 20 FONT oFont1 PIXEL
oSay1:SetColor( 0, )
oSay1:lTransparent := .T.

@ 35, 15 RADIO oRadio1 VAR nRadio1 OF oWndDlg PIXEL ;
ITEMS "
Option &1", "Option &2" _3D SIZE 70, 16 COLOR 0 ;
HELPID 100, 101 ;
ON CHANGE MsgBeep()
oRadio1:SetFont( oFont1 )
AEval( oRadio1:aItems, { | oRad | oRad:lTransparent := .T. } )

@ 80, 20 CHECKBOX oCheck1 VAR lCheck1  COLOR 0 PIXEL ;
PROMPT "
&Checkbox" OF oWndDlg SIZE 70, 15 ;
ON CHANGE oCheck3:SetText( "
New Text" )
oCheck1:lTransparent := .T.
oCheck1:SetFont( oFont1 )

@ 18, 130 FOLDEREX oFld OF oWndDlg PIXEL SIZE 200, 120 ;
PROMPT "
T&est","&Tabs", "&Bmp", "Br&ush" ;
BITMAPS c_Path + "
\bitmaps\16edit.bmp", ;
        c_Path + "
\bitmaps\16edit.bmp", ;
        c_Path + "
\bitmaps\16edit.bmp", ;
        c_Path + "
\bitmaps\16edit.bmp" ;
ROUND 5 ;
ON CHANGE ( nTabPos := 1 )

oFld:lTransparent := .T.
oFld:nFolderHeight := 25
oFld:nSeparator := 5
oFld:bClrText := {| o, n | 65535 }
oFld:oFont := oFont1

// aGradSel, aGradUnSel, aGradOverUnSel, aGradOver, aGradDis
aS := { { 1, 128, 16777215 } }
aUS := { { 1, 8388608, 16777215 } }
aOU := { { 1, 32768, 16777215 } }
aO := { { 1, 0, 16777215 } }
aD := { { 1, 12566463, 16777215 } }
oFld:SetDefColors( aS, aUS, aOU, aO, aD )
oFld:bClrTabs := {| o, n | oFld:SetFldColors( o, n ) }
@ 15, 20 SAY oSay2 PROMPT "
Transparent Say" OF oFld:aDialogs[1] SIZE 80, 20 FONT oFont1 PIXEL
oSay2:SetColor( 0, )
oSay2:lTransparent := .T.

@ 35, 15 RADIO oRadio2 VAR nRadio2 OF oFld:aDialogs[1] PIXEL ;
ITEMS "
Option &1", "Option &2" _3D SIZE 70, 16 COLOR 0 ;
HELPID 100, 101 ;
ON CHANGE MsgBeep()
oRadio1:SetFont( oFont1 )
AEval( oRadio1:aItems, { | oRad | oRad:lTransparent := .T. } )

@ 80, 20 CHECKBOX oCheck1 VAR lCheck1  COLOR 0 PIXEL ;
PROMPT "
&Checkbox" OF oFld:aDialogs[1] SIZE 70, 15 ;
ON CHANGE oCheck3:SetText( "
New Text" )
oCheck1:lTransparent := .T.
oCheck1:SetFont( oFont1 )

@ 150, 250 BTNBMP oBtn1 OF oWndDlg ;
SIZE 75 , 35  PROMPT "
Exit" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\Exit.bmp" ;
ACTION  oWndMain:End()

oBtn1:SetColor( 128, )
oBtn1:cTooltip :=  { "
Close" + CRLF + ;
                  "
MDI-test","Exit", 1, CLR_BLACK, 14089979 }

ACTIVATE DIALOG oWndDlg NOWAIT ;
ON  INIT ( NEW_BRUSH(oWndDlg), oFld:SetOption( 1 ) )  ;
ON PAINT F_BACKGRD( 2, oFld, hDC,0,14849119,16312263,.T.,"
Marble.bmp","Back1.jpg")

RETURN NIL

//------------------------

FUNCTION NEW_BRUSH(oWndDlg)
LOCAL hDC1, aColors

aColors := { { 0.8, 14853684, 16312263 }, { 0.8, 16312263, 14853684 } }
hDC1 = CreateCompatibleDC( oWndDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oWndDlg:hDC, oWndDlg:nWidth(), oWndDlg:nHeight() - 25 )
hBmpOld = SelectObject( hDC1, hBmp )
GradientFill( hDC1, 0, 0, oWndDlg:nHeight(), oWndDlg:nWidth(), aColors, .T. )
DeleteObject( oWndDlg:oBrush:hBrush )
oWndDlg:oBrush:hBitmap = hBmp
oWndDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC1, hBmpOld )
oWndDlg:ReleaseDC()

oWndDlg:Refresh()

RETURN NIL

// ----------------------------

FUNCTION PaintTab( o, nOption )
LOCAL hBrush, hBmp, nLastRow

IF nOption == o:nOver .OR. nOption == o:nOption
    o:SetAlphaLevel( nOption, 255 )
ELSE
    o:SetAlphaLevel( nOption, 50 )
ENDIF

IF nOption == o:nOption .and. nOption == 3
    hBmp = ReadBitmap( 0, c_Path + "
\bitmaps\Marble.bmp" )
    hBrush = CreatePatternBrush( hBmp )
    DeleteObject( hBmp )
    IF o:nLayOut == 2
        nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 1 ] + o:nFolderHeight
        SetBrushOrgEx( o:hDC, nLastRow + 2, 1 )
    ELSE
        SetBrushOrgEx( o:hDC, 2, 2 )
    ENDIF
    RETURN hBrush
ENDIF

RETURN o:SetFldColors( o, nOption )

// --------  Folder - Background ---------------

FUNCTION F_BACKGRD( nStyle, oFld, hDC, nMove, nColor1, nColor2, lDirect, cBrush, cImage )
LOCAL n, oDlg, oBrush2, oBrush3, oImage2, hDC1
LOCAL aColors := { { nMOVE, nCOLOR1, nCOLOR2 }, ;
                 { nMOVE, nCOLOR2, nCOLOR1 } }
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 )
        GradientFill( hDC1, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lDirect )
    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:
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: Error when testing FolderEx

Postby PeterHarmes » Tue Mar 08, 2011 3:21 pm

Uwe,

That works, the only difference between your example and mine is I am using a resource.

It also looks as if all of the controls are correctly transparent, so i'm going to try and compare my code to see if it fixes my other problems:

viewtopic.php?f=3&t=21025

Regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests