Ooops
March 05, 2021, 06:29:35 AM

Author Topic: [bb] Google Search Bar for BlitzPlus Interface by Tails [ 1+ years ago ]  (Read 607 times)

Offline BlitzBot

Title : Google Search Bar for BlitzPlus Interface
Author : Tails
Posted : 1+ years ago

Description : Add a Google Search Bar to any BlitzPlus Application

Code :
Code: BlitzBasic
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;Google Search Bar Example   ;
  3. ;by Steve Mountain           ;
  4. ;(Tails)                     ;
  5. ;05/08/2004                  ;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8.  
  9. AppTitle "Google Search Bar"
  10.  
  11.  
  12. ;Global Variables
  13. Global Main
  14. Global File
  15. Global Close
  16. Global Google
  17. Global Search
  18. Global HTML
  19.  
  20.  
  21. ;Function to Create the Main Interface
  22. Function CreateMain()
  23. Main = CreateWindow("Google Search Bar",104,97,800,600,Desktop(),15)
  24.  
  25. File = CreateMenu("File",1,WindowMenu(Main))
  26. Close = CreateMenu("Close",2,File)
  27.  
  28. Google = CreateTextField(5,25,350,20,Main,0)
  29. SetGadgetLayout Google,1,0,1,0
  30. Search = CreateButton("Search Google",350,25,100,20,Main,0)
  31. HTML = CreateHtmlView(6,65,780,490,Main,0)
  32. SetGadgetLayout HTML,1,1,1,1
  33.  
  34. UpdateWindowMenu Main
  35.  
  36. End Function ;ends the CreateMain function.
  37.  
  38. CreateMain()
  39. While WaitEvent()<>$803
  40. EvID=EventID()
  41.  
  42. EvData=EventData()
  43.  
  44.  
  45. Select EvID
  46.      Case $1001 ;Menu Action
  47.         Select EvData
  48.           Case 2
  49.           If Confirm("Do you really want to Exit?")                  
  50.  End
  51.           EndIf
  52.         End Select
  53. End Select
  54.  
  55. ;google bar setup
  56.      
  57. If EvID=$401 And EventSource()=Search Then
  58. HtmlViewGo html,"http://www.google.co.uk/search?hl=en&ie=UTF-8&q="+TextFieldText$(google)+"&btnG=Search&meta=cr%3DcountryUK%7CcountryGB"
  59. EndIf
  60.  
  61. Wend ;ends the while loop


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal