mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +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
|
object DesktopOptionsFrame: TDesktopOptionsFrame
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 523
|
Height = 542
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 596
|
Width = 650
|
||||||
ClientHeight = 523
|
ClientHeight = 542
|
||||||
ClientWidth = 596
|
ClientWidth = 650
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 351
|
DesignLeft = 351
|
||||||
@ -468,7 +468,10 @@ object DesktopOptionsFrame: TDesktopOptionsFrame
|
|||||||
Width = 75
|
Width = 75
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
MinValue = 5
|
MaxValue = 100
|
||||||
|
MinValue = 3
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
TabOrder = 13
|
TabOrder = 13
|
||||||
Value = 8
|
Value = 8
|
||||||
end
|
end
|
||||||
|
@ -79,7 +79,6 @@ type
|
|||||||
private
|
private
|
||||||
function LangIDToCaption(const LangID: string): string;
|
function LangIDToCaption(const LangID: string): string;
|
||||||
function CaptionToLangID(const ACaption: string): string;
|
function CaptionToLangID(const ACaption: string): string;
|
||||||
|
|
||||||
procedure DoLoadSettings(AOptions: TAbstractIDEOptions);
|
procedure DoLoadSettings(AOptions: TAbstractIDEOptions);
|
||||||
procedure DoSaveSettings(AOptions: TAbstractIDEOptions);
|
procedure DoSaveSettings(AOptions: TAbstractIDEOptions);
|
||||||
public
|
public
|
||||||
@ -166,6 +165,7 @@ begin
|
|||||||
// comboboxes
|
// comboboxes
|
||||||
lblComboBoxes.Caption := lisComboBoxes;
|
lblComboBoxes.Caption := lisComboBoxes;
|
||||||
lblDropDownCount.Caption := lisDropDownCount;
|
lblDropDownCount.Caption := lisDropDownCount;
|
||||||
|
spDropDownCount.Hint := lisDropDownCountHint;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDesktopOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
procedure TDesktopOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
|
@ -135,6 +135,22 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$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 }
|
{ TIDEOptionsDialog }
|
||||||
|
|
||||||
constructor TIDEOptionsDialog.Create(AOwner: TComponent);
|
constructor TIDEOptionsDialog.Create(AOwner: TComponent);
|
||||||
@ -229,6 +245,7 @@ begin
|
|||||||
if Assigned(AEditor) then begin
|
if Assigned(AEditor) then begin
|
||||||
AEditor.Align := alClient;
|
AEditor.Align := alClient;
|
||||||
AEditor.BorderSpacing.Around := 6;
|
AEditor.BorderSpacing.Around := 6;
|
||||||
|
SetDropDownCount(AEditor); ///TEST
|
||||||
AEditor.Visible := True;
|
AEditor.Visible := True;
|
||||||
end;
|
end;
|
||||||
FPrevEditor := AEditor;
|
FPrevEditor := AEditor;
|
||||||
@ -339,6 +356,8 @@ begin
|
|||||||
if EnvironmentOptions.Desktop.SingleTaskBarButton
|
if EnvironmentOptions.Desktop.SingleTaskBarButton
|
||||||
then Application.TaskBarBehavior := tbSingleButton
|
then Application.TaskBarBehavior := tbSingleButton
|
||||||
else Application.TaskBarBehavior := tbDefault;
|
else Application.TaskBarBehavior := tbDefault;
|
||||||
|
// update DropDownCount property immediately
|
||||||
|
SetDropDownCount(EditorsPanel);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject);
|
procedure TIDEOptionsDialog.OkButtonClick(Sender: TObject);
|
||||||
|
@ -1320,6 +1320,7 @@ resourcestring
|
|||||||
lisImportEnvironmentOptions = 'Import environment options';
|
lisImportEnvironmentOptions = 'Import environment options';
|
||||||
lisComboBoxes = 'Combo Boxes';
|
lisComboBoxes = 'Combo Boxes';
|
||||||
lisDropDownCount = 'Drop Down Count';
|
lisDropDownCount = 'Drop Down Count';
|
||||||
|
lisDropDownCountHint = 'Used for all ComboBoxes in IDE dialogs';
|
||||||
|
|
||||||
// Desktop options
|
// Desktop options
|
||||||
dlgManageDesktops = 'Manage desktops';
|
dlgManageDesktops = 'Manage desktops';
|
||||||
|
Loading…
Reference in New Issue
Block a user