uo_html_editor.sru 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  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 ();string font
  412. long index
  413. ddlb_font.text=string(f_ProfileString(sys_empid,publ_userid+'_ddlb_font' ,"text",'宋体'))
  414. index=long(f_ProfileString(sys_empid,publ_userid+'_ddlb_font_size' ,"text_size",'12'))
  415. font = ddlb_font.text
  416. ole_web.object.Document.ExecCommand("FontName", false, font)
  417. ole_web.setfocus()
  418. uf_refreshtoolbar()
  419. long fontsize
  420. fontsize = index
  421. ole_web.object.Document.ExecCommand("FontSize", false, fontsize)
  422. ole_web.setfocus()
  423. uf_refreshtoolbar()
  424. end subroutine
  425. public subroutine uf_setfont ();f_SetProfileString (sys_empid,publ_userid+'_ddlb_font', "text",String(ddlb_font.text))
  426. //f_SetProfileString (sys_empid,publ_userid+'_ddlb_font_size', "text_size",String(ddlb_fontsize.index))
  427. end subroutine
  428. public subroutine wf_picturetofile ();Long lul_hBitmap
  429. Long lul_hdcmem, hdc
  430. //判断剪贴板中的数据是否是BMP数据
  431. Constant Long CF_BITMAP = 2
  432. Constant Long DIB_RGB_COLORS = 0
  433. Constant Long BITMAPTYPE = 19778
  434. TRY
  435. IF IsNull(ClassName(GetFocus())) THEN
  436. RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  437. END IF
  438. Catch(runtimeerror err)
  439. unRegisterHotKey(sys_handle, sys_atomid)
  440. keybd_event ( 17, 0, 0 , 0 ) // 按下ctrl
  441. keybd_event ( 86, 0, 0 , 0 ) // 按下v
  442. keybd_event ( 17, 0, 2 , 0 ) // 按下ctrl
  443. keybd_event ( 86, 0, 2 , 0 ) // 按下v
  444. RETURN
  445. END TRY
  446. IF IsClipboardFormatAvailable(CF_BITMAP) <> 1 THEN
  447. ole_web.Object.Document.ExecCommand("Paste", True, 0)
  448. ole_web.SetFocus()
  449. uf_refreshtoolbar()
  450. RETURN
  451. END IF
  452. //(1)开始从剪贴板取数据
  453. OpenClipboard(GetDesktopWindow())
  454. lul_hBitmap = GetClipBoardData(CF_BITMAP)
  455. CloseClipboard()
  456. Blob lb
  457. hdc = GetDC(GetDesktopWindow())
  458. lul_hdcmem = CreateCompatibleDC(hdc)
  459. SelectObject(lul_hdcmem, lul_hBitmap)
  460. //(2)将取得的内存图片转换位blob数据流
  461. Long lul_hdc, lul_pixels
  462. Blob lblb_header, lblb_info, lblb_bitmap
  463. BitmapInfo lstr_Info
  464. BitmapFileHeader lstr_Header
  465. IF lul_hBitmap = 0 THEN RETURN
  466. lstr_Info.bmiHeader.biSize = 40
  467. IF GetDIBits(lul_hdcmem, lul_hBitmap, 0, 0, 0, lstr_Info, DIB_RGB_COLORS) <= 0 THEN RETURN
  468. lul_pixels = lstr_Info.bmiHeader.biBitCount
  469. lstr_Info.bmiColors[lul_pixels] = 0
  470. lblb_bitmap = Blob(Space(lstr_Info.bmiHeader.biSizeImage/2)) //原来------ Blob(Space(lstr_Info.bmiHeader.biSizeImage))
  471. // 获取文件信息
  472. GetDIBits(lul_hdcmem, lul_hBitmap, 0, lstr_Info.bmiHeader.biheight, &
  473. lblb_bitmap, lstr_Info, DIB_RGB_COLORS)
  474. // 创建BMP文件头
  475. lstr_Header.bfType = BITMAPTYPE
  476. lstr_Header.bfSize = lstr_Info.bmiHeader.biSizeImage
  477. lstr_Header.bfOffBits = 54 + (lul_pixels * 4)
  478. // 将文件头转换成blob
  479. lblb_header = Blob(Space(7)) //原来------Blob(Space(14))
  480. CopyBitmapFileHeader(lblb_header, lstr_Header, 14)
  481. // 将文件内容转换为blob
  482. lblb_info = Blob(Space(20 + lul_pixels * 2)) //原来------Blob(Space(40 + lul_pixels * 4))
  483. CopyBitmapInfo(lblb_info, lstr_Info, 40 + lul_pixels * 4)
  484. // 整合文件信息
  485. lblb_bitmap = lblb_header + lblb_info + lblb_bitmap
  486. //释放通过GetDC或GetWindowDC所检索出来的公用上下文设备
  487. ReleaseDC(GetDesktopWindow(),hdc)
  488. //删除通过CreteDC或CreateCompatibleDC所创建的上下文设备
  489. DeleteDC(lul_hdcmem)
  490. //(3)取到图片文件后,则开始保存到文件中
  491. IF Len(lblb_bitmap) <= 0 THEN RETURN
  492. Constant ULong INVALID_HANDLE_VALUE = -1
  493. Constant ULong GENERIC_WRITE = 1073741824
  494. Constant ULong FILE_SHARE_WRITE = 2
  495. Constant ULong CREATE_ALWAYS = 2
  496. ULong lul_file, lul_length, lul_written
  497. Boolean lb_rtn
  498. // (创建)打开文件
  499. String ls_path, ls_file,ls_filename
  500. Int li_rc
  501. //ls_filename = String(Today(), "yyyyMMddHHmmss") +"-"+ String(Hour(Now())) + String(Minute (Now()))+ String(Second(Now())) + ".bmp"
  502. ls_filename=string(today(), "yyyyMMddHHmmss") + ".bmp"
  503. ls_path = sys_cur_path+fjfilepathname+'\'+ls_filename
  504. //ls_path ="C:\Documents and Settings\Administrator\桌面\" + ls_filename
  505. //messagebox("",ls_path)
  506. //ls_path="C:\Documents and Settings\Administrator\桌面\1123.bmp"
  507. String arg_msg
  508. IF f_blobtofile(ls_path, lblb_bitmap, arg_msg) <> 1 THEN
  509. RETURN
  510. END IF
  511. //
  512. //lul_file = CreateFile(ls_path, GENERIC_WRITE, &
  513. // FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0)
  514. //IF lul_file = INVALID_HANDLE_VALUE THEN RETURN
  515. //// 写文件
  516. //lul_length = Len(lblb_bitmap)
  517. //lb_rtn = WriteFile(lul_file, lblb_bitmap, &
  518. // lul_length, lul_written, 0)
  519. //// 关闭文件
  520. //CloseHandle(lul_file)
  521. ole_web.Object.Document.ExecCommand("InsertImage", False, ls_path)
  522. end subroutine
  523. on uo_html_editor.create
  524. this.pb_underline=create pb_underline
  525. this.pb_textcolor=create pb_textcolor
  526. this.pb_numbers=create pb_numbers
  527. this.pb_bullets=create pb_bullets
  528. this.pb_italic=create pb_italic
  529. this.pb_outdent=create pb_outdent
  530. this.pb_bold=create pb_bold
  531. this.pb_indent=create pb_indent
  532. this.pb_left=create pb_left
  533. this.pb_center=create pb_center
  534. this.pb_right=create pb_right
  535. this.pb_full=create pb_full
  536. this.pb_line=create pb_line
  537. this.pb_hyperlink=create pb_hyperlink
  538. this.pb_picture=create pb_picture
  539. this.ddlb_fontsize=create ddlb_fontsize
  540. this.ddlb_font=create ddlb_font
  541. this.ole_web=create ole_web
  542. this.Control[]={this.pb_underline,&
  543. this.pb_textcolor,&
  544. this.pb_numbers,&
  545. this.pb_bullets,&
  546. this.pb_italic,&
  547. this.pb_outdent,&
  548. this.pb_bold,&
  549. this.pb_indent,&
  550. this.pb_left,&
  551. this.pb_center,&
  552. this.pb_right,&
  553. this.pb_full,&
  554. this.pb_line,&
  555. this.pb_hyperlink,&
  556. this.pb_picture,&
  557. this.ddlb_fontsize,&
  558. this.ddlb_font,&
  559. this.ole_web}
  560. end on
  561. on uo_html_editor.destroy
  562. destroy(this.pb_underline)
  563. destroy(this.pb_textcolor)
  564. destroy(this.pb_numbers)
  565. destroy(this.pb_bullets)
  566. destroy(this.pb_italic)
  567. destroy(this.pb_outdent)
  568. destroy(this.pb_bold)
  569. destroy(this.pb_indent)
  570. destroy(this.pb_left)
  571. destroy(this.pb_center)
  572. destroy(this.pb_right)
  573. destroy(this.pb_full)
  574. destroy(this.pb_line)
  575. destroy(this.pb_hyperlink)
  576. destroy(this.pb_picture)
  577. destroy(this.ddlb_fontsize)
  578. destroy(this.ddlb_font)
  579. destroy(this.ole_web)
  580. end on
  581. event constructor;do while ddlb_font.totalitems( ) > 0
  582. ddlb_font.deleteitem(1)
  583. loop
  584. uf_addfonts()
  585. ole_web.object.Navigate('about:blank')
  586. ole_web.object.document.ExecCommand("EditMode", false, 0)
  587. ole_web.object.document.ExecCommand("LiveResize", false, 0)
  588. ddlb_font.selectitem(1)
  589. ddlb_fontsize.selectitem(1)
  590. triggerevent('size')
  591. end event
  592. event other;//在窗口的other事件编写脚本:
  593. //处理系统热键
  594. IF wparam = sys_atomid And sys_atomid <> 0 THEN
  595. //处理
  596. wf_picturetofile()
  597. END IF
  598. end event
  599. type pb_underline from picturebutton within uo_html_editor
  600. string tag = "graphics\_Underline.bmp"
  601. integer x = 1184
  602. integer width = 101
  603. integer height = 88
  604. integer taborder = 30
  605. integer textsize = -9
  606. integer weight = 400
  607. fontcharset fontcharset = gb2312charset!
  608. fontpitch fontpitch = variable!
  609. string facename = "宋体"
  610. string picturename = "graphics\Underline.bmp"
  611. string disabledname = "graphics\Underline.bmp"
  612. alignment htextalign = left!
  613. end type
  614. event clicked;ole_web.object.Document.ExecCommand("Underline", false, 0)
  615. ole_web.setfocus()
  616. uf_refreshtoolbar()
  617. end event
  618. type pb_textcolor from picturebutton within uo_html_editor
  619. string tag = "graphics\_Color.bmp"
  620. integer x = 1285
  621. integer width = 101
  622. integer height = 88
  623. integer taborder = 30
  624. integer textsize = -9
  625. integer weight = 400
  626. fontcharset fontcharset = gb2312charset!
  627. fontpitch fontpitch = variable!
  628. string facename = "宋体"
  629. string picturename = "graphics\Color.bmp"
  630. string disabledname = "graphics\Color.bmp"
  631. alignment htextalign = left!
  632. end type
  633. event clicked;string ls_color
  634. long ll_color
  635. ll_color = long(ole_web.object.Document.queryCommandValue("ForeColor"));
  636. if ChooseColor(ll_color) = 1 then
  637. ls_color = tohex(ll_color, 6)
  638. ls_color = '#' + mid(ls_color, 5, len(ls_color)) + mid(ls_color, 3, 2) + mid(ls_color, 1, 2)
  639. ole_web.object.Document.ExecCommand("ForeColor", false, ls_color)
  640. ole_web.setfocus()
  641. uf_refreshtoolbar()
  642. end if
  643. end event
  644. type pb_numbers from picturebutton within uo_html_editor
  645. string tag = "graphics\_Numbers.bmp"
  646. integer x = 1385
  647. integer width = 101
  648. integer height = 88
  649. integer taborder = 30
  650. integer textsize = -9
  651. integer weight = 400
  652. fontcharset fontcharset = gb2312charset!
  653. fontpitch fontpitch = variable!
  654. string facename = "宋体"
  655. string picturename = "graphics\Numbers.bmp"
  656. string disabledname = "graphics\Numbers.bmp"
  657. alignment htextalign = left!
  658. end type
  659. event clicked;ole_web.object.Document.ExecCommand("InsertOrderedList", false, 0)
  660. ole_web.setfocus()
  661. uf_refreshtoolbar()
  662. end event
  663. type pb_bullets from picturebutton within uo_html_editor
  664. string tag = "graphics\_Bullets.bmp"
  665. integer x = 1486
  666. integer width = 101
  667. integer height = 88
  668. integer taborder = 30
  669. integer textsize = -9
  670. integer weight = 400
  671. fontcharset fontcharset = gb2312charset!
  672. fontpitch fontpitch = variable!
  673. string facename = "宋体"
  674. string picturename = "graphics\Bullets.bmp"
  675. string disabledname = "graphics\Bullets.bmp"
  676. alignment htextalign = left!
  677. end type
  678. event clicked;ole_web.object.Document.ExecCommand("InsertUnorderedList", false, 0)
  679. ole_web.setfocus()
  680. uf_refreshtoolbar()
  681. end event
  682. type pb_italic from picturebutton within uo_html_editor
  683. string tag = "graphics\_Italic.bmp"
  684. integer x = 1083
  685. integer width = 101
  686. integer height = 88
  687. integer taborder = 30
  688. integer textsize = -9
  689. integer weight = 400
  690. fontcharset fontcharset = gb2312charset!
  691. fontpitch fontpitch = variable!
  692. string facename = "宋体"
  693. string picturename = "graphics\Italic.bmp"
  694. string disabledname = "graphics\Italic.bmp"
  695. alignment htextalign = left!
  696. end type
  697. event clicked;ole_web.object.Document.ExecCommand("Italic", false, 0)
  698. ole_web.setfocus()
  699. uf_refreshtoolbar()
  700. end event
  701. type pb_outdent from picturebutton within uo_html_editor
  702. string tag = "graphics\_Outdent.bmp"
  703. integer x = 1586
  704. integer width = 101
  705. integer height = 88
  706. integer taborder = 30
  707. integer textsize = -9
  708. integer weight = 400
  709. fontcharset fontcharset = gb2312charset!
  710. fontpitch fontpitch = variable!
  711. string facename = "宋体"
  712. string picturename = "graphics\Outdent.bmp"
  713. string disabledname = "graphics\Outdent.bmp"
  714. alignment htextalign = left!
  715. end type
  716. event clicked;ole_web.object.Document.ExecCommand("Outdent", false, 0)
  717. ole_web.setfocus()
  718. uf_refreshtoolbar()
  719. end event
  720. type pb_bold from picturebutton within uo_html_editor
  721. string tag = "graphics\_Bold.bmp"
  722. integer x = 983
  723. integer width = 101
  724. integer height = 88
  725. integer taborder = 30
  726. integer textsize = -9
  727. integer weight = 400
  728. fontcharset fontcharset = gb2312charset!
  729. fontpitch fontpitch = variable!
  730. string facename = "宋体"
  731. string picturename = "graphics\Bold.bmp"
  732. string disabledname = "graphics\Bold.bmp"
  733. alignment htextalign = left!
  734. end type
  735. event clicked;ole_web.object.Document.ExecCommand("Bold", false, 0)
  736. ole_web.setfocus()
  737. uf_refreshtoolbar()
  738. end event
  739. type pb_indent from picturebutton within uo_html_editor
  740. string tag = "graphics\_Indent.bmp"
  741. integer x = 1687
  742. integer width = 101
  743. integer height = 88
  744. integer taborder = 30
  745. integer textsize = -9
  746. integer weight = 400
  747. fontcharset fontcharset = gb2312charset!
  748. fontpitch fontpitch = variable!
  749. string facename = "宋体"
  750. string picturename = "graphics\Indent.bmp"
  751. string disabledname = "graphics\Indent.bmp"
  752. alignment htextalign = left!
  753. end type
  754. event clicked;ole_web.object.Document.ExecCommand("Indent", false, 0)
  755. ole_web.setfocus()
  756. uf_refreshtoolbar()
  757. end event
  758. type pb_left from picturebutton within uo_html_editor
  759. string tag = "graphics\_Left.bmp"
  760. integer x = 1787
  761. integer width = 101
  762. integer height = 88
  763. integer taborder = 30
  764. integer textsize = -9
  765. integer weight = 400
  766. fontcharset fontcharset = gb2312charset!
  767. fontpitch fontpitch = variable!
  768. string facename = "宋体"
  769. string picturename = "graphics\Left.bmp"
  770. string disabledname = "graphics\Left.bmp"
  771. alignment htextalign = left!
  772. end type
  773. event clicked;ole_web.object.Document.ExecCommand("JustifyLeft", false, 0)
  774. ole_web.setfocus()
  775. uf_refreshtoolbar()
  776. end event
  777. type pb_center from picturebutton within uo_html_editor
  778. string tag = "graphics\_Center.bmp"
  779. integer x = 1888
  780. integer width = 101
  781. integer height = 88
  782. integer taborder = 30
  783. integer textsize = -9
  784. integer weight = 400
  785. fontcharset fontcharset = gb2312charset!
  786. fontpitch fontpitch = variable!
  787. string facename = "宋体"
  788. string picturename = "graphics\Center.bmp"
  789. string disabledname = "graphics\Center.bmp"
  790. alignment htextalign = left!
  791. end type
  792. event clicked;ole_web.object.Document.ExecCommand("JustifyCenter", false, 0)
  793. ole_web.setfocus()
  794. uf_refreshtoolbar()
  795. end event
  796. type pb_right from picturebutton within uo_html_editor
  797. string tag = "graphics\_Right.bmp"
  798. integer x = 1989
  799. integer width = 101
  800. integer height = 88
  801. integer taborder = 30
  802. integer textsize = -9
  803. integer weight = 400
  804. fontcharset fontcharset = gb2312charset!
  805. fontpitch fontpitch = variable!
  806. string facename = "宋体"
  807. string picturename = "graphics\Right.bmp"
  808. string disabledname = "graphics\Right.bmp"
  809. alignment htextalign = left!
  810. end type
  811. event clicked;ole_web.object.Document.ExecCommand("JustifyRight", false, 0)
  812. ole_web.setfocus()
  813. uf_refreshtoolbar()
  814. end event
  815. type pb_full from picturebutton within uo_html_editor
  816. string tag = "graphics\_Full.bmp"
  817. integer x = 2089
  818. integer width = 101
  819. integer height = 88
  820. integer taborder = 30
  821. integer textsize = -9
  822. integer weight = 400
  823. fontcharset fontcharset = gb2312charset!
  824. fontpitch fontpitch = variable!
  825. string facename = "宋体"
  826. string picturename = "graphics\Full.bmp"
  827. string disabledname = "graphics\Full.bmp"
  828. alignment htextalign = left!
  829. end type
  830. event clicked;ole_web.object.Document.ExecCommand("JustifyFull", false, 0)
  831. ole_web.setfocus()
  832. uf_refreshtoolbar()
  833. end event
  834. type pb_line from picturebutton within uo_html_editor
  835. string tag = "graphics\_Line.bmp"
  836. integer x = 2190
  837. integer width = 101
  838. integer height = 88
  839. integer taborder = 30
  840. integer textsize = -9
  841. integer weight = 400
  842. fontcharset fontcharset = gb2312charset!
  843. fontpitch fontpitch = variable!
  844. string facename = "宋体"
  845. string picturename = "graphics\Line.bmp"
  846. string disabledname = "graphics\Line.bmp"
  847. alignment htextalign = left!
  848. end type
  849. event clicked;ole_web.object.Document.ExecCommand("InsertHorizontalRule", false, 0)
  850. ole_web.setfocus()
  851. uf_refreshtoolbar()
  852. end event
  853. type pb_hyperlink from picturebutton within uo_html_editor
  854. string tag = "graphics\_Hyperlink.bmp"
  855. integer x = 2290
  856. integer width = 101
  857. integer height = 88
  858. integer taborder = 40
  859. integer textsize = -9
  860. integer weight = 400
  861. fontcharset fontcharset = gb2312charset!
  862. fontpitch fontpitch = variable!
  863. string facename = "宋体"
  864. string picturename = "graphics\Hyperlink.bmp"
  865. string disabledname = "graphics\Hyperlink.bmp"
  866. alignment htextalign = left!
  867. end type
  868. event clicked;ole_web.object.Document.ExecCommand("CreateLink", true, 0)
  869. ole_web.setfocus()
  870. uf_refreshtoolbar()
  871. end event
  872. type pb_picture from picturebutton within uo_html_editor
  873. string tag = "graphics\_Picture.bmp"
  874. integer x = 2391
  875. integer width = 101
  876. integer height = 88
  877. integer taborder = 30
  878. integer textsize = -9
  879. integer weight = 400
  880. fontcharset fontcharset = gb2312charset!
  881. fontpitch fontpitch = variable!
  882. string facename = "宋体"
  883. string picturename = "graphics\Picture.bmp"
  884. string disabledname = "graphics\Picture.bmp"
  885. alignment htextalign = left!
  886. end type
  887. event clicked;ole_web.object.Document.ExecCommand("InsertImage", true, 0)
  888. ole_web.setfocus()
  889. uf_refreshtoolbar()
  890. end event
  891. type ddlb_fontsize from dropdownlistbox within uo_html_editor
  892. integer x = 759
  893. integer width = 219
  894. integer height = 576
  895. integer taborder = 20
  896. integer textsize = -9
  897. integer weight = 400
  898. fontcharset fontcharset = gb2312charset!
  899. fontpitch fontpitch = variable!
  900. string facename = "宋体"
  901. long textcolor = 33554432
  902. boolean sorted = false
  903. string item[] = {"8","10","12","14","18","24","36"}
  904. borderstyle borderstyle = stylelowered!
  905. end type
  906. event selectionchanged;int fontsize
  907. fontsize = index
  908. ole_web.object.Document.ExecCommand("FontSize", false, fontsize)
  909. ole_web.setfocus()
  910. uf_refreshtoolbar()
  911. f_SetProfileString (sys_empid,publ_userid+'_ddlb_font_size', "text_size",String(index))
  912. end event
  913. type ddlb_font from dropdownlistbox within uo_html_editor
  914. integer width = 750
  915. integer height = 576
  916. integer taborder = 10
  917. integer textsize = -9
  918. integer weight = 400
  919. fontcharset fontcharset = gb2312charset!
  920. fontpitch fontpitch = variable!
  921. string facename = "宋体"
  922. long textcolor = 33554432
  923. boolean vscrollbar = true
  924. string item[] = {"宋体","黑体","@宋体","@黑体"}
  925. borderstyle borderstyle = stylelowered!
  926. end type
  927. event selectionchanged;string font
  928. font = this.text
  929. ole_web.object.Document.ExecCommand("FontName", false, font)
  930. ole_web.setfocus()
  931. uf_refreshtoolbar()
  932. f_SetProfileString (sys_empid,publ_userid+'_ddlb_font', "text",String(ddlb_font.text))
  933. end event
  934. type ole_web from olecustomcontrol within uo_html_editor
  935. event statustextchange ( string text1 )
  936. event progresschange ( long progress, long progressmax )
  937. event commandstatechange ( long command, boolean enable )
  938. event downloadbegin ( )
  939. event downloadcomplete ( )
  940. event titlechange ( string text1 )
  941. event propertychange ( string szproperty )
  942. event beforenavigate2 ( oleobject pdisp, any url, any flags, any targetframename, any postdata, any headers, ref boolean cancel1 )
  943. event newwindow2 ( ref oleobject ppdisp, ref boolean cancel1 )
  944. event navigatecomplete2 ( oleobject pdisp, any url )
  945. event documentcomplete ( oleobject pdisp, any url )
  946. event onquit ( )
  947. event onvisible ( boolean ocx_visible )
  948. event ontoolbar ( boolean toolbar )
  949. event onmenubar ( boolean menubar )
  950. event onstatusbar ( boolean statusbar )
  951. event onfullscreen ( boolean fullscreen )
  952. event ontheatermode ( boolean theatermode )
  953. event windowsetresizable ( boolean resizable )
  954. event windowsetleft ( long left )
  955. event windowsettop ( long top )
  956. event windowsetwidth ( long ocx_width )
  957. event windowsetheight ( long ocx_height )
  958. event windowclosing ( boolean ischildwindow, ref boolean cancel1 )
  959. event clienttohostwindow ( ref long cx, ref long cy )
  960. event setsecurelockicon ( long securelockicon )
  961. event filedownload ( ref boolean cancel1 )
  962. event navigateerror ( oleobject pdisp, any url, any frame, any statuscode, ref boolean cancel1 )
  963. event printtemplateinstantiation ( oleobject pdisp )
  964. event printtemplateteardown ( oleobject pdisp )
  965. event updatepagestatus ( oleobject pdisp, any npage, any fdone )
  966. event privacyimpactedstatechange ( boolean bimpacted )
  967. event keyup pbm_keyup
  968. event showwindow pbm_showwindow
  969. integer y = 96
  970. integer width = 2501
  971. integer height = 600
  972. integer taborder = 20
  973. boolean border = false
  974. borderstyle borderstyle = stylelowered!
  975. boolean focusrectangle = false
  976. string binarykey = "uo_html_editor.udo"
  977. integer textsize = -12
  978. integer weight = 400
  979. fontcharset fontcharset = ansi!
  980. fontpitch fontpitch = variable!
  981. fontfamily fontfamily = swiss!
  982. string facename = "Arial"
  983. long textcolor = 33554432
  984. end type
  985. event keyup;
  986. uf_refreshtoolbar()
  987. end event
  988. event showwindow;if not ib_shown then
  989. parent.triggerevent('ue_afterinit')
  990. end if
  991. ib_shown = true
  992. end event
  993. event getfocus;uf_refreshtoolbar()
  994. end event
  995. event clicked;string font
  996. uf_getfont()
  997. //font = string(f_ProfileString(sys_empid,publ_userid+'_ddlb_font' ,"text",'宋体'))
  998. //ole_web.object.Document.ExecCommand("FontName", false, font)
  999. //ole_web.setfocus()
  1000. //uf_refreshtoolbar()
  1001. RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  1002. ////
  1003. ////注册热键
  1004. //long ll_RC
  1005. //string ls_atomid
  1006. //ls_atomid = 'myatomid'
  1007. //atomid = GlobalAddAtom(ls_atomid)
  1008. ////得到惟一的ID,保证不和其他应用程序发生冲突
  1009. //ll_RC = RegisterHotKey(Handle(this), atomid, MOD_CONTROL , 86)
  1010. ////注册的热键为Ctrl+F ,70为'F' 86 v
  1011. ////如果组合键,可用MOD_CONTROL + MOD_ALT等ctrl +v
  1012. //if ll_RC = 0 then messagebox("Error!","热键注册错误")
  1013. ////热键注册冲突
  1014. end event
  1015. event doubleclicked;string font
  1016. uf_getfont()
  1017. //font = ddlb_font.text
  1018. //ole_web.object.Document.ExecCommand("FontName", false, font)
  1019. //ole_web.setfocus()
  1020. //uf_refreshtoolbar()
  1021. //
  1022. end event
  1023. event constructor;//注册热键
  1024. long ll_RC
  1025. string ls_atomid
  1026. ls_atomid = 'myatomid'
  1027. sys_atomid = GlobalAddAtom(ls_atomid)
  1028. sys_handle=Handle(parent)
  1029. //得到惟一的ID,保证不和其他应用程序发生冲突
  1030. ll_RC = RegisterHotKey(sys_handle, sys_atomid, MOD_CONTROL , 86)
  1031. //注册的热键为Ctrl+F ,70为'F' 86 v
  1032. //如果组合键,可用MOD_CONTROL + MOD_ALT等ctrl +v
  1033. if ll_RC = 0 then messagebox("Error!","热键注册错误")
  1034. //热键注册冲突
  1035. end event
  1036. Start of PowerBuilder Binary Data Section : Do NOT Edit
  1037. 05uo_html_editor.bin
  1038. 2E00000a00e011cfd0e11ab1a1000000000000000000000000000000000003003e0009fffe000000060000000000000000000000010000000100000000000010000000000200000001fffffffe0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffefffffffefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006f00520074006f004500200074006e00790072000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050016ffffffffffffffff0000000100000000000000000000000000000000000000000000000000000000a0d9354001cecbe200000003000001800000000000500003004f0042005800430054005300450052004d0041000000000000000000000000000000000000000000000000000000000000000000000000000000000102001affffffff00000002ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000009c00000000004200500043004f00530058004f00540041005200450047000000000000000000000000000000000000000000000000000000000000000000000000000000000001001affffffffffffffff000000038856f96111d0340ac0006ba9a205d74f00000000a0d9354001cecbe2a0d9354001cecbe2000000000000000000000000004f00430054004e004e00450053005400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001020012ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000030000009c000000000000000100000002fffffffe0000000400000005fffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  1039. 2Cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000004c0000388900000f810000000000000000000000000000000000000000000000000000004c0000000000000000000000010057d0e011cf3573000869ae62122e2b00000008000000000000004c0002140100000000000000c0460000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c0000388900000f810000000000000000000000000000000000000000000000000000004c0000000000000000000000010057d0e011cf3573000869ae62122e2b00000008000000000000004c0002140100000000000000c0460000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  1040. 15uo_html_editor.bin
  1041. End of PowerBuilder Binary Data Section : No Source Expected After This Point