如何使可停靠的形式像IDE那样没有停靠窗体的非常慢的冻结运动? [英] How do I make dockable forms like the IDE's without the very slow freezing movement of the dockable form?

查看:140
本文介绍了如何使可停靠的形式像IDE那样没有停靠窗体的非常慢的冻结运动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我将Googled用于可停靠的表单时,如何进行IDE方法或最终使基本的Dock方法没有停靠窗口的非常慢的冻结运动?德尔福发现了 Zibadian在程序员天堂的帖子


首先关闭:Delphi IDE中的窗口不是MDI窗体,由SDI表单。



现在创建一个可停靠的窗口。



Form2将被停靠,Form1将成为将其停靠。在Form1上放置一个控件(如TPanel)来为DockSite提供服务。确保将DockStation和UseDockManager属性设置为true。



对于Form2,将DragKind设置为dkDrop,将DragMode设置为dmAutomatic和UseDockManager为true。 / p>

这是基本的停靠功能。如果您运行程序,请显示Form2并将该窗体拖动到停靠站点,它应该停靠在该站点。您甚至可以通过抓住IDE中看到的标题去拆除它。


对于我来说,该方法移动可停靠形式很慢然而,Zibadian的回答继续描述了IDE如何做:


IDE的dock方法有点复杂,因为你看不到docksite。我想,你需要编写一个Form1.OnDockOver或Form1.OnDockDrop来执行。 (那些)事件需要在适当的位置显示docksite。



解决方案

看看使用TDockTabSet组件文章,由 Jeremy North 。这是几岁,但应该给你一些有用的指针。


How do I do the IDE method or eventually make the basic dock method without the very slow freezing movement of the dockable form?

When I Googled for dockable forms in Delphi and found a post by Zibadian on Programmers Heaven:

First off: The windows in the Delphi IDE aren't MDI forms, by SDI forms.

Now to create a dockable window.

Form2 will be dockable and Form1 will be the place to dock it to. Place a control (such as a TPanel) on Form1 to serve a DockSite. Make sure that you set the DockSite and the UseDockManager properties to true for that control.

For Form2 set the DragKind to dkDrop, the DragMode to dmAutomatic and UseDockManager to true.

That was the basic dock function. If you run your program, show the Form2 and drag that form over the docksite, it should dock at that site. You can even undock it by grabbing the "caption" as you have seen in the IDE.

For me, that method moves the dockable form very slowly. However, Zibadian's answer continues to describe how the IDE does it instead:

The dock-method of the IDE is a little more complex, since you don't see the docksite. I think, you need to write a Form1.OnDockOver or Form1.OnDockDrop to perform that. That (Those) event(s) need to show the docksite at the appropriate location.

解决方案

Have a look at the Using the TDockTabSet component article by Jeremy North. It is a few years old but should give you some helpful pointers.

这篇关于如何使可停靠的形式像IDE那样没有停靠窗体的非常慢的冻结运动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆