@@ -98,12 +98,14 @@ TDelphiAIDevChatView = class(TDockableForm)
98
98
procedure WordWrap1Click (Sender: TObject);
99
99
procedure btnCodeOnlyClick (Sender: TObject);
100
100
procedure btnDefaultsQuestionsClick (Sender: TObject);
101
+ procedure Clear1Click (Sender: TObject);
101
102
private
102
103
FChat: TDelphiAIDevChat;
103
104
FSettings: TDelphiAIDevSettings;
104
105
FPopupMenuQuestions: TDelphiAIDevDefaultsQuestionsPopupMenu;
105
106
FbtnUseCurrentUnitCodeWidth: Integer;
106
107
FbtnCodeOnlyWidth: Integer;
108
+ FbtnDefaultsQuestionsWidth: Integer;
107
109
procedure ReadFromFile ;
108
110
procedure WriteToFile ;
109
111
procedure InitializeRichEditReturn ;
@@ -122,6 +124,7 @@ TDelphiAIDevChatView = class(TDockableForm)
122
124
procedure ChangeCodeOnly ;
123
125
procedure AddItemsPopupMenuQuestion ;
124
126
procedure DoProcessClickInItemDefaultQuestions (ACodeOnly: Boolean; AQuestion: string);
127
+ procedure ProcessWordWrap ;
125
128
public
126
129
constructor Create(AOwner: TComponent); override;
127
130
destructor Destroy; override;
@@ -187,6 +190,7 @@ constructor TDelphiAIDevChatView.Create(AOwner: TComponent);
187
190
pnWait.Visible := False;
188
191
FbtnUseCurrentUnitCodeWidth := btnUseCurrentUnitCode.Width;
189
192
FbtnCodeOnlyWidth := btnCodeOnly.Width;
193
+ FbtnDefaultsQuestionsWidth := btnDefaultsQuestions.Width;
190
194
end ;
191
195
192
196
destructor TDelphiAIDevChatView.Destroy;
@@ -201,10 +205,10 @@ procedure TDelphiAIDevChatView.FormShow(Sender: TObject);
201
205
Self.ConfScreenOnShow;
202
206
Self.InitializeRichEditReturn;
203
207
Self.ReadFromFile;
208
+ Self.ProcessWordWrap;
204
209
// Self.GetSelectedBlockForQuestion;
205
210
206
211
Self.AddItemsPopupMenuQuestion;
207
-
208
212
TUtils.MemoFocusOnTheEnd(mmQuestion);
209
213
end ;
210
214
@@ -278,11 +282,14 @@ procedure TDelphiAIDevChatView.FormClose(Sender: TObject; var Action: TCloseActi
278
282
end ;
279
283
280
284
procedure TDelphiAIDevChatView.FormResize (Sender: TObject);
285
+ var
286
+ LWidth: Integer;
281
287
const
282
288
CAPTION_UseCurrentUnitCode = ' Use current unit code in query' ;
283
289
CAPTION_CodeOnly = ' Code only' ;
290
+ CAPTION_DefaultsQuestions = ' Questions' ;
284
291
begin
285
- if ( Self.Width > 530 ) then
292
+ if Self.Width > 620 then
286
293
begin
287
294
btnUseCurrentUnitCode.Caption := CAPTION_UseCurrentUnitCode;
288
295
btnUseCurrentUnitCode.Width := FbtnUseCurrentUnitCodeWidth;
@@ -291,16 +298,28 @@ procedure TDelphiAIDevChatView.FormResize(Sender: TObject);
291
298
btnCodeOnly.Caption := CAPTION_CodeOnly;
292
299
btnCodeOnly.Width := FbtnCodeOnlyWidth;
293
300
btnCodeOnly.ImageAlignment := TImageAlignment.iaLeft;
301
+
302
+ btnDefaultsQuestions.Caption := CAPTION_DefaultsQuestions;
303
+ btnDefaultsQuestions.Width := FbtnDefaultsQuestionsWidth;
304
+ btnDefaultsQuestions.ImageAlignment := TImageAlignment.iaLeft;
294
305
end
295
306
else
296
307
begin
308
+ LWidth := btnSend.Width;
309
+ if Self.Width < 405 then
310
+ LWidth := 24 ;
311
+
297
312
btnUseCurrentUnitCode.Caption := ' ' ;
298
- btnUseCurrentUnitCode.Width := btnSend.Width ;
313
+ btnUseCurrentUnitCode.Width := LWidth ;
299
314
btnUseCurrentUnitCode.ImageAlignment := TImageAlignment.iaCenter;
300
315
301
316
btnCodeOnly.Caption := ' ' ;
302
- btnCodeOnly.Width := btnSend.Width ;
317
+ btnCodeOnly.Width := LWidth ;
303
318
btnCodeOnly.ImageAlignment := TImageAlignment.iaCenter;
319
+
320
+ btnDefaultsQuestions.Caption := ' ' ;
321
+ btnDefaultsQuestions.Width := LWidth;
322
+ btnDefaultsQuestions.ImageAlignment := TImageAlignment.iaCenter;
304
323
end ;
305
324
end ;
306
325
@@ -564,6 +583,11 @@ procedure TDelphiAIDevChatView.WaitingFormON;
564
583
end ;
565
584
566
585
procedure TDelphiAIDevChatView.WordWrap1Click (Sender: TObject);
586
+ begin
587
+ Self.ProcessWordWrap;
588
+ end ;
589
+
590
+ procedure TDelphiAIDevChatView.ProcessWordWrap ;
567
591
begin
568
592
if WordWrap1.Checked then
569
593
mmReturn.ScrollBars := ssVertical
@@ -637,6 +661,11 @@ procedure TDelphiAIDevChatView.SaveContentToFile1Click(Sender: TObject);
637
661
TUtils.ShowV(' File saved successfully' );
638
662
end ;
639
663
664
+ procedure TDelphiAIDevChatView.Clear1Click (Sender: TObject);
665
+ begin
666
+ mmReturn.Lines.Clear;
667
+ end ;
668
+
640
669
procedure TDelphiAIDevChatView.ClearContent1Click (Sender: TObject);
641
670
begin
642
671
mmReturn.Lines.Clear;
0 commit comments