FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TMetroPanel Class bug fix
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TMetroPanel Class bug fix
Posted: Tue Jun 18, 2013 05: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMetroPanel Class bug fix
Posted: Tue Jun 18, 2013 06:53 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion