Platforms to show: All Mac Windows Linux Cross-Platform
/MacControls/HTMLViewer Mac/Google Search
Function:
Required plugins for this example: MBS Win Plugin, MBS MacControls Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/HTMLViewer Mac/Google Search
Function:
Required plugins for this example: MBS Win Plugin, MBS MacControls Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/HTMLViewer Mac/Google Search
Project "Google Search.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
window1.left=10
window1.show
window2.left=window1.left+window1.Width+10
window2.show
End EventHandler
End Class
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control EditField1 Inherits TextField
ControlInstance EditField1 Inherits TextField
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim url as string
dim query as string
query=ConvertEncoding(EditField1.text,encodings.UTF8)
query=EncodeURLComponent(query)
url="http://www.google.com/search?q="+query+"&ie=UTF-8&oe=UTF-8"
HTMLViewer1.LoadURL url
End EventHandler
End Control
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
End Control
EventHandler Sub Open()
EditField1.SetFocus
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class Window2 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control EditField1 Inherits TextField
ControlInstance EditField1 Inherits TextField
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim url as string
dim query as string
query=ConvertEncoding(EditField1.text,encodings.UTF8)
if TargetMacOS then
call HTMLViewer1.EvaluateJavaScriptMBS "document.f.q.value="""+query+""""
call HTMLViewer1.EvaluateJavaScriptMBS "document.f.submit();"
else
call HTMLViewer1.IERunJavaScriptMBS "document.f.q.value="""+query+""""
call HTMLViewer1.IERunJavaScriptMBS "document.f.submit();"
end if
End EventHandler
End Control
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
EventHandler Sub Open()
me.loadurl "http://www.google.com/"
End EventHandler
End Control
EventHandler Sub Open()
EditField1.SetFocus
End EventHandler
End Class
End Project
See also:
- /MacControls/HTMLViewer Mac/Custom Printing mit WebPrintMBS
- /MacControls/HTMLViewer Mac/File Open Dialog/File Open Dialog
- /MacControls/HTMLViewer Mac/HTML Editor Mac
- /MacControls/HTMLViewer Mac/HTMLViewer get html source
- /MacControls/HTMLViewer Mac/HTMLViewer Image
- /MacControls/HTMLViewer Mac/HTMLViewer on TabPanels fix
- /MacControls/HTMLViewer Mac/HTMLViewer PDF Save and Print
- /MacControls/HTMLViewer Mac/HTMLViewer ScrollHeight
- /MacControls/HTMLViewer Mac/WebFrameDelegate
- /MacControls/HTMLViewer Mac/WebPolicyDelegate
The items on this page are in the following plugins: MBS MacControls Plugin.
Feedback: Report problem or ask question.