I create a frame with wx.NO_BORDER style, draw the border by myself.
How to resize the frame by drag this border? (just like
wx.RESIZER_BORDER)
Thanks,
I create a frame with wx.NO_BORDER style, draw the border by myself.
How to resize the frame by drag this border? (just like
wx.RESIZER_BORDER)
Thanks,
Bind handlers for the EVT_LEFT_DOWN, EVT_MOTION and EVT_LEFT_UP events. When a left-down happens in the border area capture the mouse, when you get motion events while the mouse is captured then resize the frame appropriately. When you get the left-up then release the mouse.
On 12/8/11 5:34 PM, curliph wrote:
I create a frame with wx.NO_BORDER style, draw the border by myself.
How to resize the frame by drag this border? (just like
wx.RESIZER_BORDER)
--
Robin Dunn
Software Craftsman
curliph wrote:
I create a frame with wx.NO_BORDER style, draw the border by myself.
How to resize the frame by drag this border? (just like
wx.RESIZER_BORDER)
You have to do it all by hand. You have to catch mouse-move events so
you can change the cursor to the standard resizing cursors when the
mouse hovers over your border. You have to watch for mouse-down events
inside your border so you can capture the mouse and enter a "resizing"
state, then watch for mouse-move events while the mouse is down, and
resize the frame yourself as the user drags the border.
It's a heck of a lot of work to get it right. If you need resizing,
then you should very strongly reconsider your decision to go with NO_BORDER.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Thanks, that works!
After resize the frame, I refresh it, but my titlebar (it’s wx.panel) can not redraw properly.
It has some delay from dragging event.
So I use update(wx.Frame.Update()) instead, now, it can work well.
But frame seems a little flicker while dragging to resize, how to make it better?
Thanks for your advice, I can go on to draw my scrollbar now.
2011-12-10
curliph
发件人: Robin Dunn
发送时间: 2011-12-09 15:48:58
收件人: wxpython-users
抄送:
主题: Re: [wxPython-users] resize frame without border
On 12/8/11 5:34 PM, curliph wrote:
I create a frame with wx.NO_BORDER style, draw the border by myself.
How to resize the frame by drag this border? (just like
wx.RESIZER_BORDER)
Bind handlers for the EVT_LEFT_DOWN, EVT_MOTION and EVT_LEFT_UP events.
When a left-down happens in the border area capture the mouse, when
you get motion events while the mouse is captured then resize the frame
appropriately. When you get the left-up then release the mouse.
–
Robin Dunn
Software Craftsman
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
You draw the border yourself? I would love to see that code. Windows
XP on these new LCD displays uses ultra tiny borders. I wanted to try
my hand at managing the frame decorators with more control then the
native widgets sometimes allow. (title bar, system menu, statusbar and
border look and behavior.) Anyone ever use OS/2 would know the
customization allowed on those window decorators was just wicked.
FYI,
BTW, I did not implement system menu,
Please let me know if you know how to do that~
B.regards
2011-12-15
owxFrame.rar (9.37 KB)
curliph
发件人: Dev Player
发送时间: 2011-12-15 11:36:27
收件人: wxpython-users
抄送:
主题: Re: [wxPython-users] resize frame without border
You draw the border yourself? I would love to see that code. Windows
XP on these new LCD displays uses ultra tiny borders. I wanted to try
my hand at managing the frame decorators with more control then the
native widgets sometimes allow. (title bar, system menu, statusbar and
border look and behavior.) Anyone ever use OS/2 would know the
customization allowed on those window decorators was just wicked.
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Great code,
I searched an example for my app of a manual way to move a frame
without a caption.
It helped me a lot, Thanks.
On Dec 15, 6:15 am, "curliph" <curl...@gmail.com> wrote:
FYI,
BTW, I did not implement system menu,
Please let me know if you know how to do that~B.regards
2011-12-15
curliph
发件人: Dev Player
发送时间: 2011-12-15 11:36:27
收件人: wxpython-users
抄送:
主题: Re: [wxPython-users] resize frame without borderYou draw the border yourself? I would love to see that code. Windows
XP on these new LCD displays uses ultra tiny borders. I wanted to try
my hand at managing the frame decorators with more control then the
native widgets sometimes allow. (title bar, system menu, statusbar and
border look and behavior.) Anyone ever use OS/2 would know the
customization allowed on those window decorators was just wicked.
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visithttp://groups.google.com/group/wxPython-users?hl=enowxFrame.rar
12KViewDownload
Thank you.
I ran the code. I guess I'll need to upgrade my version of wxPython
soon. The version I have does not have wx.Frame.Get/SetMinClientSize()
methods.
I am always petrified of upgrading the wxPython package to new
versions. Other packages are layered on top of it and I fear I'll not
know what gets broken in these other packages.
You must be doing some pretty fancy stuff. The only time I’ve had issues was with the newer pubsub stuff not freezing very well into an exe with py2exe. Otherwise, I’ve had no issues in the 2.8 series when upgrading.
The only major issue I had was when changing between ANSI and Unicode
builds, (on windows), some controls started returning Unicode values
rather than strings which caused a problem. Other than that a couple of
issues where I was getting away with doing something wrong and the later
version pointed it out to me.
Gadget/Steve
On 15/12/2011 8:14 PM, Mike Driscoll wrote:
You must be doing some pretty fancy stuff. The only time I've had
issues was with the newer pubsub stuff not freezing very well into an
exe with py2exe. Otherwise, I've had no issues in the 2.8 series when
upgrading.-------------------
Mike DriscollBlog: http://blog.pythonlibrary.org
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en