File tree Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,6 @@ THiliterPrefsFrame = class(TPrefsBaseFrame)
131131 // / highlighter element.</summary>
132132 // / <remarks>This RTF is used to display elememt in preview pane.</remarks>
133133 function GenerateRTF : TRTF;
134- // / <summary>Returns reference to form that hosts the frame.</summary>
135- function ParentForm : TForm;
136134 public
137135 // / <summary>Constructs frame instance and initialises controls.</summary>
138136 // / <param name="AOwner">TComponent [in] Component that owns the frame.
@@ -523,20 +521,6 @@ procedure THiliterPrefsFrame.miNamedStylesClick(Sender: TObject);
523521 UpdatePopupMenu;
524522end ;
525523
526- function THiliterPrefsFrame.ParentForm : TForm;
527- var
528- ParentCtrl: TWinControl; // reference to parent controls
529- begin
530- // Loop through parent controls until form found or top level parent reached
531- ParentCtrl := Self.Parent;
532- while Assigned(ParentCtrl) and not (ParentCtrl is TForm) do
533- ParentCtrl := ParentCtrl.Parent;
534- if ParentCtrl is TForm then
535- Result := ParentCtrl as TForm
536- else
537- Result := nil ;
538- end ;
539-
540524procedure THiliterPrefsFrame.PopulateElementsList ;
541525var
542526 ElemId: THiliteElement; // loops thru all highlighter elements
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ TPrefsBaseFrame = class(TFrame)
4141 strict protected
4242 class function IsFlagSupported (const Flag: UInt64): Boolean; inline;
4343 class function ExtractFrameFlag (const Flag: UInt64): UInt32; inline;
44+ // / <summary>Returns reference to form that hosts the frame.</summary>
45+ function ParentForm : TForm;
4446 public
4547 procedure SavePrefs (const Prefs: IPreferences); virtual ;
4648 { Saves information user entered in frame. By default the method simply
@@ -90,7 +92,8 @@ implementation
9092
9193uses
9294 // Delphi
93- SysUtils;
95+ SysUtils,
96+ Controls;
9497
9598
9699{ $R *.dfm}
@@ -127,6 +130,20 @@ class function TPrefsBaseFrame.MakeFrameFlag(const Flag: UInt32): UInt64;
127130 Int64Rec(Result).Lo := Flag;
128131end ;
129132
133+ function TPrefsBaseFrame.ParentForm : TForm;
134+ var
135+ ParentCtrl: TWinControl; // reference to parent controls
136+ begin
137+ // Loop through parent controls until form found or top level parent reached
138+ ParentCtrl := Self.Parent;
139+ while Assigned(ParentCtrl) and not (ParentCtrl is TForm) do
140+ ParentCtrl := ParentCtrl.Parent;
141+ if ParentCtrl is TForm then
142+ Result := ParentCtrl as TForm
143+ else
144+ Result := nil ;
145+ end ;
146+
130147procedure TPrefsBaseFrame.SavePrefs (const Prefs: IPreferences);
131148 { Saves information user entered in frame. By default the method simply calls
132149 Deactivate. May be overridden to save any custom data that doesn't use Prefs
You can’t perform that action at this time.
0 commit comments