Class: Watobo::Gui::IEControl

Inherits:
BrowserControl show all
Defined in:
lib/watobo/gui/browser_preview.rb

Overview

InternetExplorer Controller Class

Instance Method Summary collapse

Methods inherited from BrowserControl

#watobo_enabled?

Constructor Details

#initializeIEControl

include WIN32OLE::VARIANT


76
77
78
79
80
# File 'lib/watobo/gui/browser_preview.rb', line 76

def initialize()
  @ie = nil
  createBrowser()

end

Instance Method Details

#busy?Boolean

Returns:

  • (Boolean)

91
92
93
# File 'lib/watobo/gui/browser_preview.rb', line 91

def busy?()
  @ie.busy()
end

#closeObject


112
113
114
115
# File 'lib/watobo/gui/browser_preview.rb', line 112

def close()
  @ie.Quit
  @ie = nil
end

#connectObject


95
96
97
# File 'lib/watobo/gui/browser_preview.rb', line 95

def connect()
  createBrowser()
end

#createBrowserObject


82
83
84
85
86
87
88
89
# File 'lib/watobo/gui/browser_preview.rb', line 82

def createBrowser()
  @ie = WIN32OLE.new('InternetExplorer.Application')

  @ie.menubar=0
  @ie.toolbar=0
  @ie.statusbar=0
  @ie.visible = true
end

#getDocObject


108
109
110
# File 'lib/watobo/gui/browser_preview.rb', line 108

def getDoc()
  @ie.document.body.innerHTML.to_s
end

99
100
101
102
# File 'lib/watobo/gui/browser_preview.rb', line 99

def navigate(url)

  @ie.navigate(url)
end

#ready?Boolean

Returns:

  • (Boolean)

117
118
119
120
121
122
123
124
125
126
# File 'lib/watobo/gui/browser_preview.rb', line 117

def ready?()
  return false if @ie.nil?
  begin
    @ie.visible = true
  rescue => bang
    puts bang
    return false
  end
  return true
end

#visible=(status) ⇒ Object


104
105
106
# File 'lib/watobo/gui/browser_preview.rb', line 104

def visible=(status)
  @ie.visible = status
end