w_sysplan_dw_freeform_edit.srw 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  1. $PBExportHeader$w_sysplan_dw_freeform_edit.srw
  2. forward
  3. global type w_sysplan_dw_freeform_edit from w_publ_base
  4. end type
  5. type dw_1 from u_dw_uc_rbtnfilter within w_sysplan_dw_freeform_edit
  6. end type
  7. type cb_1 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  8. end type
  9. type cb_2 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  10. end type
  11. type cb_3 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  12. end type
  13. type cb_4 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  14. end type
  15. type cb_5 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  16. end type
  17. type r_bar from rectangle within w_sysplan_dw_freeform_edit
  18. end type
  19. type ln_bar from line within w_sysplan_dw_freeform_edit
  20. end type
  21. type ln_bar2 from line within w_sysplan_dw_freeform_edit
  22. end type
  23. end forward
  24. global type w_sysplan_dw_freeform_edit from w_publ_base
  25. integer width = 3145
  26. integer height = 2380
  27. string title = "布局设置"
  28. boolean minbox = false
  29. windowtype windowtype = response!
  30. long backcolor = 134217738
  31. dw_1 dw_1
  32. cb_1 cb_1
  33. cb_2 cb_2
  34. cb_3 cb_3
  35. cb_4 cb_4
  36. cb_5 cb_5
  37. r_bar r_bar
  38. ln_bar ln_bar
  39. ln_bar2 ln_bar2
  40. end type
  41. global w_sysplan_dw_freeform_edit w_sysplan_dw_freeform_edit
  42. type variables
  43. Long cur_type = -1
  44. Long uc_column_int
  45. Long cur_nomodify[]
  46. Long cur_start = 0
  47. String cur_win
  48. String dwoselect
  49. String cur_mod[]
  50. Long cur_resize = 0
  51. Long cur_select = 0
  52. Long ii_x_scroll,ii_y_scroll
  53. Long cur_x,cur_y
  54. String cur_chname[]
  55. long cur_mainid
  56. end variables
  57. forward prototypes
  58. public subroutine wf_open ()
  59. public subroutine wf_aoto_taborder ()
  60. public function integer wf_get_max (integer arg_type)
  61. public subroutine wf_show (integer arg_show[])
  62. public subroutine wf_get_columnname (ref string arg_name[])
  63. public function integer wf_get_max (integer arg_type, integer arg_long[])
  64. end prototypes
  65. public subroutine wf_open ();
  66. long nColumnCount,nColumnIndex
  67. string des_1,des_2,des_3,szColumn,ls_pkcolname
  68. string ls_name
  69. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  70. ls_name = dw_1.describe("DataWindow.Objects")
  71. string ls_a[]
  72. long i=0
  73. do while pos(ls_name,'~t') > 1
  74. i++
  75. ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  76. ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  77. loop
  78. i++
  79. ls_a[i] = ls_name
  80. FOR i= 1 to upperbound(ls_a)
  81. des_1 = ls_a[i]
  82. dw_1.modify(des_1+'.moveable = 1')
  83. dw_1.modify(des_1+'.resizeable = 1')
  84. dw_1.modify(des_1+'.border = 2')
  85. // dw_1.modify(des_1+'.color = 255')
  86. next
  87. end subroutine
  88. public subroutine wf_aoto_taborder ();Long nColumnIndex,nColumnCount,lRow,ls_i,i = 1
  89. String des_1,des_2,szColumn,str
  90. String Name[]
  91. Long ll_x[],ll_y[],ll_width[],ll_height[]
  92. Long ll_count
  93. //获取所有可以编辑的字段名称、横纵坐标
  94. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  95. FOR nColumnIndex = 1 TO nColumnCount
  96. des_1 = dw_1.DESCRIBE( "#" + String(nColumnIndex) + ".Name")
  97. des_2 = dw_1.DESCRIBE(des_1+ "_t.Text")
  98. szColumn = f_strip( des_2)
  99. IF Long(dw_1.DESCRIBE(des_1+ ".Visible")) = 1 AND Long(dw_1.DESCRIBE(des_1+ ".x")) > 0 THEN
  100. IF nColumnIndex <= uc_column_int THEN
  101. Name[i] = des_1
  102. ll_x[i] = Long(dw_1.DESCRIBE(des_1+ ".x"))
  103. ll_y[i] = Long(dw_1.DESCRIBE(des_1+ ".y"))
  104. ll_width[i] = Long(dw_1.DESCRIBE(des_1+ ".width"))
  105. ll_height[i] = Long(dw_1.DESCRIBE(des_1+ ".height"))
  106. i++
  107. END IF
  108. END IF
  109. NEXT
  110. //////----------------------------
  111. ll_count = i - 1
  112. Long Min,minnub
  113. Long newx[],j = 1,ll_cnt,ll_t,midx[],k,ll_null[]
  114. String newname[],ls_t,midname[]
  115. String ls_null[]
  116. cnt:
  117. //找出纵坐标最小字段
  118. Min = ll_y[1]
  119. minnub = 1
  120. FOR i = 2 TO ll_count
  121. IF Min <= ll_y[i] THEN
  122. ELSE
  123. Min = ll_y[i]
  124. minnub = i
  125. END IF
  126. NEXT
  127. ////////////--------------------------
  128. //找出与最少纵坐标字段同行的所有字段
  129. j = 1
  130. FOR i = 1 TO ll_count
  131. IF ll_y[i] >= ll_y[minnub] AND ll_y[i] <= (ll_height[minnub] +ll_y[minnub]) THEN
  132. midname[j] = Name[i]
  133. midx[j] = ll_x[i]
  134. j++
  135. END IF
  136. NEXT
  137. ll_cnt = j -1
  138. /////-------------------------------
  139. //将同行的字段进行排序(按横坐标大小)
  140. FOR i = 1 TO ll_cnt - 1
  141. FOR j = i + 1 TO ll_cnt
  142. IF midx[i] < midx[j] THEN
  143. ELSE
  144. ll_t = midx[i]
  145. midx[i] = midx[j]
  146. midx[j] = ll_t
  147. ls_t = midname[i]
  148. midname[i] = midname[j]
  149. midname[j] = ls_t
  150. END IF
  151. NEXT
  152. NEXT
  153. ////////////----------------------------
  154. //删除已经排序的字段
  155. //FOR i = 1 TO ll_count
  156. // FOR j = 1 TO ll_cnt
  157. // IF Name[i] = midname[j] THEN
  158. // FOR k = i TO ll_count -1
  159. // Name[k] = Name[k+1]
  160. // ll_x[k] = ll_x[k+1]
  161. // ll_y[k] = ll_y[k+1]
  162. // ll_width[k] = ll_width[k+1]
  163. // ll_height[k] = ll_height[k+1]
  164. // NEXT
  165. // ll_count --
  166. // END IF
  167. // NEXT
  168. //NEXT
  169. FOR i = 1 TO ll_count
  170. FOR j = 1 TO ll_cnt
  171. IF Name[i] = midname[j] THEN
  172. Name[i] = ''
  173. k++
  174. END IF
  175. NEXT
  176. NEXT
  177. j = 0
  178. FOR i = ll_count TO 1 STEP -1
  179. IF Name[i] = '' THEN
  180. FOR k = i TO ll_count -1
  181. Name[k] = Name[k+1]
  182. ll_x[k] = ll_x[k+1]
  183. ll_y[k] = ll_y[k+1]
  184. ll_width[k] = ll_width[k+1]
  185. ll_height[k] = ll_height[k+1]
  186. NEXT
  187. j++
  188. END IF
  189. NEXT
  190. ll_count = ll_count - j
  191. ////////----------------------------
  192. //将排好序的一行字段,放入目的数组,清空临时数组
  193. Long ll_bnd
  194. ll_bnd = UpperBound(newname)
  195. FOR i = 1 TO ll_cnt
  196. newname[ll_bnd + i] = midname[i]
  197. NEXT
  198. midname[] = ls_null[]
  199. midx[] = ll_null[]
  200. ////////////-----------------------------------
  201. IF ll_count > 0 THEN
  202. GOTO cnt
  203. END IF
  204. Long aaa
  205. String ls_taborder_auto = ''
  206. FOR i = 1 TO UpperBound(newname)
  207. ls_taborder_auto = ls_taborder_auto + newname[i]+".Tabsequence="+String(i * 10)+'~t'
  208. NEXT
  209. String ls_data
  210. ls_data = dw_1.DataObject
  211. /////保存taporder
  212. UPDATE sys_user_dwnSyntax
  213. SET dwnSyntax_layout_column_taporder = :ls_taborder_auto
  214. WHERE empid = :sys_empid
  215. AND dwname = :ls_data;
  216. IF sqlca.SQLCode = 0 THEN
  217. IF sqlca.SQLNRows = 0 THEN
  218. INSERT INTO sys_user_dwnSyntax
  219. (empid,
  220. dwname,
  221. dwnSyntax_filter,
  222. dwnSyntax_sort,
  223. dwnSyntax_layout_column_visible,
  224. dwnSyntax_layout_column_width,
  225. dwnSyntax_layout_column_alignment,
  226. dwnSyntax_layout_column_pos,
  227. dwnSyntax_layout_column_edit,
  228. dwnSyntax_layout_column_font,
  229. dwnSyntax_layout_column_height,
  230. dwnSyntax_layout_column_taporder)
  231. Values(:publ_userid,:ls_data,'','','','','','','','','',:ls_taborder_auto);
  232. END IF
  233. END IF
  234. COMMIT;
  235. /////////////////////////
  236. //messagebox('',ls_taborder_auto)
  237. dw_1.ins_mdfstr_column_taporder = ls_taborder_auto
  238. MessageBox('提示','OK')
  239. end subroutine
  240. public function integer wf_get_max (integer arg_type);//wf_get_max()
  241. long nColumnIndex,nColumnCount,lRow,ls_i,j=1
  242. string des_1,des_2,szColumn,str
  243. long ll_x[100],ll_y[100],ll_width[100],ll_height[100]
  244. //获取所有可以编辑的字段名称、横纵坐标
  245. string des_3,ls_pkcolname
  246. string ls_name
  247. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  248. ls_name = dw_1.describe("DataWindow.Objects")
  249. string ls_a[]
  250. long i=0
  251. do while pos(ls_name,'~t') > 1
  252. i++
  253. ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  254. ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  255. loop
  256. i++
  257. ls_a[i] = ls_name
  258. FOR i= 1 to upperbound(ls_a)
  259. des_1 = ls_a[i]
  260. if long(dw_1.describe(des_1+'.visible')) = 1 then
  261. ll_x[j] = long(dw_1.describe(des_1+'.x'))
  262. ll_y[j] = long(dw_1.describe(des_1+'.y'))
  263. ll_width[j] = long(dw_1.describe(des_1+'.width'))
  264. ll_height[j] = long(dw_1.describe(des_1+'.height'))
  265. j++
  266. end if
  267. next
  268. long ll_maxwid,ll_maxhig
  269. ll_maxwid = ll_x[1] + ll_width[1]
  270. for i = 2 to j -1
  271. if ll_maxwid < ll_x[i] + ll_width[i] then
  272. ll_maxwid = ll_x[i] + ll_width[i]
  273. end if
  274. next
  275. ll_maxhig = ll_y[1] + ll_height[1]
  276. for i =2 to j -1
  277. if ll_maxhig < ll_y[i] + ll_height[i] then
  278. ll_maxhig = ll_y[i] + ll_height[i]
  279. end if
  280. next
  281. if arg_type = 1 then
  282. return ll_maxwid + 50
  283. elseif arg_type = 2 then
  284. return ll_maxhig + 50
  285. end if
  286. end function
  287. public subroutine wf_show (integer arg_show[]);IF UpperBound(arg_show) <= 0 THEN RETURN
  288. Long i,ll_maxw,ll_maxh,ll_x,ll_y,ll_width,ll_height,ll_with_t,ll_x_t
  289. long j,ld_x,ld_y,ld_width,ld_height,ld_with_t,ld_x_t,k= 0
  290. String arg_name[]
  291. FOR i = 1 TO UpperBound(arg_show)
  292. ll_maxh = wf_get_max(2)
  293. wf_get_columnname(arg_name)
  294. ll_x = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.x'))
  295. ll_x_t = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.x'))
  296. ll_y = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.y'))
  297. ll_width = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width'))
  298. ll_with_t = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width'))
  299. ll_height = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.height'))
  300. k= 0
  301. for j = 1 TO UpperBound(arg_name)
  302. if arg_name[j] = arg_name[arg_show[i]] then continue
  303. ld_x = Long(dw_1.DESCRIBE(arg_name[j]+'.x'))
  304. ld_x_t = Long(dw_1.DESCRIBE(arg_name[j]+'_t.x'))
  305. ld_y = Long(dw_1.DESCRIBE(arg_name[j]+'.y'))
  306. ld_width = Long(dw_1.DESCRIBE(arg_name[j]+'.width'))
  307. ld_with_t = Long(dw_1.DESCRIBE(arg_name[j]+'_t.width'))
  308. ld_height = Long(dw_1.DESCRIBE(arg_name[j]+'.height'))
  309. if ld_y < ll_y and ld_y + ld_height > ll_y or ld_y > ll_y and ld_y < ll_y + ll_height then
  310. if ll_x_t > ld_x + ld_width or ld_x_t > ll_x + ll_width then
  311. goto ext
  312. end if
  313. else
  314. k++
  315. end if
  316. next
  317. if k + 1 = UpperBound(arg_name) then goto ext
  318. IF ll_maxh - 35 + ll_height > dw_1.Height THEN
  319. IF ll_maxh - 35 + ll_height < THIS.Height - 300 THEN
  320. IF i > 1 THEN
  321. IF Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) &
  322. + 20 + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width')) &
  323. <= dw_1.Width THEN
  324. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  325. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) + 20 +ll_with_t))
  326. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  327. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) + 20))
  328. ELSE
  329. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  330. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  331. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  332. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  333. dw_1.Height = ll_maxh - 15 + ll_height -200
  334. END IF
  335. ELSE
  336. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  337. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  338. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  339. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  340. dw_1.Height = ll_maxh - 15 + ll_height -200
  341. END IF
  342. END IF
  343. ELSE
  344. IF i > 1 THEN
  345. IF Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) &
  346. + 20 + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width')) &
  347. <= dw_1.Width THEN
  348. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  349. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) + 20 +ll_with_t))
  350. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  351. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) + 20))
  352. ELSE
  353. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  354. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  355. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  356. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  357. END IF
  358. ELSE
  359. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  360. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  361. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  362. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  363. END IF
  364. END IF
  365. ext:
  366. NEXT
  367. end subroutine
  368. public subroutine wf_get_columnname (ref string arg_name[]);long nColumnIndex,nColumnCount,lRow,ls_i,i= 0
  369. string ls_name[],des_1,des_2,szColumn
  370. s_dw_uc_rbtnfilter_setlayout_rt ls_s_rt
  371. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  372. For nColumnIndex = 1 To nColumnCount
  373. des_1= dw_1.Describe( "#" + String(nColumnIndex) + ".Name")
  374. des_2= dw_1.describe(des_1+ "_t.Text")
  375. szColumn = f_strip( des_2)
  376. If szColumn <> "!" Then
  377. i++
  378. ls_name[nColumnIndex] = des_1
  379. end if
  380. next
  381. arg_name = ls_name
  382. //return ls_name
  383. end subroutine
  384. public function integer wf_get_max (integer arg_type, integer arg_long[]);//wf_get_max()
  385. long nColumnIndex,nColumnCount,lRow,ls_i,j=1
  386. string des_1,des_2,szColumn,str
  387. long ll_x[100],ll_y[100],ll_width[100],ll_height[100]
  388. //获取所有可以编辑的字段名称、横纵坐标
  389. string des_3,ls_pkcolname
  390. string ls_name
  391. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  392. ls_name = dw_1.describe("DataWindow.Objects")
  393. string ls_a[]
  394. long i=0
  395. //do while pos(ls_name,'~t') > 1
  396. // i++
  397. // ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  398. // ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  399. //loop
  400. //
  401. //i++
  402. //ls_a[i] = ls_name
  403. wf_get_columnname(ls_a)
  404. FOR i= 1 to upperbound(ls_a)
  405. des_1 = ls_a[i]
  406. // if long(dw_1.describe(des_1+'.visible')) = 1 then
  407. ll_x[j] = long(dw_1.describe(des_1+'.x'))
  408. ll_y[j] = long(dw_1.describe(des_1+'.y'))
  409. ll_width[j] = long(dw_1.describe(des_1+'.width'))
  410. ll_height[j] = long(dw_1.describe(des_1+'.height'))
  411. j++
  412. // end if
  413. next
  414. long ll_maxwid,ll_maxhig,k
  415. ll_maxwid = ll_x[1] + ll_width[1]
  416. for i = 2 to j -1
  417. for k =1 to upperbound(arg_long)
  418. if i = arg_long[k] then
  419. goto ext1
  420. end if
  421. next
  422. if ll_maxwid < ll_x[i] + ll_width[i] then
  423. ll_maxwid = ll_x[i] + ll_width[i]
  424. end if
  425. ext1:
  426. next
  427. ll_maxhig = ll_y[1] + ll_height[1]
  428. for i =2 to j -1
  429. for k =1 to upperbound(arg_long)
  430. if i = arg_long[k] then
  431. goto ext2
  432. end if
  433. next
  434. if ll_maxhig < ll_y[i] + ll_height[i] then
  435. ll_maxhig = ll_y[i] + ll_height[i]
  436. end if
  437. ext2:
  438. next
  439. if arg_type = 1 then
  440. return ll_maxwid + 50
  441. elseif arg_type = 2 then
  442. return ll_maxhig + 50
  443. end if
  444. end function
  445. on w_sysplan_dw_freeform_edit.create
  446. int iCurrent
  447. call super::create
  448. this.dw_1=create dw_1
  449. this.cb_1=create cb_1
  450. this.cb_2=create cb_2
  451. this.cb_3=create cb_3
  452. this.cb_4=create cb_4
  453. this.cb_5=create cb_5
  454. this.r_bar=create r_bar
  455. this.ln_bar=create ln_bar
  456. this.ln_bar2=create ln_bar2
  457. iCurrent=UpperBound(this.Control)
  458. this.Control[iCurrent+1]=this.dw_1
  459. this.Control[iCurrent+2]=this.cb_1
  460. this.Control[iCurrent+3]=this.cb_2
  461. this.Control[iCurrent+4]=this.cb_3
  462. this.Control[iCurrent+5]=this.cb_4
  463. this.Control[iCurrent+6]=this.cb_5
  464. this.Control[iCurrent+7]=this.r_bar
  465. this.Control[iCurrent+8]=this.ln_bar
  466. this.Control[iCurrent+9]=this.ln_bar2
  467. end on
  468. on w_sysplan_dw_freeform_edit.destroy
  469. call super::destroy
  470. destroy(this.dw_1)
  471. destroy(this.cb_1)
  472. destroy(this.cb_2)
  473. destroy(this.cb_3)
  474. destroy(this.cb_4)
  475. destroy(this.cb_5)
  476. destroy(this.r_bar)
  477. destroy(this.ln_bar)
  478. destroy(this.ln_bar2)
  479. end on
  480. event open;call super::open;s_dw_uc_modify s_modify
  481. s_modify = Message.PowerObjectParm
  482. Long ll_billid,ll_scid
  483. dw_1.DataObject = s_modify.datawinname_uc
  484. uc_column_int = s_modify.uc_column_int
  485. cur_win = s_modify.win
  486. cur_mainid = s_modify.mainid
  487. dw_1.Width = s_modify.uc_width
  488. dw_1.Height = s_modify.uc_height
  489. cur_mod = s_modify.nomod
  490. cur_start = 1
  491. dw_1.Object.datawindow.detail.Height = 2000
  492. dw_1.Object.datawindow.detail.Height.AutoSize = TRUE
  493. dw_1.TriggerEvent(Constructor!)
  494. dw_1.SetTransObject(sqlca)
  495. cur_resize = 1
  496. wf_open()
  497. end event
  498. event close;call super::close;s_resize s_size
  499. s_size.backtype = cur_type
  500. s_size.Width = dw_1.Width
  501. s_size.Height = dw_1.Height
  502. CloseWithReturn(THIS,s_size)
  503. end event
  504. event key;call super::key;//if key=Keyleftarrow! or key=Keyrightarrow! or key=Keyuparrow! or key=Keydownarrow! then
  505. //
  506. //end if
  507. end event
  508. event resize;call super::resize;ln_bar.EndX = THIS.Width
  509. ln_bar2.EndX = THIS.Width
  510. r_bar.Width = THIS.Width
  511. end event
  512. type cb_func from w_publ_base`cb_func within w_sysplan_dw_freeform_edit
  513. boolean visible = false
  514. string text = "工具"
  515. end type
  516. type cb_exit from w_publ_base`cb_exit within w_sysplan_dw_freeform_edit
  517. integer x = 1051
  518. integer width = 151
  519. integer height = 164
  520. integer picsize = 16
  521. toolbaralignment pic_align = alignattop!
  522. boolean border = false
  523. end type
  524. event cb_exit::clicked;//不保存布局
  525. cur_type = -1
  526. close(parent)
  527. end event
  528. type dw_1 from u_dw_uc_rbtnfilter within w_sysplan_dw_freeform_edit
  529. event ue_lbuttonup pbm_dwnrbuttonup
  530. integer y = 184
  531. integer width = 3026
  532. integer height = 1724
  533. integer taborder = 20
  534. boolean bringtotop = true
  535. boolean resizable = true
  536. boolean livescroll = false
  537. borderstyle borderstyle = styleraised!
  538. end type
  539. event ue_lbuttonup;////string ls_name
  540. ////long ll_y,ll_x
  541. ////
  542. ////ls_name = dwo.name
  543. ////ll_x = long(this.describe(ls_name+'.x')) + long(this.describe(ls_name+'.width'))
  544. ////ll_y = long(this.describe(ls_name+'.y')) + long(this.describe(ls_name+'.height'))
  545. ////
  546. ////if (ll_x +50 > this.width) or (ll_y + 50 > this.height + this.y) then
  547. //// messagebox('','控件不能移出窗口范围!')
  548. ////end if
  549. //
  550. ////messagebox(string(xpos),string(ypos))
  551. //
  552. ////xpos=xpos+ii_x_scroll
  553. ////ypos=ypos+ii_y_scroll
  554. ////
  555. ////messagebox(string(ii_x_scroll),string(ii_y_scroll))
  556. //if (xpos=cur_x and ypos=cur_y) or ((KeyDown(Keyshift!) or KeyDown(KeyControl!)) ) then
  557. //else
  558. //long i ,ll_x,ll_y
  559. //long ll_wid,ll_hig
  560. //string ls_name
  561. //if cur_select <= 0 then return
  562. //ls_name = dwo.name
  563. //ll_x = long(this.describe(ls_name+'.x'))
  564. //ll_y = long(this.describe(ls_name+'.y'))
  565. //ll_wid = ll_x - cur_x
  566. //ll_hig = ll_y - cur_y
  567. //
  568. //long lx,ly
  569. //for i =1 to cur_select
  570. // if cur_chname[i] <> ls_name then
  571. // lx = long(this.describe(cur_chname[i]+'.x'))
  572. // this.modify(cur_chname[i]+'.x = '+string(lx + ll_wid ))
  573. // ly = long(this.describe(cur_chname[i]+'.y'))
  574. // this.modify(cur_chname[i]+'.y = '+string(ly + ll_hig ))
  575. // end if
  576. //next
  577. //end if
  578. this.triggerevent(resize!)
  579. end event
  580. event ue_setlayout;IF setcolumn_visible_USE = FALSE THEN RETURN
  581. IF THIS.DataObject = '' THEN RETURN
  582. //设定不能隐藏的项目
  583. //wf_set_modify()
  584. //读取每列顺序
  585. THIS.TriggerEvent('ue_taborder')
  586. IF THIS.ins_if_nomodify_uc_taborder THEN
  587. THIS.uf_reset_layout(uc_column_int)
  588. END IF
  589. /////////////////////////
  590. datastore ls_ds
  591. ls_ds = CREATE datastore
  592. ls_ds.DataObject = 'dw_uc_rbtnfilter_setlayout_grid'
  593. String ls_mdfstr,ls_mdftext_str,ls_titlex_str,ls_titley_str,ls_x_str,ls_y_str //存放modify string
  594. String des_1,des_2,szColumn,ls_cwidth,ls_alignment,ls_cheight,ls_taporder
  595. string ls_dbname
  596. Long nColumnIndex,nColumnCount,lRow,ls_i,i
  597. s_dw_uc_rbtnfilter_setlayout_rt ls_s_rt
  598. nColumnCount = Integer( THIS.Object.DataWindow.Column.Count)
  599. String arg_msg
  600. IF f_set_nomod(THIS.DataObject,cur_mod,arg_msg) = 0 THEN
  601. MessageBox('提示',arg_msg)
  602. RETURN
  603. END IF
  604. FOR nColumnIndex = 1 TO nColumnCount
  605. des_1 = THIS.Describe( "#" + String(nColumnIndex) + ".Name")
  606. des_2 = THIS.Describe(des_1+ "_t.Text")
  607. ls_dbname = THIS.Describe( "#" + String(nColumnIndex) + ".dbname")
  608. szColumn = f_strip( des_2)
  609. IF szColumn <> "!" THEN
  610. lRow = ls_ds.InsertRow( 0)
  611. ls_ds.SetItem( lRow, "ctitle", szColumn)
  612. ls_ds.SetItem( lRow, "cname", ls_dbname)
  613. ls_ds.SetItem( lRow, "name", des_1)
  614. ls_ds.SetItem( lRow, "cshow_flag", Long(THIS.Describe(des_1+ ".Visible")))
  615. ls_ds.SetItem( lRow, "cnewtitle", THIS.Describe(des_1+ "_t.text"))
  616. ls_ds.SetItem( lRow, "cwidth", Long(THIS.Describe(des_1+ ".width")))
  617. ls_ds.SetItem( lRow, "cheight", Long(THIS.Describe(des_1+ ".height")))
  618. ls_ds.SetItem( lRow, "alignment", Long(THIS.Describe(des_1+ ".alignment")))
  619. ls_ds.SetItem( lRow, "nColumnIndex", nColumnIndex)
  620. ls_ds.SetItem( lRow, "titlex", Long(THIS.Describe(des_1+ "_t.x")))
  621. ls_ds.SetItem( lRow, "titley", Long(THIS.Describe(des_1+ "_t.y")))
  622. ls_ds.SetItem( lRow, "x", Long(THIS.Describe(des_1+ ".x")))
  623. ls_ds.SetItem( lRow, "y", Long(THIS.Describe(des_1+ ".y")))
  624. ls_ds.SetItem( lRow, "taporder", Long(THIS.Describe(des_1+ ".Tabsequence")))
  625. IF nColumnIndex <= uc_column_int THEN
  626. ls_ds.SetItem( lRow, "order_flag", 1)
  627. ELSE
  628. ls_ds.SetItem( lRow, "order_flag", 0)
  629. END IF
  630. FOR i = 1 TO UpperBound(cur_mod)
  631. IF cur_mod[i] = des_1 THEN
  632. cur_nomodify[nColumnIndex] = 1
  633. GOTO ext
  634. ELSE
  635. cur_nomodify[nColumnIndex] = 0
  636. END IF
  637. NEXT
  638. ext:
  639. ls_ds.SetItem( lRow, "protect", cur_nomodify[nColumnIndex])
  640. END IF
  641. NEXT
  642. //---打开设置窗口
  643. OpenWithParm(w_dw_uc_rbtnfilter_setlayout,ls_ds)
  644. ls_s_rt = Message.PowerObjectParm
  645. //---处理设置
  646. IF ls_s_rt.flag = 1 THEN //要保存修改
  647. ls_ds.SetFullState( ls_s_rt.b_changes )
  648. FOR ls_i = 1 TO ls_ds.RowCount()
  649. ls_mdfstr = ls_mdfstr+ls_ds.Object.name[ls_i]+'.visible='+String(ls_ds.Object.cshow_flag[ls_i])+'~t'
  650. ls_mdfstr = ls_mdfstr+ls_ds.Object.name[ls_i]+'_t.visible='+String(ls_ds.Object.cshow_flag[ls_i])+'~t'
  651. ls_mdftext_str = ls_mdftext_str+ls_ds.Object.name[ls_i]+"_t.text='"+ls_ds.Object.cnewtitle[ls_i]+"'~t"
  652. ls_titlex_str = ls_titlex_str+ls_ds.Object.name[ls_i]+"_t.x="+String(ls_ds.Object.titlex[ls_i])+'~t'
  653. ls_titley_str = ls_titley_str+ls_ds.Object.name[ls_i]+"_t.y="+String(ls_ds.Object.titley[ls_i])+'~t'
  654. ls_x_str = ls_x_str+ls_ds.Object.name[ls_i]+".x="+String(ls_ds.Object.X[ls_i])+'~t'
  655. ls_y_str = ls_y_str+ls_ds.Object.name[ls_i]+".y="+String(ls_ds.Object.Y[ls_i])+'~t'
  656. ls_cwidth = ls_cwidth+ls_ds.Object.name[ls_i]+".width="+String(ls_ds.Object.cwidth[ls_i])+'~t'
  657. ls_cheight = ls_cheight+ls_ds.Object.name[ls_i]+".height="+String(ls_ds.Object.cheight[ls_i])+'~t'
  658. ls_alignment = ls_alignment+ls_ds.Object.name[ls_i]+".alignment="+String(ls_ds.Object.Alignment[ls_i])+'~t'
  659. ls_taporder = ls_taporder +ls_ds.Object.name[ls_i]+".Tabsequence="+String(ls_ds.Object.taporder[ls_i])+'~t'
  660. NEXT
  661. ins_mdfstr_column_visible = ls_mdfstr
  662. ins_mdfstr_column_text = ls_mdftext_str
  663. ins_mdfstr_column_x = ls_titlex_str+ls_x_str
  664. ins_mdfstr_column_y = ls_titley_str+ls_y_str
  665. ins_mdfstr_column_width = ls_cwidth
  666. ins_mdfstr_column_alignment = ls_alignment
  667. ins_mdfstr_column_height = ls_cheight
  668. ins_mdfstr_column_taporder = ls_taporder
  669. THIS.Modify( ins_mdfstr_column_visible)
  670. THIS.Modify(ins_mdfstr_column_text)
  671. THIS.Modify(ins_mdfstr_column_width)
  672. THIS.Modify(ins_mdfstr_column_x)
  673. THIS.Modify(ins_mdfstr_column_y)
  674. THIS.Modify(ins_mdfstr_column_alignment)
  675. THIS.Modify(ins_mdfstr_column_height)
  676. // this.modify(ins_mdfstr_column_taporder)
  677. wf_show(ls_s_rt.Show)
  678. /////保存taborder
  679. UPDATE sys_user_dwnSyntax
  680. SET dwnSyntax_layout_column_taporder = :ins_mdfstr_column_taporder
  681. WHERE empid = :cardw_empid
  682. AND dwname = :cur_DataObject;
  683. IF sqlca.SQLCode = 0 THEN
  684. IF sqlca.SQLNRows = 0 THEN
  685. INSERT INTO sys_user_dwnSyntax
  686. (empid,
  687. dwname,
  688. dwnSyntax_filter,
  689. dwnSyntax_sort,
  690. dwnSyntax_layout_column_visible,
  691. dwnSyntax_layout_column_width,
  692. dwnSyntax_layout_column_alignment,
  693. dwnSyntax_layout_column_pos,
  694. dwnSyntax_layout_column_edit,
  695. dwnSyntax_layout_column_font,
  696. dwnSyntax_layout_column_height,
  697. dwnSyntax_layout_column_taporder)
  698. Values(:cardw_empid,:cur_DataObject,'','','','','','','','','',:ins_mdfstr_column_taporder);
  699. END IF
  700. COMMIT;
  701. END IF
  702. /////////////////////////
  703. ELSEIF ls_s_rt.flag = 2 THEN //reset
  704. uf_reset_layout(uc_column_int)
  705. uf_save_profile_layout()
  706. ELSEIF ls_s_rt.flag = 3 THEN //reset one
  707. uf_reset_layout_one(ls_s_rt.rownumber)
  708. uf_save_profile_layout()
  709. END IF
  710. //清除taborder
  711. THIS.TriggerEvent('c_taporder')
  712. DESTROY ls_ds
  713. end event
  714. event dwnkey;IF KeyDown(KeyF2!) THEN //save layout 不含列显示
  715. THIS.TriggerEvent('ue_setlayout')
  716. ELSEIF KeyDown(KeyF9!) THEN //save layout 全部重置,包括按钮等控件
  717. uf_reset_layout_all()
  718. END IF
  719. THIS.TriggerEvent('ue_taborder_cancel')
  720. //键盘操作触发事件
  721. Long ll_x,ll_y,ll_wid,ll_hig
  722. Long i
  723. String ls_name
  724. IF Key = Keyleftarrow! OR Key = Keyrightarrow! OR Key = Keyuparrow! OR Key = Keydownarrow! OR Key = Keydelete! THEN
  725. SetRedraw(FALSE)
  726. CHOOSE CASE keyflags
  727. CASE 1
  728. CHOOSE CASE Key
  729. CASE Keyleftarrow!
  730. FOR i = 1 TO cur_select
  731. ls_name = cur_chname[i]
  732. ll_wid = Long(THIS.DESCRIBE(ls_name+'.width'))
  733. ll_wid = ll_wid - 2
  734. THIS.Modify(ls_name+'.width ='+String(ll_wid))
  735. NEXT
  736. CASE Keyrightarrow!
  737. FOR i = 1 TO cur_select
  738. ls_name = cur_chname[i]
  739. ll_wid = Long(THIS.DESCRIBE(ls_name+'.width'))
  740. ll_wid = ll_wid + 2
  741. THIS.Modify(ls_name+'.width ='+String(ll_wid))
  742. NEXT
  743. CASE Keyuparrow!
  744. FOR i = 1 TO cur_select
  745. ls_name = cur_chname[i]
  746. ll_hig = Long(THIS.DESCRIBE(ls_name+'.height'))
  747. ll_hig = ll_hig - 2
  748. THIS.Modify(ls_name+'.height ='+String(ll_hig))
  749. NEXT
  750. CASE Keydownarrow!
  751. FOR i = 1 TO cur_select
  752. ls_name = cur_chname[i]
  753. ll_hig = Long(THIS.DESCRIBE(ls_name+'.height'))
  754. ll_hig = ll_hig + 2
  755. THIS.Modify(ls_name+'.height ='+String(ll_hig))
  756. NEXT
  757. END CHOOSE
  758. CASE ELSE
  759. CHOOSE CASE Key
  760. CASE Keyleftarrow!
  761. FOR i = 1 TO cur_select
  762. ls_name = cur_chname[i]
  763. ll_x = Long(THIS.DESCRIBE(ls_name+'.x'))
  764. ll_x = ll_x - 3
  765. THIS.Modify(ls_name+'.x ='+String(ll_x))
  766. NEXT
  767. CASE Keyrightarrow!
  768. FOR i = 1 TO cur_select
  769. ls_name = cur_chname[i]
  770. ll_x = Long(THIS.DESCRIBE(ls_name+'.x'))
  771. ll_x = ll_x + 3
  772. THIS.Modify(ls_name+'.x ='+String(ll_x))
  773. NEXT
  774. CASE Keyuparrow!
  775. FOR i = 1 TO cur_select
  776. ls_name = cur_chname[i]
  777. ll_y = Long(THIS.DESCRIBE(ls_name+'.y'))
  778. ll_y = ll_y - 3
  779. THIS.Modify(ls_name+'.y ='+String(ll_y))
  780. NEXT
  781. CASE Keydownarrow!
  782. FOR i = 1 TO cur_select
  783. ls_name = cur_chname[i]
  784. ll_y = Long(THIS.DESCRIBE(ls_name+'.y'))
  785. ll_y = ll_y + 3
  786. THIS.Modify(ls_name+'.y ='+String(ll_y))
  787. NEXT
  788. END CHOOSE
  789. END CHOOSE
  790. SetRedraw(TRUE)
  791. END IF
  792. end event
  793. event destructor;IF cur_type = -1 THEN RETURN
  794. CALL SUPER:: Destructor
  795. end event
  796. event constructor;IF cur_start = 0 THEN RETURN
  797. CALL SUPER:: Constructor
  798. dw_1.InsertRow(0)
  799. Long nColumnCount,nColumnIndex
  800. String des_1,des_2,szColumn
  801. nColumnCount = Integer( THIS.Object.DataWindow.Column.Count)
  802. FOR nColumnIndex = 1 TO nColumnCount
  803. des_1 = THIS.Describe( "#" + String(nColumnIndex) + ".Name")
  804. des_2 = THIS.Describe(des_1+ "_t.Text")
  805. szColumn = f_strip( des_2)
  806. IF szColumn <> "!" THEN
  807. THIS.SetItem(1,des_1,des_2)
  808. END IF
  809. NEXT
  810. end event
  811. event clicked;call super::clicked;
  812. String ls_type,ls_dwoname ,is_dwobject
  813. String is_dwtype
  814. ls_type = Trim(Upper(dwo.TYPE))
  815. ls_dwoname = Trim(dwo.Name)
  816. is_dwtype = ls_type
  817. IF NOT IsValid(dwo) THEN RETURN
  818. CHOOSE CASE ls_type
  819. CASE "TEXT" , "CommandButton" , "GROUPBOX"
  820. is_dwobject = ls_dwoname
  821. THIS.Modify(ls_dwoname+".color = 128")
  822. THIS.Modify(ls_dwoname+'.border = 5')
  823. CASE "LINE"
  824. is_dwobject = ls_dwoname
  825. CASE "RECTANGLE","ELLIPSE","GRAPH","BITMAP"
  826. is_dwobject = ls_dwoname
  827. THIS.Modify(ls_dwoname+".color = 128")
  828. THIS.Modify(ls_dwoname+'.border = 5')
  829. CASE "COLUMN","COMPUTE"
  830. is_dwobject = ls_dwoname
  831. THIS.Modify(ls_dwoname+".color = 128")
  832. THIS.Modify(ls_dwoname+'.border = 5')
  833. // case "DATAWINDOW"
  834. // return
  835. END CHOOSE
  836. ////////////////////
  837. IF THIS.DataObject = '' THEN RETURN
  838. String des_1,des_2,szColumn
  839. String ls_mdfstr_vis = ''
  840. String ls_mdfstr_wi = ''
  841. String ls_mdfstr_x = ''
  842. String ls_mdfstr_y = ''
  843. String ls_mdfstr_text = ''
  844. String ls_mdfstr_alignment = ''
  845. String ls_mdfstr_height = ''
  846. long ll_cnt=0
  847. Long nColumnIndex,nColumnCount,lRow,ls_i
  848. String ls_name
  849. ls_name = THIS.DESCRIBE("DataWindow.Objects")
  850. datastore ls_ds
  851. ls_ds = CREATE datastore
  852. ls_ds.DataObject = THIS.DataObject
  853. IF KeyDown(keyControl!) THEN
  854. cur_select = UpperBound(cur_chname)
  855. cur_select ++
  856. cur_chname[cur_select] = ls_dwoname
  857. cur_x = long(this.describe( ls_dwoname +'.x'))
  858. cur_y = long(this.describe( ls_dwoname +'.y'))
  859. ELSE
  860. String ls_a[]
  861. Long i = 0
  862. string ls_null[]
  863. IF UpperBound(cur_chname) > 0 THEN
  864. FOR i = 1 TO cur_select
  865. IF cur_chname[i] = ls_dwoname THEN RETURN
  866. NEXT
  867. END IF
  868. DO WHILE Pos(ls_name,'~t') > 1
  869. i++
  870. ls_a[i] = Mid(ls_name,1,Pos(ls_name,'~t') -1)
  871. ls_name = Mid(ls_name,Pos(ls_name,'~t') + 1,Len(ls_name))
  872. LOOP
  873. i++
  874. ls_a[i] = ls_name
  875. FOR i = 1 TO UpperBound(ls_a)
  876. des_1 = ls_a[i]
  877. IF ls_dwoname <> des_1 THEN
  878. THIS.Modify(des_1+".color = "+ls_ds.DESCRIBE(des_1+".color"))
  879. THIS.Modify(des_1+".border = 2 ")
  880. ELSE
  881. dwoselect = ls_dwoname
  882. cur_chname = ls_null
  883. cur_chname[1] = ls_dwoname
  884. cur_select = 1
  885. ll_cnt ++
  886. cur_x = long(this.describe( ls_dwoname +'.x'))
  887. cur_y = long(this.describe( ls_dwoname +'.y'))
  888. END IF
  889. NEXT
  890. if ll_cnt <= 0 then
  891. cur_select = 0
  892. end if
  893. END IF
  894. end event
  895. event resize;call super::resize;IF cur_resize = 0 THEN RETURN
  896. IF THIS.X <> 0 THEN
  897. THIS.X = 0
  898. END IF
  899. IF THIS.Y <> 180 THEN
  900. THIS.Y = 180
  901. END IF
  902. Long ll_width,ll_height
  903. ll_width = wf_get_max(1)
  904. ll_height = wf_get_max(2)
  905. IF THIS.Width < ll_width THEN
  906. IF ll_width + 40 >= PARENT.Width THEN
  907. THIS.Width = PARENT.Width - 40
  908. ELSE
  909. THIS.Width = ll_width
  910. END IF
  911. ELSE
  912. IF THIS.Width + 40 >= PARENT.Width THEN
  913. THIS.Width = PARENT.Width - 40
  914. END IF
  915. END IF
  916. IF THIS.Height < ll_height THEN
  917. IF ll_height + 150 + THIS.Y >= PARENT.Height THEN
  918. THIS.Height = PARENT.Height - THIS.Y - 150
  919. ELSE
  920. THIS.Height = ll_height
  921. END IF
  922. ELSE
  923. IF THIS.Height + 150 + THIS.Y >= PARENT.Height THEN
  924. THIS.Height = PARENT.Height - THIS.Y - 150
  925. END IF
  926. END IF
  927. end event
  928. event rbuttondown;//
  929. end event
  930. type cb_1 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  931. integer x = 901
  932. integer width = 151
  933. integer height = 164
  934. integer taborder = 30
  935. boolean bringtotop = true
  936. string normalpicname = "ok.bmp"
  937. integer picsize = 16
  938. toolbaralignment pic_align = alignattop!
  939. boolean border = false
  940. end type
  941. event clicked;call super::clicked;//保存修改好布局
  942. cur_type = 1
  943. dw_1.triggerevent(destructor!)
  944. /////////////////////
  945. close(parent)
  946. end event
  947. type cb_2 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  948. integer x = 503
  949. integer width = 151
  950. integer height = 164
  951. integer taborder = 40
  952. boolean bringtotop = true
  953. string text = "应用"
  954. string normalpicname = "update.BMP"
  955. integer picsize = 16
  956. toolbaralignment pic_align = alignattop!
  957. boolean border = false
  958. end type
  959. event clicked;//保存修改好布局
  960. cur_type = 1
  961. dw_1.TriggerEvent(Destructor!)
  962. /////////////////////
  963. Long ll_width,ll_height
  964. f_reset_uc(cur_mainid,dw_1.Width,dw_1.Height)
  965. end event
  966. type cb_3 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  967. integer width = 256
  968. integer height = 164
  969. integer taborder = 20
  970. boolean bringtotop = true
  971. string text = "属性修改"
  972. string normalpicname = "setting.bmp"
  973. integer picsize = 16
  974. toolbaralignment pic_align = alignattop!
  975. boolean border = false
  976. end type
  977. event clicked;call super::clicked;dw_1.triggerevent('ue_setlayout')
  978. end event
  979. type cb_4 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  980. integer x = 256
  981. integer width = 247
  982. integer height = 164
  983. integer taborder = 20
  984. boolean bringtotop = true
  985. string text = "自动顺序"
  986. string normalpicname = "p2.bmp"
  987. integer picsize = 16
  988. toolbaralignment pic_align = alignattop!
  989. boolean border = false
  990. end type
  991. event clicked;call super::clicked;//自动分配taborder
  992. wf_aoto_taborder()
  993. //////--------------------
  994. end event
  995. type cb_5 from uo_imflatbutton within w_sysplan_dw_freeform_edit
  996. integer x = 654
  997. integer width = 247
  998. integer height = 164
  999. integer taborder = 30
  1000. boolean bringtotop = true
  1001. string text = "重置布局"
  1002. string normalpicname = "p1.BMP"
  1003. integer picsize = 16
  1004. toolbaralignment pic_align = alignattop!
  1005. boolean border = false
  1006. end type
  1007. event clicked;call super::clicked;dw_1.uf_reset_layout(uc_column_int)
  1008. dw_1.uf_save_profile_layout()
  1009. end event
  1010. type r_bar from rectangle within w_sysplan_dw_freeform_edit
  1011. long linecolor = 16777215
  1012. long fillcolor = 1073741824
  1013. integer x = 2203
  1014. integer width = 91
  1015. integer height = 156
  1016. end type
  1017. event constructor;this.fillcolor = 14215660
  1018. this.linecolor = 14215660
  1019. this.x = -1
  1020. this.y = -1
  1021. this.height = ln_bar.beginy - 5
  1022. end event
  1023. type ln_bar from line within w_sysplan_dw_freeform_edit
  1024. long linecolor = 268435456
  1025. integer linethickness = 4
  1026. integer beginy = 172
  1027. integer endx = 3200
  1028. integer endy = 172
  1029. end type
  1030. type ln_bar2 from line within w_sysplan_dw_freeform_edit
  1031. long linecolor = 16777215
  1032. integer linethickness = 4
  1033. integer beginx = 9
  1034. integer beginy = 176
  1035. integer endx = 3273
  1036. integer endy = 176
  1037. end type