如何使用引脚和标签将Delphi IDE拖放到Dock? [英] How do I do Drag and Dock like the Delphi IDE with pins and tabs?

查看:439
本文介绍了如何使用引脚和标签将Delphi IDE拖放到Dock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使Drag和Dock在我的应用程序中也像在Delphi IDE中一样工作(即可以拖动对象检查器/结构视图并将其停放在合适的站点)。我已经将对接表单转换成了PageControl已经取得了很好的成功,但是想知道是否有人知道如何使用这个小的关闭按钮和引脚等。



我也有兴趣知道Delphi IDE使用哪些组件来实现这一点。



我的问题是我想制作更多高级视频关于如何做到这一点,我以前做过的两个是链接在评论中,其中有源代码,您可以下载 here 。在我谦虚的意见中,Jedi JvDocking的东西比Delphi附带的Docking Demo更专业和光滑,但内置的东西具有工作的优点,而不需要额外安装任何东西。我刚刚尝试了DockTabSet演示和内置的对接演示,而且速度很慢,而且画面是丑陋和闪烁的。 JvDocking看起来很专业。这是你的电话。


I would like to make Drag and Dock work as well in my applications as it does in the Delphi IDE (i.e. being able to drag around the Object Inspector / Structure View and Dock them at suitable sites). I've had pretty good success with docking forms into a PageControl, but was wondering if anyone knows how to get it to work with the the little close buttons and pins and so on.

I'd also be interested to know what components the Delphi IDE uses to achieve this.

The reason for my question is I want to make much more advanced videos on how to do this, the two that I have done previously are here and here.

解决方案

You can use JVCL JvDocking components to drag and dock, in almost any version of Delphi. It's free and open source. The style with pins and close buttons is available using a docking style called the VID (visual interdev) style, that comes with JvDocking.

There are already a bunch of commercial alternatives also, and there is some support built into Delphi, which I find insufficient for my needs. While the Delphi IDE has its own internal docking library, tab support is very limited, slow, and in my subjective opinion, broken.

However, even on ancient delphi versions, Delphi 7 and up, JvDocking, provides all the functionality that the VCL's docking provides, plus more, so there's no problem ignoring the built in VCL functionality, which is to docking as TStringGrid is to real Grids.

Steps with JvDocking:

  1. Drop dock server and dock style object on main (host form) and connect them.
  2. Drop dock client component on the client (form to be docked) and connect it to the dockstyle.
  3. Configure properties of dock server.
  4. Run app. Have it create a form. Now drag the client form to an area that is made dockable by the dock server. Watch it dock nicely.

For docking in code demos see the JvDocking demos in the JVCL Examples folder.

Update

Or you can use what is built into the Delphi VCL since XE and XE2. XE and XE2 include a docking demo project named dockex.dpr.

On Win7/Vista the demo is located at:

C:\Users\Public\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking

Look here for the demo on Win XP:

C:\Documents and Settings\All Users\Documents\RAD Studio\9.0\Samples\Delphi\VCL\Docking

You should also check out the documentation for TDockTabSet in the VCL, and the EDN article linked in the comments, which has source code you can download here. In my humble opinion, the Jedi JvDocking stuff is more professional and slick than the Docking Demo that ships with Delphi, but the built in stuff has the advantage of working without installing anything additional. I just tried the DockTabSet demo and the built in docking demos, and they are slow, and the painting is ugly and flickers. JvDocking looks professional. It's your call.

这篇关于如何使用引脚和标签将Delphi IDE拖放到Dock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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