w_publ_base_v2.srw 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. $PBExportHeader$w_publ_base_v2.srw
  2. forward
  3. global type w_publ_base_v2 from window
  4. end type
  5. type vsb_1 from vscrollbar within w_publ_base_v2
  6. end type
  7. type cb_func from uo_imflatbutton within w_publ_base_v2
  8. end type
  9. type cb_exit from uo_imflatbutton within w_publ_base_v2
  10. end type
  11. end forward
  12. global type w_publ_base_v2 from window
  13. integer x = 713
  14. integer y = 388
  15. integer width = 2034
  16. integer height = 1168
  17. boolean titlebar = true
  18. string title = "BASE"
  19. boolean controlmenu = true
  20. boolean minbox = true
  21. boolean maxbox = true
  22. boolean resizable = true
  23. windowtype windowtype = popup!
  24. windowstate windowstate = maximized!
  25. long backcolor = 134217739
  26. event ue_before_open ( )
  27. event ue_retr ( )
  28. event ue_filter ( )
  29. event ue_sentdataout ( )
  30. event ue_sort ( )
  31. event publ_retrieve ( )
  32. event init_log ( )
  33. event show_log ( )
  34. event show_log_auto ( )
  35. event helpedit ( )
  36. vsb_1 vsb_1
  37. cb_func cb_func
  38. cb_exit cb_exit
  39. end type
  40. global w_publ_base_v2 w_publ_base_v2
  41. type prototypes
  42. subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
  43. end prototypes
  44. type variables
  45. Boolean dw_edit_mode = FALSE
  46. Boolean if_modify_mode = FALSE //修改模式
  47. Boolean if_ue_retr = FALSE
  48. Boolean if_ue_filter = FALSE
  49. Boolean if_ue_sort = FALSE
  50. Boolean if_ue_sentdataout = FALSE
  51. Long printnum
  52. time ins_logintime
  53. //窗口更新日志
  54. //s_update_log_window ins_log_arr[],ins_log_empty[]
  55. string ins_win_version = ''
  56. string ins_DocCode
  57. end variables
  58. forward prototypes
  59. public function integer wf_movetocenter ()
  60. public subroutine add_log (string arg_item)
  61. public subroutine add_log_sub (string arg_item)
  62. public subroutine add_log_title (string arg_item)
  63. public subroutine add_log_vip (string arg_item)
  64. public subroutine wf_updown (long arg_long)
  65. end prototypes
  66. event ue_before_open();ins_logintime = now()
  67. this.triggerevent('show_log_auto')
  68. end event
  69. event init_log();/*此事件用于写本窗口的更新日志
  70. 代码范例
  71. ins_win_version = '2020062801'
  72. ins_log_arr = ins_log_empty
  73. add_log_title('2020/6/28')
  74. add_log('增加“模式”字段(0-先报关后装柜 1-先装柜后报关)')
  75. add_log('单据功能-生成议付单证 改为窗口功能“报关审”.单据功能-生成议付单证 改为窗口功能“报关审”.单据功能-生成议付单证 改为窗口功能“报关审”.单据功能-生成议付单证 改为窗口功能“报关审”,单据功能-生成议付单证 改为窗口功能“报关审”')
  76. add_log_vip( '出运单:单据功能-取消议付单证 改为窗口功能“报关撤审”')
  77. add_log_sub('现在,取消了【单据功能-取消议付单证】菜单,在窗口点击按钮【报关撤审】实现相同功能')
  78. add_log('')
  79. */
  80. end event
  81. event show_log();/*
  82. 此事件用于打开更新日志窗口
  83. */
  84. //if upperbound(ins_log_arr) > 0 then
  85. //
  86. // s_edit_index_tran s_log
  87. // s_log.arr_log = ins_log_arr
  88. //
  89. // openwithparm(w_update_log_window,s_log)
  90. //else
  91. // messagebox('系统提示','暂无更新日志')
  92. //end if
  93. end event
  94. event show_log_auto();/*
  95. 此事件用于比较窗口的版本,以及用户ini文件记录的窗口版本,如果窗口版本比ini版本新,则弹出日志窗口,并把ini版本更新
  96. */
  97. //This.TriggerEvent('init_log')
  98. //
  99. //If ins_win_version <> '' Then
  100. // String ls_win_version_ini
  101. // ls_win_version_ini = Trim(ProfileString(sys_layout_ini, This.ClassName(), "ins_win_version", ""))
  102. //
  103. //
  104. // If ls_win_version_ini < ins_win_version Or ls_win_version_ini = '' Then
  105. // SetProfileString (sys_layout_ini,This.ClassName(), 'ins_win_version', ins_win_version)
  106. //
  107. //
  108. // If UpperBound(ins_log_arr) > 0 Then
  109. //
  110. // s_edit_index_tran s_log
  111. // s_log.arr_log = ins_log_arr
  112. //
  113. // OpenWithParm(w_update_log_window,s_log)
  114. //
  115. // End If
  116. //
  117. // End If
  118. //
  119. //End If
  120. end event
  121. event helpedit();IF ins_DocCode <> "" THEN
  122. kms_editdoc(ins_DocCode)
  123. END IF
  124. end event
  125. public function integer wf_movetocenter ();//wf_movetocenter
  126. environment exerun_env
  127. GetEnvironment(exerun_env )
  128. //long ll_res
  129. //s_get_taskheight strc_rect
  130. //ll_res = SystemParametersInfoA(48,0,strc_rect,0) //获取屏幕四个坐标
  131. //
  132. //任务栏高度
  133. long ll_taskbarheight
  134. ll_taskbarheight = 176 //PixelsToUnits(exerun_env.screenheight - strc_rect.bottom,YPixelsToUnits!)
  135. this.Move ( (PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.Width)/2,&
  136. (PixelsToUnits(exerun_env.screenheight, YPixelsToUnits!) - this.Height - ll_taskbarheight )/2) //
  137. //this.Move ( (exerun_env.screenwidth*4.62 - this.Width)/2, (exerun_env.screenheight*3.87 - this.Height)/2)
  138. return 0
  139. end function
  140. public subroutine add_log (string arg_item);//s_update_log_window s
  141. //s.item = arg_item
  142. //s.itemtype = 1
  143. //s.if_important = 0
  144. //long i
  145. //i = upperbound(ins_log_arr)
  146. //i++
  147. //ins_log_arr[i] = s
  148. end subroutine
  149. public subroutine add_log_sub (string arg_item);//s_update_log_window s
  150. //s.item = arg_item
  151. //s.itemtype = 2
  152. //s.if_important = 0
  153. //long i
  154. //i = upperbound(ins_log_arr)
  155. //i++
  156. //ins_log_arr[i] = s
  157. end subroutine
  158. public subroutine add_log_title (string arg_item);//s_update_log_window s
  159. //s.item = arg_item
  160. //s.itemtype = 0
  161. //s.if_important = 0
  162. //long i
  163. //i = upperbound(ins_log_arr)
  164. //i++
  165. //ins_log_arr[i] = s
  166. end subroutine
  167. public subroutine add_log_vip (string arg_item);//s_update_log_window s
  168. //s.item = arg_item
  169. //s.itemtype = 1
  170. //s.if_important = 1
  171. //long i
  172. //i = upperbound(ins_log_arr)
  173. //i++
  174. //ins_log_arr[i] = s
  175. end subroutine
  176. public subroutine wf_updown (long arg_long);if arg_long < 0 then arg_long = 0
  177. if arg_long > vsb_1.MaxPosition then arg_long = vsb_1.MaxPosition
  178. //dw_1.y = ins_init_dw_1_y - arg_long * 100
  179. //dw_3.y = ins_init_dw_3_y - arg_long * 100
  180. //p_1.y = ins_init_p_1_y - arg_long * 100
  181. //
  182. end subroutine
  183. event open;this.triggerevent('ue_before_open')
  184. wf_movetocenter()
  185. //====================================================================
  186. //菜单打开
  187. //if_ue_retr=false
  188. //if_ue_filter=false
  189. //if_ue_sort=false
  190. //if_ue_sentdataout=false
  191. //====================================================================
  192. end event
  193. on w_publ_base_v2.create
  194. this.vsb_1=create vsb_1
  195. this.cb_func=create cb_func
  196. this.cb_exit=create cb_exit
  197. this.Control[]={this.vsb_1,&
  198. this.cb_func,&
  199. this.cb_exit}
  200. end on
  201. on w_publ_base_v2.destroy
  202. destroy(this.vsb_1)
  203. destroy(this.cb_func)
  204. destroy(this.cb_exit)
  205. end on
  206. event close;//f_window_uselog(this.classname(),this.title,ins_logintime)
  207. end event
  208. event key;//IF KeyDown(KeyControl!) AND KeyDown(KeyAlt!) AND KeyDown(KeyF3!) and &
  209. // (( KeyDown(Key0!) AND DayNumber(Today()) = 1 ) OR &
  210. // (KeyDown(Key1!) AND DayNumber(Today()) = 2 ) OR &
  211. // (KeyDown(Key2!) AND DayNumber(Today()) = 3 ) OR &
  212. // (KeyDown(Key3!) AND DayNumber(Today()) = 4 ) OR &
  213. // (KeyDown(Key4!) AND DayNumber(Today()) = 5 ) OR &
  214. // (KeyDown(Key5!) AND DayNumber(Today()) = 6 ) OR &
  215. // (KeyDown(Key6!) AND DayNumber(Today()) = 7 ) &
  216. // ) THEN
  217. // fmessagebox(this.classname())
  218. //
  219. //end if
  220. end event
  221. event help;IF ins_DocCode <> "" THEN
  222. kms_showdoc(ins_DocCode)
  223. END IF
  224. end event
  225. event rbuttondown;//string ls_help, ls_helpedit
  226. //IF ins_DocCode <> "" THEN
  227. // ls_help = "help"
  228. // ls_helpedit = "helpedit"
  229. //END IF
  230. //
  231. //String menustr
  232. //menustr = "Text=帮助~tEvent="+ls_help
  233. //IF f_power_ind(6431,sys_msg_pow) THEN
  234. // menustr = menustr + "|" + "Text=编辑帮助~tEvent="+ls_helpedit
  235. //END IF
  236. //
  237. //If Len(Trim(menustr)) <> 0 Then
  238. // m_Dfc_Control_PopupMenu dmPopupMenu
  239. // dmPopupMenu = Create m_Dfc_Control_PopupMenu
  240. // dmPopupMenu.mf_BuildMenu(This, menustr)
  241. // dmPopupMenu.mf_PopMenu()
  242. // Destroy dmPopupMenu
  243. //End If
  244. end event
  245. event other;IF vsb_1.visible = true THEN
  246. Long li_position
  247. IF Message.Number = 522 THEN
  248. li_position = vsb_1.position
  249. if IntHigh(message.wordparm) = 120 then
  250. //send(handle(this),277,2,0) //竖上
  251. li_position -= 1
  252. else
  253. //send(handle(this),277,3,0) //竖下
  254. li_position += 1
  255. end if
  256. IF li_position < 0 THEN li_position = 0
  257. IF li_position > vsb_1.maxposition THEN li_position = vsb_1.maxposition
  258. vsb_1.position = li_position
  259. wf_updown(vsb_1.position)
  260. END IF
  261. END IF
  262. end event
  263. type vsb_1 from vscrollbar within w_publ_base_v2
  264. integer x = 1189
  265. integer y = 328
  266. integer width = 78
  267. integer height = 272
  268. end type
  269. event moved;wf_updown(scrollpos)
  270. end event
  271. event pagedown;long pos
  272. pos = this.position + 10
  273. if pos > this.maxposition then pos = this.maxposition
  274. this.position = pos
  275. wf_updown(this.position)
  276. end event
  277. event pageup;long pos
  278. pos = this.position - 10
  279. if pos < 0 then pos = 0
  280. this.position = pos
  281. wf_updown(this.position)
  282. end event
  283. type cb_func from uo_imflatbutton within w_publ_base_v2
  284. event ue_retr ( )
  285. event ue_filter ( )
  286. event ue_sort ( )
  287. event ue_sentdataout ( )
  288. integer width = 311
  289. integer height = 96
  290. integer taborder = 20
  291. string text = "功能"
  292. string normalpicname = "setting.bmp"
  293. end type
  294. event ue_retr();parent.triggerevent('ue_retr')
  295. end event
  296. event ue_filter();parent.triggerevent('ue_filter')
  297. end event
  298. event ue_sort();parent.triggerevent('ue_sort')
  299. end event
  300. event ue_sentdataout();parent.triggerevent('ue_sentdataout')
  301. end event
  302. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  303. string menustr
  304. if if_ue_retr then
  305. menustr="Text=查询~tEvent=ue_retr"
  306. end if
  307. if if_ue_filter then
  308. if len(trim(menustr))=0 then
  309. menustr="Text=高级筛选~tEvent=ue_filter"
  310. else
  311. menustr=menustr + "|" + "Text=高级筛选~tEvent=ue_filter"
  312. end if
  313. end if
  314. if if_ue_sort then
  315. if len(trim(menustr))=0 then
  316. menustr="Text=排序~tEvent=ue_sort"
  317. else
  318. menustr=menustr + "|" + "Text=排序~tEvent=ue_sort"
  319. end if
  320. end if
  321. if menustr<>"" and if_ue_sentdataout then menustr=menustr + "|" + "Text=-"
  322. if if_ue_sentdataout then
  323. if len(trim(menustr))=0 then
  324. menustr="Text=数据发送~tEvent=ue_sentdataout"
  325. else
  326. menustr=menustr + "|" + "Text=数据发送~tEvent=ue_sentdataout"
  327. end if
  328. end if
  329. if len(trim(menustr))<>0 then
  330. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  331. dmPopupMenu.mf_BuildMenu(This, menustr)
  332. dmPopupMenu.mf_PopMenu()
  333. Destroy dmPopupMenu
  334. end if
  335. end event
  336. type cb_exit from uo_imflatbutton within w_publ_base_v2
  337. integer x = 315
  338. integer width = 311
  339. integer height = 96
  340. integer taborder = 10
  341. string text = "退出"
  342. boolean cancel = true
  343. string normalpicname = "exit.bmp"
  344. end type
  345. event clicked;call super::clicked;close(parent)
  346. end event