Skip to content

Commit f251384

Browse files
committed
xrEProps: add TextEdit form stub
1 parent 4f1bdda commit f251384

File tree

5 files changed

+385
-0
lines changed

5 files changed

+385
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "pch.hpp"
2+
#include "TextEdit.h"
3+
4+
System::Void XRay::ECore::Props::TextEdit::buttonClear_Click(System::Object^ sender, System::EventArgs^ e)
5+
{
6+
textBox1->Clear();
7+
}
8+
9+
System::Void XRay::ECore::Props::TextEdit::buttonOk_Click(System::Object^ sender, System::EventArgs^ e)
10+
{
11+
//marshal this
12+
//*m_text = textBox1->Text;
13+
}
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
#pragma once
2+
3+
namespace XRay
4+
{
5+
namespace ECore
6+
{
7+
namespace Props
8+
{
9+
using namespace System;
10+
using namespace System::ComponentModel;
11+
using namespace System::Collections;
12+
using namespace System::Windows::Forms;
13+
using namespace System::Data;
14+
using namespace System::Drawing;
15+
16+
public ref class TextEdit : public System::Windows::Forms::Form
17+
{
18+
public:
19+
TextEdit(void)
20+
{
21+
InitializeComponent();
22+
}
23+
24+
protected:
25+
~TextEdit()
26+
{
27+
if (components)
28+
{
29+
delete components;
30+
}
31+
}
32+
33+
public:
34+
bool Run();
35+
36+
private:
37+
xr_string* m_text;
38+
39+
private: System::Void buttonOk_Click(System::Object^ sender, System::EventArgs^ e);
40+
private: System::Void buttonClear_Click(System::Object^ sender, System::EventArgs^ e);
41+
42+
private: System::Windows::Forms::Button^ buttonOk;
43+
private: System::Windows::Forms::Button^ buttonCancel;
44+
private: System::Windows::Forms::Button^ buttonApply;
45+
private: System::Windows::Forms::Button^ buttonLoad;
46+
private: System::Windows::Forms::Button^ buttonSave;
47+
private: System::Windows::Forms::Button^ buttonClear;
48+
49+
private: System::Windows::Forms::Panel^ panel1;
50+
private: System::Windows::Forms::TextBox^ textBox1;
51+
52+
private: System::Windows::Forms::StatusStrip^ statusStrip1;
53+
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
54+
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel2;
55+
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
56+
57+
58+
private:
59+
System::ComponentModel::Container^ components;
60+
61+
#pragma region Windows Form Designer generated code
62+
void InitializeComponent(void)
63+
{
64+
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
65+
this->buttonOk = (gcnew System::Windows::Forms::Button());
66+
this->buttonCancel = (gcnew System::Windows::Forms::Button());
67+
this->buttonApply = (gcnew System::Windows::Forms::Button());
68+
this->buttonLoad = (gcnew System::Windows::Forms::Button());
69+
this->buttonSave = (gcnew System::Windows::Forms::Button());
70+
this->buttonClear = (gcnew System::Windows::Forms::Button());
71+
this->panel1 = (gcnew System::Windows::Forms::Panel());
72+
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
73+
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
74+
this->toolStripStatusLabel2 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
75+
this->toolStripStatusLabel3 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
76+
this->panel1->SuspendLayout();
77+
this->statusStrip1->SuspendLayout();
78+
this->SuspendLayout();
79+
//
80+
// textBox1
81+
//
82+
this->textBox1->AcceptsReturn = true;
83+
this->textBox1->AcceptsTab = true;
84+
this->textBox1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
85+
| System::Windows::Forms::AnchorStyles::Left)
86+
| System::Windows::Forms::AnchorStyles::Right));
87+
this->textBox1->Location = System::Drawing::Point(0, 25);
88+
this->textBox1->Multiline = true;
89+
this->textBox1->Name = L"textBox1";
90+
this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
91+
this->textBox1->Size = System::Drawing::Size(445, 217);
92+
this->textBox1->TabIndex = 0;
93+
//
94+
// buttonOk
95+
//
96+
this->buttonOk->Anchor = System::Windows::Forms::AnchorStyles::Top;
97+
this->buttonOk->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
98+
this->buttonOk->DialogResult = System::Windows::Forms::DialogResult::OK;
99+
this->buttonOk->Location = System::Drawing::Point(0, 0);
100+
this->buttonOk->Name = L"buttonOk";
101+
this->buttonOk->Size = System::Drawing::Size(75, 23);
102+
this->buttonOk->TabIndex = 1;
103+
this->buttonOk->Text = L"Ok";
104+
this->buttonOk->UseVisualStyleBackColor = true;
105+
this->buttonOk->Click += gcnew System::EventHandler(this, &TextEdit::buttonOk_Click);
106+
//
107+
// buttonCancel
108+
//
109+
this->buttonCancel->Anchor = System::Windows::Forms::AnchorStyles::Top;
110+
this->buttonCancel->DialogResult = System::Windows::Forms::DialogResult::Cancel;
111+
this->buttonCancel->Location = System::Drawing::Point(74, 0);
112+
this->buttonCancel->Name = L"buttonCancel";
113+
this->buttonCancel->Size = System::Drawing::Size(75, 23);
114+
this->buttonCancel->TabIndex = 2;
115+
this->buttonCancel->Text = L"Cancel";
116+
this->buttonCancel->UseVisualStyleBackColor = true;
117+
//
118+
// buttonApply
119+
//
120+
this->buttonApply->Anchor = System::Windows::Forms::AnchorStyles::Top;
121+
this->buttonApply->Location = System::Drawing::Point(148, 0);
122+
this->buttonApply->Name = L"buttonApply";
123+
this->buttonApply->Size = System::Drawing::Size(75, 23);
124+
this->buttonApply->TabIndex = 3;
125+
this->buttonApply->Text = L"Apply";
126+
this->buttonApply->UseVisualStyleBackColor = true;
127+
//
128+
// buttonLoad
129+
//
130+
this->buttonLoad->Anchor = System::Windows::Forms::AnchorStyles::Top;
131+
this->buttonLoad->Location = System::Drawing::Point(222, 0);
132+
this->buttonLoad->Name = L"buttonLoad";
133+
this->buttonLoad->Size = System::Drawing::Size(75, 23);
134+
this->buttonLoad->TabIndex = 4;
135+
this->buttonLoad->Text = L"Load";
136+
this->buttonLoad->UseVisualStyleBackColor = true;
137+
//
138+
// buttonSave
139+
//
140+
this->buttonSave->Anchor = System::Windows::Forms::AnchorStyles::Top;
141+
this->buttonSave->Location = System::Drawing::Point(296, 0);
142+
this->buttonSave->Name = L"buttonSave";
143+
this->buttonSave->Size = System::Drawing::Size(75, 23);
144+
this->buttonSave->TabIndex = 5;
145+
this->buttonSave->Text = L"Save";
146+
this->buttonSave->UseVisualStyleBackColor = true;
147+
//
148+
// buttonClear
149+
//
150+
this->buttonClear->Anchor = System::Windows::Forms::AnchorStyles::Top;
151+
this->buttonClear->Location = System::Drawing::Point(370, 0);
152+
this->buttonClear->Name = L"buttonClear";
153+
this->buttonClear->Size = System::Drawing::Size(75, 23);
154+
this->buttonClear->TabIndex = 6;
155+
this->buttonClear->Text = L"Clear";
156+
this->buttonClear->UseVisualStyleBackColor = true;
157+
this->buttonClear->Click += gcnew System::EventHandler(this, &TextEdit::buttonClear_Click);
158+
//
159+
// panel1
160+
//
161+
this->panel1->Controls->Add(this->buttonOk);
162+
this->panel1->Controls->Add(this->buttonClear);
163+
this->panel1->Controls->Add(this->buttonCancel);
164+
this->panel1->Controls->Add(this->buttonSave);
165+
this->panel1->Controls->Add(this->buttonApply);
166+
this->panel1->Controls->Add(this->buttonLoad);
167+
this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
168+
this->panel1->Location = System::Drawing::Point(0, 0);
169+
this->panel1->Name = L"panel1";
170+
this->panel1->Size = System::Drawing::Size(445, 24);
171+
this->panel1->TabIndex = 7;
172+
//
173+
// statusStrip1
174+
//
175+
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {
176+
this->toolStripStatusLabel1,
177+
this->toolStripStatusLabel2, this->toolStripStatusLabel3
178+
});
179+
this->statusStrip1->Location = System::Drawing::Point(0, 242);
180+
this->statusStrip1->Name = L"statusStrip1";
181+
this->statusStrip1->Size = System::Drawing::Size(445, 22);
182+
this->statusStrip1->TabIndex = 8;
183+
this->statusStrip1->Text = L"statusStrip1";
184+
//
185+
// toolStripStatusLabel1
186+
//
187+
this->toolStripStatusLabel1->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
188+
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
189+
this->toolStripStatusLabel1->Size = System::Drawing::Size(54, 17);
190+
this->toolStripStatusLabel1->Text = L"Position";
191+
//
192+
// toolStripStatusLabel2
193+
//
194+
this->toolStripStatusLabel2->Enabled = false;
195+
this->toolStripStatusLabel2->Name = L"toolStripStatusLabel2";
196+
this->toolStripStatusLabel2->Size = System::Drawing::Size(0, 17);
197+
//
198+
// toolStripStatusLabel3
199+
//
200+
this->toolStripStatusLabel3->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
201+
this->toolStripStatusLabel3->Name = L"toolStripStatusLabel3";
202+
this->toolStripStatusLabel3->Size = System::Drawing::Size(376, 17);
203+
this->toolStripStatusLabel3->Spring = true;
204+
this->toolStripStatusLabel3->Text = L"Description";
205+
//
206+
// TextEdit
207+
//
208+
this->AcceptButton = this->buttonOk;
209+
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
210+
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
211+
this->CancelButton = this->buttonCancel;
212+
this->ClientSize = System::Drawing::Size(445, 264);
213+
this->Controls->Add(this->statusStrip1);
214+
this->Controls->Add(this->panel1);
215+
this->Controls->Add(this->textBox1);
216+
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::SizableToolWindow;
217+
this->Name = L"TextEdit";
218+
this->Text = L"TextForm";
219+
this->panel1->ResumeLayout(false);
220+
this->statusStrip1->ResumeLayout(false);
221+
this->statusStrip1->PerformLayout();
222+
this->ResumeLayout(false);
223+
this->PerformLayout();
224+
225+
}
226+
#pragma endregion
227+
};
228+
}
229+
}
230+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:element name="root" msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choice maxOccurs="unbounded">
67+
<xsd:element name="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" use="required" type="xsd:string" />
73+
<xsd:attribute name="type" type="xsd:string" />
74+
<xsd:attribute name="mimetype" type="xsd:string" />
75+
<xsd:attribute ref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:element name="assembly">
79+
<xsd:complexType>
80+
<xsd:attribute name="alias" type="xsd:string" />
81+
<xsd:attribute name="name" type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:element name="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+
<xsd:attribute ref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:element name="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attribute name="name" type="xsd:string" use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheader name="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheader name="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheader name="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheader name="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>17, 17</value>
122+
</metadata>
123+
</root>

src/editors/xrECore/xrECore.vcxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<ClCompile Include="Props\GameType.cpp" />
9090
<ClCompile Include="Props\NumericVector.cpp" />
9191
<ClCompile Include="Props\ShaderFunction.cpp" />
92+
<ClCompile Include="Props\TextEdit.cpp" />
9293
<ClCompile Include="xrEProps.cpp" />
9394
</ItemGroup>
9495
<ItemGroup>
@@ -102,6 +103,9 @@
102103
<ClInclude Include="Props\ShaderFunction.h">
103104
<FileType>CppForm</FileType>
104105
</ClInclude>
106+
<ClInclude Include="Props\TextEdit.h">
107+
<FileType>CppForm</FileType>
108+
</ClInclude>
105109
<ClInclude Include="Token.h" />
106110
<ClInclude Include="xrEProps.h" />
107111
</ItemGroup>
@@ -123,6 +127,9 @@
123127
<EmbeddedResource Include="Props\ShaderFunction.resx">
124128
<DependentUpon>Props\ShaderFunction.h</DependentUpon>
125129
</EmbeddedResource>
130+
<EmbeddedResource Include="Props\TextEdit.resx">
131+
<DependentUpon>Props\TextEdit.h</DependentUpon>
132+
</EmbeddedResource>
126133
</ItemGroup>
127134
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
128135
<ImportGroup Label="ExtensionTargets">

0 commit comments

Comments
 (0)