Class: UI::HtmlDialog
- Inherits:
-
Object
- Object
- UI::HtmlDialog
Overview
Embedded CEF HTML window. Will raise an error during #initialize if there is no UI bridge.
Constants # collapse
- UI::HtmlDialog::STYLE_DIALOG
STYLE_DIALOG = 0
Dialog box style.
- UI::HtmlDialog::STYLE_WINDOW
STYLE_WINDOW = 1
Ordinary window style.
- UI::HtmlDialog::STYLE_UTILITY
STYLE_UTILITY = 2
Utility window style.
- UI::HtmlDialog::CEF_VERSION
Embedded CEF version string (may be rewritten by the host after startup).
- UI::HtmlDialog::CHROME_VERSION
Embedded Chrome version string (may be rewritten by the host after startup).
Class Method Summary # collapse
-
.new(properties = {}) ⇒ UI::HtmlDialog
Hash keys: dialog_title / preferences_key / width / height / left / top / min_width / min_height / max_width / max_height / resizable / scrollable / use_content_size / style.
Instance Method Summary # collapse
-
#set_html(html) ⇒ nil
Load the HTML string.
-
#set_file(path) ⇒ nil
Load from a local file.
-
#set_url(url) ⇒ nil
Load the URL.
-
#show ⇒ nil
Non-modal display.
-
#show_modal ⇒ nil
Shows the dialog modally. Afterward, #hide is unavailable.
-
#hide ⇒ nil
Hide the non-modal dialog box.
-
#close ⇒ nil
Close and destroy.
-
#visible? ⇒ Boolean
Visibility.
-
#bring_to_front ⇒ nil
Bring to front.
-
#center ⇒ true
Center in the viewport.
-
#set_size(width, height) ⇒ true
Set the window size.
-
#get_size ⇒ Array<Integer>, nil
[width, height]。
-
#set_position(left, top) ⇒ true
Set the window position.
-
#get_position ⇒ Array<Integer>, nil
[left, top]。
-
#get_content_size ⇒ Array<Integer>, nil
Size of the content area.
-
#set_content_size(width, height) ⇒ nil
Set the content area size.
-
#execute_script(script) ⇒ nil
Execute JavaScript in the page.
-
#add_action_callback(name) ⇒ true
Register a JS-callable callback. The block's first parameter is currently nil.
-
#set_on_closed ⇒ true
A block to be called when the dialog is closed.
-
#set_can_close ⇒ true
Returns false to prevent closing.
Class Method Details
HtmlDialog.new(properties = {}) ⇒ dialog
Hash keys: dialog_title / preferences_key / width / height / left / top / min_width / min_height / max_width / max_height / resizable / scrollable / use_content_size / style.
Instance Method Details
dialog.set_html(html) ⇒ nil
Load the HTML string.
dialog.set_file(path) ⇒ nil
Load from a local file.
dialog.set_url(url) ⇒ nil
Load the URL.
dialog.show ⇒ nil
Non-modal display.
dialog.show_modal ⇒ nil
Shows the dialog modally. Afterward, #hide is unavailable.
dialog.hide ⇒ nil
Hide the non-modal dialog box.
dialog.close ⇒ nil
Close and destroy.
dialog.visible? ⇒ Boolean
Visibility.
dialog.bring_to_front ⇒ nil
Bring to front.
dialog.center ⇒ true
Center in the viewport.
dialog.set_size(width, height) ⇒ true
Set the window size.
dialog.get_size ⇒ Array<Integer>, nil
[width, height]。
dialog.set_position(left, top) ⇒ true
Set the window position.
dialog.get_position ⇒ Array<Integer>, nil
[left, top]。
dialog.get_content_size ⇒ Array<Integer>, nil
Size of the content area.
dialog.set_content_size(width, height) ⇒ nil
Set the content area size.
dialog.execute_script(script) ⇒ nil
Execute JavaScript in the page.
dialog.add_action_callback(name) {|context, *args| } ⇒ true
Register a JS-callable callback. The block's first parameter is currently nil.
dialog.set_on_closed { } ⇒ true
A block to be called when the dialog is closed.
dialog.set_can_close { } ⇒ true
Returns false to prevent closing.