将用户界面添加到图像查看器插件 [英] Adding a user interface to an image viewer plugin

查看:149
本文介绍了将用户界面添加到图像查看器插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于如何使用Firebreath开发图像查看器插件的一般问题。为此,我想合并一个GUI框架,如wxwidget或Qt。 GUI将用于启动一些对话框,在顶部添加工具栏,或右键单击图像打开上下文菜单。

I have a general question on how to develop an image viewer plugin with Firebreath. For that, I would like to incorporate a GUI framework, like wxwidget or Qt. The GUI would be used to to fire up some dialogs, adding a toolbar on top, or to open context menus with right clicking an image.

据我所知有一个hwnd句柄,所以我可以画到一个窗口。我也明白我有各种事件,我可以反应,像鼠标按钮点击或键盘敲击。但它失败了我如何添加图形菜单,按钮等。我知道我可以使用html周围的窗口,但这不是我喜欢的路线。

As far as I understand I have a hwnd handle and so I can draw onto a window. I also understand that I have various events I can react on, like mouse button clicks or keyboard strokes. But it fails me how I would add graphical menus, buttons, etc. I know I could use html around the window but that's not the route I like to take.

例如,将用户界面离线(在内存中)映射到图像上,然后保持内部跟踪状态是否有意义?

For instance, does it makes sense to render an user interface offline (in memory) onto an image and then keep somehow track of the state internally?

有没有人做过这样的事?

Has anyone done such thing? Or can anyone give me some insight on how to accomplish adding a user interface.

推荐答案

假设你只关心窗口,并假设你不介意使用一个窗口化的插件,这是最简单的(但没有HTML元素可以漂浮在插件),它应该没有什么不同,在任何其他Windows应用程序创建GUI。

Assuming you only care about windows and assuming that you don't mind using a windowed plugin, which is the easiest (but no HTML elements can float over the plugin), it should be no different than creating a GUI in any other windows application.

你有一个窗口显示了AttachedEvent;当DetachedEvent被触发时,你需要停止使用窗口。许多人在父窗口内创建一个子窗口,并将其用于所有实际的实际代码,这使得使用其中一个抽象更容易一些,但是基本上所有的。我不知道具体如何使用QT或wxwidget,但你会创建一个HWND的子窗口,你给你的抽象为你做你的东西。

You are given a window that shows up with the AttachedEvent; when DetachedEvent is fired you need to stop using the window. Many people create a child window inside that parent window and use that for all their actual real code which makes it a little easier to use one of those other abstractions, but that's basically all there is to it. I don't know specifically how you'd do it with QT or wxwidget but you'd create a child window of that HWND that you are given and have the abstraction do your thing for you.

至于它是否会在屏幕外等等,我不知道;这完全取决于窗口系统。没有理由我知道你需要这样做,大多数事情只是直接画到HWND,但有一个zillion不同的方式,你可以做到。看起来对我来说,你真正需要的是了解如何在Windows中的绘图实际工作。

As to whether or not it would be rendering things offscreen, etc, I have no idea; that would totally depend on the window system. There is no reason that I know of that you would need to do that, and most things just draw directly to the HWND, but there are a zillion different ways you could do it. It looks to me like what you really need is to understand how drawing in Windows actually works.

我希望有帮助

这篇关于将用户界面添加到图像查看器插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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