@@ -50,6 +50,8 @@ TPreferencesDlg = class(TGenericOKDlg, INoPublicConstruct)
5050 // / <summary>Records if main UI needs to be updated to reflect changed
5151 // / preferences.</summary>
5252 fUpdateUI: Boolean;
53+ // / <summary>Records flags to be passed to frames.</summary>
54+ fFrameFlags: UInt64;
5355 // / <summary>Records index of currently select tab/list item.</summary>
5456 fCurrentPageIdx: Integer;
5557 // / <summary>Creates the required frames and displays each in a tab sheet
@@ -108,7 +110,8 @@ TPreferencesDlg = class(TGenericOKDlg, INoPublicConstruct)
108110 // / <returns>Boolean. True if user clicks OK to accept changes or False if
109111 // / user cancels and no changes made.</returns>
110112 class function Execute (AOwner: TComponent;
111- const Pages: array of TPrefsFrameClass; out UpdateUI: Boolean): Boolean;
113+ const Pages: array of TPrefsFrameClass; out UpdateUI: Boolean;
114+ const Flags: UInt64 = 0 ): Boolean;
112115 overload;
113116 // / <summary>Displays dialog with pages for each specified preferences
114117 // / frame.</summary>
@@ -119,7 +122,8 @@ TPreferencesDlg = class(TGenericOKDlg, INoPublicConstruct)
119122 // / <returns>Boolean. True if user clicks OK to accept changes or False if
120123 // / user cancels and no changes made.</returns>
121124 class function Execute (AOwner: TComponent;
122- const Pages: array of TPrefsFrameClass): Boolean; overload;
125+ const Pages: array of TPrefsFrameClass; const Flags: UInt64 = 0 ):
126+ Boolean; overload;
123127 // / <summary>Displays preferences dialog with all registered preference
124128 // / frames.</summary>
125129 // / <param name="AOwner">TComponent [in] Component that owns dialog.
@@ -128,8 +132,8 @@ TPreferencesDlg = class(TGenericOKDlg, INoPublicConstruct)
128132 // / be updated as a result of preference changes.</param>
129133 // / <returns>Boolean. True if user clicks OK to accept changes or False if
130134 // / user cancels and no changes made.</returns>
131- class function Execute (AOwner: TComponent; out UpdateUI: Boolean): Boolean ;
132- overload;
135+ class function Execute (AOwner: TComponent; out UpdateUI: Boolean;
136+ const Flags: UInt64 = 0 ): Boolean; overload;
133137 // / <summary>Displays dialogue with showing a single frame, specified by
134138 // / its class name.</summary>
135139 // / <param name="AOwner">TComponent [in] Component that owns dialog.
@@ -141,7 +145,7 @@ TPreferencesDlg = class(TGenericOKDlg, INoPublicConstruct)
141145 // / <returns>Boolean. True if user clicks OK to accept changes or False if
142146 // / user cancels and no changes made.</returns>
143147 class function Execute (AOwner: TComponent; const PageClsName: string;
144- out UpdateUI: Boolean): Boolean; overload;
148+ out UpdateUI: Boolean; const Flags: UInt64 = 0 ): Boolean; overload;
145149 // / <summary>Registers given preferences frame class for inclusion in the
146150 // / preferences dialog box.</summary>
147151 // / <remarks>Registered frames are created when the dialog box is displayed
@@ -258,10 +262,12 @@ function TPreferencesDlg.CustomHelpKeyword: string;
258262end ;
259263
260264class function TPreferencesDlg.Execute (AOwner: TComponent;
261- const Pages: array of TPrefsFrameClass; out UpdateUI: Boolean): Boolean;
265+ const Pages: array of TPrefsFrameClass; out UpdateUI: Boolean;
266+ const Flags: UInt64): Boolean;
262267begin
263268 with InternalCreate(AOwner) do
264269 try
270+ fFrameFlags := Flags;
265271 CreatePages(Pages);
266272 Result := ShowModal = mrOK;
267273 if Result then
@@ -274,21 +280,22 @@ class function TPreferencesDlg.Execute(AOwner: TComponent;
274280end ;
275281
276282class function TPreferencesDlg.Execute (AOwner: TComponent;
277- out UpdateUI: Boolean): Boolean;
283+ out UpdateUI: Boolean; const Flags: UInt64 ): Boolean;
278284begin
279- Result := Execute(AOwner, fPages.ToArray, UpdateUI);
285+ Result := Execute(AOwner, fPages.ToArray, UpdateUI, Flags );
280286end ;
281287
282288class function TPreferencesDlg.Execute (AOwner: TComponent;
283- const Pages: array of TPrefsFrameClass): Boolean;
289+ const Pages: array of TPrefsFrameClass; const Flags: UInt64 ): Boolean;
284290var
285291 Dummy: Boolean; // unused UpdateUI parameters
286292begin
287- Result := Execute(AOwner, Pages, Dummy);
293+ Result := Execute(AOwner, Pages, Dummy, Flags );
288294end ;
289295
290296class function TPreferencesDlg.Execute (AOwner: TComponent;
291- const PageClsName: string; out UpdateUI: Boolean): Boolean;
297+ const PageClsName: string; out UpdateUI: Boolean; const Flags: UInt64):
298+ Boolean;
292299var
293300 FrameClass: TPrefsFrameClass;
294301begin
@@ -335,7 +342,7 @@ procedure TPreferencesDlg.InitForm;
335342 fLocalPrefs := (Preferences as IClonable).Clone as IPreferences;
336343 // Display and initialise required pages
337344 for TabIdx := 0 to Pred(pcMain.PageCount) do
338- MapTabSheetToPage(TabIdx).LoadPrefs(fLocalPrefs);
345+ MapTabSheetToPage(TabIdx).LoadPrefs(fLocalPrefs, fFrameFlags );
339346 // Select last use tab sheet (or 1st if last not known)
340347 fCurrentPageIdx := GetLastTabIdx;
341348 if fCurrentPageIdx < 0 then
@@ -413,7 +420,7 @@ procedure TPreferencesDlg.SelectTab(TS: TTabSheet);
413420 Assert(Assigned(TS), ClassName + ' .SelectTab: TS is nil' );
414421 GetSelectedPage.Deactivate(fLocalPrefs);
415422 pcMain.ActivePage := TS;
416- GetSelectedPage.Activate(fLocalPrefs);
423+ GetSelectedPage.Activate(fLocalPrefs, fFrameFlags );
417424 fCurrentPageIdx := pcMain.ActivePageIndex;
418425end ;
419426
0 commit comments