@@ -30,14 +30,21 @@ public ref class TextEdit : public System::Windows::Forms::Form
30
30
}
31
31
}
32
32
33
- public:
34
- bool Run ();
35
-
36
33
private:
37
34
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
+
38
44
39
45
private: System::Void buttonOk_Click (System::Object^ sender, System::EventArgs^ e);
40
46
private: System::Void buttonClear_Click (System::Object^ sender, System::EventArgs^ e);
47
+ private: System::Void textBox1_SelectionChanged (System::Object^ sender, System::EventArgs^ e);
41
48
42
49
private: System::Windows::Forms::Button^ buttonOk;
43
50
private: System::Windows::Forms::Button^ buttonCancel;
@@ -47,7 +54,7 @@ private: System::Windows::Forms::Button^ buttonSave;
47
54
private: System::Windows::Forms::Button^ buttonClear;
48
55
49
56
private: System::Windows::Forms::Panel^ panel1;
50
- private: System::Windows::Forms::TextBox ^ textBox1;
57
+ private: System::Windows::Forms::RichTextBox ^ textBox1;
51
58
52
59
private: System::Windows::Forms::StatusStrip^ statusStrip1;
53
60
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
@@ -61,7 +68,7 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
61
68
#pragma region Windows Form Designer generated code
62
69
void InitializeComponent (void )
63
70
{
64
- this ->textBox1 = (gcnew System::Windows::Forms::TextBox ());
71
+ this ->textBox1 = (gcnew System::Windows::Forms::RichTextBox ());
65
72
this ->buttonOk = (gcnew System::Windows::Forms::Button ());
66
73
this ->buttonCancel = (gcnew System::Windows::Forms::Button ());
67
74
this ->buttonApply = (gcnew System::Windows::Forms::Button ());
@@ -76,23 +83,16 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
76
83
this ->panel1 ->SuspendLayout ();
77
84
this ->statusStrip1 ->SuspendLayout ();
78
85
this ->SuspendLayout ();
79
- //
80
- // textBox1
81
- //
82
- this ->textBox1 ->AcceptsReturn = true ;
83
86
this ->textBox1 ->AcceptsTab = true ;
84
87
this ->textBox1 ->Anchor = static_cast <System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
85
88
| System::Windows::Forms::AnchorStyles::Left)
86
89
| System::Windows::Forms::AnchorStyles::Right));
87
90
this ->textBox1 ->Location = System::Drawing::Point (0 , 25 );
88
- this ->textBox1 ->Multiline = true ;
89
91
this ->textBox1 ->Name = L" textBox1" ;
90
- this ->textBox1 ->ScrollBars = System::Windows::Forms::ScrollBars::Both;
91
92
this ->textBox1 ->Size = System::Drawing::Size (445 , 217 );
92
93
this ->textBox1 ->TabIndex = 0 ;
93
- //
94
- // buttonOk
95
- //
94
+ this ->textBox1 ->Text = L" " ;
95
+ this ->textBox1 ->SelectionChanged += gcnew System::EventHandler (this , &TextEdit::textBox1_SelectionChanged);
96
96
this ->buttonOk ->Anchor = System::Windows::Forms::AnchorStyles::Top;
97
97
this ->buttonOk ->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
98
98
this ->buttonOk ->DialogResult = System::Windows::Forms::DialogResult::OK;
@@ -103,9 +103,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
103
103
this ->buttonOk ->Text = L" Ok" ;
104
104
this ->buttonOk ->UseVisualStyleBackColor = true ;
105
105
this ->buttonOk ->Click += gcnew System::EventHandler (this , &TextEdit::buttonOk_Click);
106
- //
107
- // buttonCancel
108
- //
109
106
this ->buttonCancel ->Anchor = System::Windows::Forms::AnchorStyles::Top;
110
107
this ->buttonCancel ->DialogResult = System::Windows::Forms::DialogResult::Cancel;
111
108
this ->buttonCancel ->Location = System::Drawing::Point (74 , 0 );
@@ -114,39 +111,27 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
114
111
this ->buttonCancel ->TabIndex = 2 ;
115
112
this ->buttonCancel ->Text = L" Cancel" ;
116
113
this ->buttonCancel ->UseVisualStyleBackColor = true ;
117
- //
118
- // buttonApply
119
- //
120
114
this ->buttonApply ->Anchor = System::Windows::Forms::AnchorStyles::Top;
121
115
this ->buttonApply ->Location = System::Drawing::Point (148 , 0 );
122
116
this ->buttonApply ->Name = L" buttonApply" ;
123
117
this ->buttonApply ->Size = System::Drawing::Size (75 , 23 );
124
118
this ->buttonApply ->TabIndex = 3 ;
125
119
this ->buttonApply ->Text = L" Apply" ;
126
120
this ->buttonApply ->UseVisualStyleBackColor = true ;
127
- //
128
- // buttonLoad
129
- //
130
121
this ->buttonLoad ->Anchor = System::Windows::Forms::AnchorStyles::Top;
131
122
this ->buttonLoad ->Location = System::Drawing::Point (222 , 0 );
132
123
this ->buttonLoad ->Name = L" buttonLoad" ;
133
124
this ->buttonLoad ->Size = System::Drawing::Size (75 , 23 );
134
125
this ->buttonLoad ->TabIndex = 4 ;
135
126
this ->buttonLoad ->Text = L" Load" ;
136
127
this ->buttonLoad ->UseVisualStyleBackColor = true ;
137
- //
138
- // buttonSave
139
- //
140
128
this ->buttonSave ->Anchor = System::Windows::Forms::AnchorStyles::Top;
141
129
this ->buttonSave ->Location = System::Drawing::Point (296 , 0 );
142
130
this ->buttonSave ->Name = L" buttonSave" ;
143
131
this ->buttonSave ->Size = System::Drawing::Size (75 , 23 );
144
132
this ->buttonSave ->TabIndex = 5 ;
145
133
this ->buttonSave ->Text = L" Save" ;
146
134
this ->buttonSave ->UseVisualStyleBackColor = true ;
147
- //
148
- // buttonClear
149
- //
150
135
this ->buttonClear ->Anchor = System::Windows::Forms::AnchorStyles::Top;
151
136
this ->buttonClear ->Location = System::Drawing::Point (370 , 0 );
152
137
this ->buttonClear ->Name = L" buttonClear" ;
@@ -155,9 +140,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
155
140
this ->buttonClear ->Text = L" Clear" ;
156
141
this ->buttonClear ->UseVisualStyleBackColor = true ;
157
142
this ->buttonClear ->Click += gcnew System::EventHandler (this , &TextEdit::buttonClear_Click);
158
- //
159
- // panel1
160
- //
161
143
this ->panel1 ->Controls ->Add (this ->buttonOk );
162
144
this ->panel1 ->Controls ->Add (this ->buttonClear );
163
145
this ->panel1 ->Controls ->Add (this ->buttonCancel );
@@ -169,9 +151,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
169
151
this ->panel1 ->Name = L" panel1" ;
170
152
this ->panel1 ->Size = System::Drawing::Size (445 , 24 );
171
153
this ->panel1 ->TabIndex = 7 ;
172
- //
173
- // statusStrip1
174
- //
175
154
this ->statusStrip1 ->Items ->AddRange (gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3 ) {
176
155
this ->toolStripStatusLabel1 ,
177
156
this ->toolStripStatusLabel2 , this ->toolStripStatusLabel3
@@ -181,30 +160,18 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
181
160
this ->statusStrip1 ->Size = System::Drawing::Size (445 , 22 );
182
161
this ->statusStrip1 ->TabIndex = 8 ;
183
162
this ->statusStrip1 ->Text = L" statusStrip1" ;
184
- //
185
- // toolStripStatusLabel1
186
- //
187
163
this ->toolStripStatusLabel1 ->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
188
164
this ->toolStripStatusLabel1 ->Name = L" toolStripStatusLabel1" ;
189
165
this ->toolStripStatusLabel1 ->Size = System::Drawing::Size (54 , 17 );
190
166
this ->toolStripStatusLabel1 ->Text = L" Position" ;
191
- //
192
- // toolStripStatusLabel2
193
- //
194
167
this ->toolStripStatusLabel2 ->Enabled = false ;
195
168
this ->toolStripStatusLabel2 ->Name = L" toolStripStatusLabel2" ;
196
169
this ->toolStripStatusLabel2 ->Size = System::Drawing::Size (0 , 17 );
197
- //
198
- // toolStripStatusLabel3
199
- //
200
170
this ->toolStripStatusLabel3 ->BorderStyle = System::Windows::Forms::Border3DStyle::RaisedInner;
201
171
this ->toolStripStatusLabel3 ->Name = L" toolStripStatusLabel3" ;
202
172
this ->toolStripStatusLabel3 ->Size = System::Drawing::Size (376 , 17 );
203
173
this ->toolStripStatusLabel3 ->Spring = true ;
204
174
this ->toolStripStatusLabel3 ->Text = L" Description" ;
205
- //
206
- // TextEdit
207
- //
208
175
this ->AcceptButton = this ->buttonOk ;
209
176
this ->AutoScaleDimensions = System::Drawing::SizeF (6 , 13 );
210
177
this ->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
@@ -215,7 +182,7 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
215
182
this ->Controls ->Add (this ->textBox1 );
216
183
this ->FormBorderStyle = System::Windows::Forms::FormBorderStyle::SizableToolWindow;
217
184
this ->Name = L" TextEdit" ;
218
- this ->Text = L" TextForm " ;
185
+ this ->Text = L" TextEdit " ;
219
186
this ->panel1 ->ResumeLayout (false );
220
187
this ->statusStrip1 ->ResumeLayout (false );
221
188
this ->statusStrip1 ->PerformLayout ();
@@ -225,6 +192,6 @@ private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
225
192
}
226
193
#pragma endregion
227
194
};
228
- }
229
- }
230
- }
195
+ } // namespace Props
196
+ } // namespace ECore
197
+ } // namespace XRay
0 commit comments