Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
3.9 KiB

  1. // SelBarFm.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "pwsform.h"
  5. #include "Title.h"
  6. #include "FormIE.h"
  7. #include "MainFrm.h"
  8. #include "ServCntr.h"
  9. #include "SelBarFm.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. extern CMainFrame* g_frame;
  16. extern CPWSForm* g_pCurrentForm;
  17. extern BOOL g_fShutdownMode;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CFormSelectionBar
  20. IMPLEMENT_DYNCREATE(CFormSelectionBar, CFormView)
  21. CFormSelectionBar::CFormSelectionBar()
  22. : CFormView(CFormSelectionBar::IDD)
  23. {
  24. //{{AFX_DATA_INIT(CFormSelectionBar)
  25. //}}AFX_DATA_INIT
  26. }
  27. CFormSelectionBar::~CFormSelectionBar()
  28. {
  29. }
  30. void CFormSelectionBar::DoDataExchange(CDataExchange* pDX)
  31. {
  32. CFormView::DoDataExchange(pDX);
  33. //{{AFX_DATA_MAP(CFormSelectionBar)
  34. DDX_Control(pDX, IDC_STATIC_ADVANCED, m_static_advanced);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CFormSelectionBar, CFormView)
  38. //{{AFX_MSG_MAP(CFormSelectionBar)
  39. ON_BN_CLICKED(ID_PGE_MAIN, OnPgeMain)
  40. ON_BN_CLICKED(ID_PGE_ADVANCED, OnPgeAdvanced)
  41. ON_BN_CLICKED(ID_PGE_TOUR, OnPgeTour)
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CFormSelectionBar diagnostics
  46. #ifdef _DEBUG
  47. void CFormSelectionBar::AssertValid() const
  48. {
  49. CFormView::AssertValid();
  50. }
  51. void CFormSelectionBar::Dump(CDumpContext& dc) const
  52. {
  53. CFormView::Dump(dc);
  54. }
  55. #endif //_DEBUG
  56. // operations affecting the enable state of the selection bar
  57. //---------------------------------------------------------------------------
  58. // grays out the text for the pub wizard, web site, and advanced panels to
  59. // indicate that they are not available
  60. void CFormSelectionBar::ReflectAvailability()
  61. {
  62. BOOL fServedSitesAreAvailable = !g_fShutdownMode;
  63. // test if the served sites are available
  64. // only bother querying the server is we are not shutdown. Doing
  65. // otherwise would access the metabase and thus cause it to launch
  66. if ( fServedSitesAreAvailable )
  67. {
  68. //get the state
  69. CW3ServerControl serverControler;
  70. if ( serverControler.GetServerState() != MD_SERVER_STATE_STARTED )
  71. fServedSitesAreAvailable = FALSE;
  72. }
  73. // enable the served sites
  74. // m_static_publish.EnableWindow( fServedSitesAreAvailable );
  75. // m_static_website.EnableWindow( fServedSitesAreAvailable );
  76. // if we are not in shutdown mode, enable the advanced button
  77. m_static_advanced.EnableWindow( !g_fShutdownMode );
  78. }
  79. /////////////////////////////////////////////////////////////////////////////
  80. // CFormSelectionBar message handlers
  81. //---------------------------------------------------------------------------
  82. void CFormSelectionBar::OnPgeMain()
  83. {
  84. if ( g_frame )
  85. g_frame->GoToMain();
  86. }
  87. //---------------------------------------------------------------------------
  88. void CFormSelectionBar::OnPgeAdvanced()
  89. {
  90. if ( g_frame )
  91. g_frame->GoToAdvanced();
  92. }
  93. //---------------------------------------------------------------------------
  94. void CFormSelectionBar::OnPgeTour()
  95. {
  96. if ( g_frame )
  97. g_frame->GoToTour();
  98. }
  99. /*
  100. //---------------------------------------------------------------------------
  101. void CFormSelectionBar::OnPgeAboutMe()
  102. {
  103. if ( g_frame )
  104. g_frame->GoToAboutMe();
  105. }
  106. //---------------------------------------------------------------------------
  107. void CFormSelectionBar::OnPgeWebSite()
  108. {
  109. if ( g_frame )
  110. g_frame->GoToWebSite();
  111. }
  112. */
  113. //---------------------------------------------------------------------------
  114. void CFormSelectionBar::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
  115. {
  116. if ( g_pCurrentForm )
  117. g_frame->SetActiveView(g_pCurrentForm);
  118. // CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
  119. }