如何做一个插件,调整它的窗口 [英] How does a plugin resize it's window

查看:85
本文介绍了如何做一个插件,调整它的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加载具有以下HTML的PDF插件似乎重新调整它的窗口,以适应PDF文件的完整长度的PDF文件。我想知道这个插件怎么做呢?

When I load a pdf with the following html the pdf plugin seems to resize it's windows to accommodate the complete length of the pdf file. I'm wondering how the plugin does that?

<!DOCTYPE html>
<html>
<head>
<title>Test html object tag</title>
<style type = "text/css">
    html
    {
        height: 100%;
    }

    body
    {
        margin: 0;
        padding: 0;
        height: 100%;
    }

    .my_style
    {
        width: 100%;
        min-height: 100%;
    }
</style>
</head>

<body>
    <div class="my_style">
        <object class = "my_style" data="data/test.pdf" type="application/pdf"></object>
    </div>

</body>
</html>


据我的理解是提供给插件中的HTML对象标记定义窗口的大小。


As far as I understand it the size of a window that is provided to a plugin is defined in the html object tag.

谢谢,
基督教

Thanks, Christian

推荐答案

这是纯属猜测,因为我没有源头上说的插件,但是如果我试图解决这个问题,我只会得到一个参考我的插件的对象标记并设置宽度和高度。

This is pure speculation, since I don't have the source to said plugin, but if I were trying to solve this issue I would simply get a reference to the object tag of my plugin and set the width and height.

没有测试code,但这些方针的东西或许应该工作:

Haven't tested this code, but something along these lines should probably work:

FB::DOM::ElementPtr elem(m_host->getDOMElement());
elem->setWidth(640);
elem->setHeight(480);

显然,无论你做,你需要访问BrowerHostPtr(m_host)。

Obviously wherever you do that you need access to the BrowerHostPtr (m_host).

这篇关于如何做一个插件,调整它的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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