Dynamic FOLDER problem with GET on XP

Dynamic FOLDER problem with GET on XP

Postby alexstrickland » Thu Sep 13, 2007 9:52 pm

Hello Antonio

This is a slightly modified version of folder.prg:

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oFld
   local oGet, cGet := "     "

   DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
      FROM 5, 5 TO 20, 49

   @ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
      OF oDlg SIZE 160, 90

   @ 1, 1 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 ]

   @ 5.5, 11 BUTTON "Ok" OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

return nil

procedure AppSys // Xbase++ requirement

return



It must be compiled along with folder.rc for XP style:

1 24 "winxp\WindowsXP.Manifest"

The GET messes up the colour of the folder page, instead of a whitish colour it changes to the standard dialog colour and makes the tab look horrible.

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby Antonio Linares » Fri Sep 14, 2007 11:34 am

Alex,

Here it looks fine on XP and Vista:

Image
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Sep 14, 2007 11:37 am

Ok, I see what you mean: The dialog background
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Sep 14, 2007 11:40 am

Alex,

Do it this way as a workaround meanwhile we find where the difference comes from:
Code: Select all  Expand view
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT AddGet( oFld )

return nil

function AddGet( oFld )

   local cGet := "     "
   
   @ 6, 2 GET oGet VAR cGet OF oFld:aDialogs[ 1 ] SIZE 90, 25

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Sep 14, 2007 11:52 am

This may also help:

@ 3, 2 GET oGet VAR cGet OF oFld:aDialogs[ 1 ]

oFld:aDialogs[ 1 ]:bEraseBkGnd = { | hDC | DrawPBack( oFld:aDialogs[ 1 ]:hWnd, hDC ), 1 }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby alexstrickland » Fri Sep 14, 2007 12:55 pm

Hi Antonio

Thanks for the response. The first solution unfortunately is not suitable for my app.

The second solution causes my app to crash, no error, no gpf.

It works for folder.prg but the button does not look so good any more.

I actually also get a crash when I use oFolder:Move(...), I use MoveWindow() instead.

I can send you may test app, it is 1 .prg but is quite large (~1000 lines). It may help in your testing?

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby alexstrickland » Fri Sep 14, 2007 1:56 pm

Hi Antonio

This command has similar problems, and obscures items "behind" it:

@ <nTop>, <nLeft> [ GROUP <oGroup> ] TO <nBottom>, <nRight>

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby Antonio Linares » Fri Sep 14, 2007 2:01 pm

Alex,

You have to create the GROUP before other controls that you plan to place on top of it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby alexstrickland » Fri Sep 14, 2007 2:18 pm

Hi Antonio

I am placing it on before and sizing it after, all items in the group are obscured.

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby Antonio Linares » Fri Sep 14, 2007 2:20 pm

Alex,

Have you considered to build your folders from resources ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby alexstrickland » Fri Sep 14, 2007 2:24 pm

Antonio,

Sorry, it is totally data driven, resources cannot help me at all.

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby Antonio Linares » Fri Sep 14, 2007 2:47 pm

Alex,

I guess that you have found this problem when you added the themes support, right ?

How was it working before ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Fri Sep 14, 2007 2:58 pm

Alex,

In source\classes\folder.prg you find this twice:
Code: Select all  Expand view
            if Empty( oDlg:oBrush:hBitmap )
               oDlg:bEraseBkGnd = { | hDC | DrawPBack( oDlg:hWnd, hDC ), 1 }
            endif   

Comment if and endif so the codeblock is always assigned
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby alexstrickland » Fri Sep 14, 2007 3:34 pm

Antonio

I have taken the liberty of sending you my source code.

There are 4 #defines at the top of the file:

#define UGLY
//#define HANGS
//#define GROUP
#define FIX

If UGLY is defined then the tab is not a nice colour and the edges are obscured.

If HANGS is defined the Folder:Move will hang.

If GROUP is defined then you can see the problems with this.

If FIX is defined then your last fix is applied, but it has it's own problems as you may see.

You must compile with the manifest (I guess you know:).

Regards
Alex
alexstrickland
 
Posts: 23
Joined: Thu Aug 30, 2007 8:52 am

Postby Antonio Linares » Fri Sep 14, 2007 6:28 pm

Alex,

Here it is not hanging using Vista 32.

have you tried to create the controls on top of groups as childs of them ?

@ ..., ... OF oGroup
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests