Re: wxCheckListBox size, is there any way to force it to display everything?

Vadim Zeitlin <[email protected]> Thu, 22 May 2025 16:55:50 +0200
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Thu, 22 May 2025 03:48:35 -0700 (PDT) Tony Kennedy wrote:

TK> I'm using a wxCheckListBox (and it's working perfectly).
TK> 
TK> There are only 10 entries, and I'm using it like a menu. I'd like to make 
TK> sure the entire list is visible. At the moment, it displays using a scroll 
TK> bar.
TK> 
TK> I've tried getting various sizes, nothing seems to give me the size if 
TK> everything is being displayed.
TK> 
TK> wxSize szCheckListBox = m_pCheckListBox->GetSize();
TK> wxSize szCheckListBoxVirtual = m_pCheckListBox->GetVirtualSize();
TK> 
TK> Does anyone know how to do this?

 I don't think there is a way to do it directly, its GetBestSize()
implementation typically restricts its height to some "reasonable" value.
However you should be able to use GetCountPerPage() to check if the page
is big enough and increase its size if necessary.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
              https://www.tt-solutions.com/
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaC869gAKCRAG6kHeT2we
hrVQAJ4xNj7sYBjf+tRvLa467U9KXP3qWgCeKiz9aqgdllj4WDk0+LdAk+2bsfI=
=y4cx
-----END PGP SIGNATURE-----