Guidance
指路人
g.yi.org
software / rapidq / Examples / COM & OLE / Internet Projects / IEE1.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     $APPTYPE   GUI
     $TYPECHECK off
     $INCLUDE "Rapidq.Inc"
     DECLARE SUB Button1Click (Sender AS QBUTTON)
     DECLARE SUB Button2Click (Sender AS QBUTTON)
     DIM Buttonclicked AS INTEGER
     DIM x AS INTEGER
     DECLARE SUB Label1Click (Sender AS QLABEL)
     DECLARE SUB FormSize (Sender AS QFORM)
     DECLARE SUB ESCAPE
     DIM Button1.Clicked AS QLABEL
     DIM MainForm AS QFORM
     DIM DialogBox AS QFORM
     DIM EditBox AS QEDIT
     DIM RichEdit AS QRICHEDIT
     DIM MainMenu AS QMAINMENU
     DIM File AS QMENUITEM, Edit AS QMENUITEM
     DIM New AS QMENUITEM, OPEN AS QMENUITEM, ReOpen AS QMENUITEM
     DIM ReOpen1 AS QMENUITEM, ReOpen2 AS QMENUITEM, ReOpen3 AS QMENUITEM
     DIM Save AS QMENUITEM, SaveAs AS QMENUITEM
     DIM Break1 AS QMENUITEM
     DIM ExitEditor AS QMENUITEM, ExitProjects AS QMENUITEM
     DIM Copy AS QMENUITEM, Cut AS QMENUITEM, Paste AS QMENUITEM, SelectAll AS QMENUITEM
     DIM Search AS QMENUITEM, Find AS QMENUITEM
     DIM Help AS QMENUITEM, helper AS QMENUITEM, progre AS QMENUITEM
     DIM FileName AS STRING
     FileName = "UNTiTLED"
     DIM CountFiles AS BYTE
     CountFiles = 0
     DIM StatusBar AS QSTATUSBAR
     StatusBar.PARENT = MainForm
     StatusBar.AddPanels "",""
     StatusBar.Panel(0).Width = 100
     StatusBar.Panel(0).Alignment = taCenter


     DECLARE FUNCTION FGetFileHTTP_URLDownloadToFile LIB "urlmon" ALIAS "URLDownloadToFileA" _
      (BYVAL pCaller AS LONG, ByRef szURL AS STRING, ByRef szFileName AS STRING, _
      BYVAL dwReserved AS LONG, BYVAL lpfnCB AS LONG) AS LONG


     CREATE Form AS QFORM


      CAPTION = ""
      Width = 848
      Height = 611


      Center
      OnClick = ESCAPE
      AutoScroll=0
      OnResize = FormSize


      CREATE Gauge1 AS QGAUGE
       Align = 2
       Left = 0
       Top = 46
       Width = 823
       Kind = 1
       Height = 19
       BackColor = 12312312
       COLOR = 32132132
       ForeColor = 16777215
       Position = 1
      END CREATE

      CREATE Edit1 AS QEDIT
       Text = "http://www.yahoo.com"
       Left = 0
       Top = 0
       Width = 840
       Align = 1
      END CREATE
      CREATE Button1 AS QBUTTON
       CAPTION = "&Retry"
       Left = 0
       Top = 46
       Width = 840
       ShowHint = 1
       Kind = 8
       Hint = "This will display or refresh a web page.  "
       Align = 1
       TabOrder = 1
       OnClick = Button1Click
      END CREATE
      CREATE Button2 AS QBUTTON

       CAPTION = "&Help"
       Left = 0
       Top = 21
       Width = 840
       ShowHint = 1
       Hint = "More Information About this Program. "
       Align = 1
       TabOrder = 2
       Kind = 3
       OnClick = Button2Click

      END CREATE

      CREATE Explorer AS QOLECONTAINER
       Top=100
       Align = 5
      END CREATE
     END CREATE

     IF Form.SHOWMODAL THEN
      Form.CLOSE
      IF Buttonclicked > 0 THEN
       Explorer.Free
      END IF
     END IF

     Form.SHOWMODAL



     SUB Button1Click (Sender AS QBUTTON)



      FOR x=1 TO 100:Gauge1.Position = x : NEXT x
      Buttonclicked=1
      IF Button1.Clicked=1 THEN
       Explorer.Width=Form.Width
       Explorer.Height=Form._
        ClientHeight
       Explorer.CreateObject_
        ("Shell.Explorer.1")
       html$=Edit1.Text
       Explorer.Navigate(html$)
      END IF
      Gauge1.Position = 0
      FOR x=1 TO 100:Gauge1.Position = x : NEXT x
      Gauge1.Position = 33
      FOR x=1 TO 5000:NEXT x: FOR x=1 TO 100:Gauge1.Position = x : NEXT x
     END SUB


     SUB ESCAPE
      Explorer.Navigate("c:")
     END SUB

     SUB Button2Click (Sender AS QBUTTON)
      Button2.Enabled = 0
      CREATE xjForm AS QFORM
       CAPTION ="HELP:"
       Width = 843
       Height = 597
       Center
       CREATE xRichEdit1 AS QRICHEDIT
        Left = 0
        Top = 25
        Width = 835
        Height = 538
        Align = 5
        PlainText = 1
        ReadOnly = 1
        ScrollBars = 3
        WordWrap = 0
        AddStrings "		Internet Emulation Explorer Text Editor & Html/Java Work Shop. ", _
         "                                         Copyright 2002 ©   A Freeware Open Source Project, ", _
         "                                                                      Made In Montana.   ", _
         "                                      ", _
         "         Programmer:                  Johnny B Stroud.                             ", _
         "         Age:                               22 ", _
         "", _
         "         Location:                      The United States of America. ", _
         "        Assembler Used:           Rapid-Q  A Cross Platform  32bit Language. ", _
         "        Tested ON:                    Windows XP , Windows 98 / 95 & Ms-Windows, Linux/Mandrake & Red Hat.", _
         "                                                 Software Tested on the following CPU’s 80286 / 80386 / 80486 / Intel III ", _
         "", _
         "        Recommended CPU:      x86 Family 6 Model 7 Stepping 3 Genuine Intel ~448 Mhz  ", _
         "        Recommended Ram:      64.00 MB  Available Physical Memory 5.79 MB ", _
         "        Recommended OS:        Windows XP Home Eddition. ", _
         "        ", _
         "         ", _
         "       This program if you run by default is self analyzing to find what’s not setup on your operating system. ", _
         "Please Click the browser refresh button 2 times. And the web page yahoo.com will load in 2 to 3 seconds ", _
         "depending on your modem. If the program does not make a conection to the server it will time out.  ", _
         "To navagate back and forth form web page to page just right click. It gives you a lot of options exactly like ", _
         "windows Explorer.  If  you click the refresh button 3 times it will load the editor but will not close the ", _
         "browser window just hide it out of view.  You can go back at any time by using the go back short cut F2.  ", _
         "       ", _
         "Start-up Value:    Option Menu Names:                                SHORT CUTS:", _
         " ENABLED..........NEW........................................................ Alt + N ", _
         " ENABLED..........OPEN...................................................... Shift + Ctrl + O ", _
         " DISABLED.........REOPEN................................................. (Shift + 1) (Shift + 2) (Shift + 3)", _
         " ENABLED..........SAVE....................................................... Alt + S", _
         " ENABLED..........SAVE AS................................................. Alt+ A ", _
         " ENABLED..........HIDE/EDITOR TO BROWSER.............. F2", _
         " ENABLED..........Close All Projects..................................... F1", _
         " ENABLED..........COPY...................................................... CTRL+ C", _
         " ENABLED..........Cut.......................................................... CTRL+ X", _
         " ENABLED..........Paste...................................................... CTRL+ V", _
         " ENABLED.........Select All................................................. CTRL+ S", _
         " ENABLED.........Find......................................................... Ctrl + Shift + Enter", _
         "", _
         "Authors Comments: ", _
         "If you run this Software from the ms-dos prompt you will see the program unitizing ", _
         "the self debugger I have built in to test the source code.      ", _
         "DEBUGER -> HELP Log TIME:"+ TIME$  + " DATE:" + DATE$
       END CREATE
      END CREATE

      xjForm.SHOWMODAL

     END SUB


     SUB ExitEditorClick    '' Exit item clicked
      Form.SHOWMODAL
     END SUB

     SUB ProjectCloseClick
      MainForm.CLOSE
     END SUB

     SUB NewClick           '' New item clicked
      RichEdit.Clear
      FileName = "UNTiTLED"
     END SUB

     SUB OpenClick          '' Open item clicked
      DIM OpenDialog AS QOPENDIALOG

      IF OpenDialog.EXECUTE THEN
       FileName = OpenDialog.FileName
       RichEdit.LoadFromFile FileName
       IF CountFiles = 0 THEN
        ReOpen.Enabled = True
        ReOpen1.CAPTION = "&1. "+FileName
        ReOpen.Insert 0, ReOpen1
       ELSEIF CountFiles = 1 THEN
        ReOpen2.CAPTION = "&2. "+FileName
        ReOpen.Insert 1, ReOpen2
       ELSEIF CountFiles = 2 THEN
        ReOpen3.CAPTION = "&3. "+FileName
        ReOpen.Insert 2, ReOpen3
       ELSE
        CountFiles = CountFiles - 1
        ReOpen1.CAPTION = "&1. "+RIGHT$(ReOpen2.CAPTION, LEN(ReOpen2.CAPTION)-4)
        ReOpen2.CAPTION = "&2. "+RIGHT$(ReOpen3.CAPTION, LEN(ReOpen3.CAPTION)-4)
        ReOpen3.CAPTION = "&3. "+FileName
       END IF
       CountFiles = CountFiles + 1
       RichEdit.Modified = False
      END IF
     END SUB

     SUB SaveAsClick          '' SaveAs item clicked
      DIM SaveDialog AS QSAVEDIALOG

      IF SaveDialog.EXECUTE THEN
       RichEdit.SaveToFile SaveDialog.FileName
      END IF
     END SUB

     SUB SaveClick
      IF FileName = "UNTiTLED" THEN
       SaveAsClick
      ELSE
       RichEdit.SaveToFile FileName
      END IF
     END SUB

     SUB CopyClick:  RichEdit.CopyToClipBoard:    END SUB   '' Oh yeah, that was easy
     SUB CutClick:   RichEdit.CutToClipBoard:     END SUB
     SUB PasteClick: RichEdit.PasteFromClipBoard: END SUB
     SUB SelectAllClick: RichEdit.SelectAll:      END SUB

     SUB Reopen1Click
      IF RichEdit.Modified THEN
       SHOWMESSAGE "Abandoning changes"
      END IF
      RichEdit.LoadFromFile RIGHT$(ReOpen1.CAPTION, LEN(ReOpen1.CAPTION)-4)
      RichEdit.Modified = False
     END SUB

     SUB Reopen2Click
      IF RichEdit.Modified THEN
       SHOWMESSAGE "Abandoning changes"
      END IF
      RichEdit.LoadFromFile RIGHT$(ReOpen2.CAPTION, LEN(ReOpen2.CAPTION)-4)
      RichEdit.Modified = False
     END SUB

     SUB Reopen3Click
      IF RichEdit.Modified THEN
       SHOWMESSAGE "Abandoning changes"
      END IF
      RichEdit.LoadFromFile RIGHT$(ReOpen3.CAPTION, LEN(ReOpen3.CAPTION)-4)
      RichEdit.Modified = False
     END SUB

     SUB FindText   '' Primitive search...
      RichEdit.SelStart = INSTR(UCASE$(RichEdit.Text), UCASE$(EditBox.Text))-1
      IF RichEdit.SelStart > 0 THEN
       DIM Font AS QFONT
       Font.AddStyles(fsBold, fsItalic)

       RichEdit.SelLength = LEN(EditBox.Text)
       RichEdit.SelAttributes = Font
       DialogBox.CLOSE
      ELSE
       SHOWMESSAGE EditBox.Text+" not found."
      END IF
     END SUB

     SUB FindClick
      DIM Button AS QBUTTON

      Button.PARENT = DialogBox
      Button.OnClick = FindText
      Button.CAPTION = "&OK"
      Button.Top = 13
      Button.Left = 210
      Button.Width = 70

      EditBox.PARENT = DialogBox
      EditBox.Top = 15
      EditBox.Left = 20
      EditBox.Width = 170

      DialogBox.BorderStyle = bsDialog
      DialogBox.CAPTION = "Search..."
      DialogBox.Width = 300
      DialogBox.Height = 80
      DialogBox.Center

      DialogBox.SHOWMODAL
     END SUB


     SUB FormResize
      RichEdit.Width = MainForm.ClientWidth
      RichEdit.Height = MainForm.ClientHeight
     END SUB


     SUB RichShowXY
      StatusBar.Panel(0).CAPTION = STR$(RichEdit.WhereY+1)+" : "+STR$(RichEdit.WhereX+1)
     END SUB

     SUB ABOUT
      CREATE Formm AS QFORM
       Width = 500
       Height = 193
       Center
       CREATE Image1 AS QIMAGE
        BMP = "information.bmp"
        Left = 6
        Top = 9
        Width = 228
        Height = 128
        AutoSize = 1
        Align= 3
       END CREATE
      END CREATE
      Formm.SHOWMODAL
     END SUB


     New.CAPTION = "&NEW"           : New.OnClick = NewClick
     New.ShortCut = "Alt+N"
     OPEN.CAPTION = "&OPEN"         : OPEN.OnClick = OpenClick
     OPEN.ShortCut = "Shift+Ctrl+O"
     ReOpen.CAPTION = "&REOPEN"
     ReOpen.Enabled = False
     ReOpen1.CAPTION = ""           : ReOpen1.OnClick = Reopen1Click
     ReOpen1.ShortCut = "Shift+1"
     ReOpen2.CAPTION = ""           : ReOpen2.OnClick = Reopen2Click
     ReOpen2.ShortCut = "Shift+2"
     ReOpen3.CAPTION = ""           : ReOpen3.OnClick = Reopen3Click
     ReOpen3.ShortCut = "Shift+3"
     Save.CAPTION = "&SAVE"         : Save.OnClick = SaveClick
     Save.ShortCut = "Alt+S"
     SaveAs.CAPTION = "SAVE &AS..." : SaveAs.OnClick = SaveAsClick
     SaveAs.ShortCut = "Alt+A"
     Break1.CAPTION ="-"
     ExitEditor.CAPTION = "HIDE/E&DITOR TO BROWSER"   : ExitEditor.OnClick = ExitEditorClick
     ExitEditor.ShortCut = "F2"
     ExitProjects.CAPTION = "Close All &Projects"
     ExitProjects.ShortCut =  "F1"
     ExitProjects.OnClick = ProjectCloseClick

     File.CAPTION = "&File"
     File.AddItems New,OPEN,ReOpen,Save,SaveAs,Break1,ExitEditor, ExitProjects

     Copy.CAPTION = "&Copy"   : Copy.OnClick = CopyClick
     Copy.ShortCut = "CTRL+C"
     Cut.CAPTION  = "Cu&t"   : Cut.OnClick = CutClick
     Cut.ShortCut = "CTRL+X"
     Paste.CAPTION = "&Paste" : Paste.OnClick = PasteClick
     Paste.ShortCut = "CTRL+V"
     SelectAll.CAPTION = "&Select All" : SelectAll.OnClick = SelectAllClick
     SelectAll.ShortCut = "CTRL+S"
     Edit.CAPTION = "&Edit"
     Edit.AddItems Copy,Cut,Paste,SelectAll

     Find.CAPTION = "&Find"
     Find.OnClick = FindClick
     Find.ShortCut = "Ctrl+Shift+Enter"


     Search.CAPTION = "&Search"
     Search.AddItems Find

     helper.CAPTION = "&Help"
     helper.OnClick = Button2Click
     progre.CAPTION = "&About"
     progre.OnClick = ABOUT
     Help.CAPTION = "&Help"
     Help.AddItems helper, progre

     MainMenu.PARENT = MainForm
     MainMenu.AddItems File,Edit,Search,Help

     RichEdit.PARENT = MainForm
     RichEdit.Align = alClient
     RichEdit.Width = MainForm.ClientWidth
     RichEdit.Height = MainForm.ClientHeight
     RichEdit.ScrollBars = ssBoth
     RichEdit.PlainText = True
     RichEdit.WordWrap = False
     RichEdit.OnKeyUp = RichShowXY
     RichEdit.OnMouseMove = RichShowXY

     MainForm.CAPTION = "Internet Explorer Emulator & Editor."
     MainForm.Width = 848
     MainForm.Height = 611
     MainForm.Center
     MainForm.OnResize = FormResize


     Form.SHOWMODAL
     MainForm.SHOWMODAL


掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Mon 2024-3-4  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-02-26 09:48:10