Page 1 of 1

Not what I expected

Posted: Sun Feb 04, 2018 12:52 am
by Slyde
I'm new to C++. Been learning it through Qt. A lot of videos on youtube for that. Anyway, I wanted to give CodeLite a shot, so I started doing this tutorial. A few lines down the page, it tells me: "Set the wxDataViewCtrl Expand flag and make the proportion 1, so it will consume all the remaining space in the wxFrame". I did this maybe a dozen times. NOTHING. So what do I need to do to make this work like it does in the tutorial? What do I need to do to make the wxDataViewCtrl expand?
Screenshot from 2018-02-03 14-39-20.png
Thanks for your help.

Re: Not what I expected

Posted: Sun Feb 04, 2018 2:55 am
by DavidGH
Hi,

The most likely reason is that the containing sizer (or that sizer's containing sizer, or...) itself doesn't have the correct flags/proportion, and so doesn't expand. So the wxDataViewCtrl is expanding as much as possible, but that's not very much. You should be able to check the effective sizes of those sizers by selecting them in wxCrafter.

Failing that, what is the parent of the wxDataViewCtrl? If it's a wxPanel, then check the effective size of that too.

If neither of those suggestions help, you need to provide more information about your heirarchy. At present we can see the wxDataViewCtrl's sizer flags and not much else.
Regards,

David

Re: Not what I expected

Posted: Sun Feb 04, 2018 3:10 am
by Slyde
Hi David:

My hierarchy is the same as on the tutorial page.
Screenshot from 2018-02-03 17-06-02.png
And since I'm following the tutorial step-by-step, I have no idea at all what to do at this point. Kinda frustrating.

Slyde

Re: Not what I expected

Posted: Sun Feb 04, 2018 10:54 am
by eranif
HI Slyde,
Click on the m_mainPanel and make sure that it too has the expand and proportion flag of 1.
Like David suggested: the wxDVC expands as much as it to fit it parent's size, so you need to make sure that its parent container (m_mainPanel) is expanding as expected to fill the entire frame size

Re: Not what I expected

Posted: Sun Feb 04, 2018 11:27 am
by Slyde
Hi eranif:

They do. I checked all of that, but I still can't get it to fully expand.
Screenshot from 2018-02-04 01-21-26.png
Screenshot from 2018-02-04 01-21-36.png
Do you see anything wrong?

Slyde

Re: Not what I expected

Posted: Sun Feb 04, 2018 12:53 pm
by eranif
Remove the wxALIGN_CENTER from the parent container (m_mainPanel) and it will fix this. I am not sure why it affects its size, but it seems to do the trick here (it's a wxWidgets issue not wxCrafter/CodeLite issue)

Eran

Re: Not what I expected

Posted: Sun Feb 04, 2018 1:11 pm
by Slyde
Thanks, Eran. I tried to remove that earlier, but, as you can see, it's grayed out. I didn't think to use the alignment icons above the Form. Now if I can get to the point of being able to use this with MariaDB and Sqlite3, you'll have a new customer. Clean interface, btw.

Thanks again for your help.

Slyde