Antonio: Suggested changes in class TRBGroup

Post Reply
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Antonio: Suggested changes in class TRBGroup

Post by byte-one »

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: Select all | Expand

METHOD Destroy() CLASS TRBGroup
...
//  ::oFont:End()
...

2.)
This code is to reach a better linement of the text when texthigh is greater.

Code: Select all | Expand

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Antonio: Suggested changes in class TRBGroup

Post by nageswaragunupudi »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Antonio: Suggested changes in class TRBGroup

Post by nageswaragunupudi »

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
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Antonio: Suggested changes in class TRBGroup

Post by byte-one »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Antonio: Suggested changes in class TRBGroup

Post by nageswaragunupudi »

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
Post Reply