w_rpt_groupc.srw 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. $PBExportHeader$w_rpt_groupc.srw
  2. $PBExportComments$创建分组--窗口
  3. forward
  4. global type w_rpt_groupc from Window
  5. end type
  6. type cb_2 from commandbutton within w_rpt_groupc
  7. end type
  8. type cb_1 from commandbutton within w_rpt_groupc
  9. end type
  10. type dw2 from datawindow within w_rpt_groupc
  11. end type
  12. type dw1 from datawindow within w_rpt_groupc
  13. end type
  14. end forward
  15. global type w_rpt_groupc from Window
  16. int X=27
  17. int Y=336
  18. int Width=2043
  19. int Height=1428
  20. boolean TitleBar=true
  21. string Title="分组选择"
  22. long BackColor=12632256
  23. boolean ControlMenu=true
  24. WindowType WindowType=response!
  25. cb_2 cb_2
  26. cb_1 cb_1
  27. dw2 dw2
  28. dw1 dw1
  29. end type
  30. global w_rpt_groupc w_rpt_groupc
  31. type variables
  32. int i,ii_parm
  33. end variables
  34. on w_rpt_groupc.create
  35. this.cb_2=create cb_2
  36. this.cb_1=create cb_1
  37. this.dw2=create dw2
  38. this.dw1=create dw1
  39. this.Control[]={this.cb_2,&
  40. this.cb_1,&
  41. this.dw2,&
  42. this.dw1}
  43. end on
  44. on w_rpt_groupc.destroy
  45. destroy(this.cb_2)
  46. destroy(this.cb_1)
  47. destroy(this.dw2)
  48. destroy(this.dw1)
  49. end on
  50. event open;string ls_objs,ls_obj
  51. int li_pos,li_row
  52. dwobject ldwo
  53. f_wcenter(this)
  54. ii_parm=message.DoubleParm
  55. w_rpt_main.dw3.Rowscopy(1,w_rpt_main.dw3.rowcount(),Primary!,dw1,1,Primary!)
  56. if ii_parm=2 then//可以改为detail区的字段或计算字段
  57. title='压缩列选择'
  58. ls_objs=w_rpt_main.is_sparse+char(9)
  59. do while true
  60. li_pos=pos(ls_objs,char(9))//tab
  61. if li_pos=0 then exit
  62. ls_obj=trim(left(ls_objs,li_pos -1))
  63. ls_objs=mid(ls_objs,li_pos+1)
  64. li_row=dw1.find("cname='"+ls_obj+"'",1,9999)
  65. if li_row>0 then dw1.event doubleclicked(0,0,li_row,ldwo)
  66. loop
  67. end if
  68. end event
  69. type cb_2 from commandbutton within w_rpt_groupc
  70. int X=1120
  71. int Y=1200
  72. int Width=247
  73. int Height=108
  74. int TabOrder=11
  75. string Text="取消"
  76. int TextSize=-9
  77. int Weight=400
  78. string FaceName="宋体"
  79. FontPitch FontPitch=Variable!
  80. end type
  81. event clicked;close(parent)
  82. end event
  83. type cb_1 from commandbutton within w_rpt_groupc
  84. int X=640
  85. int Y=1200
  86. int Width=247
  87. int Height=108
  88. int TabOrder=10
  89. string Text="确认"
  90. int TextSize=-9
  91. int Weight=400
  92. string FaceName="宋体"
  93. FontPitch FontPitch=Variable!
  94. end type
  95. event clicked;string ls[2]
  96. w_rpt_main.ii_save=1
  97. if ii_parm=2 then//压缩列
  98. for i=1 to dw2.rowcount()
  99. ls[2]=ls[2]+char(9)+dw2.getitemstring(i,'cname')
  100. next
  101. w_rpt_main.is_sparse=mid(ls[2],2)
  102. close(parent)
  103. else
  104. for i=1 to dw2.rowcount()
  105. ls[1]=ls[1]+'+'+dw2.getitemstring(i,'ctag')
  106. ls[2]=ls[2]+'+'+dw2.getitemstring(i,'cname')
  107. next
  108. closewithreturn(parent,mid(ls[1],2)+';;'+mid(ls[2],2))
  109. end if
  110. end event
  111. type dw2 from datawindow within w_rpt_groupc
  112. int X=1024
  113. int Y=12
  114. int Width=983
  115. int Height=1140
  116. int TabOrder=20
  117. string DataObject="dw_rpt_column"
  118. boolean HScrollBar=true
  119. boolean VScrollBar=true
  120. boolean HSplitScroll=true
  121. boolean LiveScroll=true
  122. end type
  123. event doubleclicked;if row>0 then
  124. i=dw1.rowcount()
  125. dw2.RowsMove(row,row,primary!,dw1,i+1,Primary!)
  126. end if
  127. end event
  128. type dw1 from datawindow within w_rpt_groupc
  129. int X=18
  130. int Y=12
  131. int Width=983
  132. int Height=1140
  133. int TabOrder=30
  134. string DataObject="dw_rpt_column"
  135. boolean HScrollBar=true
  136. boolean VScrollBar=true
  137. boolean HSplitScroll=true
  138. boolean LiveScroll=true
  139. end type
  140. event doubleclicked;if row>0 then
  141. i=dw2.rowcount()
  142. dw1.RowsMove(row,row,primary!,dw2,i+1,Primary!)
  143. end if
  144. end event