nsIDOMChromeWindow 编辑

dom/interfaces/base/nsIDOMChromeWindow.idlScriptable This interface is implemented on the window object in chrome. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

void beginWindowMove(in nsIDOMEvent mouseDownEvent);
void getAttention();
void getAttentionWithCycleCount(in long aCycleCount);
void maximize();
void minimize();
void notifyDefaultButtonLoaded(in nsIDOMElement defaultButton);
void restore();
void setCursor(in DOMString cursor);

Attributes

AttributeTypeDescription
browserDOMWindownsIBrowserDOMWindowThe related nsIBrowserDOMWindow instance which provides access to yet another layer of utility functions by chrome script. It will be null for DOMWindows not corresponding to browsers.
messageManagernsIChromeFrameMessageManagerRead only.
titleDOMStringObsolete since Gecko 1.9.1
windowStateunsigned shortReturns current window state, the value is one of STATE_* constants. Read only.

Constants

ConstantValueDescription
STATE_MAXIMIZED1The window is maximized.
STATE_MINIMIZED2The window is minimized.
STATE_NORMAL3The window is normal.
STATE_FULLSCREEN4The window is in full screen mode.

Methods

beginWindowMove()

On some operating systems, we must allow the window manager to handle window dragging. This method tells the window manager to start dragging the window. This method will fail unless called while the left mouse button is held down, callers must check this.

void beginWindowMove(
  in nsIDOMEvent mouseDownEvent
);
Parameters
mouseDownEvent
Exceptions thrown
NS_ERROR_NOT_IMPLEMENTED
If the operating system does not support this method.

getAttention()

void getAttention();
Parameters

None.

getAttentionWithCycleCount()

Same as getAttention method excepting that this can specify the maximum number of times to animate the window per system conventions.

void getAttentionWithCycleCount(
  in long aCycleCount
);
Parameters
aCycleCount
The maximum number of times to animate the window per system conventions. If set to -1, cycles indefinitely until window is brought into the foreground. This behavior is same as getAttention method.

maximize()

Maximizes the window.

void maximize();
Parameters

None.

minimize()

Minimizes the window.

void minimize();
Parameters

None.

notifyDefaultButtonLoaded()

When a document has been loaded, the document can notify the default button of the document to the window by using this method.

When this method is called on Windows, Gecko moves the mouse cursor to center of the button if the auto cursor snap setting is enabled on the system. However, when the window isn't active at that time, the cursor isn't moved. On other systems, this method doesn't have any reaction currently.

This method is called automatically on dialog element or wizard element of XUL. If some XUL applications create a dialog like window which has a default button but it's not created by the dialog/wizard element, the applications should call this method for the accessibility and the usability on Windows at onload event.

void notifyDefaultButtonLoaded(
  in nsIDOMElement defaultButton
);
Parameters
defaultButton
The default button element of the window.

restore()

Restores the size and position of the window.

void restore();
Parameters

None.

setCursor()

Sets the mouse cursor to the specified cursor. The mouse cursor is locked to the specified cursor if it's not "auto". At that time, the cursor has been never changed by cursor moving. After you call this method with "auto", the cursor will be unlocked.

void setCursor(
  in DOMString cursor
);
Parameters
cursor
You can specify same values of CSS cursor property (including -moz- prefixed values). And there are special values: "grab", "grabbing" and "spinning". But they might be dropped in the future version, if you use the values, you should use -moz-* value instead.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:97 次

字数:8232

最后编辑:7 年前

编辑次数:0 次

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