Hi Antonio
I have reviewed everything you have said again, and it now does not hang and the groups do not obscure the other data. The code below demonstrates the remaining problems.
This is folder.prg with your fix applied (correctly I hope - see TFixFolder), and some extra controls.
It demonstrates the same problem originally reported with the folder, group boxes do not look good, radio buttons look terrible, and the normal button had a strange frame.
The original fix as shown here does not actually do anything, I had to comment out the two lines:
if IsAppThemed()
endif
and then it did something, but it was worse.
Regards
Alex
- Code: Select all Expand view
#include "fivewin.ch"
function Main()
local oDlg, oFld
local oGet, cGet := " "
local oGroup
local oSay, cSay := "Say buddy"
local oRadio, nRadio := 1
DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
FROM 5, 5 TO 30, 49
/*@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oDlg SIZE 160, 90*/
// This fix does not seem to help
oFld := TFixFolder():New( 0.5, 1, {"&xBase", "&And OOP", "&Power"}, {}, oDlg,,,, .F., .F., 160, 160,, .F., )
// Comment this line to get proper Folder colour
@ 0, 1 GROUP oGroup TO 9, 15 OF oFld:aDialogs[ 1 ]
@ 1, 2 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION MsgInfo( "Hello world!" )
// Comment this line to get proper Folder colour
@ 3, 2 GET oGet VAR cGet OF oFld:aDialogs[ 1 ]
@ 4, 2 SAY oSAY VAR cSAY OF oFld:aDialogs[ 1 ]
// If get commented this looks sort of ok, otherwise really bad
@ 6, 2 RADIO oRadio VAR nRadio ITEMS "radio 5" OF oFld:aDialogs[ 1 ]
@ 9.5, 11 BUTTON "Ok" OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
return nil
procedure AppSys // Xbase++ requirement
return
#define FD_TABMARGIN 40
CLASS TFixFolder INHERIT TFolder
METHOD Default()
METHOD LoadPages( aResNames, bRedefineControls )
ENDCLASS
METHOD Default() CLASS TFixFolder
local nLen := Len( ::aPrompts ), n
local oDlg
local nHeight := ::nFdHeight
#ifndef __CLIPPER__
nHeight *= TabGetRowCount( ::hWnd )
#endif
if nLen > 0
if ::lAllWidth
::nTabSize = int( ::nWidth() / nLen )
else
::nTabSize := 0
for n = 1 to nLen
::nTabSize = Max( ::nTabSize, ;
int( GetTextWidth( 0, ::aPrompts[n], ;
::oFont:hFont ) + FD_TABMARGIN ) )
next n
::nTabSize = Min( ::nTabSize, int( ::nWidth() / nLen ) )
endif
else
::nTabSize = ::nWidth()
endif
for nLen = 1 to Len( ::aDialogs )
oDlg = ::aDialogs[ nLen ]
#ifdef __CLIPPER__
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT ( oDlg:Move( nHeight + 2, 3 ) ) ;
VALID .f. // to avoid exiting pressing Esc !!!
#else
if ChildLevel( ::oWnd, TDialog() ) == 1
if ! ::oWnd:lResize16
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:Move( nHeight - 1, 1 ) ;
VALID .f. // to avoid exiting pressing Esc !!!
else
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:Move( nHeight - 1, 1 ) ;
VALID .f. RESIZE16 // to avoid exiting pressing Esc !!!
endif
else
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:Move( nHeight - 1, 1 ) ;
VALID .f. // to avoid exiting pressing Esc !!!
endif
#endif
#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
if Len( ::aDialogs ) > 0
if ::nOption <= Len( ::aDialogs )
::aDialogs[ ::nOption ]:Show()
endif
endif
return nil
METHOD LoadPages( aResNames, bRedefineControls ) CLASS TFixFolder
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