w_publ_edit_index.srw 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  1. $PBExportHeader$w_publ_edit_index.srw
  2. $PBExportComments$定义窗口
  3. forward
  4. global type w_publ_edit_index from w_publ_base
  5. end type
  6. type sle_usual_query from u_sleedit within w_publ_edit_index
  7. end type
  8. type cb_nextpage from uo_imflatbutton within w_publ_edit_index
  9. end type
  10. type cb_priorpage from uo_imflatbutton within w_publ_edit_index
  11. end type
  12. type cb_firstpage from uo_imflatbutton within w_publ_edit_index
  13. end type
  14. type cb_retrieveall from uo_imflatbutton within w_publ_edit_index
  15. end type
  16. type em_pagerowno from editmask within w_publ_edit_index
  17. end type
  18. type st_pagerowno from statictext within w_publ_edit_index
  19. end type
  20. type st_1 from statictext within w_publ_edit_index
  21. end type
  22. type cb_add from uo_imflatbutton within w_publ_edit_index
  23. end type
  24. type cb_edit from uo_imflatbutton within w_publ_edit_index
  25. end type
  26. type cb_delet from uo_imflatbutton within w_publ_edit_index
  27. end type
  28. type cb_choice from uo_imflatbutton within w_publ_edit_index
  29. end type
  30. type cb_cancel from uo_imflatbutton within w_publ_edit_index
  31. end type
  32. type cbx_mlselect from checkbox within w_publ_edit_index
  33. end type
  34. type cbx_allselect from checkbox within w_publ_edit_index
  35. end type
  36. type cb_mode_itfchg_b from uo_imflatbutton within w_publ_edit_index
  37. end type
  38. type cb_mode_itfchg from uo_imflatbutton within w_publ_edit_index
  39. end type
  40. type gb_1 from groupbox within w_publ_edit_index
  41. end type
  42. type dw_uc from datawindow within w_publ_edit_index
  43. end type
  44. type cb_retrieve from uo_imflatbutton within w_publ_edit_index
  45. end type
  46. type cb_print from uo_imflatbutton within w_publ_edit_index
  47. end type
  48. type ln_bar from line within w_publ_edit_index
  49. end type
  50. type ln_bar2 from line within w_publ_edit_index
  51. end type
  52. type r_bar from rectangle within w_publ_edit_index
  53. end type
  54. type ln_1 from line within w_publ_edit_index
  55. end type
  56. type ln_2 from line within w_publ_edit_index
  57. end type
  58. type dw_index from u_dw_rbtnfilter within w_publ_edit_index
  59. end type
  60. type cb_help from uo_imflatbutton within w_publ_edit_index
  61. end type
  62. end forward
  63. global type w_publ_edit_index from w_publ_base
  64. integer width = 2926
  65. integer height = 1784
  66. string title = "编缉"
  67. boolean minbox = false
  68. windowtype windowtype = response!
  69. event ue_usual_query_filt ( )
  70. event ue_usual_query_retr ( )
  71. event user_key ( )
  72. event retrieve_uc ( )
  73. event ue_mode_itfchg ( )
  74. event refresh_interface ( )
  75. event ue_help ( )
  76. event ue_page1 ( )
  77. event ue_page2 ( )
  78. event ue_page3 ( )
  79. event ue_page4 ( )
  80. sle_usual_query sle_usual_query
  81. cb_nextpage cb_nextpage
  82. cb_priorpage cb_priorpage
  83. cb_firstpage cb_firstpage
  84. cb_retrieveall cb_retrieveall
  85. em_pagerowno em_pagerowno
  86. st_pagerowno st_pagerowno
  87. st_1 st_1
  88. cb_add cb_add
  89. cb_edit cb_edit
  90. cb_delet cb_delet
  91. cb_choice cb_choice
  92. cb_cancel cb_cancel
  93. cbx_mlselect cbx_mlselect
  94. cbx_allselect cbx_allselect
  95. cb_mode_itfchg_b cb_mode_itfchg_b
  96. cb_mode_itfchg cb_mode_itfchg
  97. gb_1 gb_1
  98. dw_uc dw_uc
  99. cb_retrieve cb_retrieve
  100. cb_print cb_print
  101. ln_bar ln_bar
  102. ln_bar2 ln_bar2
  103. r_bar r_bar
  104. ln_1 ln_1
  105. ln_2 ln_2
  106. dw_index dw_index
  107. cb_help cb_help
  108. end type
  109. global w_publ_edit_index w_publ_edit_index
  110. type variables
  111. boolean ls_update_flag=true
  112. long modifyrow_no=0,crl_row //当前行记录
  113. s_edit_tran para_obj //环境信息用于查询
  114. string keyword_string //关键字 未用
  115. date first_date //查询开始日
  116. date end_date //查询结束日,比表达日后一天
  117. int child_column_int //明细dw锁定列数
  118. string ins_sqlerrtext
  119. boolean if_retrieveing=false
  120. datastore ds_curquery //缓存查询条件
  121. string ori_oldselect //保存原始select
  122. string ls_newselect //保存加入查询条件后的select
  123. string pkcolumndbtname //pk列数据库中列名
  124. long onepage_rowlmno=100 //页行最大行数
  125. boolean retrieve_all=false //是否全部retrieve(不分页)
  126. int mode=0 //工作模式:0-编辑 1-带字符串参数预选择的选择/编辑
  127. long arg_pkid //目标定位id //备用
  128. string arg_string_code //默认常用查询内容
  129. string old_title=''
  130. int retrmode=0 // 0 retrieve all;1 first page ;2 prior page;3 next page;4 last page
  131. boolean if_select_all=false
  132. boolean if_changeselect=true
  133. int if_mlselect=0
  134. end variables
  135. forward prototypes
  136. public function integer wf_editindex_lockf ()
  137. public function integer wf_retrieveuc (datawindow arg_dw, string arg_newselect, integer arg_retrmode)
  138. public function string wf_get_pkcolumndbtname (datawindow arg_dw)
  139. public function integer wf_index_uc ()
  140. public function integer wf_face_change ()
  141. public function window getparentwin ()
  142. end prototypes
  143. event ue_usual_query_filt();//if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  144. //string obj_expr=''
  145. //if trim(sle_usual_query.text)<>'' then
  146. // if pos(trim(sle_usual_query.text),'%')=0 then
  147. // obj_expr=obj_expr+'( name like "%'+trim(sle_usual_query.text)+'%" )'
  148. // else
  149. // obj_expr=obj_expr+'( name like "'+trim(sle_usual_query.text)+'" )'
  150. // end if
  151. //end if
  152. //
  153. //dw_uc.setfilter(obj_expr)
  154. //
  155. //dw_uc.setredraw(false)
  156. //dw_index.setredraw(false)
  157. //dw_uc.filter()
  158. //if dw_index.rowcount()>=1 then
  159. // dw_index.selectrow(0,false)
  160. // dw_index.selectrow(1,true)
  161. //end if
  162. //dw_uc.setredraw(true)
  163. //dw_index.setredraw(true)
  164. end event
  165. event ue_usual_query_retr();//if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  166. //string ls_querystrpart=''
  167. //ls_newselect=lower(ori_oldselect)
  168. //if trim(sle_usual_query.text)<>'' then
  169. // if pos(trim(sle_usual_query.text),'%')=0 then
  170. // ls_querystrpart=ls_querystrpart + "(name like '%"+trim(sle_usual_query.text)+"%')"
  171. // else
  172. // ls_querystrpart=ls_querystrpart + "(name like '"+trim(sle_usual_query.text)+"')"
  173. // end if
  174. //
  175. // if pos(ls_newselect," where ") <> 0 then
  176. // ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  177. // else
  178. // ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  179. // end if
  180. //end if
  181. // wf_retrieveuc(dw_uc,ls_newselect,1)
  182. //this.triggerevent('retrieve_uc') //注意必须有此句
  183. end event
  184. event user_key();if keydown(Keypageup!) then
  185. if cb_priorpage.enabled then cb_priorpage.triggerevent(clicked!)
  186. elseif keydown(Keypagedown!) then
  187. if cb_nextpage.enabled then cb_nextpage.triggerevent(clicked!)
  188. elseif keydown(Keyenter!) and keydown(keycontrol!) then
  189. if mode = 1 and not dw_edit_mode and cb_choice.enabled then cb_choice.triggerevent(clicked!)
  190. end if
  191. if keydown(keyshift!) then
  192. if cbx_mlselect.visible then
  193. cbx_mlselect.checked = not cbx_mlselect.checked
  194. cbx_mlselect.triggerevent(clicked!)
  195. end if
  196. end if
  197. if keydown(keycontrol!) and keydown(keya!) then
  198. if cbx_allselect.visible and cbx_allselect.enabled then
  199. cbx_allselect.checked = not cbx_allselect.checked
  200. cbx_allselect.triggerevent(clicked!)
  201. end if
  202. end if
  203. end event
  204. event retrieve_uc();boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  205. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  206. cb_firstpage_enabled=cb_firstpage.enabled
  207. cb_nextpage_enabled=cb_nextpage.enabled
  208. cb_retrieveall_enabled=cb_retrieveall.enabled
  209. cb_priorpage_enabled=cb_priorpage.enabled
  210. cb_func_enabled=cb_func.enabled
  211. cb_retrieve_enabled=cb_retrieve.enabled
  212. cb_firstpage.enabled=false
  213. cb_nextpage.enabled=false
  214. cb_retrieveall.enabled=false
  215. cb_priorpage.enabled=false
  216. cb_func.enabled=false
  217. cb_retrieve.enabled=false
  218. dw_UC.setredraw(false)
  219. dw_index.ShareDataOff()
  220. SetPointer(HourGlass!)
  221. dw_UC.retrieve()
  222. SetPointer(Arrow!)
  223. dw_uc.sharedata(dw_index)
  224. dw_UC.setredraw(true)
  225. if dw_index.rowcount()>=1 then
  226. dw_index.selectrow(0,false)
  227. dw_index.selectrow(1,true)
  228. end if
  229. cb_firstpage.enabled=cb_firstpage_enabled
  230. cb_nextpage.enabled=cb_nextpage_enabled
  231. cb_retrieveall.enabled=cb_retrieveall_enabled
  232. cb_priorpage.enabled=cb_priorpage_enabled
  233. cb_func.enabled=cb_func_enabled
  234. cb_retrieve.enabled=cb_retrieve_enabled
  235. end event
  236. event ue_mode_itfchg();//因工作模式(选择\非选择)改变界面布局
  237. IF mode = 1 THEN
  238. // IF cb_mode_itfchg.Text = '<<' THEN
  239. // cb_add.Enabled = FALSE
  240. // cb_delet.Enabled = FALSE
  241. // cb_edit.Enabled = FALSE
  242. // cb_choice.Enabled = TRUE
  243. // IF if_select_all THEN
  244. // cbx_mlselect.Visible = TRUE
  245. // cbx_allselect.Visible = TRUE
  246. // ELSE
  247. // cbx_mlselect.Visible = FALSE
  248. // cbx_allselect.Visible = FALSE
  249. // END IF
  250. // ELSE
  251. // cb_add.Enabled = TRUE
  252. // cb_delet.Enabled = TRUE
  253. // cb_edit.Enabled = TRUE
  254. // cb_choice.Enabled = FALSE
  255. // cbx_mlselect.Visible = FALSE
  256. // cbx_allselect.Visible = FALSE
  257. // IF if_select_all THEN
  258. // cbx_mlselect.Checked = FALSE
  259. // cbx_mlselect.TriggerEvent(Clicked!)
  260. // END IF
  261. // END IF
  262. END IF
  263. end event
  264. event ue_help();Int i
  265. i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".html")
  266. end event
  267. event ue_page1();wf_retrieveuc(dw_uc,ls_newselect,1)
  268. this.triggerevent('retrieve_uc')
  269. end event
  270. event ue_page2();wf_retrieveuc(dw_uc,ls_newselect,2)
  271. this.triggerevent('retrieve_uc')
  272. end event
  273. event ue_page3();wf_retrieveuc(dw_uc,ls_newselect,3)
  274. this.triggerevent('retrieve_uc')
  275. end event
  276. event ue_page4();wf_retrieveuc(dw_uc,ls_newselect,4)
  277. THIS.TriggerEvent('RETRIEVE_pageretr')
  278. end event
  279. public function integer wf_editindex_lockf ();//wf_editindex_lockf
  280. if retrieve_all or dw_edit_mode then
  281. cb_firstpage.enabled=false
  282. cb_nextpage.enabled=false
  283. cb_priorpage.enabled=false
  284. cb_retrieveall.enabled=false
  285. em_pagerowno.enabled=false
  286. Else
  287. cb_firstpage.enabled=true
  288. cb_nextpage.enabled=true
  289. cb_priorpage.enabled=true
  290. cb_retrieveall.enabled=TRUE
  291. em_pagerowno.enabled=true
  292. end if
  293. IF dw_edit_mode THEN
  294. sle_usual_query.enabled=false
  295. cb_func.enabled=FALSE
  296. ELSE
  297. sle_usual_query.enabled=TRUE
  298. cb_func.enabled=TRUE
  299. END IF
  300. return 1
  301. end function
  302. public function integer wf_retrieveuc (datawindow arg_dw, string arg_newselect, integer arg_retrmode);//====================================================================
  303. // Function: wf_retrieveuc()
  304. //--------------------------------------------------------------------
  305. // Description: 分页拼retr语句
  306. //--------------------------------------------------------------------
  307. // Arguments:
  308. // integer arg_retrmode: 0 retrieve all;1 first page ;2 prior page;3 next page;4 last page
  309. //--------------------------------------------------------------------
  310. // Returns: integer
  311. //--------------------------------------------------------------------
  312. // Author: yyx Date: 2003.10.17
  313. //--------------------------------------------------------------------
  314. // Modify History:
  315. //
  316. //====================================================================
  317. //取得当前的最大\最小ID
  318. //按上下翻页命令,拼接最新SELECT语句
  319. retrmode=arg_retrmode
  320. IF arg_retrmode=0 or retrieve_all THEN
  321. arg_dw.Modify("datawindow.table.select = ~"" + arg_newselect+ "~"")
  322. GOTO EXT
  323. END IF
  324. string cur_page_newselect,ls_pkcolname,LS_PAGE_ter=''
  325. cur_page_newselect=lower(trim(arg_newselect))
  326. LONG MAX_ID=0,MIN_ID=0,LS_I,ls_id
  327. ls_pkcolname=arg_dw.Describe("#1.name") //取得ID列名称
  328. if arg_retrmode<>1 then
  329. MAX_ID=0
  330. Min_ID=0
  331. FOR LS_I=1 TO arg_dw.ROWCOUNT()
  332. ls_id=arg_dw.GetItemNumber(ls_i, ls_pkcolname)
  333. if LS_I=1 then
  334. MAX_ID=ls_id
  335. Min_ID=ls_id
  336. end if
  337. if not isnull(ls_id) then
  338. if MAX_ID<ls_id then MAX_ID=ls_id
  339. if Min_ID>ls_id then Min_ID=ls_id
  340. end if
  341. NEXT
  342. FOR LS_I=1 TO arg_dw.FilteredCount()
  343. ls_id=arg_dw.GetItemNumber(ls_i, ls_pkcolname,filter!,true)
  344. if LS_I=1 and MAX_ID=0 and Min_ID=0 then
  345. MAX_ID=ls_id
  346. Min_ID=ls_id
  347. end if
  348. if not isnull(ls_id) then
  349. if MAX_ID<ls_id then MAX_ID=ls_id
  350. if Min_ID>ls_id then Min_ID=ls_id
  351. end if
  352. NEXT
  353. end if
  354. cur_page_newselect=trim(cur_page_newselect)
  355. IF not (retrieve_all or retrmode=0) then
  356. cur_page_newselect='select top '+string(onepage_rowlmno)+' '+mid( cur_page_newselect , 8)
  357. end if
  358. CHOOSE CASE arg_retrmode
  359. CASE 1 //第一页
  360. LS_PAGE_ter=''
  361. CASE 2 //上一页
  362. LS_PAGE_ter=pkcolumndbtname+'>'+STRING(MAX_ID)
  363. CASE 3 //下一页
  364. LS_PAGE_ter=pkcolumndbtname+'<'+STRING(Min_ID)
  365. CASE 4 //末页
  366. LS_PAGE_ter=''
  367. END CHOOSE
  368. IF TRIM(LS_PAGE_ter)<>'' THEN
  369. if Pos(cur_page_newselect," where ") <> 0 then
  370. cur_page_newselect=cur_page_newselect+" AND ("+LS_PAGE_ter+')'
  371. else
  372. cur_page_newselect=cur_page_newselect+" WHERE ("+LS_PAGE_ter+')'
  373. end if
  374. END IF
  375. IF arg_retrmode=2 or arg_retrmode=4 THEN
  376. cur_page_newselect=cur_page_newselect+' ORDER BY '+pkcolumndbtname
  377. ELSE
  378. cur_page_newselect=cur_page_newselect+' ORDER BY '+pkcolumndbtname+' DESC'
  379. END IF
  380. arg_dw.Modify("datawindow.table.select = ~"" + cur_page_newselect+ "~"")
  381. EXT:
  382. RETURN 1
  383. end function
  384. public function string wf_get_pkcolumndbtname (datawindow arg_dw);//====================================================================
  385. // Function: wf_get_pkcolumndbtname()
  386. //--------------------------------------------------------------------
  387. // Description:取第一列为关键字
  388. //--------------------------------------------------------------------
  389. // Arguments:(None)
  390. //--------------------------------------------------------------------
  391. // Returns: string
  392. //--------------------------------------------------------------------
  393. // Author: yyx Date: 2003.10.17
  394. //--------------------------------------------------------------------
  395. // Modify History:
  396. //
  397. //====================================================================
  398. string ls_pkcolumndbtname,ls_str,tmp_oldselect
  399. long l_pos
  400. ls_pkcolumndbtname=arg_dw.Describe("#1.dbname")
  401. if pos(ls_pkcolumndbtname,'.')<=0 then
  402. tmp_oldselect=trim(arg_dw.Describe("DataWindow.Table.Select"))
  403. ls_str=mid(tmp_oldselect,8)
  404. if pos(ls_str,'.')>pos(ls_str,',') then
  405. goto ext
  406. else
  407. ls_pkcolumndbtname=left(ls_str,pos(ls_str,',') - 1)
  408. end if
  409. end if
  410. ext:
  411. return ls_pkcolumndbtname
  412. end function
  413. public function integer wf_index_uc ();//WF_INDEX_UC
  414. LONG LS_LONG
  415. LS_LONG=DW_UC.GETROW()
  416. dw_index.SETROW(LS_LONG)
  417. dw_index.ScrollToRow(LS_LONG)
  418. dw_index.selectrow(0,false)
  419. dw_index.selectrow(LS_LONG,true)
  420. RETURN 0
  421. end function
  422. public function integer wf_face_change ();if dw_edit_mode then
  423. cb_func.enabled = false
  424. cb_retrieve.enabled = false
  425. cb_delet.enabled = false
  426. cb_print.enabled = false
  427. cb_choice.Enabled = FALSE
  428. sle_usual_query.Enabled = FALSE
  429. cb_edit.text = "放弃&E"
  430. cb_add.text = "保存&S"
  431. cb_edit.normalpicname = 'Undo.bmp'
  432. cb_add.normalpicname = 'Save.bmp'
  433. else
  434. cb_retrieve.enabled = true
  435. cb_delet.enabled = true
  436. cb_print.enabled = true
  437. cb_func.enabled = true
  438. sle_usual_query.Enabled = TRUE
  439. IF mode = 1 THEN
  440. cb_choice.Enabled = TRUE
  441. ELSE
  442. cb_choice.Enabled = FALSE
  443. END IF
  444. cb_edit.text = "修改&E"
  445. cb_add.text = "新建&S"
  446. cb_edit.normalpicname = 'OPEN.bmp'
  447. cb_add.normalpicname = 'new.bmp'
  448. end if
  449. cb_edit.of_init_draw()
  450. cb_add.of_init_draw()
  451. cb_edit.of_paint()
  452. cb_add.of_paint()
  453. cb_edit.triggerevent('ue_textchange')
  454. cb_add.triggerevent('ue_textchange')
  455. this.triggerevent('refresh_interface')
  456. return 1
  457. end function
  458. public function window getparentwin ();//GetParentWin()
  459. return this
  460. end function
  461. on w_publ_edit_index.create
  462. int iCurrent
  463. call super::create
  464. this.sle_usual_query=create sle_usual_query
  465. this.cb_nextpage=create cb_nextpage
  466. this.cb_priorpage=create cb_priorpage
  467. this.cb_firstpage=create cb_firstpage
  468. this.cb_retrieveall=create cb_retrieveall
  469. this.em_pagerowno=create em_pagerowno
  470. this.st_pagerowno=create st_pagerowno
  471. this.st_1=create st_1
  472. this.cb_add=create cb_add
  473. this.cb_edit=create cb_edit
  474. this.cb_delet=create cb_delet
  475. this.cb_choice=create cb_choice
  476. this.cb_cancel=create cb_cancel
  477. this.cbx_mlselect=create cbx_mlselect
  478. this.cbx_allselect=create cbx_allselect
  479. this.cb_mode_itfchg_b=create cb_mode_itfchg_b
  480. this.cb_mode_itfchg=create cb_mode_itfchg
  481. this.gb_1=create gb_1
  482. this.dw_uc=create dw_uc
  483. this.cb_retrieve=create cb_retrieve
  484. this.cb_print=create cb_print
  485. this.ln_bar=create ln_bar
  486. this.ln_bar2=create ln_bar2
  487. this.r_bar=create r_bar
  488. this.ln_1=create ln_1
  489. this.ln_2=create ln_2
  490. this.dw_index=create dw_index
  491. this.cb_help=create cb_help
  492. iCurrent=UpperBound(this.Control)
  493. this.Control[iCurrent+1]=this.sle_usual_query
  494. this.Control[iCurrent+2]=this.cb_nextpage
  495. this.Control[iCurrent+3]=this.cb_priorpage
  496. this.Control[iCurrent+4]=this.cb_firstpage
  497. this.Control[iCurrent+5]=this.cb_retrieveall
  498. this.Control[iCurrent+6]=this.em_pagerowno
  499. this.Control[iCurrent+7]=this.st_pagerowno
  500. this.Control[iCurrent+8]=this.st_1
  501. this.Control[iCurrent+9]=this.cb_add
  502. this.Control[iCurrent+10]=this.cb_edit
  503. this.Control[iCurrent+11]=this.cb_delet
  504. this.Control[iCurrent+12]=this.cb_choice
  505. this.Control[iCurrent+13]=this.cb_cancel
  506. this.Control[iCurrent+14]=this.cbx_mlselect
  507. this.Control[iCurrent+15]=this.cbx_allselect
  508. this.Control[iCurrent+16]=this.cb_mode_itfchg_b
  509. this.Control[iCurrent+17]=this.cb_mode_itfchg
  510. this.Control[iCurrent+18]=this.gb_1
  511. this.Control[iCurrent+19]=this.dw_uc
  512. this.Control[iCurrent+20]=this.cb_retrieve
  513. this.Control[iCurrent+21]=this.cb_print
  514. this.Control[iCurrent+22]=this.ln_bar
  515. this.Control[iCurrent+23]=this.ln_bar2
  516. this.Control[iCurrent+24]=this.r_bar
  517. this.Control[iCurrent+25]=this.ln_1
  518. this.Control[iCurrent+26]=this.ln_2
  519. this.Control[iCurrent+27]=this.dw_index
  520. this.Control[iCurrent+28]=this.cb_help
  521. end on
  522. on w_publ_edit_index.destroy
  523. call super::destroy
  524. destroy(this.sle_usual_query)
  525. destroy(this.cb_nextpage)
  526. destroy(this.cb_priorpage)
  527. destroy(this.cb_firstpage)
  528. destroy(this.cb_retrieveall)
  529. destroy(this.em_pagerowno)
  530. destroy(this.st_pagerowno)
  531. destroy(this.st_1)
  532. destroy(this.cb_add)
  533. destroy(this.cb_edit)
  534. destroy(this.cb_delet)
  535. destroy(this.cb_choice)
  536. destroy(this.cb_cancel)
  537. destroy(this.cbx_mlselect)
  538. destroy(this.cbx_allselect)
  539. destroy(this.cb_mode_itfchg_b)
  540. destroy(this.cb_mode_itfchg)
  541. destroy(this.gb_1)
  542. destroy(this.dw_uc)
  543. destroy(this.cb_retrieve)
  544. destroy(this.cb_print)
  545. destroy(this.ln_bar)
  546. destroy(this.ln_bar2)
  547. destroy(this.r_bar)
  548. destroy(this.ln_1)
  549. destroy(this.ln_2)
  550. destroy(this.dw_index)
  551. destroy(this.cb_help)
  552. end on
  553. event open;call super::open;if_ue_retr = True
  554. if_ue_filter = True
  555. if_ue_sort = True
  556. old_title = This.Title
  557. s_edit_index_tran s_tran //传递参数使用
  558. s_tran = Message.PowerObjectParm
  559. IF Not IsNull(s_tran) THEN
  560. retrieve_all = s_tran.if_retrieve_all
  561. mode = s_tran.work_mode
  562. arg_pkid = s_tran.arg_pkid
  563. arg_string_code = s_tran.arg_string_code
  564. if_select_all = s_tran.if_select_all
  565. END IF
  566. //choose case mode
  567. // case 0
  568. // this.title = old_title+' 编辑模式 [f4-新建/保存 f5-编辑/放弃]'
  569. // case 1
  570. // this.title = old_title+' 选择模式 [f4-新建/保存 f5-编辑/放弃]'
  571. //end choose
  572. dw_uc.SetTransObject (sqlca)
  573. dw_index.SetTransObject (sqlca)
  574. dw_index.rbutton_filter_use = True //右键查询功能开关
  575. pkcolumndbtname = wf_get_pkcolumndbtname(dw_uc) //取第一列为关键字
  576. ori_oldselect = dw_uc.Describe("datawindow.table.select")
  577. ls_newselect = ori_oldselect
  578. ds_curquery = Create datastore
  579. ds_curquery.DataObject = 'd_extr_find'
  580. ds_curquery.SetTransObject (sqlca)
  581. IF mode = 1 THEN
  582. cbx_mlselect.Visible = True
  583. cbx_allselect.Visible = True
  584. cb_choice.Enabled = True
  585. ELSE
  586. cbx_mlselect.Visible = False
  587. cbx_allselect.Visible = False
  588. cb_choice.Enabled = False
  589. END IF
  590. //IF mode = 1 THEN cb_mode_itfchg.TriggerEvent(Clicked!)
  591. wf_editindex_lockf()
  592. IF Not retrieve_all And Trim(arg_string_code) <> '' THEN
  593. sle_usual_query.Text = Trim(arg_string_code)
  594. This.TriggerEvent("ue_usual_query_retr") //修改ls_newselect,retrieve
  595. ELSE
  596. wf_retrieveuc(dw_uc,ls_newselect,1) //retrieve
  597. This.TriggerEvent('retrieve_uc')
  598. END IF
  599. IF retrieve_all And Trim(arg_string_code) <> '' THEN
  600. This.TriggerEvent("ue_usual_query_filt")
  601. END IF
  602. end event
  603. event ue_retr;call super::ue_retr;s_extrtriequery_tran s_dbdw
  604. s_dbdw.query_dw=dw_UC
  605. s_dbdw.ptn_ds=ds_curquery
  606. s_dbdw.query_oldselect=ori_oldselect
  607. string ls_select=''
  608. OPENWITHPARM(w_extr_query,s_dbdw)
  609. ls_select = Message.StringParm
  610. if TRIM(ls_select)="" OR ISNULL(ls_select) then
  611. return
  612. else
  613. ls_newselect=ls_select
  614. END IF
  615. DW_index.SetRedraw(FALSE)
  616. wf_retrieveuc(dw_uc,ls_newselect,1)
  617. DW_index.SetRedraw(TRUE)
  618. end event
  619. event close;call super::close;//CLOSEWITHRETURN(THIS,<INS_RT_STRU>)
  620. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  621. end event
  622. event closequery;call super::closequery;if dw_edit_mode then
  623. dw_UC.ACCEPTTEXT()
  624. int ls_row=0
  625. ls_row=dw_UC.GetNextModified(0, Primary!)+&
  626. dw_UC.GetNextModified(0, FILTER!)+dw_UC.DeletedCount()
  627. if ls_row>0 then
  628. if messagebox('是否保存','数据已经改变,是否放弃保存?',Question!,YesNo!,1 ) = 2 THEN
  629. RETURN 1
  630. END IF
  631. end if
  632. else
  633. if if_retrieveing then
  634. messagebox("系统提示",'系统正在查询数据,请稍后再退出!')
  635. return 1
  636. end if
  637. end if
  638. end event
  639. event key;call super::key;THIS.TRIGGEREVENT('USER_KEY')
  640. end event
  641. event ue_filter;call super::ue_filter;OPENWITHPARM(w_filter_query,dw_uc)
  642. STRING LS_EXPR
  643. LS_EXPR=Message.StringParm
  644. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  645. dw_uc.setfilter(LS_EXPR)
  646. dw_uc.SetRedraw (false)
  647. dw_uc.filter()
  648. dw_uc.SetRedraw (true)
  649. end event
  650. event ue_sort;call super::ue_sort;OPENwithparm(w_sortrow,dw_UC)
  651. STRING LS_EXPR
  652. LS_EXPR=Message.StringParm
  653. IF ISNULL(LS_EXPR) THEN LS_EXPR=' '
  654. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  655. dw_UC.setsort(LS_EXPR)
  656. dw_UC.SetRedraw (false)
  657. dw_UC.sort()
  658. dw_UC.SetRedraw (true)
  659. end event
  660. event ue_sentdataout;call super::ue_sentdataout;OPENWITHPARM(w_sentdataout,dw_index)
  661. end event
  662. event resize;call super::resize;ln_bar.endx = this.width
  663. ln_bar2.endx = this.width
  664. ln_1.endx = this.width
  665. ln_2.endx = this.width
  666. r_bar.width = this.width
  667. end event
  668. type cb_func from w_publ_base`cb_func within w_publ_edit_index
  669. integer x = 151
  670. integer width = 151
  671. integer height = 164
  672. integer taborder = 30
  673. end type
  674. type cb_exit from w_publ_base`cb_exit within w_publ_edit_index
  675. integer x = 1426
  676. integer width = 151
  677. integer height = 164
  678. integer taborder = 20
  679. integer picsize = 16
  680. toolbaralignment pic_align = alignattop!
  681. boolean border = false
  682. end type
  683. type sle_usual_query from u_sleedit within w_publ_edit_index
  684. integer x = 206
  685. integer y = 184
  686. integer height = 92
  687. end type
  688. event inputchanged;call super::inputchanged;IF retrieve_all THEN
  689. PARENT.TRIGGEREVENT("ue_usual_query_filt")
  690. END IF
  691. end event
  692. event keyup;call super::keyup;IF NOT dw_edit_mode THEN
  693. If Key = KeyDownArrow! Then //
  694. dw_INDEX.ScrollNextRow()
  695. End If
  696. If Key = KeyUPArrow! Then //
  697. dw_INDEX.ScrollPriorRow()
  698. End If
  699. END IF
  700. end event
  701. event modified;call super::modified;IF retrieve_all or retrmode=0 THEN
  702. PARENT.TRIGGEREVENT("ue_usual_query_filt")
  703. ELSE
  704. PARENT.TRIGGEREVENT("ue_usual_query_RETR")
  705. END IF
  706. end event
  707. type cb_nextpage from uo_imflatbutton within w_publ_edit_index
  708. boolean visible = false
  709. integer x = 2331
  710. integer width = 64
  711. integer height = 164
  712. integer taborder = 140
  713. string text = "▼"
  714. integer picsize = 16
  715. toolbaralignment pic_align = alignattop!
  716. boolean border = false
  717. end type
  718. event clicked;call super::clicked;//wf_retrieveuc(dw_uc,ls_newselect,4)
  719. //parent.triggerevent('retrieve_uc')
  720. m_Dfc_Control_PopupMenu dmPopupMenu
  721. string menustr
  722. menustr="Text=下页~tEvent=ue_page3"
  723. menustr = menustr + "|" + "Text=上页~tEvent=ue_page2"
  724. menustr = menustr + "|" + "Text=末页~tEvent=ue_page4"
  725. if len(trim(menustr))<>0 then
  726. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  727. dmPopupMenu.mf_BuildMenu(This, menustr)
  728. dmPopupMenu.mf_PopMenu()
  729. Destroy dmPopupMenu
  730. end if
  731. end event
  732. type cb_priorpage from uo_imflatbutton within w_publ_edit_index
  733. boolean visible = false
  734. integer x = 2181
  735. integer width = 151
  736. integer height = 164
  737. integer taborder = 130
  738. string text = "下页"
  739. string normalpicname = "p3.ico"
  740. integer picsize = 16
  741. toolbaralignment pic_align = alignattop!
  742. boolean border = false
  743. end type
  744. event clicked;call super::clicked;wf_retrieveuc(dw_uc,ls_newselect,3)
  745. parent.triggerevent('retrieve_uc')
  746. end event
  747. type cb_firstpage from uo_imflatbutton within w_publ_edit_index
  748. boolean visible = false
  749. integer x = 2030
  750. integer width = 151
  751. integer height = 164
  752. integer taborder = 120
  753. string text = "上页"
  754. string normalpicname = "p2.ico"
  755. integer picsize = 16
  756. toolbaralignment pic_align = alignattop!
  757. boolean border = false
  758. end type
  759. event clicked;call super::clicked;wf_retrieveuc(dw_uc,ls_newselect,2)
  760. parent.triggerevent('retrieve_uc')
  761. end event
  762. type cb_retrieveall from uo_imflatbutton within w_publ_edit_index
  763. boolean visible = false
  764. integer x = 1879
  765. integer width = 151
  766. integer height = 164
  767. integer taborder = 70
  768. string text = "首页"
  769. string normalpicname = "p1.ico"
  770. integer picsize = 16
  771. toolbaralignment pic_align = alignattop!
  772. boolean border = false
  773. end type
  774. event clicked;call super::clicked;PARENT.TriggerEvent('ue_page1')
  775. //wf_retrieveuc(dw_uc,ls_newselect,1)
  776. //parent.triggerevent('retrieve_uc')
  777. end event
  778. type em_pagerowno from editmask within w_publ_edit_index
  779. boolean visible = false
  780. integer x = 1577
  781. integer y = 32
  782. integer width = 302
  783. integer height = 96
  784. integer taborder = 60
  785. integer textsize = -9
  786. integer weight = 400
  787. fontcharset fontcharset = gb2312charset!
  788. fontpitch fontpitch = variable!
  789. string facename = "宋体"
  790. long textcolor = 33554432
  791. string text = "1000"
  792. borderstyle borderstyle = stylelowered!
  793. string mask = "#####0"
  794. boolean spin = true
  795. end type
  796. event constructor;this.text=f_profilestring (sys_empid,dw_uc.dataobject, "pagerowno",'1000000')
  797. onepage_rowlmno=long(this.text)
  798. end event
  799. event modified;if long(this.text) > 0 then
  800. else
  801. this.text = '1'
  802. end if
  803. onepage_rowlmno = long(this.text)
  804. f_setprofilestring (sys_empid,dw_uc.dataobject, "pagerowno", this.text)
  805. end event
  806. type st_pagerowno from statictext within w_publ_edit_index
  807. boolean visible = false
  808. integer x = 434
  809. integer y = 748
  810. integer width = 197
  811. integer height = 48
  812. integer textsize = -9
  813. integer weight = 400
  814. fontcharset fontcharset = gb2312charset!
  815. fontpitch fontpitch = variable!
  816. string facename = "宋体"
  817. long textcolor = 33554432
  818. long backcolor = 134217739
  819. boolean enabled = false
  820. string text = "页行数"
  821. boolean focusrectangle = false
  822. end type
  823. type st_1 from statictext within w_publ_edit_index
  824. integer x = 14
  825. integer y = 204
  826. integer width = 219
  827. integer height = 48
  828. integer textsize = -9
  829. integer weight = 400
  830. fontcharset fontcharset = gb2312charset!
  831. fontpitch fontpitch = variable!
  832. string facename = "宋体"
  833. long textcolor = 33554432
  834. long backcolor = 134217739
  835. string text = "编码含"
  836. boolean focusrectangle = false
  837. end type
  838. type cb_add from uo_imflatbutton within w_publ_edit_index
  839. integer x = 302
  840. integer width = 192
  841. integer height = 164
  842. integer taborder = 150
  843. boolean bringtotop = true
  844. string text = "新建&S"
  845. string normalpicname = "new.bmp"
  846. integer picsize = 16
  847. toolbaralignment pic_align = alignattop!
  848. boolean border = false
  849. end type
  850. event clicked;call super::clicked;IF dw_edit_mode THEN
  851. String ls_errmsg
  852. IF dw_uc.Update() = -1 THEN
  853. IF Pos(ins_sqlerrtext,"cannot insert duplicate key row") > 0 Or Pos(ins_sqlerrtext,"unique key") > 0 THEN
  854. ls_errmsg = "关键内容重复"
  855. ELSE
  856. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  857. END IF
  858. ROLLBACK;
  859. MessageBox ("系统提示",ls_errmsg+",保存操作失败!",exclamation!,ok!)
  860. ls_update_flag = False
  861. RETURN
  862. ELSE
  863. COMMIT;
  864. ls_update_flag = True
  865. END IF
  866. ins_sqlerrtext = ""
  867. dw_uc.Enabled = False
  868. ELSE
  869. Long li_row, li_cur_row
  870. li_cur_row = dw_uc.GetRow()
  871. li_row = dw_uc.InsertRow (li_cur_row)
  872. dw_uc.ScrollToRow (li_row)
  873. dw_uc.Enabled = True
  874. dw_uc.SetFocus()
  875. modifyrow_no = li_row
  876. END IF
  877. dw_edit_mode = Not dw_edit_mode
  878. wf_face_change()
  879. IF dw_edit_mode THEN
  880. IF cb_mode_itfchg.Text = '<<' THEN
  881. cb_mode_itfchg.TriggerEvent(Clicked!)
  882. END IF
  883. ELSE
  884. wf_index_uc()
  885. END IF
  886. dw_index.rbutton_filter_use = Not dw_edit_mode
  887. wf_editindex_lockf()
  888. end event
  889. type cb_edit from uo_imflatbutton within w_publ_edit_index
  890. integer x = 494
  891. integer width = 192
  892. integer height = 164
  893. integer taborder = 170
  894. boolean bringtotop = true
  895. string text = "修改&E"
  896. string normalpicname = "open.bmp"
  897. integer picsize = 16
  898. toolbaralignment pic_align = alignattop!
  899. boolean border = false
  900. end type
  901. event clicked;call super::clicked;if dw_edit_mode then
  902. IF MessageBox ("IF","当前资料,是否放弃保存?",Question!,YesNo! ) = 2 THEN RETURN
  903. if dw_uc.getitemstatus(dw_uc.getrow(), 0, primary!) = newmodified! or dw_uc.getitemstatus(dw_uc.getrow(), 0, primary!) = new! then
  904. dw_uc.deleterow(dw_uc.getrow())
  905. else
  906. dw_uc.reselectrow(dw_uc.getrow())
  907. end if
  908. dw_uc.enabled = false
  909. modifyrow_no = 0
  910. else
  911. dw_uc.enabled = true
  912. dw_uc.setfocus()
  913. modifyrow_no = dw_uc.getrow()
  914. end if
  915. dw_edit_mode = not dw_edit_mode
  916. wf_face_change()
  917. if dw_edit_mode then
  918. if cb_mode_itfchg.text = '<<' then
  919. cb_mode_itfchg.triggerevent(clicked!)
  920. end if
  921. else
  922. wf_index_uc()
  923. end if
  924. dw_index.rbutton_filter_use = not dw_edit_mode
  925. wf_editindex_lockf()
  926. end event
  927. type cb_delet from uo_imflatbutton within w_publ_edit_index
  928. integer x = 686
  929. integer width = 151
  930. integer height = 164
  931. integer taborder = 180
  932. boolean bringtotop = true
  933. string text = "删除"
  934. string normalpicname = "delete.bmp"
  935. integer picsize = 16
  936. toolbaralignment pic_align = alignattop!
  937. boolean border = false
  938. end type
  939. event clicked;call super::clicked;//IF MessageBox ("IF","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  940. //RETURN
  941. //END IF
  942. //dw_uc.SetRedraw (false)
  943. //dw_UC.DeleteRow (0)
  944. //dw_UC.TriggerEvent (rowfocuschanged!)
  945. //
  946. //if dw_UC.Update() = -1 then
  947. // rollback;
  948. // MessageBox ("NO","删除记录操作失败!",Exclamation!,OK!)
  949. //else
  950. // commit;
  951. //end if
  952. //dw_uc.SetRedraw (true)
  953. //
  954. //WF_INDEX_UC()
  955. end event
  956. type cb_choice from uo_imflatbutton within w_publ_edit_index
  957. string tag = "选定[C^+Enter]"
  958. integer x = 1275
  959. integer width = 151
  960. integer height = 164
  961. integer taborder = 190
  962. boolean bringtotop = true
  963. string text = "选定"
  964. string normalpicname = "ok.bmp"
  965. integer picsize = 16
  966. toolbaralignment pic_align = alignattop!
  967. boolean border = false
  968. end type
  969. event clicked;call super::clicked;////单选代码
  970. ////LONG LS_ROW
  971. ////LS_ROW=dw_uc.getrow()
  972. ////if LS_ROW<=0 then
  973. //// messagebox('系统提示','请先选择目标行!',StopSign!)
  974. //// return
  975. ////end if
  976. ////
  977. ////INS_RT_STRU.scustid=dw_INDEX.OBJECT.custid[LS_ROW]
  978. ////...
  979. ////CLOSE(PARENT)
  980. /////多选代码
  981. //LONG ROW,ls_i,chC=0
  982. //ROW=dw_pageretr.GETROW()
  983. //if ROW<=0 then
  984. // messagebox('系统提示','请先选择目标行!',StopSign!)
  985. // return
  986. //end if
  987. //
  988. //for ls_i=1 to dw_pageretr.rowcount()
  989. // if dw_pageretr.isselected(ls_i) then
  990. // chC++
  991. // INS_RT_STRU.mtrlwareid[ls_i]=dw_pageretr.OBJECT.mtrlwareid[ls_i]
  992. // INS_RT_STRU.mtrlid[ls_i]=dw_pageretr.OBJECT.mtrlid[ls_i]
  993. // INS_RT_STRU.u_mtrldef_mtrlcode[ls_i]=dw_pageretr.OBJECT.u_mtrldef_mtrlcode[ls_i]
  994. // INS_RT_STRU.u_mtrldef_mtrlname[ls_i]=dw_pageretr.OBJECT.u_mtrldef_mtrlname[ls_i]
  995. // INS_RT_STRU.u_mtrldef_mtrltype[ls_i]=dw_pageretr.OBJECT.u_mtrldef_mtrltype[ls_i]
  996. // INS_RT_STRU.u_mtrldef_unit[ls_i]=dw_pageretr.OBJECT.u_mtrldef_unit[ls_i]
  997. // INS_RT_STRU.noallocqty[ls_i]=dw_pageretr.OBJECT.noallocqty[ls_i]
  998. // INS_RT_STRU.cost[ls_i]=dw_pageretr.OBJECT.cost[ls_i]
  999. // INS_RT_STRU.planprice[ls_i]=dw_pageretr.OBJECT.planprice[ls_i]
  1000. // INS_RT_STRU.storageid[ls_i]=dw_pageretr.OBJECT.storageid[ls_i]
  1001. // INS_RT_STRU.plancode[ls_i]=dw_pageretr.OBJECT.plancode[ls_i]
  1002. // INS_RT_STRU.billtype[ls_i]=dw_pageretr.OBJECT.billtype[ls_i]
  1003. // INS_RT_STRU.noauditingqty[ls_i]=dw_pageretr.OBJECT.noauditingqty[ls_i]
  1004. // if isnull(INS_RT_STRU.noauditingqty[ls_i]) then INS_RT_STRU.noauditingqty[ls_i]=0
  1005. // end if
  1006. //
  1007. //next
  1008. //if chC=0 then
  1009. // messagebox('系统提示','请至少选择一个目标行!',StopSign!)
  1010. // return
  1011. //end if
  1012. //
  1013. //CLOSE(PARENT)
  1014. end event
  1015. type cb_cancel from uo_imflatbutton within w_publ_edit_index
  1016. string tag = "取消[&Esc]"
  1017. boolean visible = false
  1018. integer x = 270
  1019. integer y = 592
  1020. integer width = 329
  1021. integer height = 112
  1022. integer taborder = 200
  1023. boolean bringtotop = true
  1024. boolean enabled = false
  1025. string text = "取消"
  1026. end type
  1027. event clicked;call super::clicked;CLOSE(PARENT)
  1028. end event
  1029. type cbx_mlselect from checkbox within w_publ_edit_index
  1030. integer x = 1458
  1031. integer y = 204
  1032. integer width = 215
  1033. integer height = 60
  1034. boolean bringtotop = true
  1035. integer textsize = -9
  1036. integer weight = 400
  1037. fontcharset fontcharset = gb2312charset!
  1038. fontpitch fontpitch = variable!
  1039. string facename = "宋体"
  1040. long textcolor = 16711680
  1041. long backcolor = 134217739
  1042. string text = "多选"
  1043. end type
  1044. event clicked;if this.checked then
  1045. if_mlselect=1
  1046. cbx_allselect.enabled=true
  1047. else
  1048. if_mlselect=0
  1049. cbx_allselect.enabled=false
  1050. cbx_allselect.checked=false
  1051. cbx_allselect.triggerevent(clicked!)
  1052. end if
  1053. f_SetProfileString (sys_empid,dw_index.DATAOBJECT, "if_mlselect", string(if_mlselect))
  1054. end event
  1055. type cbx_allselect from checkbox within w_publ_edit_index
  1056. integer x = 1774
  1057. integer y = 204
  1058. integer width = 229
  1059. integer height = 60
  1060. boolean bringtotop = true
  1061. integer textsize = -9
  1062. integer weight = 400
  1063. fontcharset fontcharset = gb2312charset!
  1064. fontpitch fontpitch = variable!
  1065. string facename = "宋体"
  1066. long textcolor = 16711680
  1067. long backcolor = 134217739
  1068. string text = "全选"
  1069. end type
  1070. event clicked;if dw_index.rowcount()<=0 then return
  1071. long li
  1072. if this.checked then
  1073. for li =1 to dw_index.rowcount()
  1074. dw_index.selectrow(li,true)
  1075. next
  1076. else
  1077. for li =1 to dw_index.rowcount()
  1078. dw_index.selectrow(li,false)
  1079. next
  1080. end if
  1081. end event
  1082. type cb_mode_itfchg_b from uo_imflatbutton within w_publ_edit_index
  1083. boolean visible = false
  1084. integer x = 709
  1085. integer y = 1004
  1086. integer width = 78
  1087. integer height = 132
  1088. integer taborder = 160
  1089. boolean bringtotop = true
  1090. boolean enabled = false
  1091. string text = ">>"
  1092. end type
  1093. event clicked;call super::clicked;cb_mode_itfchg.TRIGGEREVENT(clicked!)
  1094. this.text=cb_mode_itfchg.text
  1095. cb_mode_itfchg.triggerevent('ue_textchange')
  1096. end event
  1097. type cb_mode_itfchg from uo_imflatbutton within w_publ_edit_index
  1098. integer x = 1179
  1099. integer width = 96
  1100. integer height = 164
  1101. integer taborder = 80
  1102. boolean bringtotop = true
  1103. string text = ">>"
  1104. boolean border = false
  1105. end type
  1106. event clicked;call super::clicked;IF This.Text = '<<' THEN
  1107. This.Text = '>>'
  1108. dw_index.Width = dw_uc.X+1 - dw_index.X
  1109. dw_index.Y = dw_uc.Y
  1110. ELSE
  1111. This.Text = '<<'
  1112. dw_index.Width = dw_uc.X+1+dw_uc.Width - dw_index.X
  1113. dw_index.Y = dw_uc.Y
  1114. END IF
  1115. //PARENT.TriggerEvent('ue_mode_itfchg')
  1116. cb_mode_itfchg_b.Text = This.Text
  1117. cb_mode_itfchg_b.TriggerEvent('ue_textchange')
  1118. end event
  1119. type gb_1 from groupbox within w_publ_edit_index
  1120. boolean visible = false
  1121. integer x = 87
  1122. integer y = 844
  1123. integer width = 1184
  1124. integer height = 148
  1125. integer taborder = 50
  1126. integer textsize = -9
  1127. integer weight = 400
  1128. fontcharset fontcharset = gb2312charset!
  1129. fontpitch fontpitch = variable!
  1130. string facename = "宋体"
  1131. long textcolor = 33554432
  1132. long backcolor = 134217739
  1133. boolean enabled = false
  1134. end type
  1135. type dw_uc from datawindow within w_publ_edit_index
  1136. event key pbm_dwnkey
  1137. event ue_dw_scroll pbm_vscroll
  1138. integer x = 1362
  1139. integer y = 292
  1140. integer width = 1495
  1141. integer height = 1372
  1142. integer taborder = 90
  1143. boolean enabled = false
  1144. string title = "none"
  1145. boolean livescroll = true
  1146. borderstyle borderstyle = stylelowered!
  1147. end type
  1148. event key;PARENT.TRIGGEREVENT('USER_KEY')
  1149. boolean cancel_key=false
  1150. If key = KeyEnter! or key = Keydownarrow! Then //
  1151. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  1152. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  1153. cancel_key=true
  1154. elseif key = Keyuparrow! then
  1155. keybd_event ( 16, 0, 0 , 0 )
  1156. keybd_event ( 9, 0, 0 , 0 )
  1157. keybd_event ( 9, 0, 2, 0 )
  1158. keybd_event ( 16, 0, 2, 0 )
  1159. cancel_key=true
  1160. End If
  1161. this.ScrollToRow(this.getrow())
  1162. if cancel_key then return 1
  1163. end event
  1164. event ue_dw_scroll;return 1
  1165. end event
  1166. event dberror;ins_sqlerrtext=sqlerrtext
  1167. return 1
  1168. end event
  1169. event rowfocuschanged;IF modifyrow_no >0 AND dw_edit_mode THEN
  1170. THIS.SETROW(modifyrow_no)
  1171. THIS.ScrollToRow(modifyrow_no)
  1172. END IF
  1173. end event
  1174. event rowfocuschanging;IF dw_edit_mode THEN RETURN 1
  1175. end event
  1176. event rbuttondown;if not dw_edit_mode then return
  1177. Long ll_row,ll_column
  1178. ll_row = THIS.GetRow()
  1179. ll_column = THIS.GetColumn()
  1180. IF ll_row <= 0 THEN RETURN
  1181. IF ll_column <= 0 THEN RETURN
  1182. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  1183. s_calender_arg s_calender
  1184. s_calender.PointerX = xpos
  1185. s_calender.PointerY = ypos
  1186. s_calender.X = THIS.X + PARENT.X
  1187. s_calender.Y = THIS.Y + PARENT.Y
  1188. OpenWithParm(w_calendar,s_calender)
  1189. THIS.SetItem(ll_row,ll_column,id_date_selected)
  1190. END IF
  1191. end event
  1192. type cb_retrieve from uo_imflatbutton within w_publ_edit_index
  1193. integer width = 151
  1194. integer height = 164
  1195. integer taborder = 100
  1196. boolean bringtotop = true
  1197. string text = "刷新"
  1198. string normalpicname = "refresh.bmp"
  1199. integer picsize = 16
  1200. toolbaralignment pic_align = alignattop!
  1201. boolean border = false
  1202. end type
  1203. event clicked;call super::clicked;parent.triggerevent('retrieve_uc')
  1204. wf_index_uc()
  1205. end event
  1206. type cb_print from uo_imflatbutton within w_publ_edit_index
  1207. integer x = 987
  1208. integer width = 192
  1209. integer height = 164
  1210. integer taborder = 110
  1211. boolean bringtotop = true
  1212. string text = "预览&P"
  1213. string normalpicname = "preview.bmp"
  1214. integer picsize = 16
  1215. toolbaralignment pic_align = alignattop!
  1216. boolean border = false
  1217. end type
  1218. event clicked;call super::clicked;//S_print_MSG LS_PRMSG
  1219. //
  1220. //LS_PRMSG.obj_dwNAME='dwrp_zl_lsdzl'
  1221. //LS_PRMSG.SHARE_DW=DW_UC
  1222. //LS_PRMSG.TAG_TEXT='零售点资料表'
  1223. //LS_PRMSG.SETUP_FLAG=0
  1224. //LS_PRMSG.PAGECH_FLAG=1
  1225. //
  1226. //Openwithparm(w_publ_preview,LS_PRMSG)
  1227. //
  1228. end event
  1229. type ln_bar from line within w_publ_edit_index
  1230. long linecolor = 268435456
  1231. integer linethickness = 4
  1232. integer beginx = -46
  1233. integer beginy = 172
  1234. integer endx = 1961
  1235. integer endy = 172
  1236. end type
  1237. type ln_bar2 from line within w_publ_edit_index
  1238. long linecolor = 16777215
  1239. integer linethickness = 4
  1240. integer beginx = -46
  1241. integer beginy = 176
  1242. integer endx = 1993
  1243. integer endy = 176
  1244. end type
  1245. type r_bar from rectangle within w_publ_edit_index
  1246. long linecolor = 16777215
  1247. integer linethickness = 4
  1248. long fillcolor = 1073741824
  1249. integer x = 2629
  1250. integer width = 146
  1251. integer height = 68
  1252. end type
  1253. event constructor;this.fillcolor = 14215660
  1254. this.linecolor = 14215660
  1255. this.x = -1
  1256. this.y = -1
  1257. this.height = ln_bar.beginy - 5
  1258. end event
  1259. type ln_1 from line within w_publ_edit_index
  1260. long linecolor = 268435456
  1261. integer linethickness = 4
  1262. integer beginy = 284
  1263. integer endx = 2016
  1264. integer endy = 284
  1265. end type
  1266. type ln_2 from line within w_publ_edit_index
  1267. long linecolor = 16777215
  1268. integer linethickness = 4
  1269. integer beginy = 288
  1270. integer endx = 2048
  1271. integer endy = 288
  1272. end type
  1273. type dw_index from u_dw_rbtnfilter within w_publ_edit_index
  1274. integer y = 292
  1275. integer width = 1362
  1276. integer height = 1372
  1277. integer taborder = 40
  1278. boolean bringtotop = true
  1279. boolean minbox = true
  1280. boolean hscrollbar = true
  1281. boolean vscrollbar = true
  1282. boolean hsplitscroll = true
  1283. end type
  1284. event clicked;call super::clicked;IF row > 0 THEN
  1285. This.SetRow(row)
  1286. IF if_mlselect = 1 THEN
  1287. IF if_changeselect THEN
  1288. This.SelectRow(row,Not This.IsSelected(row))
  1289. ELSE
  1290. if_changeselect = True
  1291. END IF
  1292. ELSE
  1293. IF dw_edit_mode THEN RETURN
  1294. This.SelectRow(0,False)
  1295. This.SelectRow(row,True)
  1296. END IF
  1297. END IF
  1298. end event
  1299. event rowfocuschanged;call super::rowfocuschanged;IF if_mlselect = 1 THEN
  1300. IF currentrow <= 0 THEN RETURN
  1301. IF KeyDown(keycontrol!) THEN
  1302. IF This.IsSelected(currentrow) THEN
  1303. This.SelectRow(currentrow,False)
  1304. if_changeselect = False
  1305. ELSE
  1306. if_changeselect = True
  1307. END IF
  1308. ELSE
  1309. IF Not This.IsSelected(currentrow) THEN
  1310. This.SelectRow(currentrow,True)
  1311. if_changeselect = False
  1312. ELSE
  1313. if_changeselect = True
  1314. END IF
  1315. END IF
  1316. ELSE
  1317. IF dw_edit_mode THEN RETURN
  1318. IF currentrow <= 0 THEN RETURN
  1319. This.SelectRow(0,False)
  1320. This.SelectRow(currentrow,True)
  1321. dw_uc.SetRow(currentrow)
  1322. dw_uc.ScrollToRow (currentrow)
  1323. END IF
  1324. end event
  1325. event constructor;call super::constructor;titleclick_sort_use=true //单击标题排序功能开关
  1326. end event
  1327. event doubleclicked;call super::doubleclicked;IF mode=1 AND NOT dw_edit_mode THEN
  1328. cb_choice.TRIGGEREVENT(CLICKED!)
  1329. END IF
  1330. end event
  1331. event dwnkey;call super::dwnkey;if keydown(Keyenter!) and keydown(keycontrol!) then return 1
  1332. PARENT.POSTEVENT('USER_KEY')
  1333. end event
  1334. type cb_help from uo_imflatbutton within w_publ_edit_index
  1335. integer x = 837
  1336. integer width = 151
  1337. integer height = 164
  1338. integer taborder = 40
  1339. boolean bringtotop = true
  1340. string text = "帮助"
  1341. string normalpicname = "help.bmp"
  1342. integer picsize = 16
  1343. toolbaralignment pic_align = alignattop!
  1344. boolean border = false
  1345. end type
  1346. event clicked;call super::clicked;PARENT.TriggerEvent('ue_help')
  1347. end event