educationlaz: implemented object inspetor hide favourite and restricted page

git-svn-id: trunk@31140 -
This commit is contained in:
mattias 2011-06-09 08:55:07 +00:00
parent 5cf87bd0ee
commit e6f4c97ba1
4 changed files with 25 additions and 15 deletions

View File

@ -24,8 +24,9 @@ unit EduOIPages;
interface interface
uses uses
Classes, LResources, Forms, StdCtrls, ExtCtrls, LazConfigStorage, IDEOptionsIntf, EduOptions, Classes, Forms, LCLProc, StdCtrls, ExtCtrls, LazConfigStorage,
ObjectInspector, ObjInspStrConsts; ObjectInspector, ObjInspStrConsts, IDEOptionsIntf, FormEditingIntf,
EduOptions;
type type
@ -35,7 +36,6 @@ type
private private
FOIPageFavs: boolean; FOIPageFavs: boolean;
FOIPageRestricted: boolean; FOIPageRestricted: boolean;
public public
constructor Create; override; constructor Create; override;
destructor Destroy; override; destructor Destroy; override;
@ -44,7 +44,6 @@ type
procedure Apply(Enable: boolean); override; procedure Apply(Enable: boolean); override;
property OIPageFavs: boolean read FOIPageFavs write FOIPageFavs; property OIPageFavs: boolean read FOIPageFavs write FOIPageFavs;
property OIPageRestricted: boolean read FOIPageRestricted write FOIPageRestricted; property OIPageRestricted: boolean read FOIPageRestricted write FOIPageRestricted;
end; end;
{ TEduOIPagesFrame } { TEduOIPagesFrame }
@ -53,14 +52,12 @@ type
ckBoxRestricted: TCheckBox; ckBoxRestricted: TCheckBox;
ckBoxFavs: TCheckBox; ckBoxFavs: TCheckBox;
grpBoxOIPages: TGroupBox; grpBoxOIPages: TGroupBox;
public public
function GetTitle: String; override; function GetTitle: String; override;
procedure ReadSettings(AOptions: TAbstractIDEOptions); override; procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override; procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
procedure WriteSettings(AOptions: TAbstractIDEOptions); override; procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
end; end;
var var
@ -88,7 +85,6 @@ begin
FOIPageFavs:=false; FOIPageFavs:=false;
FOIPageRestricted:=false; FOIPageRestricted:=false;
end; end;
destructor TEduOIPagesOptions.Destroy; destructor TEduOIPagesOptions.Destroy;
@ -98,7 +94,6 @@ end;
function TEduOIPagesOptions.Load(Config: TConfigStorage): TModalResult; function TEduOIPagesOptions.Load(Config: TConfigStorage): TModalResult;
begin begin
FOIPageFavs:=Config.GetValue('OIPageFavs',true); FOIPageFavs:=Config.GetValue('OIPageFavs',true);
FOIPageRestricted:=Config.GetValue('OIPageRestricted',true); FOIPageRestricted:=Config.GetValue('OIPageRestricted',true);
@ -107,7 +102,6 @@ end;
function TEduOIPagesOptions.Save(Config: TConfigStorage): TModalResult; function TEduOIPagesOptions.Save(Config: TConfigStorage): TModalResult;
begin begin
Config.SetValue('OIPageFavs',FOIPageFavs); Config.SetValue('OIPageFavs',FOIPageFavs);
Config.SetValue('OIPageRestricted',FOIPageRestricted); Config.SetValue('OIPageRestricted',FOIPageRestricted);
@ -115,15 +109,21 @@ begin
end; end;
procedure TEduOIPagesOptions.Apply(Enable: boolean); procedure TEduOIPagesOptions.Apply(Enable: boolean);
var
ObjInsp: TObjectInspectorDlg;
begin begin
inherited Apply(Enable); 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; end;
{ TEduOIPagesFrame } { TEduOIPagesFrame }
function TEduOIPagesFrame.GetTitle: String; function TEduOIPagesFrame.GetTitle: String;
begin begin
Result:=ersEduOIPages; Result:=ersEduOIPages;

View File

@ -120,6 +120,7 @@ type
function CutSelectionToClipboard: Boolean; override; function CutSelectionToClipboard: Boolean; override;
function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags
): Boolean; override; ): Boolean; override;
function GetCurrentObjectInspector: TObjectInspectorDlg; override;
// JIT components // JIT components
function IsJITComponent(AComponent: TComponent): boolean; function IsJITComponent(AComponent: TComponent): boolean;
@ -647,6 +648,11 @@ begin
Result:=false; Result:=false;
end; end;
function TCustomFormEditor.GetCurrentObjectInspector: TObjectInspectorDlg;
begin
Result:=FObj_Inspector;
end;
function TCustomFormEditor.IsJITComponent(AComponent: TComponent): boolean; function TCustomFormEditor.IsJITComponent(AComponent: TComponent): boolean;
begin begin
Result:=JITFormList.IsJITForm(AComponent) Result:=JITFormList.IsJITForm(AComponent)

View File

@ -23,7 +23,7 @@ interface
uses uses
Math, Classes, SysUtils, LCLProc, TypInfo, types, Forms, Controls, Math, Classes, SysUtils, LCLProc, TypInfo, types, Forms, Controls,
ProjectIntf, ComponentEditors; ProjectIntf, ComponentEditors, ObjectInspector;
const const
ComponentPaletteImageWidth = 24; ComponentPaletteImageWidth = 24;
@ -166,11 +166,13 @@ type
function CutSelectionToClipboard: Boolean; virtual; abstract; function CutSelectionToClipboard: Boolean; virtual; abstract;
function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags function PasteSelectionFromClipboard(Flags: TComponentPasteSelectionFlags
): Boolean; virtual; abstract; ): Boolean; virtual; abstract;
function GetCurrentObjectInspector: TObjectInspectorDlg; virtual; abstract;
end; end;
type type
TDesignerIDECommandForm = class(TCustomForm) 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; end;
var var

View File

@ -781,6 +781,8 @@ type
const const
DefaultObjectInspectorName: string = 'ObjectInspectorDlg'; DefaultObjectInspectorName: string = 'ObjectInspectorDlg';
// the ObjectInspector of the IDE can be found in FormEditingIntf
implementation implementation
{$R *.lfm} {$R *.lfm}