w_sys_printpagesetting.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. $PBExportHeader$w_sys_printpagesetting.srw
  2. forward
  3. global type w_sys_printpagesetting from w_publ_base
  4. end type
  5. type cb_ok from uo_imflatbutton within w_sys_printpagesetting
  6. end type
  7. type st_1 from statictext within w_sys_printpagesetting
  8. end type
  9. type rb_1 from radiobutton within w_sys_printpagesetting
  10. end type
  11. type rb_2 from radiobutton within w_sys_printpagesetting
  12. end type
  13. type rb_3 from radiobutton within w_sys_printpagesetting
  14. end type
  15. type sle_1 from singlelineedit within w_sys_printpagesetting
  16. end type
  17. type gb_1 from groupbox within w_sys_printpagesetting
  18. end type
  19. type st_2 from statictext within w_sys_printpagesetting
  20. end type
  21. type st_curpage from statictext within w_sys_printpagesetting
  22. end type
  23. type st_pagecount from statictext within w_sys_printpagesetting
  24. end type
  25. type st_5 from statictext within w_sys_printpagesetting
  26. end type
  27. type em_copies from editmask within w_sys_printpagesetting
  28. end type
  29. type cb_3 from uo_imflatbutton within w_sys_printpagesetting
  30. end type
  31. end forward
  32. global type w_sys_printpagesetting from w_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_sys_printpagesetting w_sys_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_sys_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_sys_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. //OBJ_DW.setfilter('')
  153. //OBJ_DW.filter()
  154. //if ddlb_1.TotalItems ( )>=1 then ddlb_1.SelectItem(1)
  155. //w_sys_wait.HIDE()
  156. ////dw_1.SetRowFocusIndicator (Hand!)
  157. end event
  158. type cb_func from w_publ_base`cb_func within w_sys_printpagesetting
  159. boolean visible = false
  160. integer x = 1303
  161. integer y = 36
  162. boolean enabled = false
  163. end type
  164. type cb_exit from w_publ_base`cb_exit within w_sys_printpagesetting
  165. integer x = 1664
  166. integer y = 284
  167. end type
  168. type cb_ok from uo_imflatbutton within w_sys_printpagesetting
  169. integer x = 1664
  170. integer y = 36
  171. integer width = 311
  172. integer height = 96
  173. integer taborder = 40
  174. string text = "打印"
  175. end type
  176. event clicked;call super::clicked;IF rb_1.CHECKED THEN
  177. obj_dw.object.datawindow.print.page.range=''
  178. ELSEIF rb_2.CHECKED THEN
  179. obj_dw.object.datawindow.print.page.range=OBJ_DW.Describe("Evaluate('Page()',"+trim(string(OBJ_DW.getrow()))+")")
  180. ELSE
  181. obj_dw.object.datawindow.print.page.range=TRIM(sle_1.TEXT)
  182. END IF
  183. IF LONG(em_copies.TEXT)=1 THEN
  184. ELSE
  185. obj_dw.object.datawindow.print.copies=LONG(em_copies.TEXT)
  186. END IF
  187. obj_DW.PRINT()
  188. obj_dw.object.datawindow.print.page.range=''
  189. obj_dw.object.datawindow.print.copies=1
  190. Close(PARENT)
  191. end event
  192. type st_1 from statictext within w_sys_printpagesetting
  193. integer x = 73
  194. integer y = 572
  195. integer width = 887
  196. integer height = 56
  197. integer textsize = -9
  198. integer weight = 400
  199. fontcharset fontcharset = gb2312charset!
  200. fontpitch fontpitch = variable!
  201. string facename = "宋体"
  202. long textcolor = 33554432
  203. long backcolor = 134217739
  204. string text = "打印页选择"
  205. boolean focusrectangle = false
  206. end type
  207. type rb_1 from radiobutton within w_sys_printpagesetting
  208. integer x = 119
  209. integer y = 200
  210. integer width = 247
  211. integer height = 76
  212. integer taborder = 10
  213. boolean bringtotop = true
  214. integer textsize = -9
  215. integer weight = 400
  216. fontcharset fontcharset = gb2312charset!
  217. fontpitch fontpitch = variable!
  218. string facename = "宋体"
  219. long textcolor = 33554432
  220. long backcolor = 134217739
  221. string text = "全部"
  222. boolean checked = true
  223. end type
  224. event clicked;RB_3.POSTEVENT(CLICKED!)
  225. end event
  226. type rb_2 from radiobutton within w_sys_printpagesetting
  227. integer x = 119
  228. integer y = 288
  229. integer width = 247
  230. integer height = 76
  231. integer taborder = 20
  232. boolean bringtotop = true
  233. integer textsize = -9
  234. integer weight = 400
  235. fontcharset fontcharset = gb2312charset!
  236. fontpitch fontpitch = variable!
  237. string facename = "宋体"
  238. long textcolor = 33554432
  239. long backcolor = 134217739
  240. string text = "当前页"
  241. end type
  242. event clicked;RB_3.POSTEVENT(CLICKED!)
  243. end event
  244. type rb_3 from radiobutton within w_sys_printpagesetting
  245. integer x = 119
  246. integer y = 372
  247. integer width = 274
  248. integer height = 76
  249. integer taborder = 30
  250. boolean bringtotop = true
  251. integer textsize = -9
  252. integer weight = 400
  253. fontcharset fontcharset = gb2312charset!
  254. fontpitch fontpitch = variable!
  255. string facename = "宋体"
  256. long textcolor = 33554432
  257. long backcolor = 134217739
  258. string text = "目标页"
  259. end type
  260. event clicked;sle_1.enabled = this.checked
  261. IF THIS.checked AND TRIM(sle_1.TEXT)='' THEN
  262. cb_ok.ENABLED=FALSE
  263. ELSE
  264. cb_ok.ENABLED=TRUE
  265. END IF
  266. end event
  267. type sle_1 from singlelineedit within w_sys_printpagesetting
  268. event key pbm_keyup
  269. integer x = 389
  270. integer y = 368
  271. integer width = 1166
  272. integer height = 84
  273. integer taborder = 40
  274. boolean bringtotop = true
  275. integer textsize = -9
  276. integer weight = 400
  277. fontcharset fontcharset = gb2312charset!
  278. fontpitch fontpitch = variable!
  279. string facename = "宋体"
  280. long textcolor = 33554432
  281. boolean enabled = false
  282. boolean autohscroll = false
  283. borderstyle borderstyle = stylelowered!
  284. end type
  285. event key;RB_3.POSTEVENT(CLICKED!)
  286. If key = KeyEnter! Or Key = KeyDownArrow! Then //
  287. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  288. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  289. Return 1
  290. End If
  291. end event
  292. event modified;THIS.TEXT=wf_checkexpr(THIS.TEXT)
  293. RB_3.POSTEVENT(CLICKED!)
  294. end event
  295. type gb_1 from groupbox within w_sys_printpagesetting
  296. integer x = 50
  297. integer y = 124
  298. integer width = 1559
  299. integer height = 412
  300. integer textsize = -9
  301. integer weight = 400
  302. fontcharset fontcharset = gb2312charset!
  303. fontpitch fontpitch = variable!
  304. string facename = "宋体"
  305. long textcolor = 33554432
  306. long backcolor = 134217739
  307. string text = "打印页选择"
  308. end type
  309. type st_2 from statictext within w_sys_printpagesetting
  310. integer x = 389
  311. integer y = 464
  312. integer width = 553
  313. integer height = 60
  314. boolean bringtotop = true
  315. integer textsize = -9
  316. integer weight = 400
  317. fontcharset fontcharset = gb2312charset!
  318. fontpitch fontpitch = variable!
  319. string facename = "宋体"
  320. long textcolor = 33554432
  321. long backcolor = 134217739
  322. boolean enabled = false
  323. string text = "如:3,4,7-10"
  324. boolean focusrectangle = false
  325. end type
  326. type st_curpage from statictext within w_sys_printpagesetting
  327. integer x = 389
  328. integer y = 300
  329. integer width = 567
  330. integer height = 60
  331. boolean bringtotop = true
  332. integer textsize = -9
  333. integer weight = 400
  334. fontcharset fontcharset = gb2312charset!
  335. fontpitch fontpitch = variable!
  336. string facename = "宋体"
  337. long textcolor = 33554432
  338. long backcolor = 134217739
  339. boolean enabled = false
  340. string text = "(第 1 页)"
  341. boolean focusrectangle = false
  342. end type
  343. type st_pagecount from statictext within w_sys_printpagesetting
  344. integer x = 389
  345. integer y = 216
  346. integer width = 562
  347. integer height = 60
  348. boolean bringtotop = true
  349. integer textsize = -9
  350. integer weight = 400
  351. fontcharset fontcharset = gb2312charset!
  352. fontpitch fontpitch = variable!
  353. string facename = "宋体"
  354. long textcolor = 33554432
  355. long backcolor = 134217739
  356. boolean enabled = false
  357. string text = "(共 1 页)"
  358. boolean focusrectangle = false
  359. end type
  360. type st_5 from statictext within w_sys_printpagesetting
  361. integer x = 78
  362. integer y = 32
  363. integer width = 261
  364. integer height = 64
  365. boolean bringtotop = true
  366. integer textsize = -9
  367. integer weight = 400
  368. fontcharset fontcharset = gb2312charset!
  369. fontpitch fontpitch = variable!
  370. string facename = "宋体"
  371. long textcolor = 33554432
  372. long backcolor = 134217739
  373. boolean enabled = false
  374. string text = "打印份数:"
  375. alignment alignment = right!
  376. boolean focusrectangle = false
  377. end type
  378. type em_copies from editmask within w_sys_printpagesetting
  379. integer x = 366
  380. integer y = 16
  381. integer width = 215
  382. integer height = 80
  383. integer taborder = 40
  384. boolean bringtotop = true
  385. integer textsize = -9
  386. integer weight = 400
  387. fontcharset fontcharset = gb2312charset!
  388. fontpitch fontpitch = variable!
  389. string facename = "宋体"
  390. long textcolor = 33554432
  391. string text = "1"
  392. alignment alignment = right!
  393. borderstyle borderstyle = stylelowered!
  394. string mask = "###0"
  395. end type
  396. event modified;IF LONG(THIS.TEXT)<=0 THEN
  397. CB_OK.ENABLED=FALSE
  398. ELSE
  399. CB_OK.ENABLED=TRUE
  400. END IF
  401. end event
  402. type cb_3 from uo_imflatbutton within w_sys_printpagesetting
  403. integer x = 1664
  404. integer y = 160
  405. integer width = 311
  406. integer height = 96
  407. integer taborder = 40
  408. string text = "打印设置"
  409. end type
  410. event clicked;call super::clicked;PRINTSETUP()
  411. end event