home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CNavCenterWindow.cp < prev    next >
Encoding:
Text File  |  1998-04-08  |  2.6 KB  |  121 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. // Implementation of the class that handles the nav-center in a stand-alone window.
  20.  
  21. #include "CNavCenterWindow.h"
  22. #include "CRDFCoordinator.h"
  23.  
  24. #include "resgui.h"
  25. #include "Netscape_Constants.h"
  26. #include "CPrefsDialog.h"
  27.  
  28.  
  29. //
  30. // Constructor
  31. //
  32. CNavCenterWindow :: CNavCenterWindow ( LStream* inStream )
  33.     : CNetscapeWindow ( inStream, WindowType_NavCenter ), CSaveWindowStatus(this)
  34. {
  35. }
  36.  
  37.  
  38. //
  39. // Destructor
  40. //
  41. CNavCenterWindow :: ~CNavCenterWindow ( ) 
  42. {
  43.     mTree->UnregisterNavCenter();
  44. }
  45.  
  46.  
  47. //
  48. // FinishCreateSelf
  49. //
  50. // Handle the remainder of the initialization stuff...
  51. //
  52. void
  53. CNavCenterWindow :: FinishCreateSelf()
  54. {
  55.     // use saved positioning information
  56.     FinishCreateWindow();
  57.     
  58.     mTree = dynamic_cast<CRDFCoordinator*>(FindPaneByID('RCoo'));
  59.     Assert_(mTree);
  60.     mTree->RegisterNavCenter(NULL);
  61.  
  62.     SwitchTarget(mTree);
  63.     
  64. } // FinishCreateSelf
  65.  
  66.  
  67. //
  68. // BringPaneToFront
  69. //        
  70. // make the given pane the one that is in front
  71. //
  72. void
  73. CNavCenterWindow :: BringPaneToFront ( HT_ViewType inPane ) 
  74. {
  75.     mTree->SelectView ( inPane );
  76.         
  77. } // BringPaneToFront
  78.         
  79.  
  80. //
  81. // DoClose
  82. //
  83. // Make sure the size/location gets saved when we close the window...
  84. //
  85. void 
  86. CNavCenterWindow :: DoClose()
  87. {
  88.     AttemptCloseWindow();            // save state
  89.     CMediatedWindow::DoClose();        // finish the job...
  90.     
  91. } // DoClose
  92.  
  93.  
  94. //
  95. // AttemptClose
  96. //
  97. // Make sure the size/location gets saved when we close the window...
  98. //
  99. // Ñ At some point this should be made like CBrowserWindow::AttemptClose 
  100. //     to do scripting right
  101. //
  102. void 
  103. CNavCenterWindow :: AttemptClose()
  104.  {
  105.     AttemptCloseWindow();                // save state
  106.     CMediatedWindow::AttemptClose();    // finish the job...
  107.     
  108. } // AttemptClose
  109.  
  110.  
  111. //
  112. // DoDefaultPrefs
  113. //
  114. // Show the prefs when called upon
  115. //
  116. void 
  117. CNavCenterWindow :: DoDefaultPrefs()
  118. {
  119.     CPrefsDialog::EditPrefs(CPrefsDialog::eExpandBrowser);
  120. }
  121.