mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 22:58:14 +02:00
educationlaz: implemented object inspetor hide favourite and restricted page
git-svn-id: trunk@31140 -
This commit is contained in:
parent
5cf87bd0ee
commit
e6f4c97ba1
@ -24,8 +24,9 @@ unit EduOIPages;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, LResources, Forms, StdCtrls, ExtCtrls, LazConfigStorage, IDEOptionsIntf, EduOptions,
|
||||
ObjectInspector, ObjInspStrConsts;
|
||||
Classes, Forms, LCLProc, StdCtrls, ExtCtrls, LazConfigStorage,
|
||||
ObjectInspector, ObjInspStrConsts, IDEOptionsIntf, FormEditingIntf,
|
||||
EduOptions;
|
||||
|
||||
type
|
||||
|
||||
@ -35,7 +36,6 @@ type
|
||||
private
|
||||
FOIPageFavs: boolean;
|
||||
FOIPageRestricted: boolean;
|
||||
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
@ -44,7 +44,6 @@ type
|
||||
procedure Apply(Enable: boolean); override;
|
||||
property OIPageFavs: boolean read FOIPageFavs write FOIPageFavs;
|
||||
property OIPageRestricted: boolean read FOIPageRestricted write FOIPageRestricted;
|
||||
|
||||
end;
|
||||
|
||||
{ TEduOIPagesFrame }
|
||||
@ -53,14 +52,12 @@ type
|
||||
ckBoxRestricted: TCheckBox;
|
||||
ckBoxFavs: TCheckBox;
|
||||
grpBoxOIPages: TGroupBox;
|
||||
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
|
||||
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
@ -88,7 +85,6 @@ begin
|
||||
|
||||
FOIPageFavs:=false;
|
||||
FOIPageRestricted:=false;
|
||||
|
||||
end;
|
||||
|
||||
destructor TEduOIPagesOptions.Destroy;
|
||||
@ -98,7 +94,6 @@ end;
|
||||
|
||||
function TEduOIPagesOptions.Load(Config: TConfigStorage): TModalResult;
|
||||
begin
|
||||
|
||||
FOIPageFavs:=Config.GetValue('OIPageFavs',true);
|
||||
FOIPageRestricted:=Config.GetValue('OIPageRestricted',true);
|
||||
|
||||
@ -107,7 +102,6 @@ end;
|
||||
|
||||
function TEduOIPagesOptions.Save(Config: TConfigStorage): TModalResult;
|
||||
begin
|
||||
|
||||
Config.SetValue('OIPageFavs',FOIPageFavs);
|
||||
Config.SetValue('OIPageRestricted',FOIPageRestricted);
|
||||
|
||||
@ -115,15 +109,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TEduOIPagesOptions.Apply(Enable: boolean);
|
||||
var
|
||||
ObjInsp: TObjectInspectorDlg;
|
||||
begin
|
||||
inherited Apply(Enable);
|
||||
ObjInsp:=FormEditingHook.GetCurrentObjectInspector;
|
||||
if ObjInsp=nil then begin
|
||||
debugln(['TEduOIPagesOptions.Apply no OI']);
|
||||
exit;
|
||||
end;
|
||||
ObjInsp.ShowFavorites:=FOIPageFavs or (not Enable);
|
||||
ObjInsp.ShowRestricted:=FOIPageRestricted or (not Enable);
|
||||
end;
|
||||
|
||||
{ TEduOIPagesFrame }
|
||||
|
||||
|
||||
|
||||
|
||||
function TEduOIPagesFrame.GetTitle: String;
|
||||
begin
|
||||
Result:=ersEduOIPages;
|
||||
|
@ -120,6 +120,7 @@ type
|
||||
function CutSelectionToClipboard: Boolean; override;
|
||||
function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags
|
||||
): Boolean; override;
|
||||
function GetCurrentObjectInspector: TObjectInspectorDlg; override;
|
||||
|
||||
// JIT components
|
||||
function IsJITComponent(AComponent: TComponent): boolean;
|
||||
@ -647,6 +648,11 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.GetCurrentObjectInspector: TObjectInspectorDlg;
|
||||
begin
|
||||
Result:=FObj_Inspector;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.IsJITComponent(AComponent: TComponent): boolean;
|
||||
begin
|
||||
Result:=JITFormList.IsJITForm(AComponent)
|
||||
|
@ -23,7 +23,7 @@ interface
|
||||
|
||||
uses
|
||||
Math, Classes, SysUtils, LCLProc, TypInfo, types, Forms, Controls,
|
||||
ProjectIntf, ComponentEditors;
|
||||
ProjectIntf, ComponentEditors, ObjectInspector;
|
||||
|
||||
const
|
||||
ComponentPaletteImageWidth = 24;
|
||||
@ -166,11 +166,13 @@ type
|
||||
function CutSelectionToClipboard: Boolean; virtual; abstract;
|
||||
function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags
|
||||
): Boolean; virtual; abstract;
|
||||
|
||||
function GetCurrentObjectInspector: TObjectInspectorDlg; virtual; abstract;
|
||||
end;
|
||||
|
||||
type
|
||||
TDesignerIDECommandForm = class(TCustomForm)
|
||||
// dummy form class, use by the IDE commands for keys in the designers
|
||||
// dummy form class, used by the IDE commands for keys in the designers
|
||||
end;
|
||||
|
||||
var
|
||||
|
@ -781,6 +781,8 @@ type
|
||||
const
|
||||
DefaultObjectInspectorName: string = 'ObjectInspectorDlg';
|
||||
|
||||
// the ObjectInspector of the IDE can be found in FormEditingIntf
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
Loading…
Reference in New Issue
Block a user