CUIStyle.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /********************************************************************************************************************************
  2. * Licensed Materials - Property of IBM *
  3. * *
  4. * IBM Cognos Products: HTS *
  5. * *
  6. * (C) Copyright IBM Corp. 2005, 2010 *
  7. * *
  8. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *
  9. *********************************************************************************************************************************/
  10. /*-----------------------------------------------------------------------------------------------------
  11. Class : CStyle
  12. Description :
  13. -----------------------------------------------------------------------------------------------------*/
  14. function CUIStyle(normal, rollover, depressed, depressed_rollover, disabled) {
  15. this.m_active = normal;
  16. this.m_normal = normal;
  17. this.m_rollover = rollover;
  18. this.m_activeRollover = rollover;
  19. this.m_depressed = depressed;
  20. this.m_depressed_rollover = depressed_rollover;
  21. this.m_disabled = disabled;
  22. }
  23. function CUIStyle_getActiveState() {
  24. return this.m_active;
  25. }
  26. function CUIStyle_setActiveState(state) {
  27. switch(state) {
  28. case "normal":
  29. this.m_active = this.m_normal;
  30. break;
  31. case "depressed":
  32. this.m_active = this.m_depressed;
  33. break;
  34. case "disabled":
  35. this.m_active = this.m_disabled;
  36. break;
  37. default:
  38. this.m_active = this.m_normal;
  39. }
  40. }
  41. function CUIStyle_getActiveRolloverState() {
  42. return this.m_activeRollover;
  43. }
  44. function CUIStyle_setActiveRolloverState(state) {
  45. switch(state) {
  46. case "normal":
  47. this.m_activeRollover = this.m_rollover;
  48. break;
  49. case "depressed":
  50. this.m_activeRollover = this.m_depressed_rollover;
  51. break;
  52. case "disabled":
  53. this.m_activeRollover = this.m_disabled;
  54. break;
  55. default:
  56. this.m_activeRollover = this.m_rollover;
  57. }
  58. }
  59. function CUIStyle_getNormalState() {
  60. return this.m_normal;
  61. }
  62. function CUIStyle_getRolloverState() {
  63. return this.m_rollover;
  64. }
  65. function CUIStyle_getDepressedState() {
  66. return this.m_depressed;
  67. }
  68. function CUIStyle_getDepressedRolloverState() {
  69. return this.m_depressed_rollover;
  70. }
  71. function CUIStyle_getDisabledState() {
  72. return this.m_disabled;
  73. }
  74. function CUIStyle_setNormalState(state) {
  75. this.m_normal = state;
  76. }
  77. function CUIStyle_setRolloverState(state) {
  78. this.m_rollover = state;
  79. }
  80. function CUIStyle_setDepressedState(state) {
  81. this.m_depressed = state;
  82. }
  83. function CUIStyle_setDepressedRolloverState(state) {
  84. this.m_depressed_rollover = state;
  85. }
  86. function CUIStyle_setDisabledState(state) {
  87. this.m_disabled = state;
  88. }
  89. CUIStyle.prototype.getNormalState = CUIStyle_getNormalState;
  90. CUIStyle.prototype.getRolloverState = CUIStyle_getRolloverState;
  91. CUIStyle.prototype.getDepressedState = CUIStyle_getDepressedState;
  92. CUIStyle.prototype.getDepressedRolloverState = CUIStyle_getDepressedRolloverState;
  93. CUIStyle.prototype.getDisabledState = CUIStyle_getDisabledState;
  94. CUIStyle.prototype.setNormalState = CUIStyle_setNormalState;
  95. CUIStyle.prototype.setRolloverState = CUIStyle_setRolloverState;
  96. CUIStyle.prototype.setDepressedState = CUIStyle_setDepressedState;
  97. CUIStyle.prototype.setDepressedRolloverState = CUIStyle_setDepressedRolloverState;
  98. CUIStyle.prototype.setDisabledState = CUIStyle_setDisabledState;
  99. CUIStyle.prototype.setActiveState = CUIStyle_setActiveState;
  100. CUIStyle.prototype.getActiveState = CUIStyle_getActiveState;
  101. CUIStyle.prototype.getActiveRolloverState = CUIStyle_getActiveRolloverState;
  102. CUIStyle.prototype.setActiveRolloverState = CUIStyle_setActiveRolloverState;