Creating folder form source and pages from resources
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Creating folder form source and pages from resources
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
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
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Marco,
Please change samples/TestFld5.prg this way:
Please change samples/TestFld5.prg this way:
Code: Select all
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oFld:LoadPages( { "one", "two" },;
{ | oFld, nPage | SetCtrls( oFld, nPage ) } ),;
oFld:SetPrompts( { "one", "two" } ) )
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
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
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
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Marco,
Please use this workaround:
Please use this workaround:
Code: Select all
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 )
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
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
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
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Marco,
You may need to resize the folder dialogs everytime the folder is resized:
You may need to resize the folder dialogs everytime the folder is resized:
Code: Select all
for i:=1 to 2
oFld:aDialogs[i]:nWidth:=oFld:nWidth-7
oFld:aDialogs[i]:nHeight:=oFld:nHeight-28
next
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
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:nWidth:=oFld:nWidth-7
oFld:aDialogs:nHeight:=oFld:nHeight-28
next
return nil
************
Any ideas ?
Marco
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:nWidth:=oFld:nWidth-7
oFld:aDialogs:nHeight:=oFld:nHeight-28
next
return nil
************
Any ideas ?
Marco
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
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
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
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Marco,
Fixed
Fixed
![Smile :-)](./images/smilies/icon_smile.gif)
Code: Select all
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
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: