Re: Expanding wxListCtrl and wxTreeCtrl to fill height of dialog

Kenneth Porter <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On 9/2/2023 7:28 AM, David Connet wrote:
> Do you also have wxEXPAND set? And if that sizer is in a sizer, make 
> sure to repeat upwards (don't know how many times I've forgotten to 
> set expand on the parent, run it, head-slap, fixed). I don't know if 
> there's an easier way, but that's what I've always done...
Nailed it! I had a structure like /frame/v-sizer/h-sizer/panel/treectrl. 
The panel lacked the expand flag. From experience, the expand flag makes 
an object grow in the direction orthogonal to the type of containing 
sizer. Since the panel was in an h-sizer, the expand flag would make it 
grow vertically. Once I did that, the tree control expanded vertically 
within it to push the bottom edge to the bottom of the dialog.
> Plus, I'll often play around in wxFormBuilder 
> (https://github.com/wxFormBuilder/wxFormBuilder) so I can easily tweak 
> settings for immediate feedback. That tool really helped me understand 
> sizers.

Indeed, I love wFB for mocking up stuff. I usually use the result 
directly, by naming its objects xxxGui and then deriving from that. In 
this case, PartViewer has my custom code and PartViewerGui is the 
wxFB-generated class it derives from.

In rare cases is my code complicated enough that I have to build the GUI 
in my own code, and then I'll mock it up with wxFB and then copy its 
code and abstract it to implement the more complicated construction.


-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/99938a4b-1edc-4fdd-935c-dad6c96e6d67%40sewingwitch.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.