拖动/大小手柄实现

发布于 2024-07-16 15:06:16 字数 159 浏览 5 评论 0原文

我正在寻找拖动/大小手柄的实现或解释。

也许我使用了错误的命名法,但我的意思是当您选择对象并想要对该对象执行操作(例如旋转、大小、缩放等)时,对象周围出现的“手柄”(主要是在绘图程序中)。 ..

任何人都可以向我指出一个我可以查看或解释他们如何实现的 OSS 实现吗?

I'm looking for drag/size handle implementations or explanations.

Perhaps I'm using the wrong nomenclature, but I mean the "handles" that appear around an object (mostly in drawing programs) when you select it and want to perform an operation on that object such as rotate, size, scale, etc...

Can anyone point me to an OSS implementation I can look at or explain how they have/would implement this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兲鉂ぱ嘚淚 2024-07-23 15:06:17

在 Windows 中,这实际上不是操作系统功能...而是您自己编写的代码。

基本上,您创建了一个矩形数组,其中将出现手柄。 您的目标有两个,第一个是简单地绘制手柄,第二个是传递给 PointInRectangle 调用。

“PointInRectangle”调用位是在 MouseMove 事件期间完成的。 基本上,您可以根据当前鼠标位置决定鼠标应具有的光标(也称为鼠标所处的“模式”)。

其他棘手的部分是处理鼠标按下并确定是否开始拖动、拖动时鼠标移动以及拖动结束时鼠标松开。

总而言之,这可能是一项繁重的工作。 哦..不要忘记,如果在边缘附近拖动,您可能需要滚动绘图窗格/窗口。

根据您正在执行的操作,您可能需要查看 http://www.lassalle.com/。 他们有一个很棒的廉价图表(不是图表)工具。

In windows this really isn't an OS feature... it's something you code yourself.

Basically you create an array of rectangles where the handles are to appear. You're goal here is twofold, the first is for simply drawing the handles, the second is for passing to a PointInRectangle call.

The "PointInRectangle" call bit is done during MouseMove events. Basically this is where you decide based on the current mouse location what cursor the mouse should have (aka what "mode" the mouse is in).

The other tricky bits are handling mouse down and determining if its time to start dragging, mouse move while dragging, and mouse up for end of dragging.

All in all it can be a bunch of work. Oh.. and don't forget that you may need to scroll your drawing pane/window if dragging near the edges.

Depending on what you're doing you might want to take a look at http://www.lassalle.com/. They have a great inexpensive graph (not charting) tool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文