Antonio: Suggested changes in class TRBGroup

Antonio: Suggested changes in class TRBGroup

Postby byte-one » Tue Apr 16, 2013 2: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: Select all  Expand view
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 view
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
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Suggested changes in class TRBGroup

Postby nageswaragunupudi » Tue Apr 16, 2013 2: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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Suggested changes in class TRBGroup

Postby nageswaragunupudi » Tue Apr 16, 2013 2: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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Suggested changes in class TRBGroup

Postby byte-one » Tue Apr 16, 2013 3: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Suggested changes in class TRBGroup

Postby nageswaragunupudi » Tue Apr 16, 2013 3: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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

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