mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
IDE: Apply global DropDownCount to TCustomComboBox derivatives in options dialog. Issue #40250, patch by n7800.
This commit is contained in:
parent
4e6acc2a82
commit
d4ab7a94a5
@ -1,10 +1,10 @@
|
||||
object DesktopOptionsFrame: TDesktopOptionsFrame
|
||||
Left = 0
|
||||
Height = 523
|
||||
Height = 542
|
||||
Top = 0
|
||||
Width = 596
|
||||
ClientHeight = 523
|
||||
ClientWidth = 596
|
||||
Width = 650
|
||||
ClientHeight = 542
|
||||
ClientWidth = 650
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
DesignLeft = 351
|
||||
@ -468,7 +468,10 @@ object DesktopOptionsFrame: TDesktopOptionsFrame
|
||||
Width = 75
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 3
|
||||
MinValue = 5
|
||||
MaxValue = 100
|
||||
MinValue = 3
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 13
|
||||
Value = 8
|
||||
end
|
||||
|
@ -79,7 +79,6 @@ type
|
||||
private
|
||||
function LangIDToCaption(const LangID: string): string;
|
||||
function CaptionToLangID(const ACaption: string): string;
|
||||
|
||||
procedure DoLoadSettings(AOptions: TAbstractIDEOptions);
|
||||
procedure DoSaveSettings(AOptions: TAbstractIDEOptions);
|
||||
public
|
||||
@ -166,6 +165,7 @@ begin
|
||||
// comboboxes
|
||||
lblComboBoxes.Caption := lisComboBoxes;
|
||||
lblDropDownCount.Caption := lisDropDownCount;
|
||||
spDropDownCount.Hint := lisDropDownCountHint;
|
||||
end;
|
||||
|
||||
procedure TDesktopOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
|
@ -135,6 +135,22 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure SetDropDownCount(AWinControl: TWinControl);
|
||||
// Set global DropDownCount to all TCustomComboBox descendants under AWinControl.
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
for i := 0 to AWinControl.ControlCount - 1 do
|
||||
begin
|
||||
if AWinControl.Controls[i] is TCustomComboBox then
|
||||
TCustomComboBox(AWinControl.Controls[i]).DropDownCount :=
|
||||
EnvironmentOptions.DropDownCount;
|
||||
// recursive call
|
||||
if AWinControl.Controls[i] is TWinControl then
|
||||
SetDropDownCount(TWinControl(AWinControl.Controls[i]));
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TIDEOptionsDialog }
|
||||
|
||||
constructor TIDEOptionsDialog.Create(AOwner: TComponent);
|
||||
@ -229,6 +245,7 @@ begin
|
||||
if Assigned(AEditor) then begin
|
||||
AEditor.Align := alClient;
|
||||
AEditor.BorderSpacing.Around := 6;
|
||||
SetDropDownCount(AEditor); ///TEST
|
||||
AEditor.Visible := True;
|
||||
end;
|
||||
FPrevEditor := AEditor;
|
||||
@ -339,6 +356,8 @@ begin
|
||||
if EnvironmentOptions.Desktop.SingleTaskBarButton
|
||||
then Application.TaskBarBehavior := tbSingleButton
|
||||
else Application.TaskBarBehavior := tbDefault;
|
||||
// update DropDownCount property immediately
|
||||
SetDropDownCount(EditorsPanel);
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject);
|
||||
|
@ -1320,6 +1320,7 @@ resourcestring
|
||||
lisImportEnvironmentOptions = 'Import environment options';
|
||||
lisComboBoxes = 'Combo Boxes';
|
||||
lisDropDownCount = 'Drop Down Count';
|
||||
lisDropDownCountHint = 'Used for all ComboBoxes in IDE dialogs';
|
||||
|
||||
// Desktop options
|
||||
dlgManageDesktops = 'Manage desktops';
|
||||
|
Loading…
Reference in New Issue
Block a user