TMetroPanel Class bug fix

TMetroPanel Class bug fix

Postby James Bott » Tue Jun 18, 2013 5:31 pm

The TMetroPanel class has a bug that prevents tiles from wrapping correctly. The maximum number of columns of tiles in a group should be three large tiles (this could be a combination of large and small tiles). Sometimes the columns exceed this by a half a large tile (width of a small tile) so you have the equivalent of 3 and a half large tiles. Whew I hope that was clear.

Here is the fix. In the Arrange() method add the line shown below:

Method Arrange () CLASS TMetroPanel
...
nCols := Ceiling( nBtns / ::nMetroRows ) // existing line
nCols := min( nCols, 5 ) // add this line

I don't quit understand what the ceiling function does, but adding the new line seems to fix the bug.

Or, I suppose you could do this instead:

nCols := min( Ceiling( nBtns / ::nMetroRows ), 5 )

Is there documentation on the ceiling function or which source code file is it in?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TMetroPanel Class bug fix

Postby Antonio Linares » Tue Jun 18, 2013 6:53 pm

regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests