uo_aifmb_tab.sru 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. $PBExportHeader$uo_aifmb_tab.sru
  2. forward
  3. global type uo_aifmb_tab from tab
  4. end type
  5. end forward
  6. global type uo_aifmb_tab from tab
  7. integer width = 1490
  8. integer height = 980
  9. integer textsize = -9
  10. integer weight = 400
  11. fontcharset fontcharset = gb2312charset!
  12. fontpitch fontpitch = variable!
  13. string facename = "宋体"
  14. long backcolor = 67108864
  15. boolean raggedright = true
  16. boolean focusonbuttondown = true
  17. integer selectedtab = 1
  18. end type
  19. global uo_aifmb_tab uo_aifmb_tab
  20. type prototypes
  21. Function Long SetParent(Long hWndChild,Long hWndNewParent) Library "User32.dll"
  22. end prototypes
  23. forward prototypes
  24. public subroutine wf_setdatasource (datastore arg_ds)
  25. public subroutine wf_opentab (string chname, string winname)
  26. public subroutine wf_reset ()
  27. end prototypes
  28. public subroutine wf_setdatasource (datastore arg_ds);Long i
  29. String ls_chname, ls_winname
  30. uo_aifmb_tabpage tabpage
  31. wf_reset()
  32. FOR i = 1 To arg_ds.RowCount()
  33. IF arg_ds.Object.ifshow[i] <> 1 THEN CONTINUE
  34. ls_chname = arg_ds.Object.chname[i]
  35. ls_winname = arg_ds.Object.winname[i]
  36. OpenTab(tabpage, 0)
  37. tabpage.Text = ls_chname
  38. tabpage.winname = ls_winname
  39. NEXT
  40. end subroutine
  41. public subroutine wf_opentab (string chname, string winname);Long i
  42. uo_aifmb_tabpage tabpage
  43. FOR i = 1 To UpperBound(Control)
  44. IF Lower(ClassName(Control[i])) = 'uo_aifmb_tabpage' THEN
  45. tabpage = Control[i]
  46. IF Lower(tabpage.winname) = Lower(winname) THEN
  47. EXIT
  48. END IF
  49. END IF
  50. NEXT
  51. IF i >= 1 And i <= UpperBound(Control) THEN
  52. SelectTab(tabpage)
  53. ELSE
  54. OpenTab(tabpage, 0)
  55. tabpage.Text = chname
  56. tabpage.winname = winname
  57. SelectTab(tabpage)
  58. END IF
  59. end subroutine
  60. public subroutine wf_reset ();Long i
  61. userobject ctrls[]
  62. ctrls = Control
  63. FOR i = 1 To UpperBound(ctrls)
  64. CloseTab(ctrls[i])
  65. NEXT
  66. end subroutine
  67. event selectionchanged;uo_aifmb_tabpage tabpage
  68. tabpage = Control[newindex]
  69. IF Not IsValid(tabpage.win) THEN
  70. Open(tabpage.win, tabpage.winname)
  71. setparent(Handle(tabpage.win), Handle(tabpage))
  72. END IF
  73. tabpage.triggerevent('resize')
  74. end event