TSizeGrip 可以用于在运行时移动和调整组件大小(在 FireMonkey 内)吗?
FireMonkey 的前身宣称它可用于创建 CAD 和 GIS 程序。我一直在探索 FireMonkey 并思考如何创建一个简单的 CAD 程序。基本功能是使用鼠标在屏幕上移动形状。 FireMonkey 包含一个 TSizeGrip 组件,我怀疑它可能适用于移动形状并在形状的角和边缘处提供节点供用户单击。然而,TSizeGrip 的文档尚未完成。
TSizeGrip 能否用于允许最终用户移动 FireMonkey 形状?如果是这样,怎么办?
FireMonkey's predecessor advertised that it could be used to create CAD and GIS programs. I've been exploring FireMonkey and thinking about how to create a simple CAD program. A basic function is to move shapes around on the screen using the mouse. FireMonkey includes a TSizeGrip component, which I suspect may be applicable to moving shapes and providing nodes at corners and edges of a shape for a user to click on. However, the documentation for TSizeGrip hasn't been completed.
Can TSizeGrip be used to allow end-user movement of FireMonkey shapes? If so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不会。
TSizeGrip 专门用于充当调整表单大小的“抓取手柄”,而不是任意 FireMonkey 控件或容器。
通过创建新的 FireMonkey HD 应用程序,您可以很容易地看到这一点。将 TPanel 拖放到表单上,然后将 TSizeGrip 拖放到该面板上。
运行该应用程序,您会发现当您将鼠标悬停在尺寸夹点上并单击并拖动时,会调整表单的大小,而不是面板的大小。尺寸夹点控件通常固定在表单的右下角。
如果您想知道为什么当可调整大小的表单只能使用其边框调整大小时,为什么需要一个用途如此明显有限的控件,答案是,有时让表单在不具有完全可拖动边框样式的情况下调整大小会很有用。例如模式对话框。
No.
TSizeGrip is provided specifically to act as a "grab handle" for resizing a form, not arbitrary FireMonkey controls or containers.
You can see this quite easily by creating a new FireMonkey HD application. Drop a TPanel on the form and then drop a TSizeGrip onto that panel.
Run the application and you will find that when you mouse over and click on the size grip and drag, the form is resized, not the panel. A size grip control would normally be anchored to the lower right of a form.
If you are wondering why you need a control with such apparently limited use when resizable forms can just be resized using their border, the answer is that it can sometimes be useful to have a form be resizable without having the full draggable border style. e.g. modal dialog boxes.
不——除了一个例外。
如果您创建一个使用TPanel和TSizeGrip的新组件 - TSizeGrip将控制TPanel的大小,不是TForm的大小。
No - with one exception.
If you create a new component in which you use TPanel and TSizeGrip – TSizeGrip will control TPanel's size, not TForm's size.