dialog size arg not honored when subclassing wx.Dialog?

Hi all,
I just tried to send this, but gmail did something odd; if you get
this twice, I apologize.

I am using the pylbc package from
http://EmpowermentZone.com/pyLbc.zip

It is an easy way to lay out a dialog's controls without worrying
about positioning or sizing. I want a dialog to pop up that is a set
size, but my dialog keeps popping up full-screen! I am passing a
"size=wx.Size(200, 400) argument to the Dialog constructor (which, in
lbc, just calls wx.Dialog.__init__() and passes all necessary args).
Does anyone have any idea why a wx.Dialog, given a set size, would
keep appearing as large as it possibly can? Thanks!

···

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; http://www.facebook.com/mehgcap

--------------------------------------------------
From: "Alex Hall" <mehgcap@gmail.com>
Sent: Tuesday, June 01, 2010 3:56 AM
To: "wxpython-users" <wxpython-users@googlegroups.com>
Subject: [wxPython-users] dialog size arg not honored when subclassing
wx.Dialog?

Hi all,
I just tried to send this, but gmail did something odd; if you get
this twice, I apologize.

I am using the pylbc package from
http://EmpowermentZone.com/pyLbc.zip

It is an easy way to lay out a dialog's controls without worrying
about positioning or sizing. I want a dialog to pop up that is a set
size, but my dialog keeps popping up full-screen! I am passing a
"size=wx.Size(200, 400) argument to the Dialog constructor (which, in
lbc, just calls wx.Dialog.__init__() and passes all necessary args).
Does anyone have any idea why a wx.Dialog, given a set size, would
keep appearing as large as it possibly can? Thanks!

Adam,

Alex, actually. :slight_smile:

Without seeing the actual code it is hard to be sure but the most likely
possibilities are either a call to ShowFullScreen(True) somewhere in the
code or a value in the constructor setting the style to include wx.MAXIMIZE

Neither is present. The only style flag in the lbc.Dialog constructor
is "size=wx.DEFAULT_DIALOG_STYLE", but changing "DIALOG" to "FRAME"
makes no difference.

remember that the style values are ORed together and that if you send an
unexpected flags value that happens to set the same bits you will get
unexpected behavior rather than a reported error, so try forcing
style=wx.DEFAULT_FRAME_STYLE and see what happens.

No change; still a very large dialog, not the 200x400 I was hoping to find.

···

On 6/1/10, GadgetSteve <gadgetsteve@live.co.uk> wrote:

Gadget/Steve

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; Redirecting...

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; Redirecting...

Hi,

Adam,

Alex, actually. :slight_smile:

Without seeing the actual code it is hard to be sure but the most likely
possibilities are either a call to ShowFullScreen(True) somewhere in the
code or a value in the constructor setting the style to include wx.MAXIMIZE

Neither is present. The only style flag in the lbc.Dialog constructor
is "size=wx.DEFAULT_DIALOG_STYLE", but changing "DIALOG" to "FRAME"
makes no difference.

Look at that classes ShowModal method though, there are some things it
is doing that I don't really see the why for, and since that module
has absolutely zero documentation in it that is up to any ones guess.

Anyway, it Binds to EVT_INIT_DIALOG a method called Activator, which
boils down to a call to ActivateWindow. In ActivateWindow it is using
MFC api calls through the ctypes module to show the window with
ShowWindow(handle, cmd). The cmd value that it is using is a hard
coded 3 which is the same as SW_MAXIMIZE or SW_SHOWMAXIMIZED values
defined in winuser.h.

So that dialog module your using is what is causing to to be shown maximized.

Cody

···

On Tue, Jun 1, 2010 at 9:38 AM, Alex Hall <mehgcap@gmail.com> wrote:

On 6/1/10, GadgetSteve <gadgetsteve@live.co.uk> wrote:

Hi,

Adam,

Alex, actually. :slight_smile:

Without seeing the actual code it is hard to be sure but the most likely
possibilities are either a call to ShowFullScreen(True) somewhere in the
code or a value in the constructor setting the style to include
wx.MAXIMIZE

Neither is present. The only style flag in the lbc.Dialog constructor
is "size=wx.DEFAULT_DIALOG_STYLE", but changing "DIALOG" to "FRAME"
makes no difference.

Look at that classes ShowModal method though, there are some things it
is doing that I don't really see the why for, and since that module
has absolutely zero documentation in it that is up to any ones guess.

Anyway, it Binds to EVT_INIT_DIALOG a method called Activator, which
boils down to a call to ActivateWindow. In ActivateWindow it is using
MFC api calls through the ctypes module to show the window with
ShowWindow(handle, cmd). The cmd value that it is using is a hard
coded 3 which is the same as SW_MAXIMIZE or SW_SHOWMAXIMIZED values
defined in winuser.h.

So that dialog module your using is what is causing to to be shown
maximized.

Thanks; another list said to change it to 5 instead of 3, and that
seems to have fixed it. Quite the bug, but all seems to be working for
the moment!

···

On 6/1/10, Cody Precord <codyprecord@gmail.com> wrote:

On Tue, Jun 1, 2010 at 9:38 AM, Alex Hall <mehgcap@gmail.com> wrote:

On 6/1/10, GadgetSteve <gadgetsteve@live.co.uk> wrote:

Cody

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; Redirecting...