n_dw2xls_resource.sru 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. $PBExportHeader$n_dw2xls_resource.sru
  2. forward
  3. global type n_dw2xls_resource from nonvisualobject
  4. end type
  5. end forward
  6. global type n_dw2xls_resource from nonvisualobject
  7. end type
  8. global n_dw2xls_resource n_dw2xls_resource
  9. type prototypes
  10. function Long GetSystemDefaultLCID() library "kernel32"
  11. end prototypes
  12. type variables
  13. //语言代码包
  14. String Language
  15. String FontName
  16. String PicFileName="Res\dw2xls_File.png"
  17. String OK
  18. String Cancel
  19. String Warning
  20. String Tips
  21. String WorkInProcessing
  22. String FileExists
  23. String FileWriteError
  24. String OpenFileConfirm
  25. String RunExcelAppError
  26. String CancelQuestion
  27. String Hour
  28. String Hours
  29. String Minute
  30. String Minutes
  31. String Second
  32. String Seconds
  33. String RemainTimes
  34. constant long LANG_CHINESE_SIMPLIFIED =2052 //0x804 中国大陆
  35. constant long LANG_CHINESE_TRADITIONAL = 1028 //0x404 台湾
  36. constant long LANG_CHINESE = 3076 //0xC04 香港
  37. end variables
  38. forward prototypes
  39. public function string of_format (readonly string as_str, readonly string as_parm)
  40. public subroutine of_setlanguage (readonly string as_language)
  41. end prototypes
  42. public function string of_format (readonly string as_str, readonly string as_parm);Int li_Pos1, li_Pos2
  43. String ls_Result
  44. li_Pos1 = Pos(as_str,"{")
  45. li_Pos2 = Pos(as_str, "}" ,li_Pos1+1 )
  46. IF li_Pos1>0 AND li_Pos2>0 Then
  47. ls_Result =Left( as_str ,li_Pos1 -1)+ as_Parm+Mid(as_str, li_Pos2+1)
  48. ELSE
  49. ls_Result = as_str
  50. END IF
  51. Return ls_Result
  52. end function
  53. public subroutine of_setlanguage (readonly string as_language);Language= Upper(Trim(as_language ))
  54. //根据当前操作系统,自动选择合适的语言
  55. IF Language="" Then
  56. Choose Case GetSystemDefaultLCID()
  57. Case LANG_CHINESE_SIMPLIFIED
  58. Language="CN"
  59. Case LANG_CHINESE_TRADITIONAL, LANG_CHINESE
  60. Language="BIG5"
  61. Case Else
  62. Language="EN"
  63. END CHOOSE
  64. END IF
  65. Choose Case Language
  66. Case 'EN'
  67. FontName='Arial'
  68. OK ="OK"
  69. Cancel ="Cancel"
  70. Tips ="Tips"
  71. Warning="warning"
  72. WorkInProcessing ="Work in processing ....."
  73. FileExists= "The file {1} already exists,~r~nDo you wish to overwrite it?"
  74. FileWriteError = "Could not create file {1}.~r~nPlease verify that the correct path and file name!"
  75. OpenFileConfirm="The file {1} generated success!~r~nDo you want to open it?"
  76. RunExcelAppError= "Unable to run the microsoft excel application!"
  77. CancelQuestion="Do you want to cancel generate file?"
  78. Hour ="Hour"
  79. Hours="Hours"
  80. Minute="Minute"
  81. Minutes="Minutes"
  82. Second="Second"
  83. Seconds="Seconds"
  84. RemainTimes ="Remaining times: "
  85. CASE 'BIG5'
  86. FontName='細明體'
  87. OK ="確認"
  88. Cancel ="取消"
  89. Tips ="提示"
  90. Warning="警告"
  91. WorkInProcessing ="正在生成Excel文件,請稍侯..... "
  92. FileExists="文件 {1} 已經存在,是否繼續? "
  93. FileWriteError ="文件路徑{1} 不能寫入數據,請檢查文件路徑是否有效!"
  94. OpenFileConfirm="文件已成功生成到{1},~r~n你是否需要現在就打開這個文件?"
  95. RunExcelAppError="不能運行Excel程序,請檢查是否已安裝Microsoft Excel軟件!"
  96. CancelQuestion ="是否取消生成Excel文件?"
  97. Hour ="小時"
  98. Hours="小時"
  99. Minute="分鐘"
  100. Minutes="分鐘"
  101. Second="秒"
  102. Seconds="秒"
  103. RemainTimes ="大約還需要: "
  104. Case Else
  105. FontName='宋体'
  106. OK ="确定"
  107. Cancel ="取消"
  108. Tips ="提示"
  109. Warning="警告"
  110. WorkInProcessing ="正在生成Excel文件,请稍侯..... "
  111. FileExists="文件 {1} 已经存在,是否继续? "
  112. FileWriteError ="文件路径 {1} 不能写入数据,请检查文件路径是否有效!"
  113. OpenFileConfirm="文件已成功生成到 {1},~r~n你是否需要现在就打开这个文件?"
  114. RunExcelAppError="不能运行Excel程序,请检查是否已安装Microsoft Excel软件!"
  115. CancelQuestion="是否取消生成Excel文件?"
  116. Hour ="小时"
  117. Hours="小时"
  118. Minute="分钟"
  119. Minutes="分钟"
  120. Second="秒"
  121. Seconds="秒"
  122. RemainTimes ="大约还需要"
  123. END CHOOSE
  124. end subroutine
  125. on n_dw2xls_resource.create
  126. call super::create
  127. TriggerEvent( this, "constructor" )
  128. end on
  129. on n_dw2xls_resource.destroy
  130. TriggerEvent( this, "destructor" )
  131. call super::destroy
  132. end on
  133. event constructor;Double ld_Ver
  134. environment lenv_current
  135. GetEnvironment(lenv_current)
  136. ld_Ver =lenv_current.PBMajorRevision
  137. IF lenv_current.PBMinorRevision=5 Then
  138. ld_Ver =ld_Ver +0.5
  139. END IF
  140. IF ld_Ver>=11.5 Then //11.5版本才支持png格式的图片文件
  141. PicFileName="Res\dw2xls_File.png"
  142. ELSE
  143. PicFileName="Res\dw2xls_File.bmp"
  144. END IF
  145. end event