w_sysplan_dw_edit.srw 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. $PBExportHeader$w_sysplan_dw_edit.srw
  2. forward
  3. global type w_sysplan_dw_edit from w_publ_base
  4. end type
  5. type cb_1 from uo_imflatbutton within w_sysplan_dw_edit
  6. end type
  7. type cb_2 from uo_imflatbutton within w_sysplan_dw_edit
  8. end type
  9. type cb_3 from uo_imflatbutton within w_sysplan_dw_edit
  10. end type
  11. type cb_5 from uo_imflatbutton within w_sysplan_dw_edit
  12. end type
  13. type dw_1 from u_dw_rbtnfilter within w_sysplan_dw_edit
  14. end type
  15. type r_bar from rectangle within w_sysplan_dw_edit
  16. end type
  17. type ln_bar from line within w_sysplan_dw_edit
  18. end type
  19. type ln_bar2 from line within w_sysplan_dw_edit
  20. end type
  21. end forward
  22. global type w_sysplan_dw_edit from w_publ_base
  23. integer width = 3611
  24. integer height = 1580
  25. string title = "布局设置"
  26. boolean minbox = false
  27. windowtype windowtype = response!
  28. long backcolor = 134217738
  29. cb_1 cb_1
  30. cb_2 cb_2
  31. cb_3 cb_3
  32. cb_5 cb_5
  33. dw_1 dw_1
  34. r_bar r_bar
  35. ln_bar ln_bar
  36. ln_bar2 ln_bar2
  37. end type
  38. global w_sysplan_dw_edit w_sysplan_dw_edit
  39. type variables
  40. Long cur_type = -1
  41. Long uc_column_int
  42. Long cur_nomodify[]
  43. Long cur_start = 0
  44. String cur_win
  45. String dwoselect
  46. String cur_mod[]
  47. Long cur_resize = 0
  48. Long cur_select = 0
  49. Long ii_x_scroll,ii_y_scroll
  50. Long cur_x,cur_y
  51. String cur_chname[]
  52. long cur_mainid
  53. end variables
  54. forward prototypes
  55. public subroutine wf_open ()
  56. public subroutine wf_aoto_taborder ()
  57. public function integer wf_get_max (integer arg_type)
  58. public subroutine wf_show (integer arg_show[])
  59. public subroutine wf_get_columnname (ref string arg_name[])
  60. public function integer wf_get_max (integer arg_type, integer arg_long[])
  61. end prototypes
  62. public subroutine wf_open ();
  63. long nColumnCount,nColumnIndex
  64. string des_1,des_2,des_3,szColumn,ls_pkcolname
  65. string ls_name
  66. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  67. ls_name = dw_1.describe("DataWindow.Objects")
  68. string ls_a[]
  69. long i=0
  70. do while pos(ls_name,'~t') > 1
  71. i++
  72. ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  73. ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  74. loop
  75. //i++
  76. //ls_a[i] = ls_name
  77. //
  78. //FOR i= 1 to upperbound(ls_a)
  79. // des_1 = ls_a[i]
  80. // dw_1.modify(des_1+'.moveable = 1')
  81. // dw_1.modify(des_1+'.resizeable = 1')
  82. // dw_1.modify(des_1+'.border = 2')
  83. //// dw_1.modify(des_1+'.color = 255')
  84. //next
  85. end subroutine
  86. public subroutine wf_aoto_taborder ();//Long nColumnIndex,nColumnCount,lRow,ls_i,i = 1
  87. //String des_1,des_2,szColumn,str
  88. //String Name[]
  89. //Long ll_x[],ll_y[],ll_width[],ll_height[]
  90. //Long ll_count
  91. //
  92. ////获取所有可以编辑的字段名称、横纵坐标
  93. //nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  94. //FOR nColumnIndex = 1 TO nColumnCount
  95. // des_1 = dw_1.DESCRIBE( "#" + String(nColumnIndex) + ".Name")
  96. // des_2 = dw_1.DESCRIBE(des_1+ "_t.Text")
  97. //
  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. //
  112. //ll_count = i - 1
  113. //
  114. //Long Min,minnub
  115. //Long newx[],j = 1,ll_cnt,ll_t,midx[],k,ll_null[]
  116. //String newname[],ls_t,midname[]
  117. //String ls_null[]
  118. //
  119. //cnt:
  120. //
  121. ////找出纵坐标最小字段
  122. //Min = ll_y[1]
  123. //minnub = 1
  124. //FOR i = 2 TO ll_count
  125. // IF Min <= ll_y[i] THEN
  126. //
  127. // ELSE
  128. // Min = ll_y[i]
  129. // minnub = i
  130. // END IF
  131. //NEXT
  132. //////////////--------------------------
  133. //
  134. ////找出与最少纵坐标字段同行的所有字段
  135. //j = 1
  136. //FOR i = 1 TO ll_count
  137. // IF ll_y[i] >= ll_y[minnub] AND ll_y[i] <= (ll_height[minnub] +ll_y[minnub]) THEN
  138. // midname[j] = Name[i]
  139. // midx[j] = ll_x[i]
  140. // j++
  141. // END IF
  142. //NEXT
  143. //ll_cnt = j -1
  144. ///////-------------------------------
  145. //
  146. ////将同行的字段进行排序(按横坐标大小)
  147. //FOR i = 1 TO ll_cnt - 1
  148. // FOR j = i + 1 TO ll_cnt
  149. // IF midx[i] < midx[j] THEN
  150. //
  151. // ELSE
  152. // ll_t = midx[i]
  153. // midx[i] = midx[j]
  154. // midx[j] = ll_t
  155. // ls_t = midname[i]
  156. // midname[i] = midname[j]
  157. // midname[j] = ls_t
  158. // END IF
  159. // NEXT
  160. //NEXT
  161. //////////////----------------------------
  162. //
  163. ////删除已经排序的字段
  164. ////FOR i = 1 TO ll_count
  165. //// FOR j = 1 TO ll_cnt
  166. //// IF Name[i] = midname[j] THEN
  167. //// FOR k = i TO ll_count -1
  168. //// Name[k] = Name[k+1]
  169. //// ll_x[k] = ll_x[k+1]
  170. //// ll_y[k] = ll_y[k+1]
  171. //// ll_width[k] = ll_width[k+1]
  172. //// ll_height[k] = ll_height[k+1]
  173. //// NEXT
  174. //// ll_count --
  175. //// END IF
  176. //// NEXT
  177. ////NEXT
  178. //
  179. //FOR i = 1 TO ll_count
  180. // FOR j = 1 TO ll_cnt
  181. // IF Name[i] = midname[j] THEN
  182. // Name[i] = ''
  183. // k++
  184. // END IF
  185. // NEXT
  186. //NEXT
  187. //
  188. //j = 0
  189. //FOR i = ll_count TO 1 STEP -1
  190. // IF Name[i] = '' THEN
  191. // FOR k = i TO ll_count -1
  192. // Name[k] = Name[k+1]
  193. // ll_x[k] = ll_x[k+1]
  194. // ll_y[k] = ll_y[k+1]
  195. // ll_width[k] = ll_width[k+1]
  196. // ll_height[k] = ll_height[k+1]
  197. // NEXT
  198. // j++
  199. // END IF
  200. //NEXT
  201. //
  202. //ll_count = ll_count - j
  203. //
  204. //////////----------------------------
  205. //
  206. ////将排好序的一行字段,放入目的数组,清空临时数组
  207. //Long ll_bnd
  208. //ll_bnd = UpperBound(newname)
  209. //FOR i = 1 TO ll_cnt
  210. // newname[ll_bnd + i] = midname[i]
  211. //NEXT
  212. //
  213. //
  214. //midname[] = ls_null[]
  215. //midx[] = ll_null[]
  216. //////////////-----------------------------------
  217. //
  218. //IF ll_count > 0 THEN
  219. // GOTO cnt
  220. //END IF
  221. //
  222. //Long aaa
  223. //String ls_taborder_auto = ''
  224. //
  225. //FOR i = 1 TO UpperBound(newname)
  226. // ls_taborder_auto = ls_taborder_auto + newname[i]+".Tabsequence="+String(i * 10)+'~t'
  227. //NEXT
  228. //
  229. //
  230. //String ls_data
  231. //ls_data = dw_1.DataObject
  232. ///////保存taporder
  233. //UPDATE sys_user_dwnSyntax
  234. // SET dwnSyntax_layout_column_taporder = :ls_taborder_auto
  235. // WHERE empid = :sys_empid
  236. // AND dwname = :ls_data;
  237. //IF sqlca.SQLCode = 0 THEN
  238. // IF sqlca.SQLNRows = 0 THEN
  239. // INSERT INTO sys_user_dwnSyntax
  240. // (empid,
  241. // dwname,
  242. // dwnSyntax_filter,
  243. // dwnSyntax_sort,
  244. // dwnSyntax_layout_column_visible,
  245. // dwnSyntax_layout_column_width,
  246. // dwnSyntax_layout_column_alignment,
  247. // dwnSyntax_layout_column_pos,
  248. // dwnSyntax_layout_column_edit,
  249. // dwnSyntax_layout_column_font,
  250. // dwnSyntax_layout_column_height,
  251. // dwnSyntax_layout_column_taporder)
  252. // Values(:publ_userid,:ls_data,'','','','','','','','','',:ls_taborder_auto);
  253. // END IF
  254. //END IF
  255. //
  256. //COMMIT;
  257. ///////////////////////////
  258. //
  259. ////messagebox('',ls_taborder_auto)
  260. //
  261. //dw_1.ins_mdfstr_column_taporder = ls_taborder_auto
  262. //
  263. //MessageBox('提示','OK')
  264. end subroutine
  265. public function integer wf_get_max (integer arg_type);//wf_get_max()
  266. long nColumnIndex,nColumnCount,lRow,ls_i,j=1
  267. string des_1,des_2,szColumn,str
  268. long ll_x[100],ll_y[100],ll_width[100],ll_height[100]
  269. //获取所有可以编辑的字段名称、横纵坐标
  270. string des_3,ls_pkcolname
  271. string ls_name
  272. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  273. ls_name = dw_1.describe("DataWindow.Objects")
  274. string ls_a[]
  275. long i=0
  276. do while pos(ls_name,'~t') > 1
  277. i++
  278. ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  279. ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  280. loop
  281. i++
  282. ls_a[i] = ls_name
  283. FOR i= 1 to upperbound(ls_a)
  284. des_1 = ls_a[i]
  285. if long(dw_1.describe(des_1+'.visible')) = 1 then
  286. ll_x[j] = long(dw_1.describe(des_1+'.x'))
  287. ll_y[j] = long(dw_1.describe(des_1+'.y'))
  288. ll_width[j] = long(dw_1.describe(des_1+'.width'))
  289. ll_height[j] = long(dw_1.describe(des_1+'.height'))
  290. j++
  291. end if
  292. next
  293. long ll_maxwid,ll_maxhig
  294. ll_maxwid = ll_x[1] + ll_width[1]
  295. for i = 2 to j -1
  296. if ll_maxwid < ll_x[i] + ll_width[i] then
  297. ll_maxwid = ll_x[i] + ll_width[i]
  298. end if
  299. next
  300. ll_maxhig = ll_y[1] + ll_height[1]
  301. for i =2 to j -1
  302. if ll_maxhig < ll_y[i] + ll_height[i] then
  303. ll_maxhig = ll_y[i] + ll_height[i]
  304. end if
  305. next
  306. if arg_type = 1 then
  307. return ll_maxwid + 50
  308. elseif arg_type = 2 then
  309. return ll_maxhig + 50
  310. end if
  311. end function
  312. public subroutine wf_show (integer arg_show[]);IF UpperBound(arg_show) <= 0 THEN RETURN
  313. Long i,ll_maxw,ll_maxh,ll_x,ll_y,ll_width,ll_height,ll_with_t,ll_x_t
  314. long j,ld_x,ld_y,ld_width,ld_height,ld_with_t,ld_x_t,k= 0
  315. String arg_name[]
  316. FOR i = 1 TO UpperBound(arg_show)
  317. ll_maxh = wf_get_max(2)
  318. wf_get_columnname(arg_name)
  319. ll_x = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.x'))
  320. ll_x_t = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.x'))
  321. ll_y = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.y'))
  322. ll_width = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width'))
  323. ll_with_t = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width'))
  324. ll_height = Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.height'))
  325. k= 0
  326. for j = 1 TO UpperBound(arg_name)
  327. if arg_name[j] = arg_name[arg_show[i]] then continue
  328. ld_x = Long(dw_1.DESCRIBE(arg_name[j]+'.x'))
  329. ld_x_t = Long(dw_1.DESCRIBE(arg_name[j]+'_t.x'))
  330. ld_y = Long(dw_1.DESCRIBE(arg_name[j]+'.y'))
  331. ld_width = Long(dw_1.DESCRIBE(arg_name[j]+'.width'))
  332. ld_with_t = Long(dw_1.DESCRIBE(arg_name[j]+'_t.width'))
  333. ld_height = Long(dw_1.DESCRIBE(arg_name[j]+'.height'))
  334. 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
  335. if ll_x_t > ld_x + ld_width or ld_x_t > ll_x + ll_width then
  336. goto ext
  337. end if
  338. else
  339. k++
  340. end if
  341. next
  342. if k + 1 = UpperBound(arg_name) then goto ext
  343. IF ll_maxh - 35 + ll_height > dw_1.Height THEN
  344. IF ll_maxh - 35 + ll_height < THIS.Height - 300 THEN
  345. IF i > 1 THEN
  346. IF Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) &
  347. + 20 + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width')) &
  348. <= dw_1.Width THEN
  349. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  350. 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))
  351. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  352. 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))
  353. ELSE
  354. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  355. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  356. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  357. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  358. dw_1.Height = ll_maxh - 15 + ll_height -200
  359. END IF
  360. ELSE
  361. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  362. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  363. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  364. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  365. dw_1.Height = ll_maxh - 15 + ll_height -200
  366. END IF
  367. END IF
  368. ELSE
  369. IF i > 1 THEN
  370. IF Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.x')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.width')) &
  371. + 20 + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'_t.width')) + Long(dw_1.DESCRIBE(arg_name[arg_show[i]]+'.width')) &
  372. <= dw_1.Width THEN
  373. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  374. 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))
  375. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(dw_1.DESCRIBE(arg_name[arg_show[i - 1]]+'.y')))
  376. 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))
  377. ELSE
  378. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  379. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  380. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  381. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  382. END IF
  383. ELSE
  384. dw_1.Modify(arg_name[arg_show[i]]+'.y ='+String(ll_maxh - 35))
  385. dw_1.Modify(arg_name[arg_show[i]]+'.x ='+String(ll_with_t + 10))
  386. dw_1.Modify(arg_name[arg_show[i]]+'_t.y ='+String(ll_maxh - 35))
  387. dw_1.Modify(arg_name[arg_show[i]]+'_t.x ='+String(5))
  388. END IF
  389. END IF
  390. ext:
  391. NEXT
  392. end subroutine
  393. public subroutine wf_get_columnname (ref string arg_name[]);long nColumnIndex,nColumnCount,lRow,ls_i,i= 0
  394. string ls_name[],des_1,des_2,szColumn
  395. s_dw_uc_rbtnfilter_setlayout_rt ls_s_rt
  396. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  397. For nColumnIndex = 1 To nColumnCount
  398. des_1= dw_1.Describe( "#" + String(nColumnIndex) + ".Name")
  399. des_2= dw_1.describe(des_1+ "_t.Text")
  400. szColumn = f_strip( des_2)
  401. If szColumn <> "!" Then
  402. i++
  403. ls_name[nColumnIndex] = des_1
  404. end if
  405. next
  406. arg_name = ls_name
  407. //return ls_name
  408. end subroutine
  409. public function integer wf_get_max (integer arg_type, integer arg_long[]);//wf_get_max()
  410. long nColumnIndex,nColumnCount,lRow,ls_i,j=1
  411. string des_1,des_2,szColumn,str
  412. long ll_x[100],ll_y[100],ll_width[100],ll_height[100]
  413. //获取所有可以编辑的字段名称、横纵坐标
  414. string des_3,ls_pkcolname
  415. string ls_name
  416. nColumnCount = Integer( dw_1.Object.DataWindow.Column.Count)
  417. ls_name = dw_1.describe("DataWindow.Objects")
  418. string ls_a[]
  419. long i=0
  420. //do while pos(ls_name,'~t') > 1
  421. // i++
  422. // ls_a[i] = mid(ls_name,1,pos(ls_name,'~t') -1)
  423. // ls_name = mid(ls_name,pos(ls_name,'~t') + 1,len(ls_name))
  424. //loop
  425. //
  426. //i++
  427. //ls_a[i] = ls_name
  428. wf_get_columnname(ls_a)
  429. FOR i= 1 to upperbound(ls_a)
  430. des_1 = ls_a[i]
  431. // if long(dw_1.describe(des_1+'.visible')) = 1 then
  432. ll_x[j] = long(dw_1.describe(des_1+'.x'))
  433. ll_y[j] = long(dw_1.describe(des_1+'.y'))
  434. ll_width[j] = long(dw_1.describe(des_1+'.width'))
  435. ll_height[j] = long(dw_1.describe(des_1+'.height'))
  436. j++
  437. // end if
  438. next
  439. long ll_maxwid,ll_maxhig,k
  440. ll_maxwid = ll_x[1] + ll_width[1]
  441. for i = 2 to j -1
  442. for k =1 to upperbound(arg_long)
  443. if i = arg_long[k] then
  444. goto ext1
  445. end if
  446. next
  447. if ll_maxwid < ll_x[i] + ll_width[i] then
  448. ll_maxwid = ll_x[i] + ll_width[i]
  449. end if
  450. ext1:
  451. next
  452. ll_maxhig = ll_y[1] + ll_height[1]
  453. for i =2 to j -1
  454. for k =1 to upperbound(arg_long)
  455. if i = arg_long[k] then
  456. goto ext2
  457. end if
  458. next
  459. if ll_maxhig < ll_y[i] + ll_height[i] then
  460. ll_maxhig = ll_y[i] + ll_height[i]
  461. end if
  462. ext2:
  463. next
  464. if arg_type = 1 then
  465. return ll_maxwid + 50
  466. elseif arg_type = 2 then
  467. return ll_maxhig + 50
  468. end if
  469. end function
  470. on w_sysplan_dw_edit.create
  471. int iCurrent
  472. call super::create
  473. this.cb_1=create cb_1
  474. this.cb_2=create cb_2
  475. this.cb_3=create cb_3
  476. this.cb_5=create cb_5
  477. this.dw_1=create dw_1
  478. this.r_bar=create r_bar
  479. this.ln_bar=create ln_bar
  480. this.ln_bar2=create ln_bar2
  481. iCurrent=UpperBound(this.Control)
  482. this.Control[iCurrent+1]=this.cb_1
  483. this.Control[iCurrent+2]=this.cb_2
  484. this.Control[iCurrent+3]=this.cb_3
  485. this.Control[iCurrent+4]=this.cb_5
  486. this.Control[iCurrent+5]=this.dw_1
  487. this.Control[iCurrent+6]=this.r_bar
  488. this.Control[iCurrent+7]=this.ln_bar
  489. this.Control[iCurrent+8]=this.ln_bar2
  490. end on
  491. on w_sysplan_dw_edit.destroy
  492. call super::destroy
  493. destroy(this.cb_1)
  494. destroy(this.cb_2)
  495. destroy(this.cb_3)
  496. destroy(this.cb_5)
  497. destroy(this.dw_1)
  498. destroy(this.r_bar)
  499. destroy(this.ln_bar)
  500. destroy(this.ln_bar2)
  501. end on
  502. event open;call super::open;s_dw_uc_modify s_modify
  503. s_modify = Message.PowerObjectParm
  504. Long ll_billid,ll_scid
  505. dw_1.DataObject = s_modify.datawinname_uc
  506. uc_column_int = s_modify.uc_column_int
  507. cur_win = s_modify.win
  508. cur_mainid = s_modify.mainid
  509. //dw_1.Width = s_modify.uc_width
  510. //dw_1.Height = s_modify.uc_height
  511. cur_mod = s_modify.nomod
  512. cur_start = 1
  513. //dw_1.Object.datawindow.detail.Height = 2000
  514. //dw_1.Object.datawindow.detail.Height.AutoSize = TRUE
  515. dw_1.TriggerEvent(Constructor!)
  516. dw_1.SetTransObject(sqlca)
  517. cur_resize = 1
  518. wf_open()
  519. end event
  520. event close;call super::close;s_resize s_size
  521. s_size.backtype = cur_type
  522. s_size.Width = dw_1.Width
  523. s_size.Height = dw_1.Height
  524. CloseWithReturn(THIS,s_size)
  525. end event
  526. event key;call super::key;//if key=Keyleftarrow! or key=Keyrightarrow! or key=Keyuparrow! or key=Keydownarrow! then
  527. //
  528. //end if
  529. end event
  530. event resize;call super::resize;ln_bar.EndX = THIS.Width
  531. ln_bar2.EndX = THIS.Width
  532. r_bar.Width = THIS.Width
  533. dw_1.width = this.width - dw_1.x - 40
  534. dw_1.Height = this.Height - dw_1.y - 140
  535. end event
  536. type cb_func from w_publ_base`cb_func within w_sysplan_dw_edit
  537. boolean visible = false
  538. string text = "工具"
  539. end type
  540. type cb_exit from w_publ_base`cb_exit within w_sysplan_dw_edit
  541. integer x = 805
  542. integer width = 151
  543. integer height = 164
  544. integer picsize = 16
  545. toolbaralignment pic_align = alignattop!
  546. boolean border = false
  547. end type
  548. event cb_exit::clicked;//不保存布局
  549. cur_type = -1
  550. close(parent)
  551. end event
  552. type cb_1 from uo_imflatbutton within w_sysplan_dw_edit
  553. integer x = 654
  554. integer width = 151
  555. integer height = 164
  556. integer taborder = 30
  557. boolean bringtotop = true
  558. string normalpicname = "ok.bmp"
  559. integer picsize = 16
  560. toolbaralignment pic_align = alignattop!
  561. boolean border = false
  562. end type
  563. event clicked;call super::clicked;//保存修改好布局
  564. cur_type = 1
  565. dw_1.triggerevent(destructor!)
  566. /////////////////////
  567. close(parent)
  568. end event
  569. type cb_2 from uo_imflatbutton within w_sysplan_dw_edit
  570. integer x = 503
  571. integer width = 151
  572. integer height = 164
  573. integer taborder = 40
  574. boolean bringtotop = true
  575. string text = "应用"
  576. string normalpicname = "update.BMP"
  577. integer picsize = 16
  578. toolbaralignment pic_align = alignattop!
  579. boolean border = false
  580. end type
  581. event clicked;//保存修改好布局
  582. cur_type = 1
  583. dw_1.TriggerEvent(Destructor!)
  584. /////////////////////
  585. Long ll_width,ll_height
  586. f_reset_uc(cur_mainid,dw_1.Width,dw_1.Height)
  587. end event
  588. type cb_3 from uo_imflatbutton within w_sysplan_dw_edit
  589. integer width = 256
  590. integer height = 164
  591. integer taborder = 20
  592. boolean bringtotop = true
  593. string text = "属性修改"
  594. string normalpicname = "setting.bmp"
  595. integer picsize = 16
  596. toolbaralignment pic_align = alignattop!
  597. boolean border = false
  598. end type
  599. event clicked;call super::clicked;dw_1.triggerevent('ue_setlayout')
  600. end event
  601. type cb_5 from uo_imflatbutton within w_sysplan_dw_edit
  602. integer x = 256
  603. integer width = 247
  604. integer height = 164
  605. integer taborder = 30
  606. boolean bringtotop = true
  607. string text = "重置布局"
  608. string normalpicname = "p1.BMP"
  609. integer picsize = 16
  610. toolbaralignment pic_align = alignattop!
  611. boolean border = false
  612. end type
  613. event clicked;call super::clicked;//dw_1.uf_reset_layout(uc_column_int)
  614. //dw_1.uf_save_profile_layout()
  615. dw_1.Triggerevent(Constructor!)
  616. end event
  617. type dw_1 from u_dw_rbtnfilter within w_sysplan_dw_edit
  618. integer y = 188
  619. integer width = 3026
  620. integer height = 704
  621. integer taborder = 20
  622. boolean bringtotop = true
  623. boolean hscrollbar = true
  624. boolean vscrollbar = true
  625. boolean resizable = true
  626. boolean hsplitscroll = true
  627. borderstyle borderstyle = StyleRaised!
  628. end type
  629. event constructor;call super::constructor;dw_1.InsertRow(0)
  630. end event
  631. type r_bar from rectangle within w_sysplan_dw_edit
  632. long linecolor = 16777215
  633. long fillcolor = 1073741824
  634. integer x = 2203
  635. integer width = 91
  636. integer height = 156
  637. end type
  638. event constructor;this.fillcolor = 14215660
  639. this.linecolor = 14215660
  640. this.x = -1
  641. this.y = -1
  642. this.height = ln_bar.beginy - 5
  643. end event
  644. type ln_bar from line within w_sysplan_dw_edit
  645. long linecolor = 268435456
  646. integer linethickness = 4
  647. integer beginy = 172
  648. integer endx = 3200
  649. integer endy = 172
  650. end type
  651. type ln_bar2 from line within w_sysplan_dw_edit
  652. long linecolor = 16777215
  653. integer linethickness = 4
  654. integer beginx = 9
  655. integer beginy = 176
  656. integer endx = 3273
  657. integer endy = 176
  658. end type