FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Wed Jan 28, 2009 01:48 PM
Hi,

I am so confused about using nested TGroup in TFolder.

First of all I use Windows manifest. Without it there is no problem.

My sample Code:
#include "FiveWin.ch" 

function Main() 

   local oDlg, oFld, oGrp, oGrp1
    
   DEFINE DIALOG oDlg SIZE 400, 300 COLOR "W/B" transparent

   @ 0.5, 1 FOLDER oFld OF oDlg SIZE 188, 138 ; 
      PROMPTS "One", "Two", "Three" 
   
   @ 2, 3 GROUP oGrp TO 120, 180 PROMPT " 1. Group Text " OF oFld:aDialogs[ 1 ] PIXEL

   @ 10, 10 GROUP oGrp1 TO 70, 100 PROMPT " 2. Group Text " OF oFld:aDialogs[ 1 ] PIXEL
      
   ACTIVATE DIALOG oDlg CENTERED ON INIT oFld:aDialogs[1]:SetColor(, 9425383)

return nil


.rc
1 24 "WindowsXP.Manifest"


with this code screen is below.


But you can see problem that 1. Group left line and bottom lines are missing.

I can fix them deleting TRANSPARENT word in DEFINE DIALOG line. But in this case there is another problem occurs like below. I can not set colors of dialogs in Folder. I don't want to use gradient.



I have solved this problem in 8.11 somehow, but I could not solve in 8.12 and 9.01. I also use xBuild version 4.6 Dated 20081205 17:41:49.

Can anbody give me an advice?

Thanks in advance.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 9.01 - Nested TGroup in TFolder problem?
Posted: Wed Jan 28, 2009 07:20 PM
Hakan,

As a temporary solution please add this function to your code:
function IsAppThemed()

return .F.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 9.01 - Nested TGroup in TFolder problem?
Posted: Wed Jan 28, 2009 07:46 PM
Hakan,

This seems to be the right fix:

METHOD Colors( hDC ) CLASS TControl

   DEFAULT ::nClrText := GetTextColor( hDC ),;
           ::nClrPane := GetBkColor( hDC ),;
           ::oBrush   := TBrush():New( , ::nClrPane ),;
           ::lTransparent := .f.

   SetTextColor( hDC, ::nClrText )
   SetBkColor( hDC, ::nClrPane )

   if ::lTransparent
      SetBkMode( hDC, 1 ) // TRANSPARENT
      if IsAppThemed()
         if ! Empty( ::oBrush:hBitmap )
            SetBrushOrgEx( hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
            FillRect( hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
         else            //  This condition is added by RAMESH BABU P on Nov. 06, 2006
            if Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
               // DrawPBack( ::hWnd,  hDC )
               ParentImage( ::hWnd, hDC )
               if Upper( ::ClassName() ) != "TGROUP"  // NEW !!!
                  SendMessage( ::oWnd:hWnd, WM_ERASEBKGND, hDC, 0 ) // to properly remove/set the dotted rect
               endif   
            endif
         endif
      endif
   else
      if IsAppThemed() .and. Upper( ::ClassName() ) $ "TCHECKBOX;TRADIO;TGROUP"
         DrawPBack( ::hWnd,  hDC )
      endif
   endif

return ::oBrush:hBrush
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: FWH 9.01 - Nested TGroup in TFolder problem?
Posted: Thu Jan 29, 2009 08:55 AM

Thanks Antonio,

It works OK now with TRANSPARENT.

Will this change work new version of fwh or should I change it every new version?

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Thu Jan 29, 2009 02:23 PM

Hakan,

It will be included in next FWH version, or in a new FWH 9.01 build, if we publish a new one (due to fixes, changes, etc.)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Thu Jan 29, 2009 02:45 PM
Antonio, a similar problem is with checkboxes! If a checkbox change from normal to disable or reverse, the part from left,top of the checkbox-control to the right,bottom corner from the DIALOG and all other controls in this area are are not further visible. But with oDlg:refresh() all the controls are visible again! It seems, this area is overwrite with background ore with windows-backcolor from the checkbox.
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Thu Jan 29, 2009 03:55 PM

Günther,

Could you please provide a small and self contained example PRG to reproduce it ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Thu Jan 29, 2009 04:06 PM
In this pictures you see also, that the background-color from the folder dialogs are the same as of the Dialog (from 9.01 on).
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14406

The first picture shows normal dialog!


This picture shows, when i go to other records and the status from the checkbox changes from enable to disable or reverse. In this case, if the checkbox is repainted, then the background from left,top from checkbox to the right,bottom corner of dialog is erased. The text above are disabled by me (not error)!! This is also in normal dialogs.
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: FWH 9.01 - Nested TGroup in TFolder problem? (SOLVED)
Posted: Thu Feb 05, 2009 11:29 AM

Antonio, please show to this problem with enable/disable checkboxes on the fly! Also the background-color from the folder-dialogs are now the same as the parent-dialog. (Should be the windows standard if no brushes are defined)

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion