Question: Complete this C++ Program, directions are in the code! BaronNotepad.cpp: // BaronNotepad.cpp : Defines the class behaviors for the application. // #include stdafx.h #include BaronNotepad.h
Complete this C++ Program, directions are in the code!
BaronNotepad.cpp:
// BaronNotepad.cpp : Defines the class behaviors for the application. // #include "stdafx.h" #include "BaronNotepad.h" #include "BaronNotepadDlg.h" #include "Logic.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CBaronNotepadApp BEGIN_MESSAGE_MAP(CBaronNotepadApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() // CBaronNotepadApp construction CBaronNotepadApp::CBaronNotepadApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance mMainLogic = new Logic; } // The one and only CBaronNotepadApp object CBaronNotepadApp theApp; // CBaronNotepadApp initialization BOOL CBaronNotepadApp::InitInstance() { CWinApp::InitInstance(); // Create the shell manager, in case the dialog contains // any shell tree view or shell list view controls. CShellManager *pShellManager = new CShellManager; // Activate "Windows Native" visual manager for enabling themes in MFC controls CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); CBaronNotepadDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } else if (nResponse == -1) { TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly. "); TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS. "); } // Delete the shell manager created above. if (pShellManager != NULL) { delete pShellManager; } #if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS) ControlBarCleanUp(); #endif // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
BaronNotePad.h:
// BaronNotepad.h : main header file for the PROJECT_NAME application // #pragma once #ifndef __AFXWIN_H__ #error "include 'stdafx.h' before including this file for PCH" #endif #include "resource.h" // main symbols // CBaronNotepadApp: // See BaronNotepad.cpp for the implementation of this class // class Logic; class CBaronNotepadApp : public CWinApp { public: CBaronNotepadApp(); // Overrides public: virtual BOOL InitInstance(); Logic *mMainLogic; // Implementation DECLARE_MESSAGE_MAP() }; extern CBaronNotepadApp theApp;
BaronNotepadDig.cpp:
// BaronNotepadDlg.cpp : implementation file // #include "stdafx.h" #include "BaronNotepad.h" #include "BaronNotepadDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CBaronNotepadDlg dialog CBaronNotepadDlg::CBaronNotepadDlg(CWnd* pParent /*=NULL*/) : CDialog(IDD_BARONNOTEPAD_DIALOG, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CBaronNotepadDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CBaronNotepadDlg, CDialog) ON_WM_PAINT() ON_WM_QUERYDRAGICON() END_MESSAGE_MAP() // CBaronNotepadDlg message handlers BOOL CBaronNotepadDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CBaronNotepadDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this function to obtain the cursor to display while the user drags // the minimized window. HCURSOR CBaronNotepadDlg::OnQueryDragIcon() { return static_cast(m_hIcon); }
BaronNotePadDig.h:
// BaronNotepadDlg.h : header file // #pragma once // CBaronNotepadDlg dialog class CBaronNotepadDlg : public CDialog { // Construction public: CBaronNotepadDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_BARONNOTEPAD_DIALOG }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: HICON m_hIcon; // Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() };
Logic.cpp:
#include "stdafx.h" #include "Logic.h" Logic::Logic() { } Logic::~Logic() { }
Logic.h:
#pragma once class Logic { public: Logic(); ~Logic(); };
Rubric:
| Layout of buttons and text area |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeSave file |
| 4.0 pts | ||
| This criterion is linked to a Learning OutcomeLoad file |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeSave/Load enter key |
| 4.0 pts | ||
| This criterion is linked to a Learning OutcomeMVC |
| 4.0 pts | ||
| This criterion is linked to a Learning OutcomeButton to clear text |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeButton to remove all of the letter e from the displayed text |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeWord wrap |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeText field and a button for "Find". Press it and it moves the cursor to the start of the first time that appears |
| 4.0 pts | ||
| This criterion is linked to a Learning OutcomeText field that lets you type in a file name instead of just saving to savea and saveb |
| 2.0 pts | ||
| This criterion is linked to a Learning OutcomeCheckbox or radio button that disables vowels from being typed. Leaves existing vowels. |
| 2.0 pts | ||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
