ListContents.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. //
  20. // ListContents.H
  21. //
  22. // History:
  23. // 01/21/97 JMI Started.
  24. //
  25. // 02/05/97 JMI Added override for OnLoseChild() to pass it on to
  26. // parent, if it is an RListBox.
  27. //
  28. //////////////////////////////////////////////////////////////////////////////
  29. //
  30. // This is a very simple class designed to be used as a container specifically
  31. // for use with an RListBox.
  32. //
  33. //////////////////////////////////////////////////////////////////////////////
  34. #ifndef LISTCONTENTS_H
  35. #define LISTCONTENTS_H
  36. //////////////////////////////////////////////////////////////////////////////
  37. // Please see the CPP file for an explanation of this API.
  38. //////////////////////////////////////////////////////////////////////////////
  39. //////////////////////////////////////////////////////////////////////////////
  40. // Headers.
  41. //////////////////////////////////////////////////////////////////////////////
  42. #include "System.h"
  43. // If PATHS_IN_INCLUDES macro is defined, we can utilized relative
  44. // paths to a header file. In this case we generally go off of our
  45. // RSPiX root directory. System.h MUST be included before this macro
  46. // is evaluated. System.h is the header that, based on the current
  47. // platform (or more so in this case on the compiler), defines
  48. // PATHS_IN_INCLUDES. Blue.h includes system.h so you can include that
  49. // instead.
  50. #ifdef PATHS_IN_INCLUDES
  51. #include "ORANGE/GUI/Frame.h"
  52. #else
  53. #include "frame.h"
  54. #endif // PATHS_IN_INCLUDES
  55. //////////////////////////////////////////////////////////////////////////////
  56. // Macros.
  57. //////////////////////////////////////////////////////////////////////////////
  58. //////////////////////////////////////////////////////////////////////////////
  59. // Typedefs.
  60. //////////////////////////////////////////////////////////////////////////////
  61. //////////////////////////////////////////////////////////////////////////////
  62. class RListContents : public RFrame
  63. {
  64. public: // Construction/Destruction.
  65. // Default constructor.
  66. RListContents(void)
  67. {
  68. }
  69. // Destructor.
  70. ~RListContents(void)
  71. {
  72. }
  73. //////////////////////////////////////////////////////////////////////////////
  74. public: // Methods.
  75. ////////////////////////////////////////////////////////////////////////
  76. // Methods.
  77. ////////////////////////////////////////////////////////////////////////
  78. // Called by SetParent() when a GUI is losing a child item.
  79. virtual // Overridden here.
  80. void OnLoseChild( // Returns nothing.
  81. RGuiItem* pguiChild) // Child item we're about to lose.
  82. {
  83. // Let parent (RListBox know).
  84. RGuiItem* pguiParent = GetParent();
  85. // If there is a parent (safety) . . .
  86. if (pguiParent != NULL)
  87. {
  88. // If it is a listbox (should be) . . .
  89. if (pguiParent->m_type == ListBox)
  90. {
  91. pguiParent->OnLoseChild(pguiChild);
  92. }
  93. }
  94. }
  95. ////////////////////////////////////////////////////////////////////////
  96. // Querries.
  97. ////////////////////////////////////////////////////////////////////////
  98. //////////////////////////////////////////////////////////////////////////////
  99. public: // Static
  100. //////////////////////////////////////////////////////////////////////////////
  101. public: // Querries.
  102. //////////////////////////////////////////////////////////////////////////////
  103. protected: // Internal functions.
  104. // Save item's children to the specified file.
  105. virtual // Overridden here.
  106. short SaveChildren( // Returns 0 on success.
  107. RFile* pfile); // File to save to.
  108. // Load item's children from the specified file.
  109. virtual // Overridden here.
  110. short LoadChildren( // Returns 0 on success.
  111. RFile* pfile); // File to load from.
  112. //////////////////////////////////////////////////////////////////////////////
  113. public: // Member variables.
  114. protected: // Internal typedefs.
  115. protected: // Protected member variables.
  116. };
  117. #endif // LISTCONTENTS_H
  118. //////////////////////////////////////////////////////////////////////////////
  119. // EOF
  120. //////////////////////////////////////////////////////////////////////////////