home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK11 / MFC / SAMPLES / SPEAKN / SPEAKN.H$ / speakn
Encoding:
Text File  |  1992-03-18  |  3.2 KB  |  105 lines

  1. // speakn.h : Declares the class interfaces for the SpeakN application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. //
  13.  
  14. #ifndef RC_INVOKED
  15. #include <afxwin.h>         // core of MFC
  16. #include <afxpen.h>         // PenWindows extras
  17. #else
  18. #include <windows.h>
  19. #include <afxres.h>
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // Control IDs for main dialog
  24.  
  25. #define IDC_PICTURE                 201
  26. #define IDC_STATUS_FACE             202
  27. #define IDC_PROMPT_TEXT             203
  28. #define IDC_REPLAY_SOUND            204
  29. #define IDC_GIVE_UP                 205
  30. #define IDC_INPUT_EDIT              206
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Standard sounds 
  34. #define IDSOUND_WELCOME         101
  35. #define IDSOUND_QUESTION        102
  36. #define IDSOUND_CORRECT         103
  37. #define IDSOUND_INCORRECT       104
  38. #define IDSOUND_GIVEUP          105
  39. #define IDSOUND_GOODBYE         106
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Icon IDs
  43.  
  44. #define IDI_FACE_NEUTRAL    10
  45. #define IDI_FACE_HAPPY      11
  46. #define IDI_FACE_HAPPIER    12
  47. #define IDI_FACE_SAD        13
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CSpeakNDlg:
  51. //   The main user interface to this application is just one big dialog
  52.  
  53. class CSpeakNDlg : public CModalDialog
  54. {
  55. // Constructors
  56. public:
  57.     CSpeakNDlg() : CModalDialog("MainDialog")
  58.         { m_lpszNextQuestion = NULL; }
  59.     BOOL LoadLesson(LPCSTR lpLessonName);
  60.  
  61. // Operations
  62.     void        AdvanceLesson();
  63.  
  64. // Attributes (the current question/lesson)
  65.     // current question (from resource)
  66.     CString         m_targetWord;           // target word (upper case)
  67.  
  68.     // resource containing all the questions
  69.     LPCSTR          m_lpszNextQuestion; // empty string => done
  70.  
  71. // Implementation
  72. protected:
  73.     // special controls
  74.     CFont           m_biggerFont;
  75.     CBitmapButton   m_pictureButton; // main bitmap done as a special button
  76.     CBitmapButton   m_replayButton; // bitmap button for replay sound
  77.  
  78.     // normal Windows controls
  79.     CStatic&    StatusFace()    // face which smiles or frowns
  80.                     { return *(CStatic*)GetDlgItem(IDC_STATUS_FACE); }
  81.     CStatic&    PromptText()    // prompt area
  82.                     { return *(CStatic*)GetDlgItem(IDC_PROMPT_TEXT); }
  83.     CBEdit&     InputEdit()     // user input (a Pen Boxed Edit)
  84.                     { return *(CBEdit*)GetDlgItem(IDC_INPUT_EDIT); }
  85.  
  86.     // message handlers
  87.     virtual BOOL OnInitDialog();
  88.     afx_msg void OnReplaySound();
  89.     afx_msg void OnUpdateStatus();
  90.     virtual void OnOK();        // Guess
  91.     virtual void OnGiveUp();
  92.     DECLARE_MESSAGE_MAP()
  93. };
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CSpeakNApp:
  97.  
  98. class CSpeakNApp : public CWinApp
  99. {
  100. public:
  101.     BOOL InitInstance();
  102. };
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105.