FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Creating folder form source and pages from resources
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Sat Apr 28, 2007 05:09 PM

Hi,
I would like to make a folder via source code and then load the pages from an rc file.

I take a look to the Fivewin sample testfld5.prg (provided in the sample FWH directory) that make this with the method LoadPages but only the first page is displayed.

Any ideas ?
Is there any problem using the method LoadPages as you know ?

I'm working with the latest FWH&XHB versions.

Thanks in advance.

Best Regards,

Marco Turco

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Sat Apr 28, 2007 05:36 PM
Marco,

Please change samples/TestFld5.prg this way:

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oFld:LoadPages( { "one", "two" },;
                                { | oFld, nPage | SetCtrls( oFld, nPage ) } ),;
                oFld:SetPrompts( { "one", "two" } ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Sun Apr 29, 2007 06:54 AM

Yes, it runs.
Thanks Antonio.

Best Regards,

Marco

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Mon Apr 30, 2007 09:38 AM

Oops. There is still a little problem.
The XP style doesn't work loading the folder pages from resources.

See image at www.softwarexp.co.uk/beta/folder.png
and the self contained sample at www.softwarexp.co.uk/beta/folder.zip

Is there any solution available ?

Thanks in advance

Best Regards,

Marco Turco

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Mon Apr 30, 2007 12:02 PM
Marco,

Please use this workaround:
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oFld:LoadPages( { "one", "two" },;
                              { | oFld, nPage | SetCtrls( oFld, nPage ) } ),;
                oFld:SetPrompts( { "one", "two" } ),;
                oFld:aDialogs[ 1 ]:nWidth := oFld:nWidth - 7,;
                oFld:aDialogs[ 1 ]:nHeight := oFld:nHeight - 28,;         
                oFld:aDialogs[ 2 ]:nWidth := oFld:nWidth - 7,;
                oFld:aDialogs[ 2 ]:nHeight := oFld:nHeight - 28 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Mon Apr 30, 2007 03:12 PM

It run with a "static" dialog
but this problem still appairs on a splitter environment when the folder is created on the window.

See this sample image at www.softwarexp.co.uk/beta/splitter.png
and my self-contained sample at www.softwarexp.co.uk/beta/splitter.zip.

Did I forget something ? I'm working a lot this time.

Marco

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Mon Apr 30, 2007 07:09 PM
Marco,

You may need to resize the folder dialogs everytime the folder is resized:
    for i:=1 to 2
        oFld:aDialogs[i]:nWidth:=oFld:nWidth-7
        oFld:aDialogs[i]:nHeight:=oFld:nHeight-28
    next
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Tue May 01, 2007 07:29 AM
Hi,
I tried adding that code in the resize routine (see below)
but it doesn't runs.

****

function ridimensiona(oWnd,oSplit,oBrw,oFld,oBtn,oCbx)

local i

oSplit:nFirst=oWnd:nWidth()-oSplit:nWidth-300
oFld:Move(90,oSplit:nFirst+oSplit:nWidth,oWnd:nHeight-200-60,100,.t.)
oBrw:Move(85,05,oSplit:nFirst-10,oWnd:nHeight-200-60,.t.)
oBtn:Move(oWnd:nHeight()-120,05,90,25,.t.)
oCbx:Move(oWnd:nHeight()-160,05,oSplit:nFirst-60-20,100,.t.)

oSplit:ADjClient()

for i:=1 to 2
oFld:aDialogs[i]:=oFld:nWidth-7
oFld:aDialogs[i]:=oFld:nHeight-28
next

return nil

************

Any ideas ?

Marco
Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Tue May 01, 2007 12:27 PM

Marco,

Whats the problem in this sample ?

www.softwarexp.co.uk/beta/splitter.png

It looks fine :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Tue May 01, 2007 04:17 PM

The problem is that the folder color has to be white and not gray.
When the folder's pages are loaded from resource the folder pages doesn't appairs with the XP theme manager color.

This is a correct folder image :

www.softwarexp.co.uk/beta/correct.png

Marco

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Wed May 02, 2007 07:43 AM
Marco,

Fixed :-)
METHOD LoadPages( aResNames, bRedefineControls ) CLASS TFolder

   local n, oDlg
   local oThis := Self

   ::DelPages()

   ::aPrompts = aResNames
   ::aDialogs = Array( Len( aResNames ) )

   for n = 1 to Len( ::aDialogs )
      DEFINE DIALOG oDlg OF Self RESOURCE aResNames[ n ] ;
         FONT Self:oFont

      ::aDialogs[ n ] = oDlg

      if bRedefineControls != nil
         Eval( bRedefineControls, Self, n )
      endif

      ACTIVATE DIALOG oDlg NOWAIT ;
         ON INIT ( oDlg:Move( oThis:nFdHeight + 2, 3, oThis:nWidth - 6, oThis:nHeight - oThis:nFdHeight - 5 ) ) ;
         VALID .f.                // to avoid exiting pressing Esc !!!

      #ifndef __CLIPPER__
         if IsAppThemed()
            // oDlg:SetBrush( TBrush():New( "NULL" ) )
            if Empty( oDlg:oBrush:hBitmap )
               oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }
            endif   
         endif
      #endif

      oDlg:Hide()
   next

   ::nOption = 1
   ::aDialogs[ 1 ]:Show()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Creating folder form source and pages from resources
Posted: Wed May 02, 2007 08:41 AM

Great !!

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Creating folder form source and pages from resources
Posted: Wed May 02, 2007 08:45 AM

Marco,

The loaded pages size is automatically set now, so you don't need to set those values :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion