Page 1 of 1

Antonio: Suggested changes in class TRBGroup

Posted: Tue Apr 16, 2013 2:14 pm
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 )
...

Re: Antonio: Suggested changes in class TRBGroup

Posted: Tue Apr 16, 2013 2:40 pm
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.

Re: Antonio: Suggested changes in class TRBGroup

Posted: Tue Apr 16, 2013 2:51 pm
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.

Re: Antonio: Suggested changes in class TRBGroup

Posted: Tue Apr 16, 2013 3:10 pm
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)!

Re: Antonio: Suggested changes in class TRBGroup

Posted: Tue Apr 16, 2013 3:59 pm
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.