Leaked source code of windows server 2003
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.

82 lines
2.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. // DlgAddLocation.cpp : Implementation of CDlgAddLocation
  23. #include "stdafx.h"
  24. #include "DlgAddLoc.h"
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CDlgAddLocation
  27. IMPLEMENT_MY_HELP(CDlgAddLocation)
  28. CDlgAddLocation::CDlgAddLocation()
  29. {
  30. m_bstrLocation = NULL;
  31. }
  32. CDlgAddLocation::~CDlgAddLocation()
  33. {
  34. SysFreeString( m_bstrLocation );
  35. }
  36. void CDlgAddLocation::UpdateData( bool bSaveAndValidate )
  37. {
  38. USES_CONVERSION;
  39. if ( bSaveAndValidate )
  40. {
  41. // Retrieve data
  42. SysFreeString( m_bstrLocation );
  43. GetDlgItemText( IDC_EDT_LOCATION, m_bstrLocation );
  44. }
  45. else
  46. {
  47. // Set data
  48. SetDlgItemText( IDC_EDT_LOCATION, OLE2CT(m_bstrLocation) );
  49. ::EnableWindow( GetDlgItem(IDC_BTN_ADD_NEW_FOLDER), (BOOL) (::GetWindowTextLength(GetDlgItem(IDC_EDT_LOCATION)) > 0) );
  50. }
  51. }
  52. LRESULT CDlgAddLocation::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  53. {
  54. UpdateData( false );
  55. return true;
  56. }
  57. LRESULT CDlgAddLocation::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  58. {
  59. UpdateData( true );
  60. EndDialog(IDOK);
  61. return 0;
  62. }
  63. LRESULT CDlgAddLocation::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  64. {
  65. EndDialog(wID);
  66. return 0;
  67. }
  68. LRESULT CDlgAddLocation::OnEdtLocationChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  69. {
  70. ::EnableWindow( GetDlgItem(IDC_BTN_ADD_NEW_FOLDER), (BOOL) (::GetWindowTextLength(GetDlgItem(IDC_EDT_LOCATION)) > 0) );
  71. return 0;
  72. }