February 27, 2021, 03:43:00 AM

Author Topic: [bb] WebSearch Plus 1.0 by ShadowTurtle [ 1+ years ago ]  (Read 658 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] WebSearch Plus 1.0 by ShadowTurtle [ 1+ years ago ]
« on: June 29, 2017, 12:28:40 AM »
Title : WebSearch Plus 1.0
Author : ShadowTurtle
Posted : 1+ years ago

Description : View title.

cu, ShadowTurtle

(sorry for my bad english)


Code :
Code: BlitzBasic
  1. Type Searcher
  2.   Field Name$
  3.   Field NameBig$
  4.   Field URLSearch$
  5.   Field PageURL$
  6. End Type
  7.  
  8. Type Search_Window
  9.   Field Win
  10.   Field HtmlSite
  11.   Field HtmlLink$
  12.   Field SearchWith.Searcher
  13. End Type
  14.  
  15. Google.Searcher = New Searcher
  16. GoogleName$ = "Google (ger)"
  17. GoogleNameBig$ = "Google (ger)"
  18. GoogleURLSearch$ = "http://www.google.de/search?q=%searchtext%&ie=UTF-8&oe=UTF-8&hl=de&meta="
  19.  
  20. Freenet.Searcher = New Searcher
  21. FreenetName$ = "Freenet (ger)"
  22. FreenetNameBig$ = "Freenet (ger)"
  23. FreenetURLSearch$ = "http://suche.freenet.de/suche?query=%searchtext%&page=1&ink=385950&target=freenet&js=on"
  24.  
  25. PageSeeker.Searcher = New Searcher
  26. PageSeekerName$ = "PageSeeker (eng)"
  27. PageSeekerNameBig$ = "PageSeeker (eng)"
  28. PageSeekerURLSearch$ = "http://www.pageseeker.com/results.htm?start=0&shareid=1&domainid=&directory=&ppsid=&search=%searchtext%"
  29.  
  30. Global SmallTitle$ = "Welcome to WebSearch Plus. You can search with WebSearchPlus to all websites. ... (sorry for my bad english)"
  31.  
  32. Global SmallTitle_Pos = 0, SmallTitle_Length = 30, SmallTitle_PixLength = 200, FH = 47
  33. Global FLength = 120, NL = 5
  34.  
  35. Global Win = CreateWindow("WebSearch Plus", 0, 0, ClientWidth(Desktop()), FH+5, Desktop(), 1)
  36. Global obja = CreateLabel("...", 5, 5, SmallTitle_PixLength, FH-5, Win)
  37.  
  38. Global fr_a_a = CreateLabel("Search: ", NL + SmallTitle_PixLength, 6, FLength/2, FH-5-22, Win) : NL = NL + (FLength/2) + 3
  39. Global fr_a_b = CreateTextField(NL + SmallTitle_PixLength, 4, FLength*2, FH-30, Win) : NL = NL + (FLength*2) + 5
  40.  
  41. Global fr_b_a = CreateLabel("Search Engine: ", NL + SmallTitle_PixLength, 6, FLength/1.5, FH-8, Win) : NL = NL + (FLength/1.5) + 3
  42. Global fr_b_b = CreateComboBox(NL + SmallTitle_PixLength, 4, FLength/1.3, FH-30, Win) : NL = NL + (FLength/1.3) + 5
  43.  
  44. Global fr_c_a = CreateButton("Find", NL + SmallTitle_PixLength, 6, FLength/1.5, FH-8-22, Win) : NL = NL + (FLength/1.5) + 3
  45.  
  46. Global MyPosY = 0
  47. Global MyPosX = 0
  48.  
  49. AddGadgetItem fr_b_b, "All"
  50. For Searcher.Searcher = Each Searcher
  51.   AddGadgetItem fr_b_b, SearcherName$
  52. Next
  53.  
  54. SelectGadgetItem fr_b_b, 0
  55.  
  56. Global LiblTimer = CreateTimer(10)
  57.  
  58. While Not KeyHit(1)
  59.   vka = WaitEvent(LiblTimer)
  60.  
  61.   If LiblTimer Then
  62.     If SmallTitle_Pos > Len(SmallTitle$) + SmallTitle_Length + 5 Then SmallTitle_Pos = 0
  63.     SmallTitle_Pos = SmallTitle_Pos + 1
  64.     SetGadgetText obja, Mid$(SmallTitle$, SmallTitle_Pos, SmallTitle_Length)
  65.   End If
  66.  
  67.   If EventSource() = fr_a_b Then
  68.     S$ = TextFieldText(fr_a_b)
  69.     S$ = Replace(S$, " ", "+")
  70.     SetGadgetText fr_a_b, S$
  71.   End If
  72.  
  73.   If (EventSource() = fr_c_a) Or (EventData()=13 And EventSource() = fr_a_b) Then
  74.     If SelectedGadgetItem(fr_b_b)>0 Then
  75.       tmp = 0
  76.       For Searcher.Searcher = Each Searcher
  77.         If SelectedGadgetItem(fr_b_b) = tmp+1 Then NewSW(Searcher, TextFieldText(fr_a_b))
  78.         tmp=tmp+1
  79.       Next
  80.     Else
  81.       For Searcher.Searcher = Each Searcher
  82.         NewSW(Searcher, TextFieldText(fr_a_b))
  83.       Next
  84.     End If
  85.     SetGadgetText fr_a_b, ""
  86.   End If
  87.  
  88.   If EventID() = $803 Then
  89.     For Search_Window.Search_Window = Each Search_Window
  90.       If EventSource() = Search_WindowWin Then
  91.         FreeGadget Search_WindowWin
  92.         Delete Search_Window
  93.       End If
  94.     Next
  95.  
  96.     If EventSource() = Win Then
  97.       For Search_Window.Search_Window = Each Search_Window
  98.         If EventSource() = Search_WindowWin Then
  99.           FreeGadget Search_WindowWin
  100.           Delete Search_Window
  101.         End If
  102.       Next
  103.  
  104.       End
  105.     End If
  106.   End If
  107. Wend
  108.  
  109. Function NewSW(Searcher.Searcher, searchnow$)
  110.   Local groX=500,groY=400
  111.  
  112.   Search_Window.Search_Window = New Search_Window
  113.   Search_WindowHtmlLink$ = Replace(SearcherURLSearch$, "%searchtext%", searchnow$)
  114.   Search_WindowSearchWith = Searcher
  115.  
  116.   Search_WindowWin = CreateWindow("Search "+Chr$(34)+searchnow$+Chr$(34)+" with "+SearcherNameBig$, 10+MyPosX, FH+20+MyPosY, groX, groY, Win, 50-32)
  117.   Search_WindowHtmlSite = CreateHtmlView(0,0,groX-8,groY-25,Search_WindowWin)
  118.   HtmlViewGo Search_WindowHtmlSite, Search_WindowHtmlLink$
  119.  
  120.   SetGadgetLayout Search_WindowHtmlSite, 1,1,1,1
  121.  
  122.   MyPosY = MyPosY + 40 : MyPosX = MyPosX + 40
  123.   If MyPosY > 400 Then MyPosY = 0
  124.   If MyPosX > 400 Then MyPosX = 0
  125. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal