w_pz_ch_fx.srw 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. $PBExportHeader$w_pz_ch_fx.srw
  2. $PBExportComments$协同物料配置选择窗口(fx_color/fx_color_wood/fx_color_pcode/fx_pztype_mx/fx_mtrl_configure)
  3. forward
  4. global type w_pz_ch_fx from window
  5. end type
  6. type dw_1 from u_dw_rbtnfilter within w_pz_ch_fx
  7. end type
  8. end forward
  9. global type w_pz_ch_fx from window
  10. integer width = 1472
  11. integer height = 1348
  12. boolean titlebar = true
  13. string title = "选择"
  14. boolean controlmenu = true
  15. windowtype windowtype = response!
  16. long backcolor = 16777215
  17. string icon = "graphics\chain_link_128px.ico"
  18. dw_1 dw_1
  19. end type
  20. global w_pz_ch_fx w_pz_ch_fx
  21. type variables
  22. s_fx_pzwin_open ins_s
  23. string ins_ret
  24. end variables
  25. on w_pz_ch_fx.create
  26. this.dw_1=create dw_1
  27. this.Control[]={this.dw_1}
  28. end on
  29. on w_pz_ch_fx.destroy
  30. destroy(this.dw_1)
  31. end on
  32. event open;ins_s = Message.PowerObjectParm
  33. if IsNull(ins_s) then
  34. MessageBox('提示', '打开方式有误(structure)')
  35. Close(this)
  36. return
  37. end if
  38. if IsNull(ins_s.arg_ds) then
  39. MessageBox('提示', '打开方式有误(datastore)')
  40. Close(this)
  41. return
  42. end if
  43. long typeid
  44. if (Pos(ins_s.arg_colname, 'status') > 0) then
  45. this.Title = '配置选择'
  46. typeid = ins_s.arg_statustype
  47. elseif (Pos(ins_s.arg_colname, 'woodcode') > 0) then
  48. this.Title = '配置1选择'
  49. typeid = ins_s.arg_woodcodetype
  50. elseif (Pos(ins_s.arg_colname, 'pcode') > 0) then
  51. this.Title = '配置2选择'
  52. typeid = ins_s.arg_pcodetype
  53. end if
  54. environment exerun_env
  55. GetEnvironment(exerun_env)
  56. this.X = ins_s.arg_x + 100
  57. this.Y = ins_s.arg_y
  58. if THIS.X + this.width > PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - 100 then
  59. THIS.X = PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.width - 100
  60. end if
  61. if THIS.Y + this.height > PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - 350 then
  62. THIS.Y = PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - this.height - 350
  63. end if
  64. dw_1.SetRedraw(false)
  65. dw_1.DataObject = ins_s.arg_ds.DataObject
  66. if ins_s.arg_ds.RowCount() > 0 then dw_1.Object.Data = ins_s.arg_ds.Object.Data
  67. if (ins_s.arg_ds.DataObject = 'ds_fx_pztype_mx') then
  68. dw_1.SetFilter('typeid_erp = ' + string(typeid))
  69. dw_1.Filter()
  70. elseif (ins_s.arg_ds.DataObject = 'ds_fx_mtrl_configure') then
  71. dw_1.SetFilter('Mtrlid_erp = ' + string(ins_s.arg_mtrlid_erp))
  72. dw_1.Filter()
  73. elseif (ins_s.arg_ds.DataObject = 'ds_fx_configure_codemx') then
  74. end if
  75. dw_1.SetRedraw(true)
  76. ins_ret = ''
  77. end event
  78. event resize;dw_1.Width = this.workspacewidth( )
  79. dw_1.Height = this.workspaceheight( )
  80. end event
  81. event close;CloseWithReturn(this, ins_ret)
  82. end event
  83. event key;if keydown(KeyEscape!) then
  84. Close(this)
  85. end if
  86. end event
  87. type dw_1 from u_dw_rbtnfilter within w_pz_ch_fx
  88. event ue_mousemove pbm_dwnmousemove
  89. integer width = 1298
  90. integer height = 1268
  91. string dataobject = "ds_fx_color"
  92. boolean hscrollbar = true
  93. boolean vscrollbar = true
  94. boolean rbutton_setposition_use = true
  95. boolean titleclick_sort_use = true
  96. end type
  97. event ue_mousemove;IF row > 0 THEN
  98. THIS.SelectRow(0, FALSE)
  99. THIS.SelectRow(row, TRUE)
  100. END IF
  101. end event
  102. event clicked;call super::clicked;if (row <= 0) then return
  103. if (dw_1.DataObject = 'ds_fx_color') then
  104. ins_ret = Trim(dw_1.Object.colorname[row])
  105. elseif (dw_1.DataObject = 'ds_fx_color_wood') then
  106. ins_ret = Trim(dw_1.Object.woodcode[row])
  107. elseif (dw_1.DataObject = 'ds_fx_color_pcode') then
  108. ins_ret = Trim(dw_1.Object.pcode[row])
  109. elseif (dw_1.DataObject = 'ds_fx_pztype_mx') then
  110. ins_ret = Trim(dw_1.Object.dscrp[row])
  111. elseif (dw_1.DataObject = 'ds_fx_mtrl_configure') then
  112. ins_ret = Trim(dw_1.Object.name[row])
  113. elseif (dw_1.DataObject = 'ds_fx_configure_codemx') then
  114. ins_ret = Trim(dw_1.Object.namemx[row])
  115. end if
  116. Close(parent)
  117. end event
  118. event dwnkey;if keydown(KeyEscape!) then
  119. Close(parent)
  120. end if
  121. end event