11#pragma once
2+ namespace XRay
3+ {
4+ namespace ECore
5+ {
6+ namespace Props
7+ {
8+ ref class TextEdit ;
9+ }
10+ }
11+ }
212
313namespace XRay
414{
@@ -15,12 +25,19 @@ using namespace System::Drawing;
1525
1626public ref class TextEdit : public System ::Windows::Forms::Form
1727{
28+ using TOnApplyClick = fastdelegate::FastDelegate1<pcstr, bool >;
29+ using TOnCloseClick = fastdelegate::FastDelegate0<bool >;
30+ using TOnCodeInsight = fastdelegate::FastDelegate3<const xr_string&, xr_string&, bool &>;
31+
1832public:
1933 TextEdit (void )
2034 {
2135 InitializeComponent ();
2236 }
2337
38+ TextEdit (xr_string& text, pcstr caption, bool read_only, int lim, pcstr apply_name,
39+ TOnApplyClick on_apply, TOnCloseClick on_close, TOnCodeInsight on_insight);
40+
2441protected:
2542 ~TextEdit ()
2643 {
@@ -32,18 +49,22 @@ public ref class TextEdit : public System::Windows::Forms::Form
3249
3350private:
3451 xr_string* m_text;
35- delegate void TOnApplyClick (pcstr, bool ) ;
36- delegate void TOnCloseClick ( bool ) ;
37- delegate void TOnCodeInsight ( const xr_string&, xr_string&, bool &) ;
52+ TOnApplyClick* onApplyClick ;
53+ TOnCloseClick* onCloseClick ;
54+ TOnCodeInsight* onCodeInsight ;
3855
3956public:
4057 bool Run (xr_string& text, pcstr caption, bool read_only, int lim,
41- pcstr apply_name, TOnApplyClick^ on_apply, TOnCloseClick^ on_close,
42- TOnCodeInsight^ on_insight);
43-
58+ pcstr apply_name, TOnApplyClick on_apply, TOnCloseClick on_close,
59+ TOnCodeInsight on_insight);
4460
4561private: System::Void buttonOk_Click (System::Object^ sender, System::EventArgs^ e);
4662private: System::Void buttonClear_Click (System::Object^ sender, System::EventArgs^ e);
63+ private: System::Void buttonApply_Click (System::Object^ sender, System::EventArgs^ e);
64+ private: System::Void buttonLoad_Click (System::Object^ sender, System::EventArgs^ e);
65+ private: System::Void buttonSave_Click (System::Object^ sender, System::EventArgs^ e);
66+
67+ private: System::Void textBox1_KeyPress (System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e);
4768private: System::Void textBox1_SelectionChanged (System::Object^ sender, System::EventArgs^ e);
4869
4970private: System::Windows::Forms::Button^ buttonOk;
@@ -93,6 +114,7 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
93114 this ->textBox1 ->TabIndex = 0 ;
94115 this ->textBox1 ->Text = L" " ;
95116 this ->textBox1 ->SelectionChanged += gcnew System::EventHandler (this , &TextEdit::textBox1_SelectionChanged);
117+ this ->textBox1 ->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler (this , &TextEdit::textBox1_KeyPress);
96118 this ->buttonOk ->Anchor = System::Windows::Forms::AnchorStyles::Top;
97119 this ->buttonOk ->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
98120 this ->buttonOk ->DialogResult = System::Windows::Forms::DialogResult::OK;
@@ -118,20 +140,23 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
118140 this ->buttonApply ->TabIndex = 3 ;
119141 this ->buttonApply ->Text = L" Apply" ;
120142 this ->buttonApply ->UseVisualStyleBackColor = true ;
143+ this ->buttonApply ->Click += gcnew System::EventHandler (this , &TextEdit::buttonApply_Click);
121144 this ->buttonLoad ->Anchor = System::Windows::Forms::AnchorStyles::Top;
122145 this ->buttonLoad ->Location = System::Drawing::Point (222 , 0 );
123146 this ->buttonLoad ->Name = L" buttonLoad" ;
124147 this ->buttonLoad ->Size = System::Drawing::Size (75 , 23 );
125148 this ->buttonLoad ->TabIndex = 4 ;
126149 this ->buttonLoad ->Text = L" Load" ;
127150 this ->buttonLoad ->UseVisualStyleBackColor = true ;
151+ this ->buttonLoad ->Click += gcnew System::EventHandler (this , &TextEdit::buttonLoad_Click);
128152 this ->buttonSave ->Anchor = System::Windows::Forms::AnchorStyles::Top;
129153 this ->buttonSave ->Location = System::Drawing::Point (296 , 0 );
130154 this ->buttonSave ->Name = L" buttonSave" ;
131155 this ->buttonSave ->Size = System::Drawing::Size (75 , 23 );
132156 this ->buttonSave ->TabIndex = 5 ;
133157 this ->buttonSave ->Text = L" Save" ;
134158 this ->buttonSave ->UseVisualStyleBackColor = true ;
159+ this ->buttonSave ->Click += gcnew System::EventHandler (this , &TextEdit::buttonSave_Click);
135160 this ->buttonClear ->Anchor = System::Windows::Forms::AnchorStyles::Top;
136161 this ->buttonClear ->Location = System::Drawing::Point (370 , 0 );
137162 this ->buttonClear ->Name = L" buttonClear" ;
@@ -169,9 +194,8 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
169194 this ->toolStripStatusLabel2 ->Size = System::Drawing::Size (0 , 17 );
170195 this ->toolStripStatusLabel3 ->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
171196 this ->toolStripStatusLabel3 ->Name = L" toolStripStatusLabel3" ;
172- this ->toolStripStatusLabel3 ->Size = System::Drawing::Size (376 , 17 );
197+ this ->toolStripStatusLabel3 ->Size = System::Drawing::Size (345 , 17 );
173198 this ->toolStripStatusLabel3 ->Spring = true ;
174- this ->toolStripStatusLabel3 ->Text = L" Description" ;
175199 this ->AcceptButton = this ->buttonOk ;
176200 this ->AutoScaleDimensions = System::Drawing::SizeF (6 , 13 );
177201 this ->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
0 commit comments