uo_html_editor.sru 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. $PBExportHeader$uo_html_editor.sru
  2. forward
  3. global type uo_html_editor from userobject
  4. end type
  5. type pb_underline from picturebutton within uo_html_editor
  6. end type
  7. type pb_textcolor from picturebutton within uo_html_editor
  8. end type
  9. type pb_numbers from picturebutton within uo_html_editor
  10. end type
  11. type pb_bullets from picturebutton within uo_html_editor
  12. end type
  13. type pb_italic from picturebutton within uo_html_editor
  14. end type
  15. type pb_outdent from picturebutton within uo_html_editor
  16. end type
  17. type pb_bold from picturebutton within uo_html_editor
  18. end type
  19. type pb_indent from picturebutton within uo_html_editor
  20. end type
  21. type pb_left from picturebutton within uo_html_editor
  22. end type
  23. type pb_center from picturebutton within uo_html_editor
  24. end type
  25. type pb_right from picturebutton within uo_html_editor
  26. end type
  27. type pb_full from picturebutton within uo_html_editor
  28. end type
  29. type pb_line from picturebutton within uo_html_editor
  30. end type
  31. type pb_hyperlink from picturebutton within uo_html_editor
  32. end type
  33. type pb_picture from picturebutton within uo_html_editor
  34. end type
  35. type ddlb_fontsize from dropdownlistbox within uo_html_editor
  36. end type
  37. type ddlb_font from dropdownlistbox within uo_html_editor
  38. end type
  39. type ole_web from olecustomcontrol within uo_html_editor
  40. end type
  41. type bitmapinfoheader from structure within uo_html_editor
  42. end type
  43. type bitmapfileheader from structure within uo_html_editor
  44. end type
  45. type bitmapinfo from structure within uo_html_editor
  46. end type
  47. end forward
  48. type bitmapinfoheader from structure
  49. long bisize
  50. long biwidth
  51. long biheight
  52. integer biplanes
  53. integer bibitcount
  54. long bicompression
  55. long bisizeimage
  56. long bixpelspermeter
  57. long biypelspermeter
  58. long biclrused
  59. long biclrimportant
  60. end type
  61. type bitmapfileheader from structure
  62. integer bftype
  63. long bfsize
  64. integer bfreserved1
  65. integer bfreserved2
  66. long bfoffbits
  67. end type
  68. type bitmapinfo from structure
  69. bitmapinfoheader bmiheader
  70. unsignedlong bmicolors[]
  71. end type
  72. global type uo_html_editor from userobject
  73. integer width = 3346
  74. integer height = 1812
  75. long backcolor = 16777215
  76. string text = "none"
  77. long tabtextcolor = 33554432
  78. long picturemaskcolor = 536870912
  79. event size pbm_size
  80. event ue_afterinit ( )
  81. event getfocus pbm_bnsetfocus
  82. event losefocus pbm_bnkillfocus
  83. pb_underline pb_underline
  84. pb_textcolor pb_textcolor
  85. pb_numbers pb_numbers
  86. pb_bullets pb_bullets
  87. pb_italic pb_italic
  88. pb_outdent pb_outdent
  89. pb_bold pb_bold
  90. pb_indent pb_indent
  91. pb_left pb_left
  92. pb_center pb_center
  93. pb_right pb_right
  94. pb_full pb_full
  95. pb_line pb_line
  96. pb_hyperlink pb_hyperlink
  97. pb_picture pb_picture
  98. ddlb_fontsize ddlb_fontsize
  99. ddlb_font ddlb_font
  100. ole_web ole_web
  101. end type
  102. global uo_html_editor uo_html_editor
  103. type prototypes
  104. function string getfontfaces() library "pbgdiex.dll" alias for "getfontfaces;Ansi"
  105. Function ulong CameraSubArea() LIBRARY "CameraDll.dll" alias for "CameraSubArea;Ansi"
  106. FUNCTION Boolean OpenClipboard(ULong hWndNewOwner) LIBRARY "user32.dll" Alias For "OpenClipboard;Ansi"
  107. FUNCTION Boolean CloseClipboard() LIBRARY "user32.dll" Alias For "CloseClipboard;Ansi"
  108. FUNCTION ULong GetClipboardData(ulong wFormat) LIBRARY "user32.dll" Alias For "GetClipboardData;Ansi"
  109. FUNCTION ulong IsClipboardFormatAvailable(ulong wFormat) LIBRARY "user32.dll" Alias For "IsClipboardFormatAvailable;Ansi"
  110. FUNCTION ULong GetDesktopWindow() LIBRARY "user32.dll" Alias For "GetDesktopWindow;Ansi"
  111. FUNCTION ULong GetDC(ULong hWnd) LIBRARY "user32.dll" Alias For "GetDC;Ansi"
  112. FUNCTION ULong CreateCompatibleDC(ULong hdc) LIBRARY "gdi32.dll" Alias For "CreateCompatibleDC;Ansi"
  113. FUNCTION ULong SelectObject(ULong hdc,ULong hgdiobj) LIBRARY "gdi32.dll" Alias For "SelectObject;Ansi"
  114. FUNCTION Int GetDIBits(ULong hdc,ULong hbmp,UInt uStartScan,UInt cScanLines,REF Blob lpvBits,REF bitmapinfo lpbi,UInt uUsage) LIBRARY "gdi32.dll" alias for "GetDIBits;Ansi"
  115. FUNCTION Int GetDIBits(ULong hdc,ULong hbmp,UInt uStartScan,UInt cScanLines, ULong lpvBits, REF bitmapinfo lpbi, UInt uUsage) LIBRARY "gdi32.dll" alias for "GetDIBits;Ansi"
  116. SUBROUTINE CopyBitmapFileHeader(REF Blob Destination, bitmapfileheader Source,Long Length) LIBRARY "kernel32.dll" ALIAS FOR "RtlMoveMemory;Ansi"
  117. SUBROUTINE CopyBitmapInfo(REF Blob Destination, bitmapinfo Source,Long Length) LIBRARY "kernel32.dll" ALIAS FOR "RtlMoveMemory"
  118. FUNCTION Boolean DeleteDC(ULong hdc) LIBRARY "gdi32.dll" Alias For "DeleteDC;Ansi"
  119. FUNCTION Int ReleaseDC(ULong hWnd,ULong hdc) LIBRARY "user32.dll" Alias For "ReleaseDC;Ansi"
  120. FUNCTION ULong CreateFile(String lpFileName, ULong dwDesiredAccess, ULong dwShareMode, ULong lpSecurityAttributes, ULong dwCreationDisposition, &
  121. ULong dwFlagsAndAttributes, ULong hTemplateFile ) LIBRARY "kernel32.dll" ALIAS FOR "CreateFileA;Ansi"
  122. FUNCTION Boolean WriteFile(ULong hFile,Blob lpBuffer,ULong nNumberOfBytesToWrite,REF ULong lpNumberOfBytesWritten, &
  123. ULong lpOverlapped) LIBRARY "kernel32.dll" Alias For "WriteFile;Ansi"
  124. FUNCTION Boolean CloseHandle(ULong hObject) LIBRARY "kernel32.dll" Alias For "CloseHandle;Ansi"
  125. FUNCTION Integer GlobalAddAtom(ref string lpString) LIBRARY "kernel32.dll" ALIAS FOR "GlobalAddAtomA"
  126. FUNCTION ulong RegisterHotKey(ulong hwnd,ulong id,ulong fsModifiers,ulong vk) LIBRARY "user32.dll"
  127. FUNCTION ulong UnregisterHotKey( ulong hWnd, ulong id ) LIBRARY "user32.dll"
  128. end prototypes
  129. type variables
  130. boolean ib_shown = false
  131. long sys_atomid,sys_handle
  132. constant integer MOD_ALT = 1 //ALT键
  133. constant integer MOD_CONTROL = 2 //CTRL键
  134. constant integer MOD_SHIFT = 4 //SHIFT键
  135. string fjfilepathname = 'fjtemp'
  136. end variables
  137. forward prototypes
  138. public subroutine uf_refreshtoolbar ()
  139. public subroutine uf_addfonts ()
  140. public function string uf_gethtml ()
  141. public function string uf_gettext ()
  142. public function integer uf_sethtml (string arg_html)
  143. public subroutine uf_settext (string arg_text)
  144. public function integer uf_test ()
  145. public function integer uf_setbackground (string arg_path)
  146. public function string uf_style_jianyue ()
  147. public function string uf_style_shuangwu ()
  148. public function string uf_style_zidingyi ()
  149. public subroutine uf_setcontenteditable (string arg_set)
  150. public subroutine uf_navigate (string arg_path)
  151. public subroutine uf_setreadonly ()
  152. public subroutine uf_getfont ()
  153. public subroutine uf_setfont ()
  154. public subroutine wf_picturetofile ()
  155. end prototypes
  156. event size;if this.width < 2500 then
  157. this.hscrollbar = true
  158. ole_web.width = 2500
  159. else
  160. this.hscrollbar = false
  161. ole_web.width = this.width
  162. end if
  163. if this.height < 600 then
  164. this.vscrollbar = true
  165. ole_web.height = 600 - ole_web.y
  166. else
  167. this.vscrollbar = false
  168. ole_web.height = this.height - ole_web.y
  169. end if
  170. end event
  171. event losefocus;// unRegisterHotKey(Handle(this), atomid)
  172. //messagebox("","eeew")
  173. //IF not IsNull(ClassName(GetFocus())) THEN
  174. // messagebox("",string(ClassName(GetFocus())))
  175. //end if
  176. //messagebox("","lose")
  177. end event
  178. public subroutine uf_refreshtoolbar ();string ls_fontname
  179. long ll_fontsize
  180. boolean lb_bold,lb_italic,lb_underline, lb_numbers, lb_bullets, lb_left, lb_center, lb_right, lb_full
  181. ls_fontname = string(ole_web.object.document.queryCommandValue("FontName"))
  182. long ll_index
  183. ll_index = ddlb_font.finditem(ls_fontname, 1)
  184. if ll_index > 0 then
  185. ddlb_font.selectitem(ll_index)
  186. end if
  187. ll_fontsize = long(ole_web.object.document.queryCommandValue("FontSize"))
  188. ddlb_fontsize.selectitem(ll_fontsize)
  189. lb_bold = ole_web.object.document.queryCommandState("Bold")
  190. lb_italic = ole_web.object.document.queryCommandState("Italic")
  191. lb_underline = ole_web.object.document.queryCommandState("Underline")
  192. lb_numbers = ole_web.object.document.queryCommandState("InsertOrderedList")
  193. lb_bullets = ole_web.object.document.queryCommandState("InsertUnorderedList")
  194. lb_left = ole_web.object.document.queryCommandState("JustifyLeft")
  195. lb_center = ole_web.object.document.queryCommandState("JustifyCenter")
  196. lb_right = ole_web.object.document.queryCommandState("JustifyRight")
  197. lb_full = ole_web.object.document.queryCommandState("JustifyFull")
  198. if lb_bold then
  199. pb_bold.picturename = pb_bold.tag
  200. else
  201. pb_bold.picturename = pb_bold.disabledname
  202. end if
  203. if lb_italic then
  204. pb_italic.picturename = pb_italic.tag
  205. else
  206. pb_italic.picturename = pb_italic.disabledname
  207. end if
  208. if lb_underline then
  209. pb_underline.picturename = pb_underline.tag
  210. else
  211. pb_underline.picturename = pb_underline.disabledname
  212. end if
  213. if lb_numbers then
  214. pb_numbers.picturename = pb_numbers.tag
  215. else
  216. pb_numbers.picturename = pb_numbers.disabledname
  217. end if
  218. if lb_bullets then
  219. pb_bullets.picturename = pb_bullets.tag
  220. else
  221. pb_bullets.picturename = pb_bullets.disabledname
  222. end if
  223. if lb_left then
  224. pb_left.picturename = pb_left.tag
  225. else
  226. pb_left.picturename = pb_left.disabledname
  227. end if
  228. if lb_center then
  229. pb_center.picturename = pb_center.tag
  230. else
  231. pb_center.picturename = pb_center.disabledname
  232. end if
  233. if lb_right then
  234. pb_right.picturename = pb_right.tag
  235. else
  236. pb_right.picturename = pb_right.disabledname
  237. end if
  238. if lb_full then
  239. pb_full.picturename = pb_full.tag
  240. else
  241. pb_full.picturename = pb_full.disabledname
  242. end if
  243. end subroutine
  244. public subroutine uf_addfonts ();string ls_fonts
  245. long ll_num1, ll_num2
  246. ls_fonts = getfontfaces()
  247. if isnull(ls_fonts) OR len(ls_fonts) <= 0 then return
  248. ll_num1 = 1
  249. ll_num2 = pos(ls_fonts, '~t', ll_num1)
  250. do while ll_num2 > 0
  251. ddlb_font.additem(trim(mid(ls_fonts, ll_num1, ll_num2 - ll_num1)))
  252. ll_num1 = ll_num2 + 1
  253. ll_num2 = pos(ls_fonts, '~t', ll_num1)
  254. loop
  255. end subroutine
  256. public function string uf_gethtml ();string rslt
  257. //if isnull(ole_web.object) then
  258. // rslt=''
  259. // goto ext
  260. //end if
  261. //if isnull(ole_web.object.document) then
  262. // rslt=''
  263. // goto ext
  264. //end if
  265. //if isnull(ole_web.object.document.body) then
  266. // rslt=''
  267. // goto ext
  268. //end if
  269. do while isnull(ole_web.object.document.body)
  270. // yield()
  271. rslt=''
  272. goto ext
  273. loop
  274. rslt=ole_web.object.document.body.innerHtml
  275. ext:
  276. return rslt
  277. end function
  278. public function string uf_gettext ();string rslt
  279. rslt=ole_web.object.document.body.innerText
  280. //messagebox('',rslt)
  281. return rslt
  282. end function
  283. public function integer uf_sethtml (string arg_html);//
  284. //if isnull(ole_web.object) then
  285. // arg_html=''
  286. // goto ext
  287. //end if
  288. //if isnull(ole_web.object.document) then
  289. // arg_html=''
  290. // goto ext
  291. //end if
  292. //if isnull(ole_web.object.document.body) then
  293. // arg_html=''
  294. // goto ext
  295. //end if
  296. //messagebox('','1'+arg_html)
  297. do while isnull(ole_web.object.document.body)
  298. yield()
  299. loop
  300. //ext:
  301. ole_web.object.document.body.innerhtml = arg_html
  302. //messagebox('','2'+string(ole_web.object.document.body.innerhtml))
  303. return 1
  304. end function
  305. public subroutine uf_settext (string arg_text);//
  306. ole_web.object.document.body.innerText=arg_text
  307. end subroutine
  308. public function integer uf_test ();string body
  309. //body='<BODY style="MARGIN: 0px" contentEditable=false><TABLE style="WIDTH: 100%; TABLE-LAYOUT: fixed; HEIGHT: 100%" border=0 cellSpacing=0 cellPadding=0 background="D:\Program Files\Foxmail 7.0\Data\MyStationery\002\5.jpg">'&
  310. //+'<TBODY>'&
  311. //+'<TR>'&
  312. //+'<TD vAlign=top align=left><IMG src="file:///D:/Program%20Files/Foxmail%207.0/Data/MyStationery/002/头像.jpg"></TD></TR>'&
  313. //+'<TR>'&
  314. //+'<TD style="PADDING-BOTTOM: 10px; LINE-HEIGHT: 1.5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; PADDING-TOP: 10px" height="100%" vAlign=top width="100%">'&
  315. //+'<DIV style="WIDTH: 100%; WHITE-SPACE: normal; WORD-BREAK: break-all" id=divFMContentBody contentEditable=true>'&
  316. //+'<DIV>ghnvbnvb</DIV>'&
  317. //+'<DIV>vbnvbn</DIV>'&
  318. //+'<DIV>vbnvbnv</DIV>'&
  319. //+'<DIV>vbnvbv</DIV>'&
  320. //+'<DIV>vbvvnvbnvbn</DIV>'&
  321. //+'<DIV>vbnbnvbnvbn</DIV>'&
  322. //+'<DIV>vbnvbnbnvnvnv</DIV>'&
  323. //+'<DIV>&nbsp;</DIV></DIV></TD></TR>'&
  324. //+'<TR>'&
  325. //+'<TD vAlign=bottom align=left><IMG src="file:///D:/Program%20Files/Foxmail%207.0/Data/MyStationery/002/feilvbin.jpg"></TD></TR></TBODY></TABLE></BODY>'
  326. //
  327. body=uf_style_jianyue()
  328. ole_web.object.document.body.innerhtml=body
  329. ole_web.object.document.body.contentEditable='false'
  330. return 1
  331. end function
  332. public function integer uf_setbackground (string arg_path);
  333. ole_web.object.document.body.background=arg_path
  334. //messagebox('',a)
  335. return 1
  336. end function
  337. public function string uf_style_jianyue ();string body
  338. body=''&
  339. +'<BODY style="MARGIN: 0px" contentEditable=false><TABLE style="PADDING-BOTTOM: 10px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 10px" border=0 cellSpacing=0 cellPadding=0 width="99.99%" background="D:\Program Files\Foxmail 7.0\Stationery\035\bg.jpg" height="100%">'&
  340. +'<TBODY>'&
  341. +'<TR>'&
  342. +'<TD style="LINE-HEIGHT: 160%; WIDTH: 100%; HEIGHT: 100%; FONT-SIZE: 10.5pt" vAlign=top>'&
  343. +'<DIV style="WIDTH: 100%; WHITE-SPACE: normal; WORD-BREAK: break-all" id=divFMContentBody contentEditable=true>'&
  344. +'<DIV>&nbsp;</DIV>'&
  345. +'<DIV>&nbsp;</DIV>'&
  346. +'<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>'&
  347. +'<DIV><SPAN > </SPAN></DIV>'&
  348. +'</DIV></TD></TR></TBODY></TABLE></BODY>'
  349. return body
  350. end function
  351. public function string uf_style_shuangwu ();string body
  352. body=''
  353. return body
  354. end function
  355. public function string uf_style_zidingyi ();string body
  356. body=''&
  357. +'<BODY style="MARGIN: 0px" contentEditable=false><TABLE style="WIDTH: 100%; TABLE-LAYOUT: fixed; HEIGHT: 100%" border=0 cellSpacing=0 cellPadding=0 background="backPicPath">'&
  358. +'<TBODY>'&
  359. +'<TR>'&
  360. +'<TD vAlign=top align=left><IMG src="file:///logoPicPath"></TD></TR>'&
  361. +'<TR id=bodytext>'&
  362. +'<TD style="PADDING-BOTTOM: 10px; LINE-HEIGHT: 1.5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; PADDING-TOP: 10px" height="100%" vAlign=top width="100%">'&
  363. +'<DIV style="WIDTH: 100%; WHITE-SPACE: normal; WORD-BREAK: break-all" id=divLEContentBody contentEditable=true>'&
  364. +'<DIV>&nbsp;</DIV>'&
  365. +'<DIV>&nbsp;</DIV>'&
  366. +'<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>'&
  367. +'<DIV><SPAN > </SPAN></DIV>'&
  368. +'<DIV><SPAN > </SPAN></DIV>'&
  369. +'<DIV id=divLEReplyBody></DIV></DIV></TD></TR>'&
  370. +'<TR>'&
  371. +'<TD vAlign=bottom align=left><IMG src="file:///bottomPicPath"></TD></TR></TBODY></TABLE></BODY>'
  372. return body
  373. end function
  374. public subroutine uf_setcontenteditable (string arg_set);ole_web.object.document.body.contentEditable=arg_set
  375. end subroutine
  376. public subroutine uf_navigate (string arg_path);ole_web.object.document.ExecCommand("EditMode", true, 1)
  377. ole_web.object.document.ExecCommand("LiveResize", true, 1)
  378. //if ole_web.object.url='about:black' then
  379. ole_web.object.Document.Write("<script>function showModalDialog{return;}</script>")
  380. //end if
  381. ole_web.object.Navigate(arg_path)
  382. ole_web.object.document.ExecCommand("EditMode", false, 0)
  383. ole_web.object.document.ExecCommand("LiveResize", false, 0)
  384. //string body
  385. //body=ole_web.object.document.body.innerHtml
  386. //
  387. //messagebox('',body)
  388. end subroutine
  389. public subroutine uf_setreadonly ();pb_underline.Visible = False
  390. pb_textcolor.Visible = False
  391. pb_numbers.Visible = False
  392. pb_bullets.Visible = False
  393. pb_italic.Visible = False
  394. pb_outdent.Visible = False
  395. pb_bold.Visible = False
  396. pb_indent.Visible = False
  397. pb_left.Visible = False
  398. pb_center.Visible = False
  399. pb_right.Visible = False
  400. pb_full.Visible = False
  401. pb_line.Visible = False
  402. pb_hyperlink.Visible = False
  403. pb_picture.Visible = False
  404. ddlb_fontsize.Visible = False
  405. ddlb_font.Visible = False
  406. ole_web.y = 0
  407. ole_web.Object.document.ExecCommand("BrowseMode", False, 0)
  408. ole_web.Object.document.ExecCommand("LiveResize", False, 0)
  409. TriggerEvent('size')
  410. end subroutine
  411. public subroutine uf_getfont ();// 在分销客户端环境下会产生字体变大的问题,因此屏蔽。ERP则正常
  412. //string font
  413. //long index
  414. //ddlb_font.text=string(f_ProfileString(sys_empid,publ_userid+'_ddlb_font' ,"text",'宋体'))
  415. //index=long(f_ProfileString(sys_empid,publ_userid+'_ddlb_font_size' ,"text_size",'12'))
  416. //
  417. //
  418. //font = ddlb_font.text
  419. //ole_web.object.Document.ExecCommand("FontName", false, font)
  420. //ole_web.setfocus()
  421. //uf_refreshtoolbar()
  422. //
  423. //long fontsize
  424. //fontsize = index
  425. //ole_web.object.Document.ExecCommand("FontSize", false, fontsize)
  426. //ole_web.setfocus()
  427. //uf_refreshtoolbar()
  428. end subroutine
  429. public subroutine uf_setfont ();f_SetProfileString (sys_empid,publ_userid+'_ddlb_font', "text",String(ddlb_font.text))
  430. //f_SetProfileString (sys_empid,publ_userid+'_ddlb_font_size', "text_size",String(ddlb_fontsize.index))
  431. end subroutine
  432. public subroutine wf_picturetofile ();Long lul_hBitmap
  433. Long lul_hdcmem, hdc
  434. //判断剪贴板中的数据是否是BMP数据
  435. Constant Long CF_BITMAP = 2
  436. Constant Long DIB_RGB_COLORS = 0
  437. Constant Long BITMAPTYPE = 19778
  438. TRY
  439. IF IsNull(ClassName(GetFocus())) THEN
  440. RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  441. END IF
  442. Catch(runtimeerror err)
  443. unRegisterHotKey(sys_handle, sys_atomid)
  444. keybd_event ( 17, 0, 0 , 0 ) // 按下ctrl
  445. keybd_event ( 86, 0, 0 , 0 ) // 按下v
  446. keybd_event ( 17, 0, 2 , 0 ) // 按下ctrl
  447. keybd_event ( 86, 0, 2 , 0 ) // 按下v
  448. RETURN
  449. END TRY
  450. IF IsClipboardFormatAvailable(CF_BITMAP) <> 1 THEN
  451. ole_web.Object.Document.ExecCommand("Paste", True, 0)
  452. ole_web.SetFocus()
  453. uf_refreshtoolbar()
  454. RETURN
  455. END IF
  456. //(1)开始从剪贴板取数据
  457. OpenClipboard(GetDesktopWindow())
  458. lul_hBitmap = GetClipBoardData(CF_BITMAP)
  459. CloseClipboard()
  460. Blob lb
  461. hdc = GetDC(GetDesktopWindow())
  462. lul_hdcmem = CreateCompatibleDC(hdc)
  463. SelectObject(lul_hdcmem, lul_hBitmap)
  464. //(2)将取得的内存图片转换位blob数据流
  465. Long lul_hdc, lul_pixels
  466. Blob lblb_header, lblb_info, lblb_bitmap
  467. BitmapInfo lstr_Info
  468. BitmapFileHeader lstr_Header
  469. IF lul_hBitmap = 0 THEN RETURN
  470. lstr_Info.bmiHeader.biSize = 40
  471. IF GetDIBits(lul_hdcmem, lul_hBitmap, 0, 0, 0, lstr_Info, DIB_RGB_COLORS) <= 0 THEN RETURN
  472. lul_pixels = lstr_Info.bmiHeader.biBitCount
  473. lstr_Info.bmiColors[lul_pixels] = 0
  474. lblb_bitmap = Blob(Space(lstr_Info.bmiHeader.biSizeImage/2)) //原来------ Blob(Space(lstr_Info.bmiHeader.biSizeImage))
  475. // 获取文件信息
  476. GetDIBits(lul_hdcmem, lul_hBitmap, 0, lstr_Info.bmiHeader.biheight, &
  477. lblb_bitmap, lstr_Info, DIB_RGB_COLORS)
  478. // 创建BMP文件头
  479. lstr_Header.bfType = BITMAPTYPE
  480. lstr_Header.bfSize = lstr_Info.bmiHeader.biSizeImage
  481. lstr_Header.bfOffBits = 54 + (lul_pixels * 4)
  482. // 将文件头转换成blob
  483. lblb_header = Blob(Space(7)) //原来------Blob(Space(14))
  484. CopyBitmapFileHeader(lblb_header, lstr_Header, 14)
  485. // 将文件内容转换为blob
  486. lblb_info = Blob(Space(20 + lul_pixels * 2)) //原来------Blob(Space(40 + lul_pixels * 4))
  487. CopyBitmapInfo(lblb_info, lstr_Info, 40 + lul_pixels * 4)
  488. // 整合文件信息
  489. lblb_bitmap = lblb_header + lblb_info + lblb_bitmap
  490. //释放通过GetDC或GetWindowDC所检索出来的公用上下文设备
  491. ReleaseDC(GetDesktopWindow(),hdc)
  492. //删除通过CreteDC或CreateCompatibleDC所创建的上下文设备
  493. DeleteDC(lul_hdcmem)
  494. //(3)取到图片文件后,则开始保存到文件中
  495. IF Len(lblb_bitmap) <= 0 THEN RETURN
  496. Constant ULong INVALID_HANDLE_VALUE = -1
  497. Constant ULong GENERIC_WRITE = 1073741824
  498. Constant ULong FILE_SHARE_WRITE = 2
  499. Constant ULong CREATE_ALWAYS = 2
  500. ULong lul_file, lul_length, lul_written
  501. Boolean lb_rtn
  502. // (创建)打开文件
  503. String ls_path, ls_file,ls_filename
  504. Int li_rc
  505. //ls_filename = String(Today(), "yyyyMMddHHmmss") +"-"+ String(Hour(Now())) + String(Minute (Now()))+ String(Second(Now())) + ".bmp"
  506. ls_filename=string(today(), "yyyyMMddHHmmss") + ".bmp"
  507. ls_path = sys_cur_path+fjfilepathname+'\'+ls_filename
  508. //ls_path ="C:\Documents and Settings\Administrator\桌面\" + ls_filename
  509. //messagebox("",ls_path)
  510. //ls_path="C:\Documents and Settings\Administrator\桌面\1123.bmp"
  511. String arg_msg
  512. IF f_blobtofile(ls_path, lblb_bitmap, arg_msg) <> 1 THEN
  513. RETURN
  514. END IF
  515. //
  516. //lul_file = CreateFile(ls_path, GENERIC_WRITE, &
  517. // FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0)
  518. //IF lul_file = INVALID_HANDLE_VALUE THEN RETURN
  519. //// 写文件
  520. //lul_length = Len(lblb_bitmap)
  521. //lb_rtn = WriteFile(lul_file, lblb_bitmap, &
  522. // lul_length, lul_written, 0)
  523. //// 关闭文件
  524. //CloseHandle(lul_file)
  525. ole_web.Object.Document.ExecCommand("InsertImage", False, ls_path)
  526. end subroutine
  527. on uo_html_editor.create
  528. this.pb_underline=create pb_underline
  529. this.pb_textcolor=create pb_textcolor
  530. this.pb_numbers=create pb_numbers
  531. this.pb_bullets=create pb_bullets
  532. this.pb_italic=create pb_italic
  533. this.pb_outdent=create pb_outdent
  534. this.pb_bold=create pb_bold
  535. this.pb_indent=create pb_indent
  536. this.pb_left=create pb_left
  537. this.pb_center=create pb_center
  538. this.pb_right=create pb_right
  539. this.pb_full=create pb_full
  540. this.pb_line=create pb_line
  541. this.pb_hyperlink=create pb_hyperlink
  542. this.pb_picture=create pb_picture
  543. this.ddlb_fontsize=create ddlb_fontsize
  544. this.ddlb_font=create ddlb_font
  545. this.ole_web=create ole_web
  546. this.Control[]={this.pb_underline,&
  547. this.pb_textcolor,&
  548. this.pb_numbers,&
  549. this.pb_bullets,&
  550. this.pb_italic,&
  551. this.pb_outdent,&
  552. this.pb_bold,&
  553. this.pb_indent,&
  554. this.pb_left,&
  555. this.pb_center,&
  556. this.pb_right,&
  557. this.pb_full,&
  558. this.pb_line,&
  559. this.pb_hyperlink,&
  560. this.pb_picture,&
  561. this.ddlb_fontsize,&
  562. this.ddlb_font,&
  563. this.ole_web}
  564. end on
  565. on uo_html_editor.destroy
  566. destroy(this.pb_underline)
  567. destroy(this.pb_textcolor)
  568. destroy(this.pb_numbers)
  569. destroy(this.pb_bullets)
  570. destroy(this.pb_italic)
  571. destroy(this.pb_outdent)
  572. destroy(this.pb_bold)
  573. destroy(this.pb_indent)
  574. destroy(this.pb_left)
  575. destroy(this.pb_center)
  576. destroy(this.pb_right)
  577. destroy(this.pb_full)
  578. destroy(this.pb_line)
  579. destroy(this.pb_hyperlink)
  580. destroy(this.pb_picture)
  581. destroy(this.ddlb_fontsize)
  582. destroy(this.ddlb_font)
  583. destroy(this.ole_web)
  584. end on
  585. event constructor;do while ddlb_font.totalitems( ) > 0
  586. ddlb_font.deleteitem(1)
  587. loop
  588. uf_addfonts()
  589. ole_web.object.Navigate('about:blank')
  590. ole_web.object.document.ExecCommand("EditMode", false, 0)
  591. ole_web.object.document.ExecCommand("LiveResize", false, 0)
  592. ddlb_font.selectitem(1)
  593. ddlb_fontsize.selectitem(1)
  594. triggerevent('size')
  595. end event
  596. event other;//在窗口的other事件编写脚本:
  597. //处理系统热键
  598. IF wparam = sys_atomid And sys_atomid <> 0 THEN
  599. //处理
  600. wf_picturetofile()
  601. END IF
  602. end event
  603. type pb_underline from picturebutton within uo_html_editor
  604. string tag = "graphics\_Underline.bmp"
  605. integer x = 1184
  606. integer width = 101
  607. integer height = 88
  608. integer taborder = 30
  609. integer textsize = -9
  610. integer weight = 400
  611. fontcharset fontcharset = gb2312charset!
  612. fontpitch fontpitch = variable!
  613. string facename = "宋体"
  614. string picturename = "graphics\Underline.bmp"
  615. string disabledname = "graphics\Underline.bmp"
  616. alignment htextalign = left!
  617. end type
  618. event clicked;ole_web.object.Document.ExecCommand("Underline", false, 0)
  619. ole_web.setfocus()
  620. uf_refreshtoolbar()
  621. end event
  622. type pb_textcolor from picturebutton within uo_html_editor
  623. string tag = "graphics\_Color.bmp"
  624. integer x = 1285
  625. integer width = 101
  626. integer height = 88
  627. integer taborder = 30
  628. integer textsize = -9
  629. integer weight = 400
  630. fontcharset fontcharset = gb2312charset!
  631. fontpitch fontpitch = variable!
  632. string facename = "宋体"
  633. string picturename = "graphics\Color.bmp"
  634. string disabledname = "graphics\Color.bmp"
  635. alignment htextalign = left!
  636. end type
  637. event clicked;string ls_color
  638. long ll_color
  639. ll_color = long(ole_web.object.Document.queryCommandValue("ForeColor"));
  640. if ChooseColor(ll_color) = 1 then
  641. ls_color = tohex(ll_color, 6)
  642. ls_color = '#' + mid(ls_color, 5, len(ls_color)) + mid(ls_color, 3, 2) + mid(ls_color, 1, 2)
  643. ole_web.object.Document.ExecCommand("ForeColor", false, ls_color)
  644. ole_web.setfocus()
  645. uf_refreshtoolbar()
  646. end if
  647. end event
  648. type pb_numbers from picturebutton within uo_html_editor
  649. string tag = "graphics\_Numbers.bmp"
  650. integer x = 1385
  651. integer width = 101
  652. integer height = 88
  653. integer taborder = 30
  654. integer textsize = -9
  655. integer weight = 400
  656. fontcharset fontcharset = gb2312charset!
  657. fontpitch fontpitch = variable!
  658. string facename = "宋体"
  659. string picturename = "graphics\Numbers.bmp"
  660. string disabledname = "graphics\Numbers.bmp"
  661. alignment htextalign = left!
  662. end type
  663. event clicked;ole_web.object.Document.ExecCommand("InsertOrderedList", false, 0)
  664. ole_web.setfocus()
  665. uf_refreshtoolbar()
  666. end event
  667. type pb_bullets from picturebutton within uo_html_editor
  668. string tag = "graphics\_Bullets.bmp"
  669. integer x = 1486
  670. integer width = 101
  671. integer height = 88
  672. integer taborder = 30
  673. integer textsize = -9
  674. integer weight = 400
  675. fontcharset fontcharset = gb2312charset!
  676. fontpitch fontpitch = variable!
  677. string facename = "宋体"
  678. string picturename = "graphics\Bullets.bmp"
  679. string disabledname = "graphics\Bullets.bmp"
  680. alignment htextalign = left!
  681. end type
  682. event clicked;ole_web.object.Document.ExecCommand("InsertUnorderedList", false, 0)
  683. ole_web.setfocus()
  684. uf_refreshtoolbar()
  685. end event
  686. type pb_italic from picturebutton within uo_html_editor
  687. string tag = "graphics\_Italic.bmp"
  688. integer x = 1083
  689. integer width = 101
  690. integer height = 88
  691. integer taborder = 30
  692. integer textsize = -9
  693. integer weight = 400
  694. fontcharset fontcharset = gb2312charset!
  695. fontpitch fontpitch = variable!
  696. string facename = "宋体"
  697. string picturename = "graphics\Italic.bmp"
  698. string disabledname = "graphics\Italic.bmp"
  699. alignment htextalign = left!
  700. end type
  701. event clicked;ole_web.object.Document.ExecCommand("Italic", false, 0)
  702. ole_web.setfocus()
  703. uf_refreshtoolbar()
  704. end event
  705. type pb_outdent from picturebutton within uo_html_editor
  706. string tag = "graphics\_Outdent.bmp"
  707. integer x = 1586
  708. integer width = 101
  709. integer height = 88
  710. integer taborder = 30
  711. integer textsize = -9
  712. integer weight = 400
  713. fontcharset fontcharset = gb2312charset!
  714. fontpitch fontpitch = variable!
  715. string facename = "宋体"
  716. string picturename = "graphics\Outdent.bmp"
  717. string disabledname = "graphics\Outdent.bmp"
  718. alignment htextalign = left!
  719. end type
  720. event clicked;ole_web.object.Document.ExecCommand("Outdent", false, 0)
  721. ole_web.setfocus()
  722. uf_refreshtoolbar()
  723. end event
  724. type pb_bold from picturebutton within uo_html_editor
  725. string tag = "graphics\_Bold.bmp"
  726. integer x = 983
  727. integer width = 101
  728. integer height = 88
  729. integer taborder = 30
  730. integer textsize = -9
  731. integer weight = 400
  732. fontcharset fontcharset = gb2312charset!
  733. fontpitch fontpitch = variable!
  734. string facename = "宋体"
  735. string picturename = "graphics\Bold.bmp"
  736. string disabledname = "graphics\Bold.bmp"
  737. alignment htextalign = left!
  738. end type
  739. event clicked;ole_web.object.Document.ExecCommand("Bold", false, 0)
  740. ole_web.setfocus()
  741. uf_refreshtoolbar()
  742. end event
  743. type pb_indent from picturebutton within uo_html_editor
  744. string tag = "graphics\_Indent.bmp"
  745. integer x = 1687
  746. integer width = 101
  747. integer height = 88
  748. integer taborder = 30
  749. integer textsize = -9
  750. integer weight = 400
  751. fontcharset fontcharset = gb2312charset!
  752. fontpitch fontpitch = variable!
  753. string facename = "宋体"
  754. string picturename = "graphics\Indent.bmp"
  755. string disabledname = "graphics\Indent.bmp"
  756. alignment htextalign = left!
  757. end type
  758. event clicked;ole_web.object.Document.ExecCommand("Indent", false, 0)
  759. ole_web.setfocus()
  760. uf_refreshtoolbar()
  761. end event
  762. type pb_left from picturebutton within uo_html_editor
  763. string tag = "graphics\_Left.bmp"
  764. integer x = 1787
  765. integer width = 101
  766. integer height = 88
  767. integer taborder = 30
  768. integer textsize = -9
  769. integer weight = 400
  770. fontcharset fontcharset = gb2312charset!
  771. fontpitch fontpitch = variable!
  772. string facename = "宋体"
  773. string picturename = "graphics\Left.bmp"
  774. string disabledname = "graphics\Left.bmp"
  775. alignment htextalign = left!
  776. end type
  777. event clicked;ole_web.object.Document.ExecCommand("JustifyLeft", false, 0)
  778. ole_web.setfocus()
  779. uf_refreshtoolbar()
  780. end event
  781. type pb_center from picturebutton within uo_html_editor
  782. string tag = "graphics\_Center.bmp"
  783. integer x = 1888
  784. integer width = 101
  785. integer height = 88
  786. integer taborder = 30
  787. integer textsize = -9
  788. integer weight = 400
  789. fontcharset fontcharset = gb2312charset!
  790. fontpitch fontpitch = variable!
  791. string facename = "宋体"
  792. string picturename = "graphics\Center.bmp"
  793. string disabledname = "graphics\Center.bmp"
  794. alignment htextalign = left!
  795. end type
  796. event clicked;ole_web.object.Document.ExecCommand("JustifyCenter", false, 0)
  797. ole_web.setfocus()
  798. uf_refreshtoolbar()
  799. end event
  800. type pb_right from picturebutton within uo_html_editor
  801. string tag = "graphics\_Right.bmp"
  802. integer x = 1989
  803. integer width = 101
  804. integer height = 88
  805. integer taborder = 30
  806. integer textsize = -9
  807. integer weight = 400
  808. fontcharset fontcharset = gb2312charset!
  809. fontpitch fontpitch = variable!
  810. string facename = "宋体"
  811. string picturename = "graphics\Right.bmp"
  812. string disabledname = "graphics\Right.bmp"
  813. alignment htextalign = left!
  814. end type
  815. event clicked;ole_web.object.Document.ExecCommand("JustifyRight", false, 0)
  816. ole_web.setfocus()
  817. uf_refreshtoolbar()
  818. end event
  819. type pb_full from picturebutton within uo_html_editor
  820. string tag = "graphics\_Full.bmp"
  821. integer x = 2089
  822. integer width = 101
  823. integer height = 88
  824. integer taborder = 30
  825. integer textsize = -9
  826. integer weight = 400
  827. fontcharset fontcharset = gb2312charset!
  828. fontpitch fontpitch = variable!
  829. string facename = "宋体"
  830. string picturename = "graphics\Full.bmp"
  831. string disabledname = "graphics\Full.bmp"
  832. alignment htextalign = left!
  833. end type
  834. event clicked;ole_web.object.Document.ExecCommand("JustifyFull", false, 0)
  835. ole_web.setfocus()
  836. uf_refreshtoolbar()
  837. end event
  838. type pb_line from picturebutton within uo_html_editor
  839. string tag = "graphics\_Line.bmp"
  840. integer x = 2190
  841. integer width = 101
  842. integer height = 88
  843. integer taborder = 30
  844. integer textsize = -9
  845. integer weight = 400
  846. fontcharset fontcharset = gb2312charset!
  847. fontpitch fontpitch = variable!
  848. string facename = "宋体"
  849. string picturename = "graphics\Line.bmp"
  850. string disabledname = "graphics\Line.bmp"
  851. alignment htextalign = left!
  852. end type
  853. event clicked;ole_web.object.Document.ExecCommand("InsertHorizontalRule", false, 0)
  854. ole_web.setfocus()
  855. uf_refreshtoolbar()
  856. end event
  857. type pb_hyperlink from picturebutton within uo_html_editor
  858. string tag = "graphics\_Hyperlink.bmp"
  859. integer x = 2290
  860. integer width = 101
  861. integer height = 88
  862. integer taborder = 40
  863. integer textsize = -9
  864. integer weight = 400
  865. fontcharset fontcharset = gb2312charset!
  866. fontpitch fontpitch = variable!
  867. string facename = "宋体"
  868. string picturename = "graphics\Hyperlink.bmp"
  869. string disabledname = "graphics\Hyperlink.bmp"
  870. alignment htextalign = left!
  871. end type
  872. event clicked;ole_web.object.Document.ExecCommand("CreateLink", true, 0)
  873. ole_web.setfocus()
  874. uf_refreshtoolbar()
  875. end event
  876. type pb_picture from picturebutton within uo_html_editor
  877. string tag = "graphics\_Picture.bmp"
  878. integer x = 2391
  879. integer width = 101
  880. integer height = 88
  881. integer taborder = 30
  882. integer textsize = -9
  883. integer weight = 400
  884. fontcharset fontcharset = gb2312charset!
  885. fontpitch fontpitch = variable!
  886. string facename = "宋体"
  887. string picturename = "graphics\Picture.bmp"
  888. string disabledname = "graphics\Picture.bmp"
  889. alignment htextalign = left!
  890. end type
  891. event clicked;ole_web.object.Document.ExecCommand("InsertImage", true, 0)
  892. ole_web.setfocus()
  893. uf_refreshtoolbar()
  894. end event
  895. type ddlb_fontsize from dropdownlistbox within uo_html_editor
  896. integer x = 759
  897. integer y = 4
  898. integer width = 219
  899. integer height = 576
  900. integer taborder = 20
  901. integer textsize = -9
  902. integer weight = 400
  903. fontcharset fontcharset = gb2312charset!
  904. fontpitch fontpitch = variable!
  905. string facename = "宋体"
  906. long textcolor = 33554432
  907. boolean sorted = false
  908. string item[] = {"8","10","12","14","18","24","36"}
  909. borderstyle borderstyle = stylelowered!
  910. end type
  911. event selectionchanged;int fontsize
  912. fontsize = index
  913. ole_web.object.Document.ExecCommand("FontSize", false, fontsize)
  914. ole_web.setfocus()
  915. uf_refreshtoolbar()
  916. f_SetProfileString (sys_empid,publ_userid+'_ddlb_font_size', "text_size",String(index))
  917. end event
  918. type ddlb_font from dropdownlistbox within uo_html_editor
  919. integer y = 4
  920. integer width = 750
  921. integer height = 576
  922. integer taborder = 10
  923. integer textsize = -9
  924. integer weight = 400
  925. fontcharset fontcharset = gb2312charset!
  926. fontpitch fontpitch = variable!
  927. string facename = "宋体"
  928. long textcolor = 33554432
  929. boolean vscrollbar = true
  930. string item[] = {"宋体","黑体","@宋体","@黑体"}
  931. borderstyle borderstyle = stylelowered!
  932. end type
  933. event selectionchanged;string font
  934. font = this.text
  935. ole_web.object.Document.ExecCommand("FontName", false, font)
  936. ole_web.setfocus()
  937. uf_refreshtoolbar()
  938. f_SetProfileString (sys_empid,publ_userid+'_ddlb_font', "text",String(ddlb_font.text))
  939. end event
  940. type ole_web from olecustomcontrol within uo_html_editor
  941. event statustextchange ( string text1 )
  942. event progresschange ( long progress, long progressmax )
  943. event commandstatechange ( long command, boolean enable )
  944. event downloadbegin ( )
  945. event downloadcomplete ( )
  946. event titlechange ( string text1 )
  947. event propertychange ( string szproperty )
  948. event beforenavigate2 ( oleobject pdisp, any url, any flags, any targetframename, any postdata, any headers, ref boolean cancel1 )
  949. event newwindow2 ( ref oleobject ppdisp, ref boolean cancel1 )
  950. event navigatecomplete2 ( oleobject pdisp, any url )
  951. event documentcomplete ( oleobject pdisp, any url )
  952. event onquit ( )
  953. event onvisible ( boolean ocx_visible )
  954. event ontoolbar ( boolean toolbar )
  955. event onmenubar ( boolean menubar )
  956. event onstatusbar ( boolean statusbar )
  957. event onfullscreen ( boolean fullscreen )
  958. event ontheatermode ( boolean theatermode )
  959. event windowsetresizable ( boolean resizable )
  960. event windowsetleft ( long left )
  961. event windowsettop ( long top )
  962. event windowsetwidth ( long ocx_width )
  963. event windowsetheight ( long ocx_height )
  964. event windowclosing ( boolean ischildwindow, ref boolean cancel1 )
  965. event clienttohostwindow ( ref long cx, ref long cy )
  966. event setsecurelockicon ( long securelockicon )
  967. event filedownload ( ref boolean cancel1 )
  968. event navigateerror ( oleobject pdisp, any url, any frame, any statuscode, ref boolean cancel1 )
  969. event printtemplateinstantiation ( oleobject pdisp )
  970. event printtemplateteardown ( oleobject pdisp )
  971. event updatepagestatus ( oleobject pdisp, any npage, any fdone )
  972. event privacyimpactedstatechange ( boolean bimpacted )
  973. event keyup pbm_keyup
  974. event showwindow pbm_showwindow
  975. integer y = 92
  976. integer width = 2501
  977. integer height = 600
  978. integer taborder = 20
  979. boolean border = false
  980. borderstyle borderstyle = stylelowered!
  981. boolean focusrectangle = false
  982. string binarykey = "uo_html_editor.udo"
  983. integer textsize = -12
  984. integer weight = 400
  985. fontcharset fontcharset = ansi!
  986. fontpitch fontpitch = variable!
  987. fontfamily fontfamily = swiss!
  988. string facename = "Arial"
  989. long textcolor = 33554432
  990. end type
  991. event keyup;
  992. uf_refreshtoolbar()
  993. end event
  994. event showwindow;if not ib_shown then
  995. parent.triggerevent('ue_afterinit')
  996. end if
  997. ib_shown = true
  998. end event
  999. event getfocus;uf_refreshtoolbar()
  1000. end event
  1001. event clicked;string font
  1002. uf_getfont()
  1003. //font = string(f_ProfileString(sys_empid,publ_userid+'_ddlb_font' ,"text",'宋体'))
  1004. //ole_web.object.Document.ExecCommand("FontName", false, font)
  1005. //ole_web.setfocus()
  1006. //uf_refreshtoolbar()
  1007. RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  1008. ////
  1009. ////注册热键
  1010. //long ll_RC
  1011. //string ls_atomid
  1012. //ls_atomid = 'myatomid'
  1013. //atomid = GlobalAddAtom(ls_atomid)
  1014. ////得到惟一的ID,保证不和其他应用程序发生冲突
  1015. //ll_RC = RegisterHotKey(Handle(this), atomid, MOD_CONTROL , 86)
  1016. ////注册的热键为Ctrl+F ,70为'F' 86 v
  1017. ////如果组合键,可用MOD_CONTROL + MOD_ALT等ctrl +v
  1018. //if ll_RC = 0 then messagebox("Error!","热键注册错误")
  1019. ////热键注册冲突
  1020. end event
  1021. event doubleclicked;string font
  1022. uf_getfont()
  1023. //font = ddlb_font.text
  1024. //ole_web.object.Document.ExecCommand("FontName", false, font)
  1025. //ole_web.setfocus()
  1026. //uf_refreshtoolbar()
  1027. //
  1028. end event
  1029. event constructor;//注册热键
  1030. long ll_RC
  1031. string ls_atomid
  1032. ls_atomid = 'myatomid'
  1033. sys_atomid = GlobalAddAtom(ls_atomid)
  1034. sys_handle=Handle(parent)
  1035. //得到惟一的ID,保证不和其他应用程序发生冲突
  1036. ll_RC = RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  1037. //注册的热键为Ctrl+F ,70为'F' 86 v
  1038. //如果组合键,可用MOD_CONTROL + MOD_ALT等ctrl +v
  1039. //if ll_RC = 0 then messagebox("Error!","热键注册错误") // 貌似注册失败都可以使用Ctrl+F热键 hjy161223
  1040. //热键注册冲突
  1041. end event
  1042. Start of PowerBuilder Binary Data Section : Do NOT Edit
  1043. 05uo_html_editor.bin
  1044. 2E00000a00e011cfd0e11ab1a1000000000000000000000000000000000003003e0009fffe000000060000000000000000000000010000000100000000000010000000000200000001fffffffe0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffefffffffefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006f00520074006f004500200074006e00790072000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050016ffffffffffffffff000000010000000000000000000000000000000000000000000000000000000044ea50a001d25cd200000003000001800000000000500003004f0042005800430054005300450052004d0041000000000000000000000000000000000000000000000000000000000000000000000000000000000102001affffffff00000002ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000009c00000000004200500043004f00530058004f00540041005200450047000000000000000000000000000000000000000000000000000000000000000000000000000000000001001affffffffffffffff000000038856f96111d0340ac0006ba9a205d74f0000000044ea50a001d25cd244ea50a001d25cd2000000000000000000000000004f00430054004e004e00450053005400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001020012ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000030000009c000000000000000100000002fffffffe0000000400000005fffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  1045. 2Cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000004c0000388900000f810000000000000000000000000000000000000000000000000000004c0000000000000000000000010057d0e011cf3573000869ae62122e2b00000008000000000000004c0002140100000000000000c0460000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c0000388900000f810000000000000000000000000000000000000000000000000000004c0000000000000000000000010057d0e011cf3573000869ae62122e2b00000008000000000000004c0002140100000000000000c0460000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  1046. 15uo_html_editor.bin
  1047. End of PowerBuilder Binary Data Section : No Source Expected After This Point