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.

153 lines
3.5 KiB

  1. // rvoutvw.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "FaxApi.h"
  5. #include "rvoutvw.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. extern CFaxApiApp * pFaxApiBrowserApp;
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CReturnValueOutputFormView
  14. IMPLEMENT_DYNCREATE(CReturnValueOutputFormView, CFormView)
  15. CReturnValueOutputFormView::CReturnValueOutputFormView()
  16. : CFormView(CReturnValueOutputFormView::IDD)
  17. {
  18. //{{AFX_DATA_INIT(CReturnValueOutputFormView)
  19. // NOTE: the ClassWizard will add member initialization here
  20. //}}AFX_DATA_INIT
  21. }
  22. CReturnValueOutputFormView::~CReturnValueOutputFormView()
  23. {
  24. }
  25. void CReturnValueOutputFormView::DoDataExchange(CDataExchange* pDX)
  26. {
  27. CFormView::DoDataExchange(pDX);
  28. //{{AFX_DATA_MAP(CReturnValueOutputFormView)
  29. // NOTE: the ClassWizard will add DDX and DDV calls here
  30. //}}AFX_DATA_MAP
  31. }
  32. BEGIN_MESSAGE_MAP(CReturnValueOutputFormView, CFormView)
  33. //{{AFX_MSG_MAP(CReturnValueOutputFormView)
  34. // NOTE - the ClassWizard will add and remove mapping macros here.
  35. //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CReturnValueOutputFormView diagnostics
  39. #ifdef _DEBUG
  40. void CReturnValueOutputFormView::AssertValid() const
  41. {
  42. CFormView::AssertValid();
  43. }
  44. void CReturnValueOutputFormView::Dump(CDumpContext& dc) const
  45. {
  46. CFormView::Dump(dc);
  47. }
  48. #endif //_DEBUG
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CReturnValueOutputFormView message handlers
  51. BOOL CReturnValueOutputFormView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
  52. {
  53. BOOL fReturnValue;
  54. fReturnValue = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
  55. if ( fReturnValue != (BOOL) FALSE )
  56. {
  57. // Save the handle to this view in the CFaxApiApp object.
  58. pFaxApiBrowserApp->StoreReturnValueOutputFormViewHWND( m_hWnd );
  59. }
  60. return ( fReturnValue );
  61. }
  62. BOOL CReturnValueOutputFormView::UpdateReturnValueOutputEditCtrl( CString & rcsReturnValueOutputString )
  63. {
  64. BOOL fReturnValue;
  65. // Get a pointer to the Return Value Output edit control;
  66. CEdit * pceReturnValueOutputEditCtrl;
  67. pceReturnValueOutputEditCtrl = (CEdit *) ((CDialog *) this)->
  68. GetDlgItem( IDC_EDIT_RETURN_VALUE );
  69. // Is the pointer valid ?
  70. if ( pceReturnValueOutputEditCtrl != (CEdit *) NULL )
  71. {
  72. pceReturnValueOutputEditCtrl->SetWindowText( rcsReturnValueOutputString );
  73. fReturnValue = (BOOL) TRUE;
  74. }
  75. else
  76. {
  77. fReturnValue = (BOOL) FALSE;
  78. }
  79. return ( fReturnValue );
  80. }
  81. /*
  82. * CReturnValueOutputFormView
  83. *
  84. * Purpose:
  85. * This function cleard the Return Value Output edit control.
  86. *
  87. * Arguments:
  88. * None
  89. *
  90. * Returns:
  91. * TRUE - indicates that the edit control was cleared.
  92. * FALSE - indicates that some error occured.
  93. *
  94. */
  95. BOOL CReturnValueOutputFormView::ClearReturnValueOutputEditCtrl()
  96. {
  97. BOOL fReturnValue;
  98. CEdit * pceEditControl;
  99. pceEditControl = (CEdit *) ((CDialog *) this)->
  100. GetDlgItem( IDC_EDIT_RETURN_VALUE );
  101. if ( pceEditControl != (CEdit *) NULL )
  102. {
  103. pceEditControl->SetReadOnly( (BOOL) FALSE );
  104. pceEditControl->SetSel( 0, -1, (BOOL) TRUE );
  105. pceEditControl->Clear();
  106. pceEditControl->SetReadOnly( (BOOL) TRUE );
  107. fReturnValue = (BOOL) TRUE;
  108. }
  109. else
  110. fReturnValue = (BOOL) FALSE;
  111. return ( fReturnValue );
  112. }