home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / Multi-Panel Dialogs 1.1 / MPD Sources / CMPDAGAIndexTab.cp next >
Encoding:
Text File  |  1996-11-14  |  4.0 KB  |  102 lines  |  [TEXT/R*ch]

  1. // ===========================================================================
  2. //    File:                        CMPDAGAIndexTab.cp
  3. // Version:                    1.0 - Aug 19, 1996
  4. //    Author:                    Mike Shields (mshields@inconnect.com)
  5. //                            
  6. //    Copyright ©1996 Mike Shields. All rights reserved.
  7. //    I hereby grant users of CMPDAGAIndexTab permission to use it (or any modified 
  8. //    version of it) in applications (or any other type of Macintosh software 
  9. //    like extensions -- freeware, shareware, commercial, or other) for free, 
  10. //    subject to the terms that:
  11. //
  12. //        (1)  This agreement is non-exclusive.
  13. //
  14. //        (2)  I, Mike Shields, retain the copyright to the original source code.
  15. //
  16. //    These two items are the only required conditions for use. However, I do have 
  17. //    an additional request. Note, however, that this is only a request, and 
  18. //    that it is not a required condition for use of this code.
  19. //
  20. //        (1) That I be given credit for CMPDAGAIndexTab code in the copyrights or 
  21. //            acknowledgements section of your manual or other appropriate documentation.
  22. //
  23. //
  24. //    I would like to repeat that this last item is only a request. You are prefectly 
  25. //    free to choose not to do any or all of them.
  26. //    
  27. //        This source code is distributed in the hope that it will be useful,
  28. //        but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. //        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  30. // ===========================================================================
  31. //    CMPDAGAIndexTab.h        <- double-click + Command-D to see class declaration
  32. //
  33. // A subclass of LAGAIndexTab which has been adapted to work with the MPD classes.
  34.  
  35. #include "CMPDAGAIndexTab.h"
  36.  
  37. //----------------------------------------------------------------------------------------
  38. // CMPDAGAIndexTab::CreateFromStream
  39. //----------------------------------------------------------------------------------------
  40. CMPDAGAIndexTab* CMPDAGAIndexTab::CreateFromStream(LStream* inStream)
  41. {
  42.     return new CMPDAGAIndexTab(inStream);
  43. }
  44.     
  45. //----------------------------------------------------------------------------------------
  46. // CMPDAGAIndexTab::CMPDAGAIndexTab
  47. //----------------------------------------------------------------------------------------
  48. CMPDAGAIndexTab::CMPDAGAIndexTab(LStream* inStream)
  49.     : LAGAIndexTab(inStream)
  50. {
  51.     mTabbedViewID = 0;
  52. }
  53.  
  54. //----------------------------------------------------------------------------------------
  55. // CMPDAGAIndexTab::~CMPDAGAIndexTab
  56. //----------------------------------------------------------------------------------------
  57. CMPDAGAIndexTab::~CMPDAGAIndexTab()
  58. {
  59. }
  60.     
  61. //----------------------------------------------------------------------------------------
  62. // CMPDAGAIndexTab::InsertPanelIDs
  63. //----------------------------------------------------------------------------------------
  64. void CMPDAGAIndexTab::InsertPanelIDs(MPDPtr inPanelIDData)
  65. {
  66.     if ( SetTabCount(inPanelIDData->numItems) )
  67.     {
  68.         for ( Int16 i = 0; i < inPanelIDData->numItems; i++ )
  69.         {
  70.             LStr255    tabName(inPanelIDData->MPDList[i].name);
  71.             SetTabTitle(i, tabName);
  72.         }
  73.     }
  74. }
  75.  
  76. //----------------------------------------------------------------------------------------
  77. // CMPDAGAIndexTab::SelectPanelID
  78. //----------------------------------------------------------------------------------------
  79. void CMPDAGAIndexTab::SelectPanelID(PanelIDIndexT inPanelID)
  80. {
  81.     // LAGAIndexTab is 0-based while the MPD classes are 1-based
  82.     SetSelectedTab(inPanelID - 1);
  83. }
  84.  
  85. //----------------------------------------------------------------------------------------
  86. // CMPDAGAIndexTab::GetCurrentPanelID
  87. //----------------------------------------------------------------------------------------
  88. PanelIDIndexT CMPDAGAIndexTab::GetCurrentPanelID(void) const
  89. {
  90.     // LAGAIndexTab is 0-based while the MPD classes are 1-based
  91.     return mSelectedTab + 1;
  92. }
  93.  
  94. //----------------------------------------------------------------------------------------
  95. // CMPDAGAIndexTab::AdaptTab
  96. //----------------------------------------------------------------------------------------
  97. void CMPDAGAIndexTab::AdaptTab(Boolean inRefresh)
  98. {
  99.     ReportPanelIDChanged();
  100. }
  101.  
  102.