FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: Suggested changes in class TRBGroup
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Antonio: Suggested changes in class TRBGroup
Posted: Tue Apr 16, 2013 02:14 PM
1.) When i use a second window with ribbonbar and open and close this second window several times, the font in the first window is destroyed. We should not end the font.
Code (fw): Select all Collapse
METHOD Destroy() CLASS TRBGroup
...
//  ::End()
...

2.)
This code is to reach a better linement of the text when texthigh is greater.
Code (fw): Select all Collapse
METHOD Paint() CLASS TRBGroup
...
      nOldBk := SetBkMode( ::hDC, TRANSPARENT )
      DrawText( ::hDC, ::cCaption,{ aRect[ 3 ] - ::oFont:nHeight * nLine * 1.3 , aRect[ 2 ] + 3, aRect[ 3 ] - 1, aRect[ 4 ] - 3 }, nStyle )   //NEW
      SetBkMode( ::hDC, nOldBk )
...
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Suggested changes in class TRBGroup
Posted: Tue Apr 16, 2013 02:40 PM
We should not end the font.

I am of the view that the ::oFont should be ended inside the Destroy() method and that the program need not be modified.

To set a font to a control like this, we should use oGrp:SetFont( oOurFont ) and should not directly assign oGrp:oFont := oOurFont.

SetFont( oFont ) increments the count of font and the oFont:end() in the Destroy() method decrements the count.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Suggested changes in class TRBGroup
Posted: Tue Apr 16, 2013 02:51 PM
This code is to reach a better linement of the text when texthigh is greater.

The requirement is appreciated and will be implemented in an appropriate manner.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Suggested changes in class TRBGroup
Posted: Tue Apr 16, 2013 03:10 PM

I assign the font with ::setfont( oMyfont ) as you wrote! The same font is assigned to the parent ribbonbar and also to the buttons from the RBGroups. I see in the code from the ribbonbar and buttons that the font also not is ended!?

Another suggestion is to use the function RefreshRibbonBarBtn( oRb , oMyfont ) also to assign a font to all the ribbonbar-contents, if needed (as i made also so)!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Suggested changes in class TRBGroup
Posted: Tue Apr 16, 2013 03:59 PM

Mr Günther

First I stand corrected on my earlier posting on ::oFont:End(). You are right. We shall remove this line, because call to Super:Destroy() is releasing the font.

Thank you for other suggestions and we shall work on them.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion