-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainframe.cpp
92 lines (75 loc) · 3.18 KB
/
mainframe.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/////////////////////////////////////////////////////////////////////////////
// Name: mainframe.cpp
// Purpose: Main frame for the application
// Author: Brad Larsen
// Modified by:
// Created: Dec 3, 2004
// RCS-ID:
// Copyright: (c) Brad Larsen
// License: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include "stdwx.h"
#include "mainframe.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_CLASS(MainFrame, wxDocMDIParentFrame)
BEGIN_EVENT_TABLE(MainFrame, wxDocMDIParentFrame)
EVT_MENU(IDM_HELP_ABOUT, MainFrame::OnHelpAbout)
EVT_MENU(IDM_TOOLS_MERGE_SCORES, MainFrame::OnToolsMergeScores)
EVT_MENU(IDM_TEST_TESTINGFRAMEWORK, MainFrame::OnTestTestingFramework)
EVT_MENU(IDM_TEST_BATCHFILESERIALIZATION, MainFrame::OnTestBatchFileSerialization)
EVT_MENU(IDM_TEST_STATISTICALANALYSIS, MainFrame::OnTestStatisticalAnalysis)
END_EVENT_TABLE()
// Constructor/Destructor
MainFrame::MainFrame(wxDocManager* manager, wxFrame* frame,
const wxString& title, const wxPoint& pos, const wxSize& size, long type) :
wxDocMDIParentFrame(manager, frame, -1, title, pos, size, type,
wxT("MainFrame"))
{
//------Last Checked------//
// - Dec 31, 2004
}
// Operations
/// Creates a child frame for a view
/// @param document Document for the view that the frame is to be created for
/// @param view View that the frame is to be created for
/// @return A pointer to the newly created child frame, or NULL if the child
/// frame could not be created
wxMDIChildFrame* MainFrame::CreateChildFrame(wxDocument* document,
wxView* view)
{
//------Last Checked------//
// - Dec 31, 2004
// Create the child frame
wxDocMDIChildFrame* childframe =
new wxDocMDIChildFrame(document, view, this, -1, wxT("Child Frame"),
wxPoint(10,10), wxSize(300,300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE | wxMAXIMIZE);
// Create the child frame menu
// TODO: Add any menu items specific to a view here
// File Menu
wxMenu* file_menu = new wxMenu;
file_menu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"));
file_menu->Append(wxID_CLOSE, wxT("&Close"));
// ** NOTE: Uncomment the following two lines to allow Save functionality **
// This can be dangerous: i.e. don't overwrite your existing files!
//file_menu->AppendSeparator();
//file_menu->Append(wxID_SAVEAS, wxT("Save &As..."));
file_menu->AppendSeparator();
file_menu->Append(wxID_EXIT, wxT("E&xit"));
// Test Menu
wxMenu* test_menu = new wxMenu;
test_menu->Append(IDM_TEST_PARSE_FILE, wxT("&Parse File"));
// Help Menu
wxMenu* help_menu = new wxMenu;
help_menu->Append(IDM_HELP_ABOUT, wxT("&About"));
// Menu Bar
wxMenuBar* menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, wxT("&File"));
menu_bar->Append(test_menu, wxT("&Test"));
menu_bar->Append(help_menu, wxT("&Help"));
// Attach the menu bar to the child frame
childframe->SetMenuBar(menu_bar);
return (childframe);
}