From a36b277a4bb93d2f0f0740dbbf2dce34587cae9a Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Thu, 1 Feb 2024 23:18:35 +1000 Subject: [PATCH] IDE: Clarify misleading names of common event handlers in options window Notice the GeneralCheckBoxOnChange() function, which already had named properly. --- debugger/frames/debugger_eventlog_options.lfm | 4 +- debugger/frames/debugger_eventlog_options.pas | 4 +- ide/syncolorattribeditor.lfm | 84 +++++++++---------- ide/syncolorattribeditor.pas | 24 +++--- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/debugger/frames/debugger_eventlog_options.lfm b/debugger/frames/debugger_eventlog_options.lfm index 6edce2d77a..0111151e9c 100644 --- a/debugger/frames/debugger_eventlog_options.lfm +++ b/debugger/frames/debugger_eventlog_options.lfm @@ -171,7 +171,7 @@ inherited DebuggerEventLogOptionsFrame: TDebuggerEventLogOptionsFrame BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 2 end object BackGroundColorBox: TColorBox @@ -194,7 +194,7 @@ inherited DebuggerEventLogOptionsFrame: TDebuggerEventLogOptionsFrame BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 3 end object ForeGroundLabel: TLabel diff --git a/debugger/frames/debugger_eventlog_options.pas b/debugger/frames/debugger_eventlog_options.pas index 375af4f90a..9e901cf8a4 100644 --- a/debugger/frames/debugger_eventlog_options.pas +++ b/debugger/frames/debugger_eventlog_options.pas @@ -61,7 +61,7 @@ type var {%H-}PaintImages, DefaultDraw: Boolean); procedure ColorTreeChange(Sender: TObject; {%H-}Node: TTreeNode); procedure ColorTreeClick(Sender: TObject); - procedure ForegroundColorBoxChange(Sender: TObject); + procedure GeneralColorBoxOnChange(Sender: TObject); private FColors: array[TDBGEventType] of TDebuggerEventLogColor; class function GetCategoryStr(ACategory: TDBGEventCategory): String; @@ -141,7 +141,7 @@ begin UpdateSelectedColor; end; -procedure TDebuggerEventLogOptionsFrame.ForegroundColorBoxChange(Sender: TObject); +procedure TDebuggerEventLogOptionsFrame.GeneralColorBoxOnChange(Sender: TObject); begin if Assigned(ColorTree.Selected) then begin diff --git a/ide/syncolorattribeditor.lfm b/ide/syncolorattribeditor.lfm index 4c3bbf9da1..3ec34ca64c 100644 --- a/ide/syncolorattribeditor.lfm +++ b/ide/syncolorattribeditor.lfm @@ -60,13 +60,13 @@ object SynColorAttrEditor: TSynColorAttrEditor Width = 200 DefaultColorColor = clWhite Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors] - OnGetColors = ForegroundColorBoxGetColors + OnGetColors = GeneralColorBoxOnGetColors Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 3 Constraints.MaxWidth = 200 Constraints.MinWidth = 80 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 1 end object BackGroundColorBox: TColorBox @@ -80,13 +80,13 @@ object SynColorAttrEditor: TSynColorAttrEditor Width = 200 DefaultColorColor = clWhite Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors] - OnGetColors = ForegroundColorBoxGetColors + OnGetColors = GeneralColorBoxOnGetColors Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 3 Constraints.MaxWidth = 200 Constraints.MinWidth = 80 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 4 end object BackGroundUseDefaultCheckBox: TCheckBox @@ -115,13 +115,13 @@ object SynColorAttrEditor: TSynColorAttrEditor Width = 200 DefaultColorColor = clWhite Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors] - OnGetColors = ForegroundColorBoxGetColors + OnGetColors = GeneralColorBoxOnGetColors Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 3 Constraints.MaxWidth = 200 Constraints.MinWidth = 80 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 7 end object FrameColorUseDefaultCheckBox: TCheckBox @@ -431,8 +431,8 @@ object SynColorAttrEditor: TSynColorAttrEditor 'slsDotted' 'slsWaved' ) - OnChange = ForegroundColorBoxChange - OnDrawItem = FrameStyleBoxDrawItem + OnChange = GeneralColorBoxOnChange + OnDrawItem = GeneralStyleBoxOnDrawItem Style = csOwnerDrawFixed TabOrder = 10 Text = 'slsSolid' @@ -453,7 +453,7 @@ object SynColorAttrEditor: TSynColorAttrEditor 'Bottom' 'Left' ) - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange OnDrawItem = FrameEdgesBoxDrawItem Style = csOwnerDrawFixed TabOrder = 9 @@ -528,11 +528,11 @@ object SynColorAttrEditor: TSynColorAttrEditor Constraints.MinWidth = 65 MaxValue = 256 MinValue = 1 - OnChange = ForeAlphaSpinChange - OnEditingDone = ForeAlphaSpinChange - OnEnter = ForeAlphaSpinEnter - OnExit = ForeAlphaSpinChange - OnResize = ForeAlphaSpinChange + OnChange = GeneralAlphaSpinOnChange + OnEditingDone = GeneralAlphaSpinOnChange + OnEnter = GeneralAlphaSpinOnEnter + OnExit = GeneralAlphaSpinOnChange + OnResize = GeneralAlphaSpinOnChange TabOrder = 2 Value = 256 end @@ -549,11 +549,11 @@ object SynColorAttrEditor: TSynColorAttrEditor Constraints.MinWidth = 65 MaxValue = 256 MinValue = 1 - OnChange = ForeAlphaSpinChange - OnEditingDone = ForeAlphaSpinChange - OnEnter = ForeAlphaSpinEnter - OnExit = ForeAlphaSpinChange - OnResize = ForeAlphaSpinChange + OnChange = GeneralAlphaSpinOnChange + OnEditingDone = GeneralAlphaSpinOnChange + OnEnter = GeneralAlphaSpinOnEnter + OnExit = GeneralAlphaSpinOnChange + OnResize = GeneralAlphaSpinOnChange TabOrder = 5 Value = 256 end @@ -570,11 +570,11 @@ object SynColorAttrEditor: TSynColorAttrEditor Constraints.MinWidth = 65 MaxValue = 256 MinValue = 1 - OnChange = ForeAlphaSpinChange - OnEditingDone = ForeAlphaSpinChange - OnEnter = ForeAlphaSpinEnter - OnExit = ForeAlphaSpinChange - OnResize = ForeAlphaSpinChange + OnChange = GeneralAlphaSpinOnChange + OnEditingDone = GeneralAlphaSpinOnChange + OnEnter = GeneralAlphaSpinOnEnter + OnExit = GeneralAlphaSpinOnChange + OnResize = GeneralAlphaSpinOnChange TabOrder = 8 Value = 256 end @@ -629,9 +629,9 @@ object SynColorAttrEditor: TSynColorAttrEditor BorderSpacing.Left = 6 Constraints.MinWidth = 65 MaxValue = 9999 - OnChange = ForePriorSpinChange - OnEditingDone = ForePriorSpinChange - OnExit = ForePriorSpinChange + OnChange = GeneralPriorSpinOnChange + OnEditingDone = GeneralPriorSpinOnChange + OnExit = GeneralPriorSpinOnChange TabOrder = 15 Value = 1 end @@ -647,9 +647,9 @@ object SynColorAttrEditor: TSynColorAttrEditor BorderSpacing.Left = 6 Constraints.MinWidth = 65 MaxValue = 9999 - OnChange = ForePriorSpinChange - OnEditingDone = ForePriorSpinChange - OnExit = ForePriorSpinChange + OnChange = GeneralPriorSpinOnChange + OnEditingDone = GeneralPriorSpinOnChange + OnExit = GeneralPriorSpinOnChange TabOrder = 16 Value = 1 end @@ -665,9 +665,9 @@ object SynColorAttrEditor: TSynColorAttrEditor BorderSpacing.Left = 6 Constraints.MinWidth = 65 MaxValue = 9999 - OnChange = ForePriorSpinChange - OnEditingDone = ForePriorSpinChange - OnExit = ForePriorSpinChange + OnChange = GeneralPriorSpinOnChange + OnEditingDone = GeneralPriorSpinOnChange + OnExit = GeneralPriorSpinOnChange TabOrder = 17 Value = 1 end @@ -697,13 +697,13 @@ object SynColorAttrEditor: TSynColorAttrEditor Width = 200 DefaultColorColor = clWhite Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors] - OnGetColors = ForegroundColorBoxGetColors + OnGetColors = GeneralColorBoxOnGetColors Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 3 Constraints.MaxWidth = 200 Constraints.MinWidth = 80 ItemHeight = 16 - OnChange = ForegroundColorBoxChange + OnChange = GeneralColorBoxOnChange TabOrder = 18 end object MarkupFoldAlphaLabel: TLabel @@ -732,11 +732,11 @@ object SynColorAttrEditor: TSynColorAttrEditor Constraints.MinWidth = 65 MaxValue = 256 MinValue = 1 - OnChange = ForeAlphaSpinChange - OnEditingDone = ForeAlphaSpinChange - OnEnter = ForeAlphaSpinEnter - OnExit = ForeAlphaSpinChange - OnResize = ForeAlphaSpinChange + OnChange = GeneralAlphaSpinOnChange + OnEditingDone = GeneralAlphaSpinOnChange + OnEnter = GeneralAlphaSpinOnEnter + OnExit = GeneralAlphaSpinOnChange + OnResize = GeneralAlphaSpinOnChange TabOrder = 20 Value = 256 end @@ -757,8 +757,8 @@ object SynColorAttrEditor: TSynColorAttrEditor 'slsDotted' 'slsWaved' ) - OnChange = ForegroundColorBoxChange - OnDrawItem = FrameStyleBoxDrawItem + OnChange = GeneralColorBoxOnChange + OnDrawItem = GeneralStyleBoxOnDrawItem Style = csOwnerDrawFixed TabOrder = 21 Text = 'slsSolid' diff --git a/ide/syncolorattribeditor.pas b/ide/syncolorattribeditor.pas index c3b96272bd..b2cfb103b0 100644 --- a/ide/syncolorattribeditor.pas +++ b/ide/syncolorattribeditor.pas @@ -68,14 +68,14 @@ type TextUnderlineRadioPanel: TPanel; ForeGroundLabel: TLabel; ForeGroundUseDefaultCheckBox: TCheckBox; - procedure ForeAlphaSpinChange(Sender: TObject); - procedure ForeAlphaSpinEnter(Sender: TObject); - procedure ForegroundColorBoxChange(Sender: TObject); - procedure ForegroundColorBoxGetColors(Sender: TCustomColorBox; Items: TStrings); - procedure ForePriorSpinChange(Sender: TObject); + procedure GeneralAlphaSpinOnChange(Sender: TObject); + procedure GeneralAlphaSpinOnEnter(Sender: TObject); + procedure GeneralColorBoxOnChange(Sender: TObject); + procedure GeneralColorBoxOnGetColors(Sender: TCustomColorBox; Items: TStrings); + procedure GeneralPriorSpinOnChange(Sender: TObject); procedure FrameEdgesBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; {%H-}State: TOwnerDrawState); - procedure FrameStyleBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; + procedure GeneralStyleBoxOnDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; {%H-}State: TOwnerDrawState); procedure GeneralCheckBoxOnChange(Sender: TObject); procedure pnlElementAttributesResize(Sender: TObject); @@ -124,7 +124,7 @@ end; { TSynColorAttrEditor } -procedure TSynColorAttrEditor.ForegroundColorBoxChange(Sender: TObject); +procedure TSynColorAttrEditor.GeneralColorBoxOnChange(Sender: TObject); begin if (FCurHighlightElement = nil) or UpdatingColor then exit; @@ -170,7 +170,7 @@ begin DoChanged; end; -procedure TSynColorAttrEditor.ForeAlphaSpinChange(Sender: TObject); +procedure TSynColorAttrEditor.GeneralAlphaSpinOnChange(Sender: TObject); var v: Integer; begin @@ -199,7 +199,7 @@ begin DoChanged; end; -procedure TSynColorAttrEditor.ForeAlphaSpinEnter(Sender: TObject); +procedure TSynColorAttrEditor.GeneralAlphaSpinOnEnter(Sender: TObject); begin UpdatingColor := True; If TSpinEdit(Sender).Value = 256 then @@ -207,7 +207,7 @@ begin UpdatingColor := False; end; -procedure TSynColorAttrEditor.ForegroundColorBoxGetColors(Sender: TCustomColorBox; Items: TStrings); +procedure TSynColorAttrEditor.GeneralColorBoxOnGetColors(Sender: TCustomColorBox; Items: TStrings); var i: longint; begin @@ -218,7 +218,7 @@ begin end; end; -procedure TSynColorAttrEditor.ForePriorSpinChange(Sender: TObject); +procedure TSynColorAttrEditor.GeneralPriorSpinOnChange(Sender: TObject); var v: Integer; begin @@ -304,7 +304,7 @@ begin end; end; -procedure TSynColorAttrEditor.FrameStyleBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; +procedure TSynColorAttrEditor.GeneralStyleBoxOnDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); var p: TPoint;