Dynamic FOLDER problem with GET on XP
-
- Posts: 23
- Joined: Thu Aug 30, 2007 8:52 am
Hi Antonio
The groups actually aren't too important, and the hanging doesn't matter either as I have a work around.
But it doesn't look too good, and even if I take the XP themes off, it's still not so good.
You suggested that I try and use the resource editor, as you can see, I have little chance there, but what is the difference ultimately between dynamically defining the dialog, and creating it via the resource editor?
Regards
Alex
The groups actually aren't too important, and the hanging doesn't matter either as I have a work around.
But it doesn't look too good, and even if I take the XP themes off, it's still not so good.
You suggested that I try and use the resource editor, as you can see, I have little chance there, but what is the difference ultimately between dynamically defining the dialog, and creating it via the resource editor?
Regards
Alex
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 23
- Joined: Thu Aug 30, 2007 8:52 am
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 23
- Joined: Thu Aug 30, 2007 8:52 am
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:
Regards
Alex
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:
and then it did something, but it was worse.if IsAppThemed()
endif
Regards
Alex
Code: Select all
#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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 23
- Joined: Thu Aug 30, 2007 8:52 am
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Alex,
Please do it this way (see below the results):
Please do it this way (see below the results):
Code: Select all
#include "fivewin.ch"
function Main()
local oDlg, oFld
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, 160
@ 0, 1 GROUP oGroup TO 9, 15 OF oFld:aDialogs[ 1 ]
oGroup:lTransparent = .T.
@ 1, 2 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION MsgInfo( "Hello world!" )
@ 4, 2 SAY oSAY VAR cSAY OF oFld:aDialogs[ 1 ]
@ 6, 2 RADIO oRadio VAR nRadio ITEMS "radio 1", "radio 2" OF oFld:aDialogs[ 1 ]
@ 9.5, 11 BUTTON "Ok" OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT PlaceGet( oFld )
return nil
function PlaceGet( oFld )
local oGet, cGet := " "
@ 7, 4 GET oGet VAR cGet OF oFld:aDialogs[ 1 ] SIZE 80, 20
return nil