home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / mucwiz.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  16.8 KB  |  691 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. #include "stdafx.h"
  20. #include "setupwiz.h"
  21. #include "mucproc.h"
  22. #include "logindg.h"
  23.  
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29.  
  30. static  CMucProc m_pMucProc;
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CMucIntroPage dialog
  34.  
  35. #ifdef XP_WIN32
  36. CMucIntroPage::CMucIntroPage(CWnd* pParent)
  37.     : CNetscapePropertyPage(IDD)
  38. #else
  39. CMucIntroPage::CMucIntroPage(CWnd* pParent)
  40.     : CDialog()
  41. #endif  
  42. {
  43.     m_pParent = (CNewProfileWizard*)pParent;
  44.     m_pParent->m_bASWEnabled = FALSE;
  45.     m_pParent->m_bMucEnabled = TRUE;
  46. }
  47.  
  48. #ifdef XP_WIN32
  49. BOOL CMucIntroPage::OnSetActive()
  50. {
  51.     m_pParent->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
  52.     return CNetscapePropertyPage::OnSetActive();
  53. }
  54. #else
  55. BOOL CMucIntroPage::Create(UINT nID, CWnd *pWnd)
  56. {       
  57.     return CDialog::Create(nID, pWnd);      
  58. }
  59. #endif
  60.  
  61. void CMucIntroPage::DoDataExchange(CDataExchange* pDX)
  62. {
  63.     CDialog::DoDataExchange(pDX);
  64. }
  65.  
  66.  
  67. #ifdef XP_WIN32
  68. BEGIN_MESSAGE_MAP(CMucIntroPage, CNetscapePropertyPage)
  69. #else
  70. BEGIN_MESSAGE_MAP(CMucIntroPage, CDialog)
  71. #endif
  72.     //{{AFX_MSG_MAP(CMucIntroPage)
  73.     ON_BN_CLICKED(IDC_MUCINTRO_ACCT_EXIST, OnMucIntroAcctExist)
  74.     ON_BN_CLICKED(IDC_MUCINTRO_ACCT_SYS, OnMucIntroAcctSys)
  75.     ON_BN_CLICKED(IDC_MUCINTRO_ACCT_ADD, OnMucIntroAcctAdd)
  76.     //}}AFX_MSG_MAP
  77. END_MESSAGE_MAP()
  78.  
  79. /////////////////////////////////////////////////////////////////////////////
  80. // CMucIntroPage message handlers
  81.  
  82. BOOL CMucIntroPage::OnInitDialog() 
  83. {                                                                                      
  84.  
  85.     if(m_pParent->m_bUpgrade)
  86.     {
  87.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_EXIST)) -> SetCheck(TRUE);
  88.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_SYS)) -> SetCheck(FALSE);
  89.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_ADD)) -> SetCheck(FALSE);
  90.         GetDlgItem(IDC_MUCINTRO_ACCT_SYS) -> EnableWindow(FALSE);
  91.         GetDlgItem(IDC_MUCINTRO_ACCT_ADD) -> EnableWindow(FALSE);
  92.         GetDlgItem(IDC_ACCTSYS_TEXT) -> EnableWindow(FALSE);
  93.         GetDlgItem(IDC_ACCTADD_TEXT) -> EnableWindow(FALSE);
  94.  
  95.         MucIntroProc(m_OptExist);
  96.     }
  97.     else
  98.     {
  99.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_EXIST)) -> SetCheck(FALSE);
  100.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_SYS)) -> SetCheck(FALSE);
  101.         ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_ADD)) -> SetCheck(TRUE);
  102.  
  103.         MucIntroProc(m_OptAdd);
  104.     }
  105. #ifdef XP_WIN32
  106.     return CNetscapePropertyPage::OnInitDialog();
  107. #else
  108.     RECT    rect;
  109.     m_pParent->GetWindowRect(&rect);
  110.     m_height = rect.bottom-rect.top-80;
  111.     m_width = rect.right-rect.left-10;
  112.         
  113.     SetWindowPos(&wndTop, rect.left, rect.top+30, m_width, m_height, SWP_HIDEWINDOW);
  114.     return TRUE;
  115. #endif
  116. }
  117.  
  118. void CMucIntroPage::OnMucIntroAcctAdd() 
  119. {
  120.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_ADD)) -> SetCheck(TRUE);
  121.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_EXIST)) -> SetCheck(FALSE);
  122.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_SYS)) -> SetCheck(FALSE);
  123.  
  124.     MucIntroProc(m_OptAdd);
  125. }
  126.  
  127. void CMucIntroPage::OnMucIntroAcctExist() 
  128. {
  129.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_ADD)) -> SetCheck(FALSE);
  130.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_EXIST)) -> SetCheck(TRUE);
  131.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_SYS)) -> SetCheck(FALSE);
  132.  
  133.     MucIntroProc(m_OptExist);
  134. }
  135.  
  136. void CMucIntroPage::OnMucIntroAcctSys() 
  137. {
  138.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_ADD)) -> SetCheck(FALSE);
  139.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_EXIST)) -> SetCheck(FALSE);
  140.     ((CButton *)GetDlgItem(IDC_MUCINTRO_ACCT_SYS)) -> SetCheck(TRUE);
  141.  
  142.     MucIntroProc(m_OptSys);
  143. }
  144.  
  145. void CMucIntroPage::MucIntroProc(int m_option) 
  146. {
  147.     switch(m_option)
  148.     {
  149.         case m_OptAdd:
  150.             m_pParent->m_bASWEnabled = TRUE;
  151.             m_pParent->m_bMucEnabled = FALSE;
  152.         break;
  153.  
  154.         case m_OptExist:        // enable MUC
  155.             m_pParent->m_bASWEnabled = FALSE;
  156.             if(!m_pMucProc.LoadMuc())
  157.             {
  158.                 AfxMessageBox("Muc.dll is missing");
  159.                 m_pParent->m_bMucEnabled = FALSE;
  160.             }
  161.             else
  162.                 m_pParent->m_bMucEnabled = TRUE;
  163.         break;
  164.  
  165.         case m_OptSys:  // disable MUC  
  166.             m_pParent->m_bASWEnabled = FALSE;
  167.             m_pParent->m_bMucEnabled = FALSE;
  168.         break;
  169.  
  170.         default:
  171.             break;
  172.     }
  173. }
  174. void CMucIntroPage::SetMove(int x, int y, int nShowCmd)
  175. {
  176.     SetWindowPos(&wndTop, x, y, m_width, m_height, nShowCmd);
  177. }       
  178.  
  179. /////////////////////////////////////////////////////////////////////////////
  180. // CMucEditPage dialog
  181.  
  182. #ifdef XP_WIN32
  183. CMucEditPage::CMucEditPage(CWnd* pParent, BOOL bEditView)
  184.     : CNetscapePropertyPage(IDD)
  185. #else
  186. CMucEditPage::CMucEditPage(CWnd* pParent,BOOL bEditView)
  187.     : CDialog()
  188. #endif
  189. {
  190.     //{{AFX_DATA_INIT(CMucEditPage)
  191.     //}}AFX_DATA_INIT
  192.     
  193.     m_bEditView = bEditView;
  194.  
  195.     if(m_bEditView)
  196.     {
  197.         m_pEditParent = (CNewProfileWizard*)pParent;
  198.         m_pEditParent->m_pAcctName = "";
  199.         m_pEditParent->m_pModemName = "";
  200.     }
  201.     else
  202.         m_pViewParent = (CMucViewWizard*)pParent;
  203.  
  204.     m_acctSelect = "";
  205.     m_modemSelect = "";
  206. }
  207.  
  208. CMucEditPage::~CMucEditPage()
  209. {
  210. }
  211.  
  212. #ifdef XP_WIN32
  213. BOOL CMucEditPage::OnSetActive()
  214. {
  215.     CString    m_str;
  216.  
  217.     if(m_bEditView)
  218.     {
  219.         if (m_pEditParent->m_bUpgrade) 
  220.         {
  221.             m_str.LoadString(IDS_PEMUCEDIT_UPGRADE);
  222.             m_pEditParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  223.         }
  224.         else
  225.         {
  226.             m_str.LoadString(IDS_PEMUCEDIT_NORMAL);
  227.             m_pEditParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
  228.         }
  229.         GetDlgItem(IDC_EDIT_TEXT)->SetWindowText(m_str);
  230.     }
  231.     else
  232.         m_pViewParent->SetWizardButtons(PSWIZB_FINISH);
  233.  
  234.     return CNetscapePropertyPage::OnSetActive();
  235. }
  236. #else
  237. BOOL CMucEditPage::Create(UINT nID, CWnd *pWnd)
  238. {       
  239.     return CDialog::Create(nID, pWnd);      
  240. }
  241. #endif
  242.  
  243. void CMucEditPage::DoDataExchange(CDataExchange* pDX)
  244. {
  245.     CDialog::DoDataExchange(pDX);
  246. }
  247.  
  248. #ifdef XP_WIN32
  249. BEGIN_MESSAGE_MAP(CMucEditPage, CNetscapePropertyPage)
  250. #else
  251. BEGIN_MESSAGE_MAP(CMucEditPage, CDialog)
  252. #endif
  253.     //{{AFX_MSG_MAP(CMucEditPage)
  254. //      ON_CBN_SELENDOK(IDC_MUCWIZARD_MODEMLIST, OnSelectModemlist)
  255.     ON_LBN_SELCHANGE(IDC_MUCWIZARD_ACCTLIST, OnSelectAcctlist)
  256.     ON_BN_CLICKED(IDC_DIALER_FLAG, OnCheckDialerFlag)
  257. #ifdef XP_WIN32
  258.     ON_BN_CLICKED(ID_WIZFINISH,DoFinish)
  259. #endif
  260.     //}}AFX_MSG_MAP
  261. END_MESSAGE_MAP()
  262.  
  263. /////////////////////////////////////////////////////////////////////////////
  264. // CMucEditPage message handlers
  265.  
  266. BOOL CMucEditPage::OnInitDialog() 
  267. {
  268.     if(!m_bEditView)
  269.     {   
  270.         if(((m_pViewParent->m_pAcctName).Compare("") == 0) ||
  271.             ((m_pViewParent->m_pAcctName).Compare("None") == 0))
  272.                 m_bCheckState = FALSE;
  273.         else
  274.             m_bCheckState = TRUE;
  275.             
  276.         ((CButton*)GetDlgItem(IDC_DIALER_FLAG))->SetCheck(m_bCheckState);
  277.         SetViewPageState(m_bCheckState);
  278.  
  279.         CString text;
  280.         text.LoadString(IDS_PEMUCVIEW_TEXT1);
  281.         GetDlgItem(IDC_VIEW_TEXT1)->SetWindowText(text);
  282.         text.LoadString(IDS_PEMUCVIEW_TEXT2);
  283.         GetDlgItem(IDC_VIEW_TEXT2)->SetWindowText(text);
  284.         GetDlgItem(IDC_EDIT_TEXT)->ShowWindow(FALSE);
  285.     }
  286.     else 
  287.     {
  288.         GetDlgItem(IDC_DIALER_FLAG)->ShowWindow(FALSE);
  289.         GetDlgItem(IDC_DIALER_TEXT)->ShowWindow(FALSE);
  290.         GetDlgItem(IDC_CTRL)->ShowWindow(FALSE);
  291.         GetDlgItem(IDC_VIEW_TEXT1)->ShowWindow(FALSE);
  292.         GetDlgItem(IDC_VIEW_TEXT2)->ShowWindow(FALSE);
  293.     }
  294.         
  295.     if(!m_pMucProc.LoadMuc())
  296.         return FALSE;
  297.  
  298.     m_pMucProc.GetAcctArray(&m_acctList);
  299.  
  300.     if(!m_bEditView)
  301.     {
  302.         // check the validility
  303.         if(m_pMucProc.IsAcctValid((char*)((const char*)m_pViewParent->m_pAcctName)))
  304.             m_acctSelect = m_pViewParent->m_pAcctName;
  305.     }
  306.  
  307.     UpdateList();
  308.  
  309.     RECT        rect;
  310. #ifdef XP_WIN32
  311.     return CNetscapePropertyPage::OnInitDialog();
  312. #else
  313.     if(m_bEditView)
  314.         m_pEditParent->GetWindowRect(&rect);
  315.     else
  316.         m_pViewParent->GetWindowRect(&rect);
  317.  
  318.     m_height = rect.bottom-rect.top-80;
  319.     m_width = rect.right-rect.left-40;
  320.         
  321.     if(m_bEditView)
  322.         SetWindowPos(&wndTop, rect.left+15, rect.top+30, m_width, m_height, SWP_HIDEWINDOW);
  323.     else
  324.         SetWindowPos(&wndTop, rect.left+15, rect.top+30, m_width, m_height, SWP_SHOWWINDOW);
  325.     
  326.     return TRUE;  
  327. #endif
  328.  
  329. }
  330. void CMucEditPage::SetMove(int x, int y, int nShowCmd)
  331. {
  332.     RECT    rect;
  333.  
  334.     if(m_bEditView)
  335.         m_pEditParent->GetWindowRect(&rect);
  336.     else
  337.         m_pViewParent->GetWindowRect(&rect);
  338.  
  339.     SetWindowPos(&wndTop, rect.left+15, rect.top+30, m_width, m_height, nShowCmd);
  340. }       
  341.  
  342. void CMucEditPage::UpdateList()
  343. {
  344.     int             num,i,err;
  345.     CString temp;
  346.  
  347.     m_acctName= (CListBox*)GetDlgItem(IDC_MUCWIZARD_ACCTLIST);
  348.     if(m_acctName == NULL && !(::IsWindow(((CWnd*)m_acctName)->GetSafeHwnd())))
  349.         return;    
  350.     
  351. // update account list
  352.     num = m_acctList.GetSize();
  353.     if(num == 0)
  354.         return;
  355.  
  356.     for (i=0; i < num; i++) 
  357.     {
  358.         temp = m_acctList.GetAt(i); 
  359.         err = m_acctName->AddString(temp); 
  360.         ASSERT(err != CB_ERR);
  361.     }
  362.  
  363.     // highlight
  364.     if((!m_bEditView) && (m_acctSelect.GetLength() !=0))
  365.         temp = m_acctSelect;
  366.     else      
  367. //        temp = (char*)(m_acctName->GetItemDataPtr(0));
  368.         temp = m_acctList.GetAt(0); 
  369.  
  370.     m_acctName->SelectString(-1, temp);
  371.     
  372.     if(m_bEditView)
  373.         m_pEditParent->m_pAcctName = temp;
  374.     else
  375.         m_pViewParent->m_pAcctName = temp;
  376. }
  377.  
  378. void CMucEditPage::OnSelectAcctlist() 
  379. {
  380.     CString temp; 
  381.  
  382.     int cur_sel = m_acctName->GetCurSel();
  383.  
  384.     m_acctName->GetText(cur_sel, temp);
  385.         
  386.     if(m_bEditView)
  387.         m_pEditParent->m_pAcctName = temp;
  388.     else
  389.         m_pViewParent->m_pAcctName = temp;
  390. }
  391.  
  392. void CMucEditPage::OnCheckDialerFlag() 
  393. {
  394.     m_bCheckState = (m_bCheckState + 1) %2;
  395.     SetViewPageState(m_bCheckState);
  396. }
  397.  
  398. void CMucEditPage::SetViewPageState(BOOL m_bState) 
  399. {
  400.     ((CButton*)GetDlgItem(IDC_DIALER_FLAG))->SetCheck(m_bState);
  401.  
  402.     GetDlgItem(IDC_MUCEDIT_TEXT1)->EnableWindow(m_bState);
  403.     GetDlgItem(IDC_MUCEDIT_TEXT2)->EnableWindow(m_bState);
  404.     GetDlgItem(IDC_VIEW_TEXT1)->EnableWindow(m_bState);
  405.     GetDlgItem(IDC_VIEW_TEXT2)->EnableWindow(m_bState);
  406.     GetDlgItem(IDC_MUCWIZARD_ACCTLIST)->EnableWindow(m_bState);
  407. }
  408.  
  409. void CMucEditPage::DoFinish() 
  410. {
  411.     char    acctStr[MAX_PATH];
  412.     char    path[MAX_PATH];
  413.     int     ret;
  414.     BOOL    m_bDialOnDemand = FALSE;
  415.     XP_StatStruct statinfo; 
  416.  
  417.     if(!m_bEditView)    // advanced option of profile manager
  418.     {
  419.         if(m_bCheckState)
  420.             strcpy(acctStr, (const char*)m_pViewParent->m_pAcctName); 
  421.         else
  422.             strcpy(acctStr, "None");
  423.  
  424.         m_bDialOnDemand = m_bCheckState;
  425.         strcpy(path, (const char*)m_pViewParent->m_pProfileName);
  426.     }
  427.     else
  428.     {
  429.         // profile dir created?
  430.         ret = _stat((const char*)m_pEditParent->m_pProfilePath, &statinfo);
  431.         if(ret == -1) 
  432.             return;
  433.  
  434.         // construct config name
  435.         strcpy(path, m_pEditParent->m_pProfilePath);
  436.         strcat(path, "\\config.ini");
  437.  
  438.         // save the acct config
  439.         if(m_pEditParent->m_pAcctName.GetLength() == 0)
  440.             strcpy(acctStr, "None");
  441.         else
  442.         {
  443.             strcpy(acctStr, (const char*)m_pEditParent->m_pAcctName);
  444.             m_bDialOnDemand = TRUE;
  445.         }
  446.     }
  447.  
  448.     WritePrivateProfileString("Account", "Account", acctStr, path);
  449.  
  450.     (*(m_pMucProc.m_lpfnPEPluginFunc))(kSelectDialOnDemand, acctStr, &m_bDialOnDemand);
  451. }
  452.  
  453. /////////////////////////////////////////////////////////////////////////////
  454. // CMucReadyPage
  455. #ifdef XP_WIN32
  456. CMucReadyPage::CMucReadyPage(CWnd *pParent)
  457.     : CNetscapePropertyPage(IDD)
  458. #else
  459. CMucReadyPage::CMucReadyPage(CWnd *pParent)
  460.     : CDialog()
  461. #endif
  462. {
  463.     m_pParent = (CNewProfileWizard*)pParent;
  464. }
  465.  
  466. #ifdef XP_WIN32
  467. BOOL CMucReadyPage::OnSetActive()
  468. {
  469.     m_pParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  470.     return CNetscapePropertyPage::OnSetActive();
  471. }
  472. #else
  473. BOOL CMucReadyPage::Create(UINT nID, CWnd *pWnd)
  474. {       
  475.     return CDialog::Create(nID, pWnd);      
  476. }
  477. #endif
  478.  
  479. void CMucReadyPage::DoDataExchange(CDataExchange* pDX)
  480. {
  481.     CDialog::DoDataExchange(pDX);
  482. }
  483.  
  484. BOOL CMucReadyPage::OnInitDialog() 
  485. {
  486. #ifdef XP_WIN32
  487.     return CNetscapePropertyPage::OnInitDialog();
  488. #else
  489.     RECT    rect;
  490.     m_pParent->GetWindowRect(&rect);
  491.     m_height = rect.bottom-rect.top-80;
  492.     m_width = rect.right-rect.left-10;
  493.         
  494.     SetWindowPos(&wndTop, rect.left, rect.top+30, m_width, m_height, SWP_HIDEWINDOW);
  495.  
  496.     return TRUE;  
  497. #endif
  498. }
  499.  
  500. void CMucReadyPage::SetMove(int x, int y, int nShowCmd)
  501. {
  502.     SetWindowPos(&wndTop, x, y, m_width, m_height, nShowCmd);
  503. }       
  504.  
  505. #ifdef XP_WIN32
  506. BEGIN_MESSAGE_MAP(CMucReadyPage, CNetscapePropertyPage)
  507. #else
  508. BEGIN_MESSAGE_MAP(CMucReadyPage, CDialog)
  509. #endif
  510. END_MESSAGE_MAP()
  511. /////////////////////////////////////////////////////////////////////////////
  512. // CASWReadyPage
  513. #ifdef XP_WIN32
  514. CASWReadyPage::CASWReadyPage(CWnd *pParent)
  515.     : CNetscapePropertyPage(IDD)
  516. #else
  517. CASWReadyPage::CASWReadyPage(CWnd *pParent)
  518.     : CDialog()
  519. #endif
  520. {
  521.     m_pParent = (CNewProfileWizard*)pParent;
  522. }
  523.  
  524.  
  525. #ifdef XP_WIN32
  526. BOOL CASWReadyPage::OnSetActive()
  527. {
  528.     m_pParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
  529.     return CNetscapePropertyPage::OnSetActive();
  530. }
  531. #else
  532. BOOL CASWReadyPage::Create(UINT nID, CWnd *pWnd)
  533. {       
  534.     return CDialog::Create(nID, pWnd);      
  535. }
  536. #endif
  537.  
  538. void CASWReadyPage::DoDataExchange(CDataExchange* pDX)
  539. {
  540.     CDialog::DoDataExchange(pDX);
  541. }
  542.  
  543. void CASWReadyPage::DoFinish()
  544. {
  545.     char *asw = GetASWURL();
  546.     theApp.m_csPEPage = asw;
  547.     theApp.m_bAlwaysDockTaskBar = TRUE;
  548.     theApp.m_bAccountSetupStartupJava = TRUE;  // Force java startup too
  549.     theApp.m_bAccountSetup = TRUE;       // Force into account setup
  550.     XP_FREEIF(asw);
  551. }
  552.  
  553. BOOL CASWReadyPage::OnInitDialog() 
  554. {
  555. #ifdef XP_WIN32
  556.     return CNetscapePropertyPage::OnInitDialog();
  557. #else
  558.     RECT    rect;
  559.     m_pParent->GetWindowRect(&rect);
  560.     m_height = rect.bottom-rect.top-80;
  561.     m_width = rect.right-rect.left-10;
  562.         
  563.     SetWindowPos(&wndTop, rect.left, rect.top+30, m_width, m_height, SWP_HIDEWINDOW);
  564.  
  565.     return TRUE;  
  566. #endif
  567. }
  568.  
  569. void CASWReadyPage::SetMove(int x, int y, int nShowCmd)
  570. {
  571.     SetWindowPos(&wndTop, x, y, m_width, m_height, nShowCmd);
  572. }       
  573.     
  574. #ifdef XP_WIN32
  575. BEGIN_MESSAGE_MAP(CASWReadyPage, CNetscapePropertyPage)
  576.     ON_BN_CLICKED(ID_WIZFINISH,DoFinish)
  577.     END_MESSAGE_MAP()
  578. #else
  579. BEGIN_MESSAGE_MAP(CASWReadyPage, CDialog)
  580. END_MESSAGE_MAP()
  581. #endif
  582.  
  583. /////////////////////////////////////////////////////////////////////////////
  584. // CMucViewWizard   
  585. #ifdef XP_WIN32
  586.            
  587. CMucViewWizard::CMucViewWizard(CWnd *pParent, CString strProfileName,
  588.                                CString strAcctName, CString strModemName)
  589.     : CNetscapePropertySheet("", pParent)
  590. {
  591.     m_pProfileName = strProfileName;
  592.     m_pAcctName = strAcctName;
  593.     m_pMucEditPage = NULL;
  594.  
  595.     m_pMucEditPage = new CMucEditPage(this,FALSE);
  596.     AddPage(m_pMucEditPage);
  597.     SetWizardMode();
  598. }
  599.  
  600. CMucViewWizard::~CMucViewWizard()
  601. {
  602.     if (m_pMucEditPage)
  603.         delete m_pMucEditPage;
  604. }
  605.  
  606. BOOL CMucViewWizard::OnInitDialog()
  607. {
  608.     BOOL ret = CNetscapePropertySheet::OnInitDialog();
  609.     
  610.     CString text;
  611.     text.LoadString(IDS_PEMUCWIZ_TITLE);
  612.     SetTitle(text);
  613.  
  614.     text.LoadString(IDS_PEMUCWIZ_BUTTON);
  615.     SetFinishText(text);
  616.  
  617.     GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
  618.     return ret;  // return TRUE  unless you set the focus to a control
  619. }
  620.  
  621. void CMucViewWizard::DoFinish()
  622. {
  623.     if (m_pMucEditPage && ::IsWindow(m_pMucEditPage->GetSafeHwnd()))
  624.                     m_pMucEditPage->DoFinish();
  625.  
  626.     PressButton(PSBTN_FINISH);
  627. }
  628.  
  629. BEGIN_MESSAGE_MAP(CMucViewWizard, CNetscapePropertySheet)
  630.     ON_BN_CLICKED(ID_WIZFINISH,DoFinish)
  631. END_MESSAGE_MAP()
  632.  
  633. #else
  634. /////////////////////////////////////////////////////////////////////////////
  635. // CMucViewWizard   
  636. CMucViewWizard::CMucViewWizard(CWnd* pParent,CString strProfileName,
  637.                                CString strAcctName, CString strModemName)
  638.     : CDialog(CMucViewWizard::IDD, pParent)
  639. {
  640.     m_pProfileName = strProfileName;
  641.     m_pAcctName = strAcctName;
  642.     m_pModemName = strModemName;
  643.  
  644.     m_pMucEditPage = new CMucEditPage(this,FALSE);
  645. }
  646.  
  647. void CMucViewWizard::DoDataExchange(CDataExchange* pDX)
  648. {
  649.     CDialog::DoDataExchange(pDX);
  650. }
  651.  
  652. BOOL CMucViewWizard::OnInitDialog()
  653. {
  654.     CDialog::OnInitDialog();
  655.     
  656.     m_pMucEditPage->Create(IDD_MUCWIZARD_EDIT, this);
  657.             
  658.     return TRUE;  // return TRUE  unless you set the focus to a control
  659. }
  660.  
  661. void CMucViewWizard::OnMove(int x, int y)
  662. {
  663.     CDialog::OnMove(x, y);
  664.  
  665.     if(m_pMucEditPage)
  666.         m_pMucEditPage->SetMove(x,y,SW_SHOW);
  667.  
  668. }
  669. void CMucViewWizard::OnOK()
  670.     if (m_pMucEditPage && ::IsWindow(m_pMucEditPage->GetSafeHwnd()))
  671.         m_pMucEditPage->DoFinish();
  672.  
  673.     EndDialog(TRUE);
  674. }
  675.  
  676. void CMucViewWizard::OnCancel()
  677. {   
  678.     EndDialog(TRUE);
  679. }
  680.  
  681. BEGIN_MESSAGE_MAP(CMucViewWizard, CDialog)
  682.     ON_BN_CLICKED(IDCANCEL, OnCancel)
  683.     ON_BN_CLICKED(IDOK,OnOK)
  684.     ON_WM_MOVE()
  685. END_MESSAGE_MAP()
  686.  
  687.  
  688. #endif XP_WIN32
  689.  
  690.