w_publ_base.srw 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. $PBExportHeader$w_publ_base.srw
  2. forward
  3. global type w_publ_base from window
  4. end type
  5. type cb_func from uo_imflatbutton within w_publ_base
  6. end type
  7. type cb_exit from uo_imflatbutton within w_publ_base
  8. end type
  9. end forward
  10. global type w_publ_base from window
  11. integer x = 713
  12. integer y = 388
  13. integer width = 2007
  14. integer height = 1144
  15. boolean titlebar = true
  16. string title = "BASE"
  17. boolean controlmenu = true
  18. boolean minbox = true
  19. windowtype windowtype = popup!
  20. long backcolor = 134217739
  21. event ue_before_open ( )
  22. event ue_retr ( )
  23. event ue_filter ( )
  24. event ue_sentdataout ( )
  25. event ue_sort ( )
  26. cb_func cb_func
  27. cb_exit cb_exit
  28. end type
  29. global w_publ_base w_publ_base
  30. type prototypes
  31. subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
  32. end prototypes
  33. type variables
  34. Boolean dw_edit_mode = FALSE
  35. Boolean if_modify_mode = FALSE //修改模式
  36. Boolean if_ue_retr = FALSE
  37. Boolean if_ue_filter = FALSE
  38. Boolean if_ue_sort = FALSE
  39. Boolean if_ue_sentdataout = FALSE
  40. Long printnum
  41. end variables
  42. forward prototypes
  43. public function integer wf_movetocenter ()
  44. end prototypes
  45. public function integer wf_movetocenter ();//wf_movetocenter
  46. //environment exerun_env
  47. //GetEnvironment(exerun_env )
  48. //this.Move ( (PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.Width)/2,&
  49. // (PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - this.Height - 350 )/2) //
  50. ////this.Move ( (exerun_env.screenwidth*4.62 - this.Width)/2, (exerun_env.screenheight*3.87 - this.Height)/2)
  51. //return 0
  52. // 读取窗口位置信息
  53. if (this.WindowType = Response!) then return 0
  54. Environment env
  55. GetEnvironment(env)
  56. long xparm, yparm, widthparm, heightparm, ifMax
  57. ifMax = ProfileInt(sys_fx_positon, this.ClassName(), 'ifmax', 0)
  58. xparm = ProfileInt(sys_fx_positon, this.ClassName(), 'x', 0)
  59. yparm = ProfileInt(sys_fx_positon, this.ClassName(), 'y', 0)
  60. widthparm = ProfileInt(sys_fx_positon, this.ClassName(), 'width', 0)
  61. heightparm = ProfileInt(sys_fx_positon, this.ClassName(), 'height', 0)
  62. if (ifMax = 1) then
  63. this.WindowState = Maximized!
  64. elseif (widthparm > 0 and heightparm > 0) then
  65. if (xparm <= 0) then xparm = 0
  66. if (yparm <= 0) then yparm = 0
  67. if (xparm + widthparm > PixelsToUnits(env.screenwidth, XPixelsToUnits!)) then xparm = (PixelsToUnits(env.screenwidth, XPixelsToUnits!) - widthparm) / 2
  68. if (yparm + heightparm > PixelsToUnits(env.screenheight, YPixelsToUnits!)) then yparm = (PixelsToUnits(env.screenheight, YPixelsToUnits!) - heightparm - 176) / 2
  69. this.Move(xparm, yparm)
  70. this.Width = widthparm
  71. this.Height = heightparm
  72. else
  73. this.Move ( (PixelsToUnits(env.screenwidth, XPixelsToUnits!) - this.workspacewidth()) / 2,&
  74. (PixelsToUnits(env.screenheight, YPixelsToUnits!) - this.workspaceheight() - 176) / 2)
  75. end if
  76. return 0
  77. end function
  78. event open;this.triggerevent('ue_before_open')
  79. wf_movetocenter()
  80. //====================================================================
  81. //菜单打开
  82. //if_ue_retr=false
  83. //if_ue_filter=false
  84. //if_ue_sort=false
  85. //if_ue_sentdataout=false
  86. //====================================================================
  87. end event
  88. on w_publ_base.create
  89. this.cb_func=create cb_func
  90. this.cb_exit=create cb_exit
  91. this.Control[]={this.cb_func,&
  92. this.cb_exit}
  93. end on
  94. on w_publ_base.destroy
  95. destroy(this.cb_func)
  96. destroy(this.cb_exit)
  97. end on
  98. event close;// 记录浮动窗口信息
  99. long xparm, yparm, widthparm, heightparm, ifMax
  100. if (this.WindowState = Maximized!) then
  101. ifMax = 1
  102. SetProfileString (sys_fx_positon, this.ClassName(), 'ifmax', string(ifMax))
  103. else
  104. ifMax = 0
  105. xparm = this.X
  106. yparm = this.Y
  107. widthparm = this.Width
  108. heightparm = this.Height
  109. SetProfileString (sys_fx_positon, this.ClassName(), 'ifmax', string(ifMax))
  110. SetProfileString (sys_fx_positon, this.ClassName(), 'x', string(xparm))
  111. SetProfileString (sys_fx_positon, this.ClassName(), 'y', string(yparm))
  112. SetProfileString (sys_fx_positon, this.ClassName(), 'width', string(widthparm))
  113. SetProfileString (sys_fx_positon, this.ClassName(), 'height', string(heightparm))
  114. end if
  115. end event
  116. type cb_func from uo_imflatbutton within w_publ_base
  117. event ue_retr ( )
  118. event ue_filter ( )
  119. event ue_sort ( )
  120. event ue_sentdataout ( )
  121. integer width = 311
  122. integer height = 96
  123. integer taborder = 20
  124. string text = "功能"
  125. end type
  126. event ue_retr();parent.triggerevent('ue_retr')
  127. end event
  128. event ue_filter();parent.triggerevent('ue_filter')
  129. end event
  130. event ue_sort();parent.triggerevent('ue_sort')
  131. end event
  132. event ue_sentdataout();parent.triggerevent('ue_sentdataout')
  133. end event
  134. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  135. string menustr
  136. if if_ue_retr then
  137. menustr="Text=查询~tEvent=ue_retr"
  138. end if
  139. if if_ue_filter then
  140. if len(trim(menustr))=0 then
  141. menustr="Text=高级筛选~tEvent=ue_filter"
  142. else
  143. menustr=menustr + "|" + "Text=高级筛选~tEvent=ue_filter"
  144. end if
  145. end if
  146. if if_ue_sort then
  147. if len(trim(menustr))=0 then
  148. menustr="Text=排序~tEvent=ue_sort"
  149. else
  150. menustr=menustr + "|" + "Text=排序~tEvent=ue_sort"
  151. end if
  152. end if
  153. if menustr<>"" and if_ue_sentdataout then menustr=menustr + "|" + "Text=-"
  154. if if_ue_sentdataout then
  155. if len(trim(menustr))=0 then
  156. menustr="Text=数据发送~tEvent=ue_sentdataout"
  157. else
  158. menustr=menustr + "|" + "Text=数据发送~tEvent=ue_sentdataout"
  159. end if
  160. end if
  161. if len(trim(menustr))<>0 then
  162. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  163. dmPopupMenu.mf_BuildMenu(This, menustr)
  164. dmPopupMenu.mf_PopMenu()
  165. Destroy dmPopupMenu
  166. end if
  167. end event
  168. type cb_exit from uo_imflatbutton within w_publ_base
  169. integer x = 315
  170. integer width = 311
  171. integer height = 96
  172. integer taborder = 10
  173. string text = "退出"
  174. boolean cancel = true
  175. string normalpicname = "exit.bmp"
  176. end type
  177. event clicked;call super::clicked;close(parent)
  178. end event