Can’t seem to figure out how to stop a frame or miniframe from maximizing when the titlebar is doubleclicked on.
self.Bind(wx.EVT_MAXIMIZE, self.OnMaximize)
def OnMaximize(self, event):
#TODO: Figure out how to stop the frame from maximizing...
print('OnMaximize')
Anyone have any idea where to start…
event.stuff doesn’t seem to work, also intentionally causing a error and passing doesn’t work either.
Well, wx.Dialog seems to work when I put a OneInstance Open check into my code, but what I really want is it to visually look like a miniframe, and also be resizeable.
It looks like wx.Dialog doesn’t seem to support the miniframe style…
Yes. The maximize, minimize, and close operations are all enabled
by bits in the window style. So, you just need to remove the
“maximize box” from the styles for your frame. In your iniit
when you call wx.Frame.init, just add this:
style =
wx.MINIMIZE_BOX|wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN
···
Metallicow wrote:
Can't seem to figure out how to stop a frame or
miniframe from maximizing when the titlebar is doubleclicked on.
self.Bind(wx.EVT_MAXIMIZE,
self.OnMaximize)
def OnMaximize(self, event):
#TODO: Figure out how to stop the frame from
maximizing…
print('OnMaximize')
Anyone have any idea where to start...
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com
Yes. The maximize, minimize, and close operations are all enabled
by bits in the window style. So, you just need to remove the
“maximize box” from the styles for your frame. In your iniit
when you call wx.Frame.init, just add this:
style =
wx.MINIMIZE_BOX|wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN
Thanks. Much better now. I will jot that bit about bits down in my notes.
Here is basic floating miniframe dialog. Added wx.FRAME_FLOAT_ON_PARENT and works like I want.
Double clicking the titlebar now has no maximize/minimize effect.
class GoToDialog(wx.MiniFrame):
def init(self, parent, id=wx.ID_ANY, title=_(u’Go To…'),
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN | wx.FRAME_FLOAT_ON_PARENT,
name=‘miniframe’):
wx.MiniFrame.init(self,parent,id,title,pos,size,style)
wx.DEFAULT_MINIFRAME_STYLE support for dialogs would be nice tho…
···
On Tuesday, July 9, 2013 11:32:21 AM UTC-5, Tim Roberts wrote: