w_rpt_printpagesetting.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. $PBExportHeader$w_rpt_printpagesetting.srw
  2. forward
  3. global type w_rpt_printpagesetting from w_rpt_publ_base
  4. end type
  5. type cb_ok from uo_imflatbutton within w_rpt_printpagesetting
  6. end type
  7. type st_1 from statictext within w_rpt_printpagesetting
  8. end type
  9. type rb_1 from radiobutton within w_rpt_printpagesetting
  10. end type
  11. type rb_2 from radiobutton within w_rpt_printpagesetting
  12. end type
  13. type rb_3 from radiobutton within w_rpt_printpagesetting
  14. end type
  15. type sle_1 from singlelineedit within w_rpt_printpagesetting
  16. end type
  17. type gb_1 from groupbox within w_rpt_printpagesetting
  18. end type
  19. type st_2 from statictext within w_rpt_printpagesetting
  20. end type
  21. type st_curpage from statictext within w_rpt_printpagesetting
  22. end type
  23. type st_pagecount from statictext within w_rpt_printpagesetting
  24. end type
  25. type st_5 from statictext within w_rpt_printpagesetting
  26. end type
  27. type em_copies from editmask within w_rpt_printpagesetting
  28. end type
  29. type cb_3 from uo_imflatbutton within w_rpt_printpagesetting
  30. end type
  31. end forward
  32. global type w_rpt_printpagesetting from w_rpt_publ_base
  33. integer x = 553
  34. integer y = 288
  35. integer width = 2043
  36. integer height = 744
  37. string title = "龙嘉打印页选择"
  38. boolean minbox = false
  39. windowtype windowtype = response!
  40. cb_ok cb_ok
  41. st_1 st_1
  42. rb_1 rb_1
  43. rb_2 rb_2
  44. rb_3 rb_3
  45. sle_1 sle_1
  46. gb_1 gb_1
  47. st_2 st_2
  48. st_curpage st_curpage
  49. st_pagecount st_pagecount
  50. st_5 st_5
  51. em_copies em_copies
  52. cb_3 cb_3
  53. end type
  54. global w_rpt_printpagesetting w_rpt_printpagesetting
  55. type variables
  56. INT OBJ_PAGECOUNT
  57. datawindow OBJ_DW
  58. end variables
  59. forward prototypes
  60. public function string wf_checkexpr (string obj_str)
  61. end prototypes
  62. public function string wf_checkexpr (string obj_str);//wf_checkexpr
  63. long ls_flag,OBJ_COUNT,LS_SUBFLAG
  64. INT CHOICE_FLAG
  65. string LS_STR,STR_ARRAY[],MID_STR
  66. LS_STR=TRIM(OBJ_STR)+','
  67. ls_flag=pos(LS_STR,",")
  68. DO WHILE ls_flag>0 and OBJ_COUNT<=1000
  69. MID_STR=TRIM(left(LS_STR,ls_flag - 1))
  70. CHOICE_FLAG=0
  71. LS_SUBFLAG=pos(MID_STR,"-")
  72. IF INTEGER(MID_STR)>0 AND INTEGER(MID_STR)<=obj_pagecount THEN
  73. CHOICE_FLAG=1
  74. ELSEIF LS_SUBFLAG>0 THEN
  75. IF INTEGER(LEFT(MID_STR,LS_SUBFLAG - 1))>0 AND INTEGER(LEFT(MID_STR,LS_SUBFLAG - 1))<=obj_pagecount &
  76. AND INTEGER(RIGHT(MID_STR,LEN(MID_STR) - LS_SUBFLAG))>0 AND INTEGER(RIGHT(MID_STR,LEN(MID_STR) - LS_SUBFLAG))<=obj_pagecount &
  77. AND INTEGER(LEFT(MID_STR,LS_SUBFLAG - 1))<INTEGER(RIGHT(MID_STR,LEN(MID_STR) - LS_SUBFLAG)) THEN
  78. CHOICE_FLAG=1
  79. END IF
  80. END IF
  81. IF CHOICE_FLAG=1 THEN
  82. OBJ_COUNT++
  83. STR_ARRAY[OBJ_COUNT]=MID_STR
  84. END IF
  85. LS_STR=mid(LS_STR,ls_flag+1)
  86. ls_flag=pos(LS_STR,",")
  87. LOOP
  88. LS_STR=''
  89. int ls_xx
  90. for ls_xx=1 to upperbound(STR_ARRAY)
  91. IF ls_xx=1 THEN
  92. LS_STR=LS_STR+STR_ARRAY[ls_xx]
  93. ELSE
  94. LS_STR=LS_STR+','+STR_ARRAY[ls_xx]
  95. END IF
  96. next
  97. RETURN LS_STR
  98. end function
  99. on w_rpt_printpagesetting.create
  100. int iCurrent
  101. call super::create
  102. this.cb_ok=create cb_ok
  103. this.st_1=create st_1
  104. this.rb_1=create rb_1
  105. this.rb_2=create rb_2
  106. this.rb_3=create rb_3
  107. this.sle_1=create sle_1
  108. this.gb_1=create gb_1
  109. this.st_2=create st_2
  110. this.st_curpage=create st_curpage
  111. this.st_pagecount=create st_pagecount
  112. this.st_5=create st_5
  113. this.em_copies=create em_copies
  114. this.cb_3=create cb_3
  115. iCurrent=UpperBound(this.Control)
  116. this.Control[iCurrent+1]=this.cb_ok
  117. this.Control[iCurrent+2]=this.st_1
  118. this.Control[iCurrent+3]=this.rb_1
  119. this.Control[iCurrent+4]=this.rb_2
  120. this.Control[iCurrent+5]=this.rb_3
  121. this.Control[iCurrent+6]=this.sle_1
  122. this.Control[iCurrent+7]=this.gb_1
  123. this.Control[iCurrent+8]=this.st_2
  124. this.Control[iCurrent+9]=this.st_curpage
  125. this.Control[iCurrent+10]=this.st_pagecount
  126. this.Control[iCurrent+11]=this.st_5
  127. this.Control[iCurrent+12]=this.em_copies
  128. this.Control[iCurrent+13]=this.cb_3
  129. end on
  130. on w_rpt_printpagesetting.destroy
  131. call super::destroy
  132. destroy(this.cb_ok)
  133. destroy(this.st_1)
  134. destroy(this.rb_1)
  135. destroy(this.rb_2)
  136. destroy(this.rb_3)
  137. destroy(this.sle_1)
  138. destroy(this.gb_1)
  139. destroy(this.st_2)
  140. destroy(this.st_curpage)
  141. destroy(this.st_pagecount)
  142. destroy(this.st_5)
  143. destroy(this.em_copies)
  144. destroy(this.cb_3)
  145. end on
  146. event open;call super::open;OBJ_DW=Message.PowerObjectParm
  147. IF OBJ_DW.DATAOBJECT='' THEN RETURN
  148. st_curpage.text='[第 '+OBJ_DW.Describe("Evaluate('Page()',"+trim(string(OBJ_DW.getrow()))+")")+' 页]'
  149. st_pagecount.text='[共 '+OBJ_DW.Describe("Evaluate('Pagecount()',0)")+' 页]'
  150. st_1.text='共 '+trim(string(OBJ_DW.rowCOUNT()))+' 个记录'
  151. obj_pagecount=INTEGER(OBJ_DW.Describe("Evaluate('Pagecount()',0)"))
  152. end event
  153. type cb_exit from w_rpt_publ_base`cb_exit within w_rpt_printpagesetting
  154. integer x = 1664
  155. integer y = 284
  156. end type
  157. type cb_ok from uo_imflatbutton within w_rpt_printpagesetting
  158. integer x = 1664
  159. integer y = 36
  160. integer width = 311
  161. integer height = 96
  162. integer taborder = 40
  163. string text = "打印"
  164. end type
  165. event clicked;call super::clicked;IF rb_1.CHECKED THEN
  166. obj_dw.object.datawindow.print.page.range=''
  167. ELSEIF rb_2.CHECKED THEN
  168. obj_dw.object.datawindow.print.page.range=OBJ_DW.Describe("Evaluate('Page()',"+trim(string(OBJ_DW.getrow()))+")")
  169. ELSE
  170. obj_dw.object.datawindow.print.page.range=TRIM(sle_1.TEXT)
  171. END IF
  172. IF LONG(em_copies.TEXT)=1 THEN
  173. ELSE
  174. obj_dw.object.datawindow.print.copies=LONG(em_copies.TEXT)
  175. END IF
  176. obj_DW.PRINT()
  177. obj_dw.object.datawindow.print.page.range=''
  178. obj_dw.object.datawindow.print.copies=1
  179. Close(PARENT)
  180. end event
  181. type st_1 from statictext within w_rpt_printpagesetting
  182. integer x = 73
  183. integer y = 572
  184. integer width = 887
  185. integer height = 56
  186. integer textsize = -9
  187. integer weight = 400
  188. fontcharset fontcharset = gb2312charset!
  189. fontpitch fontpitch = variable!
  190. string facename = "宋体"
  191. long textcolor = 33554432
  192. long backcolor = 134217739
  193. string text = "打印页选择"
  194. boolean focusrectangle = false
  195. end type
  196. type rb_1 from radiobutton within w_rpt_printpagesetting
  197. integer x = 119
  198. integer y = 200
  199. integer width = 247
  200. integer height = 76
  201. integer taborder = 10
  202. boolean bringtotop = true
  203. integer textsize = -9
  204. integer weight = 400
  205. fontcharset fontcharset = gb2312charset!
  206. fontpitch fontpitch = variable!
  207. string facename = "宋体"
  208. long textcolor = 33554432
  209. long backcolor = 134217739
  210. string text = "全部"
  211. boolean checked = true
  212. end type
  213. event clicked;RB_3.POSTEVENT(CLICKED!)
  214. end event
  215. type rb_2 from radiobutton within w_rpt_printpagesetting
  216. integer x = 119
  217. integer y = 288
  218. integer width = 247
  219. integer height = 76
  220. integer taborder = 20
  221. boolean bringtotop = true
  222. integer textsize = -9
  223. integer weight = 400
  224. fontcharset fontcharset = gb2312charset!
  225. fontpitch fontpitch = variable!
  226. string facename = "宋体"
  227. long textcolor = 33554432
  228. long backcolor = 134217739
  229. string text = "当前页"
  230. end type
  231. event clicked;RB_3.POSTEVENT(CLICKED!)
  232. end event
  233. type rb_3 from radiobutton within w_rpt_printpagesetting
  234. integer x = 119
  235. integer y = 372
  236. integer width = 274
  237. integer height = 76
  238. integer taborder = 30
  239. boolean bringtotop = true
  240. integer textsize = -9
  241. integer weight = 400
  242. fontcharset fontcharset = gb2312charset!
  243. fontpitch fontpitch = variable!
  244. string facename = "宋体"
  245. long textcolor = 33554432
  246. long backcolor = 134217739
  247. string text = "目标页"
  248. end type
  249. event clicked;sle_1.enabled = this.checked
  250. IF THIS.checked AND TRIM(sle_1.TEXT)='' THEN
  251. cb_ok.ENABLED=FALSE
  252. ELSE
  253. cb_ok.ENABLED=TRUE
  254. END IF
  255. end event
  256. type sle_1 from singlelineedit within w_rpt_printpagesetting
  257. event key pbm_keyup
  258. integer x = 389
  259. integer y = 368
  260. integer width = 1166
  261. integer height = 84
  262. integer taborder = 40
  263. boolean bringtotop = true
  264. integer textsize = -9
  265. integer weight = 400
  266. fontcharset fontcharset = gb2312charset!
  267. fontpitch fontpitch = variable!
  268. string facename = "宋体"
  269. long textcolor = 33554432
  270. boolean enabled = false
  271. boolean autohscroll = false
  272. borderstyle borderstyle = stylelowered!
  273. end type
  274. event key;RB_3.POSTEVENT(CLICKED!)
  275. If key = KeyEnter! Or Key = KeyDownArrow! Then //
  276. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  277. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  278. Return 1
  279. End If
  280. end event
  281. event modified;THIS.TEXT=wf_checkexpr(THIS.TEXT)
  282. RB_3.POSTEVENT(CLICKED!)
  283. end event
  284. type gb_1 from groupbox within w_rpt_printpagesetting
  285. integer x = 50
  286. integer y = 124
  287. integer width = 1559
  288. integer height = 412
  289. integer textsize = -9
  290. integer weight = 400
  291. fontcharset fontcharset = gb2312charset!
  292. fontpitch fontpitch = variable!
  293. string facename = "宋体"
  294. long textcolor = 33554432
  295. long backcolor = 134217739
  296. string text = "打印页选择"
  297. end type
  298. type st_2 from statictext within w_rpt_printpagesetting
  299. integer x = 389
  300. integer y = 464
  301. integer width = 553
  302. integer height = 60
  303. boolean bringtotop = true
  304. integer textsize = -9
  305. integer weight = 400
  306. fontcharset fontcharset = gb2312charset!
  307. fontpitch fontpitch = variable!
  308. string facename = "宋体"
  309. long textcolor = 33554432
  310. long backcolor = 134217739
  311. boolean enabled = false
  312. string text = "如:3,4,7-10"
  313. boolean focusrectangle = false
  314. end type
  315. type st_curpage from statictext within w_rpt_printpagesetting
  316. integer x = 389
  317. integer y = 300
  318. integer width = 567
  319. integer height = 60
  320. boolean bringtotop = true
  321. integer textsize = -9
  322. integer weight = 400
  323. fontcharset fontcharset = gb2312charset!
  324. fontpitch fontpitch = variable!
  325. string facename = "宋体"
  326. long textcolor = 33554432
  327. long backcolor = 134217739
  328. boolean enabled = false
  329. string text = "(第 1 页)"
  330. boolean focusrectangle = false
  331. end type
  332. type st_pagecount from statictext within w_rpt_printpagesetting
  333. integer x = 389
  334. integer y = 216
  335. integer width = 562
  336. integer height = 60
  337. boolean bringtotop = true
  338. integer textsize = -9
  339. integer weight = 400
  340. fontcharset fontcharset = gb2312charset!
  341. fontpitch fontpitch = variable!
  342. string facename = "宋体"
  343. long textcolor = 33554432
  344. long backcolor = 134217739
  345. boolean enabled = false
  346. string text = "(共 1 页)"
  347. boolean focusrectangle = false
  348. end type
  349. type st_5 from statictext within w_rpt_printpagesetting
  350. integer x = 78
  351. integer y = 32
  352. integer width = 261
  353. integer height = 64
  354. boolean bringtotop = true
  355. integer textsize = -9
  356. integer weight = 400
  357. fontcharset fontcharset = gb2312charset!
  358. fontpitch fontpitch = variable!
  359. string facename = "宋体"
  360. long textcolor = 33554432
  361. long backcolor = 134217739
  362. boolean enabled = false
  363. string text = "打印份数:"
  364. alignment alignment = right!
  365. boolean focusrectangle = false
  366. end type
  367. type em_copies from editmask within w_rpt_printpagesetting
  368. integer x = 366
  369. integer y = 16
  370. integer width = 215
  371. integer height = 80
  372. integer taborder = 40
  373. boolean bringtotop = true
  374. integer textsize = -9
  375. integer weight = 400
  376. fontcharset fontcharset = gb2312charset!
  377. fontpitch fontpitch = variable!
  378. string facename = "宋体"
  379. long textcolor = 33554432
  380. string text = "1"
  381. alignment alignment = right!
  382. borderstyle borderstyle = stylelowered!
  383. string mask = "###0"
  384. end type
  385. event modified;IF LONG(THIS.TEXT)<=0 THEN
  386. CB_OK.ENABLED=FALSE
  387. ELSE
  388. CB_OK.ENABLED=TRUE
  389. END IF
  390. end event
  391. type cb_3 from uo_imflatbutton within w_rpt_printpagesetting
  392. integer x = 1664
  393. integer y = 160
  394. integer width = 311
  395. integer height = 96
  396. integer taborder = 40
  397. string text = "打印设置"
  398. end type
  399. event clicked;call super::clicked;PRINTSETUP()
  400. end event