A Strange Error in TGroup in 12.02

A Strange Error in TGroup in 12.02

Postby Horizon » Thu Mar 08, 2012 4:02 pm

Hi,

As you can see difference in screenshots as below, I think there is a paint problem in TGroup class.

The code is exactly the same.

1) Look to the group title.
2) disappears some lines in group.


12.01 screenshoot
Image

12.02 screenshoot
Image

Thanks
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Fri Mar 09, 2012 8:51 am

Antonio

Any comment?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Antonio Linares » Sat Mar 10, 2012 5:24 pm

Hakan,

Please add this function inside FWH\source\classes\group.prg:
Code: Select all  Expand view

static function IsAppThemed()

return .F.
 
regards, saludos

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

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Sun Mar 11, 2012 9:29 am

Antonio,

It works OK now.

I just want to know that Should I change everytime group.prg in every new version or you changed it in your group.prg?

Thanks
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Antonio Linares » Sun Mar 11, 2012 4:15 pm

Hakan,

Please provide me a small PRG to reproduce the GROUP paint error here and we will fix it for FWH 12.03, thanks :-)
regards, saludos

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

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Sun Mar 11, 2012 7:00 pm

Antonio,

I have tried to simulate the my application. but I only simulate the group title error. I think it occurs when the group is resized.

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

function Main()
 
  DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD
    DEFINE FONT oFnt1 NAME "Verdana" SIZE 0, -12

   DEFINE DIALOG oDlg SIZE 620, 294 FONT oFnt1 TRANSPARENT ;
        STYLE nOr( WS_OVERLAPPEDWINDOW ) //COLOR CLR_BLACK,RGB(196,244,244)
        oDlg:SetColor(,9425383)
   
  @ 2, 3 GROUP oGrp TO 150, 150 PROMPT " Group Text " OF oDlg PIXEL TRANSPARENT;
    FONT oFnt

  @ 65, 3 GROUP oGrp1 TO 150, 150 PROMPT " Second Group Text " OF oDlg PIXEL TRANSPARENT;
    FONT oFnt
 
  @ 80, 10 SAY "XXXXXXXXXXXXXXXXXXXXXXXXXX" OF oDlg PIXEL FONT oFnt1 TRANSPARENT
 
    @ 100,10 BUTTON obtnCancel PROMPT "&Cancel" OF oDlg PIXEL SIZE 50,13 ;
        ACTION oDlg:End()
       
  oDlg:bResized := {|| RESIZE_IT(oGrp, obtnCancel, oGrp1) }
    ACTIVATE DIALOG oDlg CENTERED ON INIT RESIZE_IT(oGrp, obtnCancel, oGrp1)
   
    oFnt:End()
    oFnt1:End()

return nil

PROCEDURE RESIZE_IT(oGrp, obtnCancel, oGrp1)
  oGrp:nHeight := oDlg:nHeight-80-oGrp:nTop
  oGrp:nWidth  := oDlg:nWidth-29
 
  oGrp1:nHeight := oDlg:nHeight-80-oGrp1:nTop
  oGrp1:nWidth  := oDlg:nWidth-29

  obtnCancel:nTop := oDlg:nHeight-70
  obtnCancel:nLeft := oDlg:nWidth-120
return
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Wed Mar 21, 2012 7:55 am

up
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Antonio Linares » Wed Mar 21, 2012 10:49 am

Hakan,

Your example looks fine here, whats wrong with it ?

Image
regards, saludos

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

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Wed Mar 21, 2012 11:31 am

Hi,

Look at the group title.

.rc
Code: Select all  Expand view
  1 24 "WindowsXP.Manifest"
 


Image
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Thu Mar 29, 2012 8:05 am

up
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Enrico Maria Giordano » Thu Mar 29, 2012 8:30 am

Try changing this (look at EMG) in group.prg:

Code: Select all  Expand view
METHOD Paint() CLASS TGroup

   local aSize, hOldFont

   CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )

   if .F. //IsAppThemed() //EMG
      aSize = GetLabelDim( ::hWnd, ::cCaption, ::oWnd:oFont:hFont )
      hOldFont = SelectObject( ::hDC, ::oWnd:oFont:hFont )
      SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
      FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
      SetBkMode( ::hDC, 1 )
      TextOut( ::hDC, 0, 9, ::cCaption, Len( ::cCaption ) )
      SelectObject( ::hDC, hOldFont )
   endif  

return 1


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8342
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: A Strange Error in TGroup in 12.02

Postby Horizon » Fri Mar 30, 2012 7:34 am

Thanks Enrico,

If I use 12.01, There is not problem.

I will wait a solution in 12.03.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Antonio Linares » Fri Mar 30, 2012 10:19 am

Hakan,

This change is required in Class TGroup: (fwh\source\classes\group.prg)

Code: Select all  Expand view
METHOD Paint() CLASS TGroup

   local aSize, hOldFont, oFont

   CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )

   if IsAppThemed()
      oFont = If( ::oFont != nil, ::oFont, ::oWnd:oFont )
      ASize = GetLabelDim( ::hWnd, ::cCaption, oFont:hFont )
      hOldFont = SelectObject( ::hDC, oFont:hFont )
      SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
      FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
      SetBkMode( ::hDC, 1 )
      TextOut( ::hDC, 0, 9, ::cCaption, Len( ::cCaption ) )
      SelectObject( ::hDC, hOldFont )
   endif  

return 1
 
regards, saludos

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

Re: A Strange Error in TGroup in 12.03

Postby Horizon » Mon Apr 02, 2012 8:27 am

Hi Antonio,

I have copied the your emailed Fivehcm.lib to lib directory. I have have deleted the group.prg from my xbp file and compiled.

Result :

- The font problem is gone. It is OK now.
- disapearing group line is same as fwh 12.02. (I know I could not prepare a small sample for it.)

I have added to group.prg to my xbp file and I have remarked the below line:

Code: Select all  Expand view
     //FillRect( ::hDC, { 0, 7, aSize[ 2 ] + 2, aSize[ 1 ] + 11 }, ::oBrush:hBrush )
 


It is ok now. Is this line is necessary?

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: A Strange Error in TGroup in 12.02

Postby Antonio Linares » Mon Apr 02, 2012 8:36 am

Hakan,

In our first tests it was needed, but now, yes you are right we could remove it, as the SetBrushOrgEx() is properly filling the background where we paint the text :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 22 guests