home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / ript32 / sample / rtabdial.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-21  |  3.0 KB  |  118 lines

  1. // rtabdial.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "rtab_sam.h"
  6. #include "..\include\rip_tabs.h"
  7. #include "rtab_doc.h"
  8. #include "rtab_vw.h"
  9. #include "rtabdial.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CRTabDialog dialog
  18.  
  19. CRTabDialog::CRTabDialog(CWnd* pParent /*=NULL*/)
  20.     : CTabDialog(CRTabDialog::IDD, pParent)
  21. {
  22.     //{{AFX_DATA_INIT(CRTabDialog)
  23.         // NOTE: the ClassWizard will add member initialization here
  24.     //}}AFX_DATA_INIT
  25.  
  26.     MyView = (CRtab_samView*)pParent;
  27. }
  28.  
  29. void CRTabDialog::DoDataExchange(CDataExchange* pDX)
  30. {
  31.     CTabDialog::DoDataExchange(pDX);
  32.     //{{AFX_DATA_MAP(CRTabDialog)
  33.         // NOTE: the ClassWizard will add DDX and DDV calls here
  34.     //}}AFX_DATA_MAP
  35. }
  36.  
  37. BEGIN_MESSAGE_MAP(CRTabDialog, CTabDialog)
  38.     //{{AFX_MSG_MAP(CRTabDialog)
  39.     ON_BN_CLICKED(IDHELP, OnClickedHelp)
  40.     //}}AFX_MSG_MAP
  41. END_MESSAGE_MAP()
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CRTabDialog message handlers
  45.  
  46. BOOL CRTabDialog::OnInitDialog()
  47. {
  48.   DlgOptionsList[0]= new CPtrArray();
  49.   DlgOptionsList[0]->SetSize(0, 20);
  50.   DlgOptionsList[1]= new CPtrArray();
  51.   DlgOptionsList[1]->SetSize(0, 20);
  52.  
  53.   
  54.     // mode info was here
  55.     DlgOptionsList[0]->Add((void*)CStringPtr("Radio Buttons"));
  56.     DlgOptionsList[0]->Add((void*)CStringPtr("Check Boxes"));
  57.     DlgOptionsList[0]->Add((void*)CStringPtr("Edit Control"));
  58.                                 
  59.     DlgOptionsList[1]->Add((void*)CStringPtr("RADIO_DIALOG"));
  60.     DlgOptionsList[1]->Add((void*)CStringPtr("CHECK_DIALOG"));
  61.     DlgOptionsList[1]->Add((void*)CStringPtr("EDIT_DIALOG"));
  62.     
  63.  
  64.     CTabDialog::InitData(DlgOptionsList[0], DlgOptionsList[1], IDC_RSTATIC);
  65.  
  66.     CTabDialog::OnInitDialog();
  67.     
  68.     // place your own controls intialization code here ...    
  69.     // (*after* calling CTabDialog::InitData & OnInitDialog)
  70.     
  71.     return TRUE;  // return TRUE  unless you set the focus to a control
  72. }
  73.  
  74. void CRTabDialog::OnOK()
  75. {
  76.     char str[101];
  77.     CString CheckBoxStatus, RadioButtonStatus, EditControlStatus;
  78.  
  79.     if(IsDlgButtonChecked(IDC_CHECK1))
  80.         MyView->CheckBoxStatus = "1";
  81.     if(IsDlgButtonChecked(IDC_CHECK2))
  82.         MyView->CheckBoxStatus = "2";
  83.     if(IsDlgButtonChecked(IDC_CHECK3))
  84.         MyView->CheckBoxStatus = "3";
  85.  
  86.     if(IsDlgButtonChecked(IDC_RADIO1))
  87.         MyView->RadioButtonStatus = "1";
  88.     if(IsDlgButtonChecked(IDC_RADIO2))
  89.         MyView->RadioButtonStatus = "2";
  90.     if(IsDlgButtonChecked(IDC_RADIO3))
  91.         MyView->RadioButtonStatus = "3";
  92.     
  93.     GetDlgItemText(IDC_EDITBOX, str, 100);
  94.     MyView->EditControlStatus = str;
  95.  
  96.     CTabDialog::OnOK();
  97. }
  98.  
  99. void CRTabDialog::OnClickedHelp()
  100. {
  101.     CString MessageText="Display Help For : ";
  102.     MessageText+=ActivePage;
  103.     MessageBox(MessageText, "RipTABS Sample");
  104. }
  105.  
  106. void CRTabDialog::OnCancel()
  107. {
  108.     // TODO: Add extra cleanup here
  109.     
  110.     CTabDialog::OnCancel();
  111. }
  112.  
  113. void CRTabDialog::SwitchToNotification(int TabIndex, CString* TabName)
  114. {
  115.     ActivePage= *TabName;
  116. }
  117.  
  118.