home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Translator59518352002.psc / Trans.frm (.txt) next >
Encoding:
Visual Basic Form  |  2002-03-05  |  7.4 KB  |  242 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  3. Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
  4. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  5. Begin VB.Form Form1 
  6.    BackColor       =   &H80000009&
  7.    BorderStyle     =   1  'Fixed Single
  8.    Caption         =   "5 Language Translator"
  9.    ClientHeight    =   6930
  10.    ClientLeft      =   150
  11.    ClientTop       =   720
  12.    ClientWidth     =   5175
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6930
  17.    ScaleWidth      =   5175
  18.    StartUpPosition =   3  'Windows Default
  19.    Begin MSComDlg.CommonDialog CommonDialog1 
  20.       Left            =   120
  21.       Top             =   120
  22.       _ExtentX        =   847
  23.       _ExtentY        =   847
  24.       _Version        =   393216
  25.    End
  26.    Begin VB.CommandButton Command3 
  27.       Caption         =   "Clear All"
  28.       Height          =   495
  29.       Left            =   2160
  30.       TabIndex        =   9
  31.       Top             =   5520
  32.       Width           =   855
  33.    End
  34.    Begin RichTextLib.RichTextBox Text3 
  35.       Height          =   1455
  36.       Left            =   240
  37.       TabIndex        =   6
  38.       Top             =   3960
  39.       Width           =   4695
  40.       _ExtentX        =   8281
  41.       _ExtentY        =   2566
  42.       _Version        =   393217
  43.       TextRTF         =   $"Trans.frx":0000
  44.    End
  45.    Begin RichTextLib.RichTextBox Text2 
  46.       Bindings        =   "Trans.frx":0082
  47.       Height          =   1575
  48.       Left            =   240
  49.       TabIndex        =   5
  50.       Top             =   2160
  51.       Width           =   4695
  52.       _ExtentX        =   8281
  53.       _ExtentY        =   2778
  54.       _Version        =   393217
  55.       ScrollBars      =   2
  56.       TextRTF         =   $"Trans.frx":008D
  57.    End
  58.    Begin RichTextLib.RichTextBox Text1 
  59.       Height          =   1095
  60.       Left            =   6360
  61.       TabIndex        =   4
  62.       Top             =   2160
  63.       Width           =   1575
  64.       _ExtentX        =   2778
  65.       _ExtentY        =   1931
  66.       _Version        =   393217
  67.       ScrollBars      =   2
  68.       TextRTF         =   $"Trans.frx":010F
  69.    End
  70.    Begin VB.ComboBox Combo2 
  71.       Height          =   315
  72.       ItemData        =   "Trans.frx":0191
  73.       Left            =   3120
  74.       List            =   "Trans.frx":01A4
  75.       TabIndex        =   3
  76.       Text            =   "Target Language"
  77.       Top             =   5520
  78.       Width           =   1815
  79.    End
  80.    Begin VB.ComboBox Combo1 
  81.       Height          =   315
  82.       ItemData        =   "Trans.frx":01D3
  83.       Left            =   240
  84.       List            =   "Trans.frx":01E6
  85.       TabIndex        =   2
  86.       Text            =   "Source Language"
  87.       Top             =   5520
  88.       Width           =   1815
  89.    End
  90.    Begin VB.CommandButton Command2 
  91.       Caption         =   "Request"
  92.       Height          =   495
  93.       Left            =   1200
  94.       TabIndex        =   1
  95.       Top             =   5880
  96.       Width           =   855
  97.    End
  98.    Begin VB.CommandButton Command1 
  99.       Caption         =   "Traslate"
  100.       Height          =   495
  101.       Left            =   3120
  102.       TabIndex        =   0
  103.       Top             =   5880
  104.       Width           =   855
  105.    End
  106.    Begin InetCtlsObjects.Inet Inet1 
  107.       Left            =   6360
  108.       Top             =   840
  109.       _ExtentX        =   1005
  110.       _ExtentY        =   1005
  111.       _Version        =   393216
  112.       RequestTimeout  =   120
  113.    End
  114.    Begin VB.Label Label2 
  115.       BackColor       =   &H80000009&
  116.       Height          =   255
  117.       Left            =   1080
  118.       TabIndex        =   8
  119.       Top             =   6480
  120.       Width           =   3015
  121.    End
  122.    Begin VB.Label Label1 
  123.       BackColor       =   &H80000009&
  124.       Caption         =   "Source Text Below,  Translated Text Above"
  125.       Height          =   255
  126.       Left            =   960
  127.       TabIndex        =   7
  128.       Top             =   3720
  129.       Width           =   3135
  130.    End
  131.    Begin VB.Image Image1 
  132.       Height          =   2160
  133.       Left            =   960
  134.       Picture         =   "Trans.frx":0215
  135.       Top             =   0
  136.       Width           =   3240
  137.    End
  138.    Begin VB.Menu FileMenu 
  139.       Caption         =   "File"
  140.       Begin VB.Menu ExitPro 
  141.          Caption         =   "E&xit"
  142.          Shortcut        =   ^X
  143.       End
  144.    End
  145.    Begin VB.Menu TransOptions 
  146.       Caption         =   "Translation Options"
  147.       Begin VB.Menu ClearTrans 
  148.          Caption         =   "Clear &Translation"
  149.          Shortcut        =   ^T
  150.       End
  151.       Begin VB.Menu ClearSource 
  152.          Caption         =   "Clear So&urce"
  153.          Shortcut        =   ^U
  154.       End
  155.       Begin VB.Menu ClearAll 
  156.          Caption         =   "Clear &All"
  157.          Shortcut        =   ^A
  158.       End
  159.    End
  160.    Begin VB.Menu HelpMenu 
  161.       Caption         =   "Help"
  162.       Begin VB.Menu HowTo 
  163.          Caption         =   "&How to use this program"
  164.          Shortcut        =   ^H
  165.       End
  166.       Begin VB.Menu AboutItem 
  167.          Caption         =   "A&bout"
  168.          Shortcut        =   ^B
  169.       End
  170.    End
  171. Attribute VB_Name = "Form1"
  172. Attribute VB_GlobalNameSpace = False
  173. Attribute VB_Creatable = False
  174. Attribute VB_PredeclaredId = True
  175. Attribute VB_Exposed = False
  176. Private Sub Combo2_Click()
  177. Select Case Combo2.Text
  178.     Case "French": Combo2.Tag = "FR"
  179.     Case "German": Combo2.Tag = "DE"
  180.     Case "Spanish": Combo2.Tag = "ES"
  181.     Case "English": Combo2.Tag = "EN"
  182.     Case "Italian": Combo2.Tag = "IT"
  183. End Select
  184. End Sub
  185. Private Sub Combo1_Click()
  186. Select Case Combo1.Text
  187.     Case "French": Combo1.Tag = "FR"
  188.     Case "German": Combo1.Tag = "DE"
  189.     Case "Spanish": Combo1.Tag = "ES"
  190.     Case "English": Combo1.Tag = "EN"
  191.     Case "Italian": Combo1.Tag = "IT"
  192. End Select
  193. End Sub
  194. Private Sub Command1_Click()
  195. Dim Start As Integer
  196. Dim Done As Integer
  197. Start = InStr(1, Text1.Text, "<textarea name=""wl_result""")
  198. Start = Start + 114
  199. Done = InStr(Start, Text1.Text, "</textarea>")
  200. Text2.Text = Mid(Text1.Text, Start, Done - Start)
  201. Label2.Caption = "Enter your text and hit the request button."
  202. Command1.Enabled = False
  203. End Sub
  204. Private Sub Command2_Click()
  205. Label2.Caption = "Please Wait..."
  206. Dim ReturnStr As String
  207. Text1.Text = Inet1.OpenURL("http://www.worldlingo.com/wl/Translate?wl_text=" & Text3.Text & "&wl_gloss=1&wl_srclang=" & Combo1.Tag & "&wl_trglang=" & Combo2.Tag, icString)
  208. ReturnStr = Inet1.GetChunk(2048, icString)
  209. Command1.Enabled = True
  210. Label2.Caption = "Done! Hit the translate button."
  211. Do While Len(ReturnStr) <> 0
  212.     DoEvents
  213.         Command1.Enabled = False
  214.         Label2.Caption = "Pease Wait..."
  215.         Text1.Text = Text1.Text & ReturnStr
  216.         ReturnStr = Inet1.GetChunk(2048, icString)
  217.         Command1.Enabled = True
  218.         Label2.Caption = "Done! Hit the translate button."
  219.     Loop
  220. End Sub
  221. Private Sub ExitPro_Click()
  222. Unload Me
  223. End Sub
  224. Private Sub Form_Load()
  225. Command1.Enabled = False
  226. Label2.Caption = "Enter your text and hit the request button."
  227. End Sub
  228. Private Sub ClearAll_Click()
  229. Text2.Text = ""
  230. Text3.Text = ""
  231. End Sub
  232. Private Sub ClearSource_Click()
  233. Text3.Text = ""
  234. End Sub
  235. Private Sub ClearTrans_Click()
  236. Text2.Text = ""
  237. End Sub
  238. Private Sub Command3_Click()
  239. Text2.Text = ""
  240. Text3.Text = ""
  241. End Sub
  242.