Incorrect dialog size after LoadDialog

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Incorrect dialog size after LoadDialog

Tim Burgess-5

Hi,

 

I have an .xrc file containing may entries, including:

 

  <object class="wxDialog" name="DLG_ABOUT">

    <pos>100,100</pos>

    <size>580,448</size>

    <title>About Product</title>

        </object>

 

I use LoadDialog to load this resource with no errors and my dialog displays when I call it using ShowModal, but the size of the dialog is not as specified (it’s larger), though its position matches the .xrc entry.

 

If the contents of any child controls exceeds the size of the parent dialog, does the dialog expand to fit? This may be a silly question, but I’m a blind developer, so this is a little tricky for me😊

 

Best wishes.

 

Tim Burgess

 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect dialog size after LoadDialog

Vadim Zeitlin-4
On Tue, 7 Mar 2017 12:22:49 -0000 Tim Burgess wrote:

TB> If the contents of any child controls exceeds the size of the parent
TB> dialog, does the dialog expand to fit?

 It doesn't do it by default, although it's quite customary to call Fit()
or similar to make it fit its contents explicitly. Generally speaking, it's
a pretty bad idea to use hard-coded sizes in XRC, especially using pixels:
you should at least express the sizes in dialog units if you do this at
all.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment