CUIStyle.js 3.4 KB

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