|
@@ -1,5 +1,5 @@
|
|
{
|
|
{
|
|
- Copyright (C) 2024 Mattias Gaertner [email protected]
|
|
|
|
|
|
+ Copyright (C) 2025 Mattias Gaertner [email protected]
|
|
|
|
|
|
*****************************************************************************
|
|
*****************************************************************************
|
|
This file is part of the Fresnel project.
|
|
This file is part of the Fresnel project.
|
|
@@ -15,12 +15,19 @@ unit Fresnel.Register;
|
|
interface
|
|
interface
|
|
|
|
|
|
uses
|
|
uses
|
|
- LCLProc, LCLType, Classes, SysUtils, FormEditingIntf, PropEdits, LazIDEIntf,
|
|
|
|
- ComponentEditors, IDEOptEditorIntf, LCLIntf, Graphics, Controls, Forms, ProjectIntf,
|
|
|
|
- PackageIntf, IDEOptionsIntf, LazLoggerBase, CodeToolManager, CodeCache,
|
|
|
|
- StdCodeTools, Fresnel.DOM, Fresnel.Controls, Fresnel.Forms,
|
|
|
|
|
|
+ Classes, SysUtils,
|
|
|
|
+ // lcl
|
|
|
|
+ LCLProc, LCLType, LCLIntf, LazLoggerBase, Graphics, Controls, Forms,
|
|
|
|
+ // IDE intf
|
|
|
|
+ FormEditingIntf, PropEdits, LazIDEIntf, ComponentEditors, IDEOptEditorIntf, ProjectIntf,
|
|
|
|
+ IDECommands, MenuIntf, IDEWindowIntf, PackageIntf, IDEOptionsIntf,
|
|
|
|
+ // codetools
|
|
|
|
+ CodeToolManager, CodeCache, StdCodeTools,
|
|
|
|
+ // fresnel
|
|
|
|
+ Fresnel.DOM, Fresnel.Controls, Fresnel.Forms,
|
|
Fresnel.Renderer, Fresnel.Classes, Fresnel.LCLApp, Fresnel.LCL,
|
|
Fresnel.Renderer, Fresnel.Classes, Fresnel.LCLApp, Fresnel.LCL,
|
|
- Fresnel.DsgnStrConsts, Fresnel.StylePropEdit, Fresnel.DsgnOptsFrame, Fresnel.DsgnOptions;
|
|
|
|
|
|
+ Fresnel.DsgnStrConsts, Fresnel.StylePropEdit, Fresnel.DsgnOptsFrame, Fresnel.DsgnOptions,
|
|
|
|
+ Fresnel.DsgnInspector;
|
|
|
|
|
|
const
|
|
const
|
|
ProjDescNameFresnelApplication = 'Fresnel Application';
|
|
ProjDescNameFresnelApplication = 'Fresnel Application';
|
|
@@ -132,6 +139,9 @@ implementation
|
|
{$R fresneldsgnimg.res}
|
|
{$R fresneldsgnimg.res}
|
|
|
|
|
|
procedure Register;
|
|
procedure Register;
|
|
|
|
+var
|
|
|
|
+ Key: TIDEShortCut;
|
|
|
|
+ Cat: TIDECommandCategory;
|
|
begin
|
|
begin
|
|
FresnelOptions:=TFresnelDsgnOptions.Create(nil);
|
|
FresnelOptions:=TFresnelDsgnOptions.Create(nil);
|
|
|
|
|
|
@@ -159,6 +169,19 @@ begin
|
|
// register IDE options frame
|
|
// register IDE options frame
|
|
FresnelOptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TFresnelOptionsFrame,
|
|
FresnelOptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TFresnelOptionsFrame,
|
|
FresnelOptionsFrameID)^.Index;
|
|
FresnelOptionsFrameID)^.Index;
|
|
|
|
+
|
|
|
|
+ // register shortcut for view CSS Inspector
|
|
|
|
+ Key:=IDEShortCut(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
|
|
|
+ Cat:=IDECommandList.FindCategoryByName(CommandCategoryViewName);
|
|
|
|
+ ViewCSSInspectorCmd:=RegisterIDECommand(Cat, 'View Fresnel CSS Inspector',
|
|
|
|
+ frsFresnelCSSInspector, Key,nil,@ViewCSSInspector);
|
|
|
|
+
|
|
|
|
+ // add a menu item in the view menu
|
|
|
|
+ ViewCSSInspectorMenuCmd:=RegisterIDEMenuCommand(itmViewMainWindows, 'ViewFresnelCSSInspector',
|
|
|
|
+ frsFresnelCSSInspector, nil, nil, ViewCSSInspectorCmd{, 'menu_view_fresnel_css_inspector'});
|
|
|
|
+
|
|
|
|
+ // register window creator
|
|
|
|
+ IDEWindowCreators.Add(CSSInspectorWindowName,@CreateCSSInspectorWindow,nil,'250','400','','');
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TFresnelFormMediator }
|
|
{ TFresnelFormMediator }
|
|
@@ -675,10 +698,8 @@ begin
|
|
TheDialog.Editor := Self;
|
|
TheDialog.Editor := Self;
|
|
TheDialog.CSSSynEdit.Text := AString;
|
|
TheDialog.CSSSynEdit.Text := AString;
|
|
TheDialog.CSSSynEditChange(nil);
|
|
TheDialog.CSSSynEditChange(nil);
|
|
- if (TheDialog.ShowModal = mrOK) then
|
|
|
|
- begin
|
|
|
|
|
|
+ if TheDialog.ShowModal = mrOK then
|
|
TheDialog.Apply;
|
|
TheDialog.Apply;
|
|
- end;
|
|
|
|
finally
|
|
finally
|
|
TheDialog.Free;
|
|
TheDialog.Free;
|
|
end;
|
|
end;
|
|
@@ -699,10 +720,8 @@ begin
|
|
TheDialog.Editor := Self;
|
|
TheDialog.Editor := Self;
|
|
TheDialog.CSSSynEdit.Text := aList.Text;
|
|
TheDialog.CSSSynEdit.Text := aList.Text;
|
|
TheDialog.CSSSynEditChange(nil);
|
|
TheDialog.CSSSynEditChange(nil);
|
|
- if (TheDialog.ShowModal = mrOK) then
|
|
|
|
- begin
|
|
|
|
|
|
+ if TheDialog.ShowModal = mrOK then
|
|
TheDialog.Apply;
|
|
TheDialog.Apply;
|
|
- end;
|
|
|
|
finally
|
|
finally
|
|
TheDialog.Free;
|
|
TheDialog.Free;
|
|
end;
|
|
end;
|