-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostExperimentForm.h
More file actions
123 lines (111 loc) · 3.58 KB
/
PostExperimentForm.h
File metadata and controls
123 lines (111 loc) · 3.58 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* PostExperimentForm.h
* --------------------
* Component and event code for the windows form that collects
* post experiment notes from the user.
*
* Created by John Whitworth on 8/26/14.
* Copyright 2015 Eileen Mazzochette, et al <emazz86@stanford.edu>
*/
#pragma once
#include <msclr/marshal.h>
#include <msclr/marshal_cppstd.h>
#include "Experiment.h"
namespace BehaviorRig20 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace msclr::interop;
/// <summary>
/// Summary for PostExperimentForm
/// </summary>
public ref class PostExperimentForm : public System::Windows::Forms::Form
{
public:
PostExperimentForm(Experiment* exp)
{
InitializeComponent();
this->experiment = exp;
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~PostExperimentForm()
{
if (components)
{
delete components;
}
}
private: Experiment* experiment;
private: System::Windows::Forms::TextBox^ postExpNotesTextBox;
private: System::Windows::Forms::Button^ okButton;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->postExpNotesTextBox = (gcnew System::Windows::Forms::TextBox());
this->okButton = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// postExpNotesTextBox
//
this->postExpNotesTextBox->Location = System::Drawing::Point(12, 12);
this->postExpNotesTextBox->Multiline = true;
this->postExpNotesTextBox->Name = L"postExpNotesTextBox";
this->postExpNotesTextBox->Size = System::Drawing::Size(260, 119);
this->postExpNotesTextBox->TabIndex = 10;
//
// okButton
//
this->okButton->Location = System::Drawing::Point(197, 137);
this->okButton->Name = L"okButton";
this->okButton->Size = System::Drawing::Size(75, 23);
this->okButton->TabIndex = 11;
this->okButton->Text = L"OK";
this->okButton->UseVisualStyleBackColor = true;
this->okButton->Click += gcnew System::EventHandler(this, &PostExperimentForm::okButton_Click);
//
// PostExperimentForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 166);
this->ControlBox = false;
this->Controls->Add(this->okButton);
this->Controls->Add(this->postExpNotesTextBox);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"PostExperimentForm";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Post Experiment Notes";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private:
/* Function: okButton_Click
* ------------------------
* Click event handler for okButton. Submits the user's notes to the experiment
* and closes the form.
*/
System::Void okButton_Click(System::Object^ sender, System::EventArgs^ e)
{
marshal_context^ context = gcnew marshal_context();
experiment->postExpNotes = context->marshal_as<string>(postExpNotesTextBox->Text);
this->DialogResult = Windows::Forms::DialogResult::OK;
this->Close();
}
};
}