@@ -30,14 +30,21 @@ public ref class TextEdit : public System::Windows::Forms::Form
3030 }
3131 }
3232
33- public:
34- bool Run ();
35-
3633private:
3734 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 &);
38+
39+ public:
40+ 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+
3844
3945private: System::Void buttonOk_Click (System::Object^ sender, System::EventArgs^ e);
4046private: System::Void buttonClear_Click (System::Object^ sender, System::EventArgs^ e);
47+ private: System::Void textBox1_SelectionChanged (System::Object^ sender, System::EventArgs^ e);
4148
4249private: System::Windows::Forms::Button^ buttonOk;
4350private: System::Windows::Forms::Button^ buttonCancel;
@@ -47,7 +54,7 @@ private: System::Windows::Forms::Button^ buttonSave;
4754private: System::Windows::Forms::Button^ buttonClear;
4855
4956private: System::Windows::Forms::Panel^ panel1;
50- private: System::Windows::Forms::TextBox ^ textBox1;
57+ private: System::Windows::Forms::RichTextBox ^ textBox1;
5158
5259private: System::Windows::Forms::StatusStrip^ statusStrip1;
5360private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
@@ -61,7 +68,7 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
6168#pragma region Windows Form Designer generated code
6269 void InitializeComponent (void )
6370 {
64- this ->textBox1 = (gcnew System::Windows::Forms::TextBox ());
71+ this ->textBox1 = (gcnew System::Windows::Forms::RichTextBox ());
6572 this ->buttonOk = (gcnew System::Windows::Forms::Button ());
6673 this ->buttonCancel = (gcnew System::Windows::Forms::Button ());
6774 this ->buttonApply = (gcnew System::Windows::Forms::Button ());
@@ -76,23 +83,16 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
7683 this ->panel1 ->SuspendLayout ();
7784 this ->statusStrip1 ->SuspendLayout ();
7885 this ->SuspendLayout ();
79- //
80- // textBox1
81- //
82- this ->textBox1 ->AcceptsReturn = true ;
8386 this ->textBox1 ->AcceptsTab = true ;
8487 this ->textBox1 ->Anchor = static_cast <System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
8588 | System::Windows::Forms::AnchorStyles::Left)
8689 | System::Windows::Forms::AnchorStyles::Right));
8790 this ->textBox1 ->Location = System::Drawing::Point (0 , 25 );
88- this ->textBox1 ->Multiline = true ;
8991 this ->textBox1 ->Name = L" textBox1" ;
90- this ->textBox1 ->ScrollBars = System::Windows::Forms::ScrollBars::Both;
9192 this ->textBox1 ->Size = System::Drawing::Size (445 , 217 );
9293 this ->textBox1 ->TabIndex = 0 ;
93- //
94- // buttonOk
95- //
94+ this ->textBox1 ->Text = L" " ;
95+ this ->textBox1 ->SelectionChanged += gcnew System::EventHandler (this , &TextEdit::textBox1_SelectionChanged);
9696 this ->buttonOk ->Anchor = System::Windows::Forms::AnchorStyles::Top;
9797 this ->buttonOk ->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
9898 this ->buttonOk ->DialogResult = System::Windows::Forms::DialogResult::OK;
@@ -103,9 +103,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
103103 this ->buttonOk ->Text = L" Ok" ;
104104 this ->buttonOk ->UseVisualStyleBackColor = true ;
105105 this ->buttonOk ->Click += gcnew System::EventHandler (this , &TextEdit::buttonOk_Click);
106- //
107- // buttonCancel
108- //
109106 this ->buttonCancel ->Anchor = System::Windows::Forms::AnchorStyles::Top;
110107 this ->buttonCancel ->DialogResult = System::Windows::Forms::DialogResult::Cancel;
111108 this ->buttonCancel ->Location = System::Drawing::Point (74 , 0 );
@@ -114,39 +111,27 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
114111 this ->buttonCancel ->TabIndex = 2 ;
115112 this ->buttonCancel ->Text = L" Cancel" ;
116113 this ->buttonCancel ->UseVisualStyleBackColor = true ;
117- //
118- // buttonApply
119- //
120114 this ->buttonApply ->Anchor = System::Windows::Forms::AnchorStyles::Top;
121115 this ->buttonApply ->Location = System::Drawing::Point (148 , 0 );
122116 this ->buttonApply ->Name = L" buttonApply" ;
123117 this ->buttonApply ->Size = System::Drawing::Size (75 , 23 );
124118 this ->buttonApply ->TabIndex = 3 ;
125119 this ->buttonApply ->Text = L" Apply" ;
126120 this ->buttonApply ->UseVisualStyleBackColor = true ;
127- //
128- // buttonLoad
129- //
130121 this ->buttonLoad ->Anchor = System::Windows::Forms::AnchorStyles::Top;
131122 this ->buttonLoad ->Location = System::Drawing::Point (222 , 0 );
132123 this ->buttonLoad ->Name = L" buttonLoad" ;
133124 this ->buttonLoad ->Size = System::Drawing::Size (75 , 23 );
134125 this ->buttonLoad ->TabIndex = 4 ;
135126 this ->buttonLoad ->Text = L" Load" ;
136127 this ->buttonLoad ->UseVisualStyleBackColor = true ;
137- //
138- // buttonSave
139- //
140128 this ->buttonSave ->Anchor = System::Windows::Forms::AnchorStyles::Top;
141129 this ->buttonSave ->Location = System::Drawing::Point (296 , 0 );
142130 this ->buttonSave ->Name = L" buttonSave" ;
143131 this ->buttonSave ->Size = System::Drawing::Size (75 , 23 );
144132 this ->buttonSave ->TabIndex = 5 ;
145133 this ->buttonSave ->Text = L" Save" ;
146134 this ->buttonSave ->UseVisualStyleBackColor = true ;
147- //
148- // buttonClear
149- //
150135 this ->buttonClear ->Anchor = System::Windows::Forms::AnchorStyles::Top;
151136 this ->buttonClear ->Location = System::Drawing::Point (370 , 0 );
152137 this ->buttonClear ->Name = L" buttonClear" ;
@@ -155,9 +140,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
155140 this ->buttonClear ->Text = L" Clear" ;
156141 this ->buttonClear ->UseVisualStyleBackColor = true ;
157142 this ->buttonClear ->Click += gcnew System::EventHandler (this , &TextEdit::buttonClear_Click);
158- //
159- // panel1
160- //
161143 this ->panel1 ->Controls ->Add (this ->buttonOk );
162144 this ->panel1 ->Controls ->Add (this ->buttonClear );
163145 this ->panel1 ->Controls ->Add (this ->buttonCancel );
@@ -169,9 +151,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
169151 this ->panel1 ->Name = L" panel1" ;
170152 this ->panel1 ->Size = System::Drawing::Size (445 , 24 );
171153 this ->panel1 ->TabIndex = 7 ;
172- //
173- // statusStrip1
174- //
175154 this ->statusStrip1 ->Items ->AddRange (gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3 ) {
176155 this ->toolStripStatusLabel1 ,
177156 this ->toolStripStatusLabel2 , this ->toolStripStatusLabel3
@@ -181,30 +160,18 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
181160 this ->statusStrip1 ->Size = System::Drawing::Size (445 , 22 );
182161 this ->statusStrip1 ->TabIndex = 8 ;
183162 this ->statusStrip1 ->Text = L" statusStrip1" ;
184- //
185- // toolStripStatusLabel1
186- //
187163 this ->toolStripStatusLabel1 ->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
188164 this ->toolStripStatusLabel1 ->Name = L" toolStripStatusLabel1" ;
189165 this ->toolStripStatusLabel1 ->Size = System::Drawing::Size (54 , 17 );
190166 this ->toolStripStatusLabel1 ->Text = L" Position" ;
191- //
192- // toolStripStatusLabel2
193- //
194167 this ->toolStripStatusLabel2 ->Enabled = false ;
195168 this ->toolStripStatusLabel2 ->Name = L" toolStripStatusLabel2" ;
196169 this ->toolStripStatusLabel2 ->Size = System::Drawing::Size (0 , 17 );
197- //
198- // toolStripStatusLabel3
199- //
200170 this ->toolStripStatusLabel3 ->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
201171 this ->toolStripStatusLabel3 ->Name = L" toolStripStatusLabel3" ;
202172 this ->toolStripStatusLabel3 ->Size = System::Drawing::Size (376 , 17 );
203173 this ->toolStripStatusLabel3 ->Spring = true ;
204174 this ->toolStripStatusLabel3 ->Text = L" Description" ;
205- //
206- // TextEdit
207- //
208175 this ->AcceptButton = this ->buttonOk ;
209176 this ->AutoScaleDimensions = System::Drawing::SizeF (6 , 13 );
210177 this ->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
@@ -215,7 +182,7 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
215182 this ->Controls ->Add (this ->textBox1 );
216183 this ->FormBorderStyle = System::Windows::Forms::FormBorderStyle::SizableToolWindow;
217184 this ->Name = L" TextEdit" ;
218- this ->Text = L" TextForm " ;
185+ this ->Text = L" TextEdit " ;
219186 this ->panel1 ->ResumeLayout (false );
220187 this ->statusStrip1 ->ResumeLayout (false );
221188 this ->statusStrip1 ->PerformLayout ();
@@ -225,6 +192,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
225192 }
226193#pragma endregion
227194};
228- }
229- }
230- }
195+ } // namespace Props
196+ } // namespace ECore
197+ } // namespace XRay
0 commit comments