@@ -93,6 +93,9 @@ TSaveSourceDlg = class(TSaveDialogEx)
93
93
fSelectedFilterIdx: Integer;
94
94
// / <summary>Stores type of selected encoding.</summary>
95
95
fSelectedEncoding: TEncodingType;
96
+ // / <summary>Value of <c>EnableCommentStyles</c> property.</summary>
97
+ fEnableCommentStyles: Boolean;
98
+
96
99
// / <summary>Handles click on Help button.</summary>
97
100
// / <remarks>Calls help with required keyword.</remarks>
98
101
procedure HelpClickHandler (Sender: TObject);
@@ -201,6 +204,10 @@ TSaveSourceDlg = class(TSaveDialogEx)
201
204
// / encodings supported for the file type.</summary>
202
205
property OnEncodingQuery: TEncodingQuery
203
206
read fOnEncodingQuery write fOnEncodingQuery;
207
+ // / <summary>Determines whether the comment styles combo and associated
208
+ // / controls are enabled, and so can be changed, or are disabled.</summary>
209
+ property EnableCommentStyles: Boolean
210
+ read fEnableCommentStyles write fEnableCommentStyles default True;
204
211
// / <summary>Re-implementation of inherited property to overcome apparent
205
212
// / bug where property forgets selected filter when dialog box is closed.
206
213
// / </summary>
@@ -317,6 +324,9 @@ constructor TSaveSourceDlg.Create(AOwner: TComponent);
317
324
// set dialog options
318
325
Options := [ofPathMustExist, ofEnableIncludeNotify];
319
326
327
+ // enable comment style selection
328
+ fEnableCommentStyles := True;
329
+
320
330
// inhibit default help processing: we provide own help button and handling
321
331
WantDefaultHelpSupport := False;
322
332
end ;
@@ -579,6 +589,9 @@ procedure TSaveSourceDlg.UpdateCommentStyle;
579
589
if TCommentStyle(fCmbCommentStyle.Items.Objects[Idx]) = fCommentStyle then
580
590
fCmbCommentStyle.ItemIndex := Idx;
581
591
end ;
592
+ fCmbCommentStyle.Enabled := fEnableCommentStyles;
593
+ fLblCommentStyle.Enabled := fEnableCommentStyles;
594
+ fChkTruncateComment.Enabled := fEnableCommentStyles;
582
595
end ;
583
596
584
597
procedure TSaveSourceDlg.UpdateCommentTruncation ;
0 commit comments