|

分享源码
界面截图: |
|
是否带模块: |
- |
备注说明: |
无法显示标题我也无赖....
EPL核心支持库问题啊.... |
本帖最后由 玲心韩雪 于 2012-10-28 09:36 编辑
EPL language 开发多页浏览器源码
![]() - .DocVersion 2
- .Lib HtmlView
- .Lib iext3
- .Lib iext
- .Module FormModule1
- .ModuleVar IE, HTMLBrowser, , "0"
- .ModuleVar MainCaption, String
- .Sub _MainForm_AfterCreate
- 窗口布局 ()
- .Sub 窗口布局, , Export
- MainCaption = "Themyth Browser"
- SSL.Text = "百度一下,你就知道"
- MainForm.Caption = MainCaption
- MainForm.MinButton = True
- Browser1.Visible = False
- Browser1.Silence = Not (True)
- FstOneRun_CSH_Function ()
- IE [Tab.CurrentTab].SetFocus ()
- CSH_CDBT ()
- .Sub CSH_CDBT, , Export
- 主页A.Caption = "主页"
- 空白页A.Caption = "空白页"
- 搜索页A.Caption = "搜索页"
- .Sub FstOneRun_CSH_Function, , Export
- .LocalVar aa, HTMLBrowser
- Tab.AddTab ("", , , , )
- Tab.HideTab (0, True)
- CopyControl (Browser1, aa)
- AddElement (IE, aa)
- Tab.CurrentTab = GetAryElementCount (IE)
- IE [Tab.CurrentTab].Visible = True
- ' // IE [Tab.CurrentTab].ZOrder ()
- IE [Tab.CurrentTab].Execute (2)
- 同步显示WEB页 (Tab.CurrentTab)
- .Sub 同步显示WEB页, , Export
- .Arg XSSY, Integer
- .LocalVar CurLoopTime, Integer
- .Count (GetAryElementCount (IE), CurLoopTime)
- .If (CurLoopTime <> XSSY)
- IE [CurLoopTime].Visible = False
- IE [CurLoopTime].ZOrder (2)
- .else
- IE [CurLoopTime].Visible = True
- IE [CurLoopTime].ZOrder ()
- .ife_end
- .CountNext ()
- .Sub 新建页面, , Export
- .Arg 地址, String, ByRef AllowEmpty
- .LocalVar aa, HTMLBrowser
- Tab.AddTab ("", , , , )
- Tab.HideTab (0, True)
- CopyControl (Browser1, aa)
- AddElement (IE, aa)
- Tab.CurrentTab = GetAryElementCount (IE)
- IE [Tab.CurrentTab].Visible = True
- IE [Tab.CurrentTab].ZOrder ()
- IE [Tab.CurrentTab].URL = 地址
- 同步显示WEB页 (Tab.CurrentTab)
- .Sub 跳转页面
- .Arg 地址, String, AllowEmpty
- .Arg 特殊, Boolean, AllowEmpty
- .Arg 内定, Integer, AllowEmpty
- .Arg 索引, Integer, AllowEmpty
- .If (IsEmpty (特殊) = True)
- .If (特殊 <> True)
- Tab.CurrentTab = 索引
- IE [索引].Navigate (地址, , )
- 同步显示WEB页 (索引)
- .else
- 跳转面页_Function (内定, 索引)
- .ife_end
- .else
- 跳转面页_Function (内定, 索引)
- .ife_end
- .Sub 跳转面页_Function
- .Arg 内定, Integer
- .Arg 索引, Integer
- IE [索引].Execute (内定)
- Tab.CurrentTab = 索引
- 同步显示WEB页 (索引)
- .Sub _主页A_Click
- 新建页面 (GetTextKey (3, "SOFTWARE\Microsoft\Internet Explorer\Main\Start Page", ))
- ' Search Page
- .Sub _搜索页A_Click
- 新建页面 (GetTextKey (3, "SOFTWARE\Microsoft\Internet Explorer\Main\Search Page", ))
- .Sub _空白页A_Click
- ' //新建页面 (GetTextKey (3, "SOFTWARE\Microsoft\Internet Explorer\Main\Security Risk Page", ))
- 新建页面 ("about:inprivate")
- .Sub _Tab_HeadRightClick
- .Arg TabIndex, Integer
- PopupMenu (t12jinkninwi1no31123, , )
- .Sub _主页_Click
- 跳转页面 ("", True, 2, Tab.CurrentTab)
- .Sub _搜索页_Click
- 跳转页面 ("", True, 3, Tab.CurrentTab)
- .Sub _空白页_Click
- 跳转页面 ("about:inprivate", , , Tab.CurrentTab)
- .Sub _Tab_TabChange
- .LocalVar Temp, String
- .IfTrue (GetAryElementCount (IE) > 0)
- 同步显示WEB页 (Tab.CurrentTab)
- _Browser1_CaptionChange ()
- ' //Caption = MainCaption + " " + IE [Tab.CurrentTab].Caption
- ' //SetTab_Box_Function (Tab.CurrentTab, TabCaptionFunction (#MY_24, IE [Tab.CurrentTab].Caption), IE [Tab.CurrentTab].Caption)
- .if_end
- .Sub _当前页_Click
- .LocalVar 索引, Integer
- ' // 关闭面页 (Tab.CurrentTab, "about:inprivate")
- .IfTrue (Tab.CurrentTab > 0)
- .If (Tab.GetTabCount () = 2)
- _空白页_Click ()
- .else
- IE [Tab.CurrentTab].Destroy ()
- RemoveElement (IE, Tab.CurrentTab, )
- Tab.DeleteTab (Tab.CurrentTab)
- .ife_end
- 同步显示WEB页 (Tab.CurrentTab)
- .if_end
- .Sub _全部页_Click
- .LocalVar s, Integer
- .LocalVar f
- .IfTrue (GetAryElementCount (IE) > 0)
- .Count (GetAryElementCount (IE), s)
- ' f = GetAryElementCount (IE)
- ' f = f - s
- .If (GetAryElementCount (IE) = 1)
- 跳转页面 ("about:inprivate", False, -1, Tab.CurrentTab)
- .else
- IE [s].Destroy ()
- Tab.DeleteTab (s)
- RemoveElement (IE, s, )
- .ife_end
- 同步显示WEB页 (Tab.CurrentTab)
- .CountNext ()
- .if_end
- .Sub _Browser1_StatusTextChange
- Statusbar.SetText (1, IE [Tab.CurrentTab].StatusText)
- .Sub _Browser1_BeforeNavigate, Boolean
- Return (Not (False))
- DZL.Text = IE [Tab.CurrentTab].URL
- Swap (IE [Tab.CurrentTab].URL)
- .Sub Swap, , Export
- .Arg UrlAdderss, String, , url地址
- .LocalVar ico, Bin, Static, "0"
- .LocalVar url, String, Static, "0"
- .LocalVar linseed, Bin, , "0"
- .LocalVar Sy, Integer
- .LocalVar Cs, Integer
- .LocalVar bni, Bin
- .For (1, GetAryElementCount (url), 1, Sy)
- .IfTrue (url [Sy] = UrlAdderss)
- AddElement (linseed, ico [Sy])
- Cs = Cs + 1
- .if_end
- .Next ()
- .If (Cs <> 0)
- bni = Readehtmlico (CliocAdderss (UrlAdderss))
- .else
- bni = linseed [1]
- .ife_end
- .If (bni <> { })
- htmlIco.Picture = bni
- .else
- htmlIco.Picture = Icon
- .ife_end
- .Sub CliocAdderss, String, Export
- .Arg adderss, String
- .LocalVar a, String, , "0"
- .LocalVar c
- .LocalVar d, String
- a = SplitString (adderss, "/", )
- .Count (#MY_03, c)
- .If (c < 2 And c > 0)
- d = a [c] + "//"
- .else
- d = d + a [c] + "/"
- .ife_end
- .CountNext ()
- .IfTrue (StrRight (d, 1) <> "/")
- d = d + "/"
- .if_end
- d = d + "favicon.ico"
- Return (d)
- .Sub Readehtmlico, Bin, Export
- .Arg call, String, AllowEmpty
- .Arg adder, String, AllowEmpty
- .LocalVar oject, Object
- .LocalVar bin, Bin
- .If (oject.Create ("Microsoft.XMLHTTP", ))
- .If (IsEmpty (call) = True)
- oject.Call ("Open", "GET", adder, False)
- .else
- oject.Call ("Open", call, adder, False)
- .ife_end
- oject.Call ("Send", )
- bin = oject.GetProperty ("ResponseBody", ).GetBin ()
- Return (bin)
- .else
- Return (CBin (""))
- .ife_end
- .Sub _Browser1_StartLoading
- SetTab_Box_Function (Tab.CurrentTab, TabCaptionFunction (#MY_024, "StartLoading"), "StartLoading")
- .Sub _Browser1_AfterLoad
- SetTab_Box_Function (Tab.CurrentTab, TabCaptionFunction (#MY_024, "AfterLoad"), "AfterLoad")
- 同步标题 ()
- .Sub SetTab_Box_Function, , Export
- .Arg Index, Integer
- .Arg Name, String
- .Arg Tip, String
- Tab.SetTabName (Index, Name)
- Tab.SetTabTip (Index, Tip)
- .Sub _Browser1_OpeningNew, Boolean
- 新建页面 (IE [Tab.CurrentTab].StatusText)
- .Sub _Browser1_CaptionChange
- 同步标题 ()
- .Sub 同步标题, , Export, EPL HTMLBrower Fne Error SY dome TB Caption
- .LocalVar Temp, String
- .If (IE [Tab.CurrentTab].Caption <> "Internet Explorer 无法显示该网页")
- SetTab_Box_Function (Tab.CurrentTab, TabCaptionFunction (#MY_024, Temp), IE [Tab.CurrentTab].Caption)
- Caption = MainCaption + " " + IE [Tab.CurrentTab].Caption
- .else
- Temp = MainCaption + " " + "无法显示该网页"
- SetTab_Box_Function (Tab.CurrentTab, TabCaptionFunction (#MY_024, Temp), Temp)
- Caption = Temp
- .ife_end
- .Sub TabCaptionFunction, String
- .Arg Width, Integer
- .Arg Char, String
- .LocalVar temp_Width, Integer
- .LocalVar Temp_Count, Integer, , "2"
- .LocalVar Temp_Char, String
- temp_Width = Width
- Temp_Count [1] = StrLen (Char)
- Temp_Count [2] = temp_Width - Temp_Count [1]
- .If (Temp_Count [2] <= 0)
- Return (StrLeft (Char, temp_Width) + "...")
- .else
- .Count (Temp_Count [2] / 2, )
- Temp_Char = Temp_Char + " "
- .CountNext ()
- Temp_Char = Temp_Char + Char + Temp_Char
- Return (StrLeft (Temp_Char, #MY_024))
- .ife_end
- .Sub _Browser1_AfterNavigate
- DZL.Text = IE [Tab.CurrentTab].URL
- ProgressBar1.Position = ProgressBar1.Min
- ComboBox_Add (IE [Tab.CurrentTab].URL)
- .Sub _Browser1_Progress
- .Arg ProgressPercent, Integer
- ProgressBar1.Position = ProgressPercent
- ProgressBar1.ZOrder (3)
- .Sub _Tab_DblClick, Boolean
- .Arg x, Integer
- .Arg y, Integer
- .Arg KeyState, Integer
- _当前页_Click ()
- .Sub _SSL_GetFocus
- SSL.Text = ""
- .Sub _SSL_LostFocus
- SSL.Text = "百度一下,你就知道"
- .Sub _DZL_LButtonDown, Boolean
- .Arg x, Integer
- .Arg y, Integer
- .Arg KeyState, Integer
- DZL.SetFocus ()
- .Sub _Tab_LButtonDown, Boolean
- .Arg x, Integer
- .Arg y, Integer
- .Arg KeyState, Integer
- IE [Tab.CurrentTab].SetFocus ()
- .Sub _XLCD_Click
- ComboBox1.SendMessage (335, 1, 0)
- .Sub ComboBox_Add, , Export
- .Arg 文本, String
- .LocalVar 寄存器, String
- .LocalVar 索引, Integer
- .LocalVar 次数, Integer
- 寄存器 = 文本
- .IfTrue (InStr (寄存器, "about:blank", , False) = -1)
- .Count (ComboBox1.GetItemCount (), 索引)
- .IfTrue (ComboBox1.GetItemText (索引 - 1) = 文本)
- 次数 = 次数 + 1
- .if_end
- .CountNext ()
- .IfTrue (次数 = 0)
- ComboBox1.AddItem (寄存器, )
- .if_end
- .if_end
- .Sub _ComboBox1_ItemSelect
- DZL.Text = ComboBox1.Text
- _ZD_Click ()
- .Sub _ZD_Click
- .IfTrue (TrimAll (DZL.Text) <> "")
- 跳转页面 (DZL.Text, False, -1, Tab.CurrentTab)
- .if_end
- .Sub _SS_Click
- .IfTrue (TrimAll (SSL.Text) <> "")
- DZL.Text = SSL.Text
- _ZD_Click ()
- .if_end
复制代码 启动函数集- .DocVersion 2
- .Module MainModule
- .Sub _MainFunction, Integer, , This sub function will be executed first after program starts
- Return (Function_LoadWindow () - 1) ' You can return any number as you need
- .Sub Function_LoadWindow, Integer, Export
- Return (CInt (Load (MainForm, , False)))
复制代码- .DocVersion 2
- .Const MY_024, "24"
- .Const MY_03, "3"
复制代码 源码下载地址:
EPL Source Code.rar
(51.75 KB, 下载次数: 290)
|
|