$PBExportHeader$w_rte_link_test.srw forward global type w_rte_link_test from window end type type cb_3 from commandbutton within w_rte_link_test end type type cb_2 from commandbutton within w_rte_link_test end type type st_1 from statictext within w_rte_link_test end type type cb_1 from commandbutton within w_rte_link_test end type type rte_1 from richtextedit within w_rte_link_test end type end forward global type w_rte_link_test from window integer width = 3694 integer height = 2200 boolean titlebar = true string title = "Test adding link to rich text - and store as html" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true cb_3 cb_3 cb_2 cb_2 st_1 st_1 cb_1 cb_1 rte_1 rte_1 end type global w_rte_link_test w_rte_link_test on w_rte_link_test.create this.cb_3=create cb_3 this.cb_2=create cb_2 this.st_1=create st_1 this.cb_1=create cb_1 this.rte_1=create rte_1 this.Control[]={this.cb_3,& this.cb_2,& this.st_1,& this.cb_1,& this.rte_1} end on on w_rte_link_test.destroy destroy(this.cb_3) destroy(this.cb_2) destroy(this.st_1) destroy(this.cb_1) destroy(this.rte_1) end on type cb_3 from commandbutton within w_rte_link_test integer x = 78 integer y = 212 integer width = 709 integer height = 112 integer taborder = 30 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "Show rich text source" end type event clicked;string a_rt a_rt=rte_1.copyRTF(false, detail!) messagebox('RT',a_rt) end event type cb_2 from commandbutton within w_rte_link_test integer x = 78 integer y = 372 integer width = 709 integer height = 112 integer taborder = 20 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "Generate html" end type event clicked;integer status, filenum string filename, fname, a_html filename='linktest.htm' status=GetFileSaveName("Filename for HTML-source",filename,fname,& "Html Files (*.HTM),*.HTM,") IF status = -1 THEN MessageBox("Filename","Error...") Return ElseIf status = 0 Then // Cancel Return END IF rte_1.SaveDocument(filename,FileTypeHTML!) filenum=fileopen(fname, TextMode!, Read!) filereadex(filenum, a_html) fileclose(filenum) messagebox('HTML',a_html) end event type st_1 from statictext within w_rte_link_test integer x = 823 integer y = 80 integer width = 887 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "Adding https://www.appeon.com/" boolean focusrectangle = false end type type cb_1 from commandbutton within w_rte_link_test integer x = 78 integer y = 52 integer width = 709 integer height = 112 integer taborder = 20 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "Add link to RTE text" end type event clicked;string a_link, a_text, a_rt a_link='https://www.appeon.com' a_text='Appeon' a_rt='{\rtf1{\colortbl ;\red0\green0\blue238;}{\field{*\fldinst HYPERLINK "'+a_link+'"}{\fldrslt{\ul\cf1'+a_text+'}}} }' rte_1.PasteRTF(a_rt) end event type rte_1 from richtextedit within w_rte_link_test integer x = 1742 integer y = 32 integer width = 1792 integer height = 468 integer taborder = 10 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" borderstyle borderstyle = stylelowered! end type