Alaska Software Inc. - XbpListBox with ::drawMode := XBP_DRAW_OWNER, after ::Clear() the items height becomes lesser then original
Username: Password:
AuthorTopic: XbpListBox with ::drawMode := XBP_DRAW_OWNER, after ::Clear() the items height becomes lesser then original
Paulo PinheiroXbpListBox with ::drawMode := XBP_DRAW_OWNER, after ::Clear() the items height becomes lesser then original
on Tue, 20 Nov 2012 09:49:24 +0000
Hi all,

Using Alaska example in "%Alaska%\XPPW32\SOURCE\samples\basics\OWNERDRW"
with a few changes:
- 2 buttons
- 1 more method in class XbpColorListbox

to demonstrate the following: after the initial creation, if we do a
::Clear() and redraw the items, the height of the items becomes lesser than
what it was at first.

Does anyone know how to workaround this?

TIA,
Paulo Pinheiro


OWNERDRW .prg
COLORBOX .prg
Andreas Gehrs-Pahl
Re: XbpListBox with ::drawMode := XBP_DRAW_OWNER, after ::Clear() the items height becomes lesser then original
on Tue, 20 Nov 2012 15:03:45 -0500
Paulo,

>Does anyone know how to workaround this?

The problem is (partially) explained in PDR 6374 -- see here:
http://www.alaska-software.com/scripts/waa001.dll?WAA_PACKAGE=PUBLICDTS&WAA_FORM=DISPLAYPDR&PDRID=6374

In the sample program, the MeasureItem code is called only once -- for the
very first Item -- and the Item Size is calculated based on the used Font. 
Later, the MeasureItem Method isn't called anymore, and the default Height 
is used instead.

In Xbase++ 2.0, those issues are fixed (for both Owner Draw methods).

A workaround (for the example code) would be to simply add "::Configure()" 
in your "::ReDraw()" Method, before the For/Next loop. Alternatively, you 
could use the workaround from the PDR, overloading the "::AddItem()" method.

Hope that helps.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
       Andreas.Gehrs-Pahl@InterAct911.com
       Andreas.Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
web:   http://www.Aerospace-History.net