Revert "Revert "r8""

This reverts commit 5b02fa6fa6.
This commit is contained in:
Basile Burg 2014-06-22 22:21:38 +02:00
parent 5b02fa6fa6
commit ba9c1df5fa
19 changed files with 846 additions and 360 deletions

View File

@ -201,19 +201,22 @@
<UnitName Value="ce_projinspect"/>
</Unit10>
<Unit11>
<Filename Value="..\src\ce_jsoninfos.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ce_jsoninfos"/>
</Unit11>
<Unit12>
<Filename Value="..\src\ce_project.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ce_project"/>
</Unit12>
<Unit13>
</Unit11>
<Unit12>
<Filename Value="..\src\ce_widgettypes.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ce_widgettypes"/>
</Unit12>
<Unit13>
<Filename Value="..\src\ce_staticexplorer.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="CEStaticExplorerWidget"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="ce_staticexplorer"/>
</Unit13>
</Units>
</ProjectOptions>

View File

@ -8,8 +8,8 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_widget,
ce_dmdwrap, ce_common, ce_synmemo, ce_main, ce_messages, ce_editor,
ce_projinspect, ce_projconf, ce_jsoninfos, jsonparser, ce_project,
ce_widgettypes;
ce_projinspect, ce_projconf, jsonparser, ce_project,
ce_widgettypes, ce_staticexplorer;
{$R *.res}

View File

@ -5,7 +5,7 @@ unit ce_common;
interface
uses
Classes, SysUtils, ActnList;
Classes, SysUtils, ActnList, dialogs, forms;
(**
* Save a component with a readable aspect.
@ -29,12 +29,17 @@ uses
(**
* Patches the directory separators from a string.
* This is used to ensure a that project saved on a plateform can be loaded
* This is used to ensure that a project saved on a plateform can be loaded
* on another one.
*)
function patchPlateformPath(const aPath: string): string;
procedure patchPlateformPaths(const sPaths: TStrings);
(**
* Ok/Cancel modal dialog
*)
function dlgOkCancel(const aMsg: string): TModalResult;
implementation
@ -225,4 +230,11 @@ begin
end;
end;
function dlgOkCancel(const aMsg: string): TModalResult;
const
Btns = [mbOK,mbCancel];
begin
exit( MessageDlg('Coedit', aMsg, mtConfirmation, Btns, ''));
end;
end.

View File

@ -315,8 +315,9 @@ begin
fKeywdAttrib.Foreground := clNavy;
fCurrIAttrib.Foreground := clBlack;
fCurrIAttrib.FrameEdges:= sfeAround;
fCurrIAttrib.FrameColor:= clGray;
fCurrIAttrib.FrameEdges := sfeAround;
fCurrIAttrib.FrameColor := clGray;
fCurrIAttrib.Background := cl3dlight;
fCommtAttrib.Style := [fsItalic];
fKeywdAttrib.Style := [fsBold];

View File

@ -1,7 +1,5 @@
inherited CEEditorWidget: TCEEditorWidget
Left = 1159
Height = 382
Top = 91
Width = 465
Caption = 'Source editor'
ClientHeight = 382

View File

@ -20,11 +20,11 @@ type
procedure PageControlChange(Sender: TObject);
procedure PageControlCloseTabClicked(Sender: TObject);
protected
procedure autoWidgetUpdate; override;
procedure UpdateByDelay; override;
private
// http://bugs.freepascal.org/view.php?id=26329
fKeyChanged: boolean;
fSyncEdit: TSynPluginSyncroEdit;
procedure focusedEditorChanged;
procedure memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure memoChange(Sender: TObject);
@ -38,6 +38,7 @@ type
constructor create(aOwner: TComponent); override;
procedure addEditor;
procedure removeEditor(const aIndex: NativeInt);
procedure focusedEditorChanged;
//
property currentEditor: TCESynMemo read getCurrentEditor;
property editor[index: NativeInt]: TCESynMemo read getEditor;
@ -102,6 +103,9 @@ begin
md := getModuleName(curr.Lines);
if md = '' then md := extractFileName(curr.fileName);
pageControl.ActivePage.Caption := md;
//
if pageControl.ActivePageIndex <> -1 then
mainForm.docFocusedNotify(Self, pageControl.ActivePageIndex);
end;
procedure TCEEditorWidget.PageControlChange(Sender: TObject);
@ -121,7 +125,6 @@ var
sheet: TTabSheet;
memo: TCESynMemo;
begin
fNeedAutoUpdate := true;
sheet := pageControl.AddTabSheet;
memo := TCESynMemo.Create(sheet);
//
@ -134,6 +137,7 @@ begin
memo.OnChange := @memoChange;
memo.OnMouseMove := @memoMouseMove;
//
pageControl.ActivePage := sheet;
//http://bugs.freepascal.org/view.php?id=26320
focusedEditorChanged;
end;
@ -151,34 +155,35 @@ end;
procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
fNeedAutoUpdate := true;
if (sender is TCESynMemo) then
identifierToD2Syn(TCESynMemo(Sender));
fKeyChanged := true;
beginUpdateByDelay;
end;
procedure TCEEditorWidget.memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
fNeedAutoUpdate := true;
if (sender is TCESynMemo) then
identifierToD2Syn(TCESynMemo(Sender));
beginUpdateByDelay;
end;
procedure TCEEditorWidget.memoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ssLeft in Shift then
fNeedAutoUpdate := true;
beginUpdateByDelay;
end;
procedure TCEEditorWidget.memoChange(Sender: TObject);
var
ed: TCESynMemo;
begin
fNeedAutoUpdate := true;
ed := TCESynMemo(sender);
ed.modified := true;
beginUpdateByDelay;
end;
procedure TCEEditorWidget.autoWidgetUpdate;
procedure TCEEditorWidget.UpdateByDelay;
const
modstr: array[boolean] of string = ('...', 'MODIFIED');
var
@ -191,6 +196,10 @@ begin
editorStatus.Panels[1].Text := modstr[ed.modified];
editorStatus.Panels[2].Text := ed.fileName;
end;
//
if fKeyChanged then if editorIndex <> -1 then
mainForm.docChangeNotify(Self, editorIndex);
fKeyChanged := false;
end;
end.

View File

@ -1,147 +0,0 @@
unit ce_jsoninfos;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, jsonparser, fpjson;
type
TJSonLoader = class(TThread)
private
parser: TJSONParser;
public
Filename: string;
Data: TJsonData;
procedure Execute; override;
end;
TDSourceInfo = record
line: integer;
infs: string;
end;
TDSourceInfos = array of TDSourceInfo;
TInfKind = (ikModule, ikImport, ikFunction, ikAlias, ikClass, ikStruct,
ikMixin, ikEnum, ikTemplate);
const
InfKindStr: array[TInfKind] of string = ('module', 'import', 'function', 'alias',
'class', 'structure', 'mixin', 'enum', 'template');
InfKindNonModule = [ikImport..ikTemplate];
type
TJSonInfos = class
private
fFilenames: TStringList;
procedure FilesChanged(Sender: TObject);
procedure scan;
public
fData: array of TJsonData;
constructor create;
destructor destroy; override;
//
function getFileModule(const index: integer): TDSourceInfos;
function getMembers(const aFileIndex, aModuleIndex: integer; const aKind: TInfKind): TDSourceInfos;
property Files: TStringList read fFilenames;
end;
var
JSONInfos: TJSonInfos;
implementation
procedure TJSonLoader.Execute;
var
str: TMemoryStream;
begin
str := TMemoryStream.create;
parser := TJSONParser.Create(str);
try
str.LoadFromFile(Filename);
Data := parser.parse;
finally
str.free;
parser.free;
end;
end;
constructor TJSonInfos.create;
begin
fFilenames := TStringList.Create;
fFilenames.OnChange := @FilesChanged;
end;
destructor TJSonInfos.destroy;
begin
fFilenames.Free;
inherited;
end;
procedure TJSonInfos.FilesChanged(Sender: TObject);
begin
scan;
end;
procedure TJSonInfos.scan;
var
fname: string;
str: TmemoryStream;
begin
setLength(fData,0);
str := tMemoryStream.Create;
for fname in fFilenames do
begin
str.LoadFromFile(fname);
str.Position := 0;
setLength(fData, length(fData)+1);
fData[high(fData)] := GetJSON(str);
end;
end;
function TJSonInfos.getFileModule(const index: integer): TDSourceInfos;
var
memb: TJsonData;
i: nativeInt;
begin
setlength(result,0);
memb := fData[index].GetPath('');
for i := 0 to memb.Count-1 do
begin
if memb.Items[i].GetPath('kind').AsString <> 'module' then continue;
setlength(result, length(result) + 1);
result[high(result)].infs := memb.Items[i].GetPath('name').AsString;
result[high(result)].line := 0;
end;
end;
function TJSonInfos.getMembers(const aFileIndex, aModuleIndex: integer; const aKind: TInfKind): TDSourceInfos;
var
memb: TJsonData;
i: nativeInt;
begin
setlength(result,0);
memb := fData[aFileIndex].items[aModuleIndex].GetPath('members');
for i := 0 to memb.Count-1 do
begin
if memb.Items[i].GetPath('kind').AsString <> InfKindStr[aKind]
then continue;
setlength(result, length(result) + 1);
result[high(result)].infs := memb.Items[i].GetPath('name').AsString;
if (aKind = ikModule) then result[high(result)].line := 0
else result[high(result)].line := memb.Items[i].GetPath('line').AsInt64;
end;
end;
initialization
JSONInfos := TJSonInfos.create;
finalization
JSONInfos.Free;
end.

View File

@ -5,7 +5,8 @@ object CEMainForm: TCEMainForm
Width = 745
AllowDropFiles = True
Caption = 'Coedit'
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.Layout = cclTopToBottomThenLeftToRight
DockSite = True
Menu = mainMenu
OnDropFiles = FormDropFiles
OnShow = FormShow

View File

@ -7,9 +7,9 @@ interface
uses
Classes, SysUtils, FileUtil, SynEditKeyCmds, SynHighlighterLFM, Forms,
AnchorDocking, AnchorDockStorage, AnchorDockOptionsDlg, Controls, Graphics,
Dialogs, Menus, ActnList, ExtCtrls, process,
ce_jsoninfos, ce_common, ce_dmdwrap, ce_project, ce_synmemo,
ce_widget, ce_messages, ce_editor, ce_projinspect, ce_projconf, ce_staticexplorer;
Dialogs, Menus, ActnList, ExtCtrls, ComCtrls, process,
ce_common, ce_dmdwrap, ce_project, ce_synmemo, ce_widget, ce_messages,
ce_editor, ce_projinspect, ce_projconf, ce_staticexplorer;
type
@ -174,6 +174,8 @@ type
destructor destroy; override;
//
procedure openFile(const aFilename: string);
procedure docChangeNotify(Sender: TObject; const aIndex: Integer);
procedure docFocusedNotify(Sender: TObject; const aIndex: Integer);
//
property WidgetList: TCEWidgetList read fWidgList;
property MessageWidget: TCEMessagesWidget read fMesgWidg;
@ -190,8 +192,6 @@ implementation
uses
SynMacroRecorder;
// TODO: warnings, OkCancel dialogs
{$REGION std comp methods ******************************************************}
constructor TCEMainForm.create(aOwner: TComponent);
var
@ -206,13 +206,13 @@ begin
fEditWidg := TCEEditorWidget.create(nil);
fProjWidg := TCEProjectInspectWidget.create(nil);
fPrjCfWidg:= TCEProjectConfigurationWidget.create(nil);
//fStExpWidg:= TCEStaticExplorerWidget.create(nil);
fStExpWidg:= TCEStaticExplorerWidget.create(nil);
fWidgList.addWidget(@fMesgWidg);
fWidgList.addWidget(@fEditWidg);
fWidgList.addWidget(@fProjWidg);
fWidgList.addWidget(@fPrjCfWidg);
//fWidgList.addWidget(@fStExpWidg);
fWidgList.addWidget(@fStExpWidg);
for widg in fWidgList do widg.Show;
@ -373,8 +373,8 @@ begin
j += 1;
end;
fEditWidg.editor[i].fileName := str;
fEditWidg.editor[i].modified := true;
fEditWidg.PageControl.PageIndex := i;
fEditWidg.editor[i].modified := false;
fEditWidg.focusedEditorChanged;
end;
function TCEMainForm.findFile(const aFilename: string): NativeInt;
@ -403,12 +403,13 @@ begin
fEditWidg.addEditor;
fEditWidg.editor[i].Lines.LoadFromFile(aFilename);
fEditWidg.editor[i].fileName := aFilename;
fEditWidg.PageControl.PageIndex := i;
fEditWidg.focusedEditorChanged;
end;
procedure TCEMainForm.saveFile(const edIndex: NativeInt);
var
str: string;
i: NativeInt;
begin
if fEditWidg = nil then exit;
if edIndex >= fEditWidg.editorCount then exit;
@ -426,6 +427,9 @@ begin
finally
fEditWidg.editor[edIndex].modified := false;
end;
//
for i := 0 to fWidgList.Count-1 do
fWidgList.widget[i].docChanged(fEditWidg.editor[edIndex]);
end;
procedure TCEMainForm.saveFileAs(const edIndex: NativeInt; const aFilename: string);
@ -442,6 +446,24 @@ begin
end;
end;
procedure TCEMainForm.docChangeNotify(Sender: TObject; const aIndex: Integer);
var
i: NativeInt;
begin
for i := 0 to fWidgList.Count-1 do
if fWidgList.widget[i] <> Sender then
fWidgList.widget[i].docChanged(fEditWidg.editor[aIndex]);
end;
procedure TCEMainForm.docFocusedNotify(Sender: TObject; const aIndex: Integer);
var
i: NativeInt;
begin
for i := 0 to fWidgList.Count-1 do
if fWidgList.widget[i] <> Sender then
fWidgList.widget[i].docFocused(fEditWidg.editor[aIndex]);
end;
procedure TCEMainForm.actFileOpenExecute(Sender: TObject);
begin
if fEditWidg = nil then exit;
@ -521,7 +543,18 @@ begin
end;
procedure TCEMainForm.actFileCloseExecute(Sender: TObject);
var
curr: TCESynMemo;
i: NativeInt;
begin
curr := fEditWidg.currentEditor;
if curr.modified then if dlgOkCancel(
'The latest mdofifications are not saved, continue ?') = mrCancel
then exit;
//
for i := 0 to fWidgList.Count-1 do
fWidgList.widget[i].docClose(fEditWidg.editor[fEditWidg.editorIndex]);
//
fEditWidg.removeEditor(fEditWidg.editorIndex);
end;
@ -539,7 +572,6 @@ begin
for fname in FileNames do
openFile(fname);
end;
{$ENDREGION}
{$REGION edit ******************************************************************}
@ -663,6 +695,9 @@ begin
{$IFDEF DEBUG}{$WARNINGS ON}{$HINTS ON}{$ENDIF}
fEditWidg.editor[edIndex].Lines.SaveToFile(fname + '.d');
{$IFDEF RELEASE}
dmdProc.ShowWindow := swoHIDE;
{$ENDIF}
dmdproc.Options:= [poWaitOnExit, poStdErrToOutput, poUsePipes];
dmdproc.Executable:= 'dmd';
dmdproc.Parameters.Add(fname + '.d');
@ -738,6 +773,9 @@ begin
prjpath := extractFilePath(aProject.fileName);
if directoryExists(prjpath) then chDir(prjpath);
{$IFDEF RELEASE}
dmdProc.ShowWindow := swoHIDE;
{$ENDIF}
dmdproc.Options :=
procopts[aProject.currentConfiguration.messagesOptions.verbose];
@ -909,40 +947,43 @@ begin
fProject := TCEProject.Create(self);
for widg in WidgetList do widg.projNew(fProject);
fProject.onChange := @projChange;
fProject.beforeChanged;
fProject.afterChanged;
end;
procedure TCEMainForm.saveProj;
begin
saveCompToTxtFile(fProject, fProject.fileName);
fProject.saveToFile(fProject.fileName);
end;
procedure TCEMainForm.saveProjAs(const aFilename: string);
begin
fProject.fileName := aFilename;
saveCompToTxtFile(fProject, aFilename);
fProject.saveToFile(fProject.fileName);
end;
procedure TCEMainForm.openProj(const aFilename: string);
begin
closeProj;
newProj;
fProject.beforeChanged;
fProject.fileName := aFilename;
loadCompFromTxtFile(fProject, aFilename);
fProject.afterLoad;
fProject.afterChanged;
fProject.loadFromFile(aFilename);
end;
procedure TCEMainForm.actProjNewExecute(Sender: TObject);
begin
if fProject <> nil then if fProject.modified then if dlgOkCancel(
'The latest mdofifications are not saved, continue ?')
= mrCancel then exit;
closeProj;
newProj;
end;
procedure TCEMainForm.actProjCloseExecute(Sender: TObject);
begin
if fProject = nil then exit;
if fProject.modified then if dlgOkCancel(
'The latest mdofifications are not saved, continue ?')
= mrCancel then exit;
closeProj;
end;
@ -970,6 +1011,10 @@ end;
procedure TCEMainForm.actProjOpenExecute(Sender: TObject);
begin
if fProject <> nil then if fProject.modified then if dlgOkCancel(
'The latest mdofifications are not saved, continue ?')
= mrCancel then exit;
with TOpenDialog.Create(nil) do
try
if execute then openProj(filename);

View File

@ -1,24 +1,24 @@
inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Left = 1160
Height = 276
Top = 723
Width = 474
Height = 277
Top = 722
Width = 463
Caption = 'Project configuration'
ClientHeight = 276
ClientWidth = 474
ClientHeight = 277
ClientWidth = 463
inherited Back: TPanel
Height = 276
Width = 474
ClientHeight = 276
ClientWidth = 474
Height = 277
Width = 463
ClientHeight = 277
ClientWidth = 463
inherited Content: TPanel
Height = 276
Width = 474
ClientHeight = 276
ClientWidth = 474
Height = 277
Width = 463
ClientHeight = 277
ClientWidth = 463
object Tree: TTreeView[0]
Left = 4
Height = 242
Height = 243
Hint = 'filter configuration elements'
Top = 30
Width = 150
@ -53,19 +53,19 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Left = 2
Height = 24
Top = 2
Width = 470
Width = 459
Align = alTop
BorderSpacing.Around = 2
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 470
ClientWidth = 459
TabOrder = 1
object selConf: TComboBox
Left = 0
Height = 23
Hint = 'select a configuration'
Top = 1
Width = 379
Width = 368
Align = alClient
BorderSpacing.Top = 1
BorderSpacing.Right = 1
@ -75,7 +75,7 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
TabOrder = 0
end
object btnAddConf: TSpeedButton
Left = 380
Left = 369
Height = 24
Hint = 'add an empty configuration'
Top = 0
@ -121,7 +121,7 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
ShowCaption = False
end
object btnDelConf: TSpeedButton
Left = 410
Left = 399
Height = 24
Hint = 'remove selected configuration'
Top = 0
@ -167,7 +167,7 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
ShowCaption = False
end
object btnCloneConf: TSpeedButton
Left = 440
Left = 429
Height = 24
Hint = 'clone selected configuration'
Top = 0
@ -215,15 +215,15 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
end
object Splitter1: TSplitter[2]
Left = 154
Height = 248
Height = 249
Top = 28
Width = 5
end
object Grid: TTIPropertyGrid[3]
Left = 159
Height = 242
Height = 243
Top = 30
Width = 311
Width = 300
Align = alClient
BorderSpacing.Top = 4
BorderSpacing.Right = 4

View File

@ -32,7 +32,7 @@ type
fProj: TCEProject;
function getGridTarget: TPersistent;
protected
procedure manualWidgetUpdate; override;
procedure UpdateByEvent; override;
public
constructor create(aOwner: TComponent); override;
procedure projNew(const aProject: TCEProject); override;
@ -52,16 +52,16 @@ end;
procedure TCEProjectConfigurationWidget.projNew(const aProject: TCEProject);
begin
beginManualWidgetUpdate;
beginUpdateByEvent;
fProj := aProject;
endManualWidgetUpdate;
endUpdateByEvent;
end;
procedure TCEProjectConfigurationWidget.projChange(const aProject: TCEProject);
begin
beginManualWidgetUpdate;
beginUpdateByEvent;
fProj := aProject;
endManualWidgetUpdate;
endUpdateByEvent;
end;
procedure TCEProjectConfigurationWidget.projClose(const aProject: TCEProject);
@ -74,12 +74,12 @@ end;
procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject);
begin
if fProj = nil then exit;
if isManualUpdating then exit;
if Updating then exit;
if selConf.ItemIndex = -1 then exit;
//
beginManualWidgetUpdate;
beginUpdateByEvent;
fProj.ConfigurationIndex := selConf.ItemIndex;
endManualWidgetUpdate;
endUpdateByEvent;
end;
procedure TCEProjectConfigurationWidget.TreeChange(Sender: TObject;
@ -102,11 +102,11 @@ begin
if fProj = nil then exit;
//
nme := '';
beginManualWidgetUpdate;
beginUpdateByEvent;
cfg := fProj.addConfiguration;
if InputQuery('Configuration name', '', nme) then cfg.name := nme;
fProj.ConfigurationIndex := cfg.Index;
endManualWidgetUpdate;
endUpdateByEvent;
end;
procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
@ -114,13 +114,13 @@ begin
if fProj = nil then exit;
if fProj.OptionsCollection.Count = 1 then exit;
//
beginManualWidgetUpdate;
beginUpdateByEvent;
Grid.TIObject := nil;
Grid.Clear;
Invalidate;
fProj.OptionsCollection.Delete(selConf.ItemIndex);
fProj.ConfigurationIndex := 0;
endManualWidgetUpdate;
endUpdateByEvent;
end;
procedure TCEProjectConfigurationWidget.btnCloneCurrClick(Sender: TObject);
@ -131,13 +131,13 @@ begin
if fProj = nil then exit;
//
nme := '';
beginManualWidgetUpdate;
beginUpdateByEvent;
src := fProj.currentConfiguration;
trg := fProj.addConfiguration;
trg.assign(src);
if InputQuery('Configuration name', '', nme) then trg.name := nme;
fProj.ConfigurationIndex := trg.Index;
endManualWidgetUpdate;
endUpdateByEvent;
end;
function TCEProjectConfigurationWidget.getGridTarget: TPersistent;
@ -159,7 +159,7 @@ begin
end;
end;
procedure TCEProjectConfigurationWidget.manualWidgetUpdate;
procedure TCEProjectConfigurationWidget.UpdateByEvent;
var
i: NativeInt;
begin

View File

@ -50,12 +50,14 @@ type
procedure addSource(const aFilename: string);
function addConfiguration: TCompilerConfiguration;
procedure getOpts(const aList: TStrings);
procedure afterLoad;
procedure saveToFile(const aFilename: string);
procedure loadFromFile(const aFilename: string);
//
property configuration[ix: integer]: TCompilerConfiguration read getConfig;
property currentConfiguration: TCompilerConfiguration read getCurrConf;
property fileName: string read fFilename write setFname;
property onChange: TNotifyEvent read fOnChange write fOnChange;
property modified: boolean read fModified;
end;
implementation
@ -71,6 +73,7 @@ begin
fSrcsCop := TStringList.Create;
fOptsColl := TCollection.create(TCompilerConfiguration);
reset;
fModified := false;
end;
destructor TCEProject.destroy;
@ -140,11 +143,6 @@ begin
afterChanged;
end;
procedure TCEProject.afterLoad;
begin
patchPlateformPaths(fSrcs);
end;
procedure TCEProject.setConfIx(aValue: Integer);
begin
if fConfIx = aValue then exit;
@ -225,6 +223,7 @@ begin
fSrcs.Clear;
fFilename := '';
afterChanged;
fModified := false;
end;
procedure TCEProject.getOpts(const aList: TStrings);
@ -252,6 +251,21 @@ begin
result := expandFileNameEx(fBasePath, aFilename);
end;
procedure TCEProject.saveToFile(const aFilename: string);
begin
saveCompToTxtFile(self, aFilename);
fModified := false;
end;
procedure TCEProject.loadFromFile(const aFilename: string);
begin
Filename := aFilename;
loadCompFromTxtFile(self, aFilename);
patchPlateformPaths(fSrcs);
doChanged;
fModified := false;
end;
initialization
RegisterClasses([TCEProject]);
end.

View File

@ -1,28 +1,28 @@
inherited CEProjectInspectWidget: TCEProjectInspectWidget
Left = 1641
Height = 384
Top = 89
Width = 263
Left = 1640
Height = 383
Top = 90
Width = 264
AllowDropFiles = True
Caption = 'Project inspector'
ClientHeight = 384
ClientWidth = 263
ClientHeight = 383
ClientWidth = 264
OnDropFiles = FormDropFiles
inherited Back: TPanel
Height = 384
Width = 263
ClientHeight = 384
ClientWidth = 263
Height = 383
Width = 264
ClientHeight = 383
ClientWidth = 264
inherited Content: TPanel
Height = 384
Width = 263
ClientHeight = 384
ClientWidth = 263
Height = 383
Width = 264
ClientHeight = 383
ClientWidth = 264
object Tree: TTreeView[0]
Left = 2
Height = 354
Height = 353
Top = 28
Width = 259
Width = 260
Align = alClient
AutoExpand = True
BorderSpacing.Around = 2
@ -44,12 +44,12 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
Left = 2
Height = 24
Top = 2
Width = 259
Width = 260
Align = alTop
BorderSpacing.Around = 2
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 259
ClientWidth = 260
TabOrder = 1
object btnAddFile: TSpeedButton
Left = 0
@ -190,12 +190,13 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
end
object TreeFilterEdit1: TTreeFilterEdit
Left = 114
Height = 20
Top = 2
Width = 143
ButtonWidth = 30
Height = 23
Top = 0
Width = 114
ButtonWidth = 28
NumGlyphs = 1
Align = alClient
Align = alCustom
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 2
MaxLength = 0
TabOrder = 0

View File

@ -25,7 +25,7 @@ type
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
procedure TreeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
protected
procedure manualWidgetUpdate; override;
procedure UpdateByEvent; override;
private
fProject: TCEProject;
fFileNode, fConfNode: TTreeNode;
@ -56,19 +56,19 @@ end;
procedure TCEProjectInspectWidget.projNew(const aProject: TCEProject);
begin
fProject := aProject;
manualWidgetUpdate;
UpdateByEvent;
end;
procedure TCEProjectInspectWidget.projChange(const aProject: TCEProject);
begin
fProject := aProject;
manualWidgetUpdate;
UpdateByEvent;
end;
procedure TCEProjectInspectWidget.projClose(const aProject: TCEProject);
begin
fProject := nil;
manualWidgetUpdate;
UpdateByEvent;
end;
procedure TCEProjectInspectWidget.TreeKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
@ -99,7 +99,7 @@ begin
begin
i := Tree.Selected.Index;
fProject.ConfigurationIndex := i;
manualWidgetUpdate;
UpdateByEvent;
end;
end;
@ -163,7 +163,7 @@ begin
fname := Tree.Selected.Text;
i := fProject.Sources.IndexOf(fname);
if i > -1 then fProject.Sources.Delete(i);
manualWidgetUpdate;
UpdateByEvent;
end
end;
@ -176,7 +176,7 @@ begin
for fname in Filenames do fProject.addSource(fname);
end;
procedure TCEProjectInspectWidget.manualWidgetUpdate;
procedure TCEProjectInspectWidget.UpdateByEvent;
var
src, conf: string;
itm: TTreeNode;

View File

@ -1,47 +1,74 @@
inherited CEStaticExplorerWidget: TCEStaticExplorerWidget
Left = 1569
Height = 278
Left = 1640
Height = 276
Top = 721
Width = 261
Caption = 'Static explorer'
ClientHeight = 278
ClientHeight = 276
ClientWidth = 261
inherited Back: TPanel
Height = 278
ClientHeight = 278
Height = 276
Width = 261
ClientHeight = 276
ClientWidth = 261
inherited Content: TPanel
Height = 278
ClientHeight = 278
Height = 276
Width = 261
ClientHeight = 276
ClientWidth = 261
object Tree: TTreeView[0]
Left = 4
Height = 242
Height = 240
Top = 32
Width = 324
Width = 253
Align = alClient
BorderSpacing.Around = 4
DefaultItemHeight = 18
ExpandSignType = tvestPlusMinus
HideSelection = False
Images = imgList
ReadOnly = True
ScrollBars = ssAutoBoth
SelectionColor = clActiveBorder
TabOrder = 0
OnDeletion = TreeDeletion
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
Items.Data = {
F9FFFFFF020009000000000000000000000000000000FFFFFFFF000000000000
00000005000000416C6961730100000001000000FFFFFFFFFFFFFFFF00000000
000000000007000000436C6173736573020000000200000002000000FFFFFFFF
00000000000000000005000000456E756D730300000003000000FFFFFFFFFFFF
FFFF0000000000000000000800000046756E6374696F6E0400000004000000FF
FFFFFFFFFFFFFF00000000000000000007000000496D706F7274730500000005
000000FFFFFFFFFFFFFFFF000000000000000000050000004D6978696E060000
0006000000FFFFFFFFFFFFFFFF00000000000000000007000000537472756374
730700000007000000FFFFFFFFFFFFFFFF000000000000000000090000005465
6D706C617465730800000008000000FFFFFFFFFFFFFFFF000000000000000000
080000005661726961626C65
}
TreeLineColor = 14671839
TreeLinePenStyle = psSolid
end
object Panel1: TPanel[1]
Left = 2
Height = 26
Top = 2
Width = 328
Width = 257
Align = alTop
BorderSpacing.Around = 2
BevelOuter = bvNone
ClientHeight = 26
ClientWidth = 328
ClientWidth = 257
TabOrder = 1
object TreeFilterEdit1: TTreeFilterEdit
Left = 2
Height = 22
Height = 23
Top = 2
Width = 324
Width = 226
ButtonWidth = 23
NumGlyphs = 1
Align = alClient
Align = alCustom
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 2
MaxLength = 0
TabOrder = 0
@ -50,4 +77,298 @@ inherited CEStaticExplorerWidget: TCEStaticExplorerWidget
end
end
end
object imgList: TImageList[2]
left = 32
Bitmap = {
4C69090000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000000064646497626262FF616161FF626262FF6464649700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00646464976F6E6EFFA6A5A4FFA9A8A9FFA6A5A4FF6D6E6EFF64646497FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00626363FFA7A5A5FF7D7B7AFF787675FF7D7B7AFFA7A5A5FF626363FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00626363FF8E8C8BFF767371FF767371FF767371FF8E8C8BFF626363FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00636464FF858381FF878481FF868381FF878481FF858381FF636464FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00585858AC6F6E6EFF95918FFF989492FF95918FFF6F6E6EFF585858ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E585858AC636363FF626263FF636363FF585858AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0000000000B9851C97B78319FFB68217FFB78319FFB9851C9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00B9851C97C6922EFFECC482FFEFC886FFECC482FFC6912CFFB9851C97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00B78319FFEEC684FFE5AA49FFE2A641FFE5AA49FFEEC684FFB78319FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00B78219FFEBB964FFE3A641FFE3A641FFE3A641FFEBB964FFB78219FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00B7841AFFEAB45CFFE9B45CFFE8B35BFFE9B45CFFEAB45CFFB7841AFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00A37519ACC5922FFFEDC074FFF1C47AFFEDC074FFC5922FFFA37519ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001EA37519ACB78319FFB68218FFB78319FFA37519AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0000000000008C4B97008A48FF008946FF008A48FF008C4B9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00008C4B97109F63FF74DAB7FF7ADEBDFF74DAB7FF109F63FF008C4B97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00008A49FF66DAB4FF1EC68EFF16C388FF1EC68EFF66DAB4FF008A49FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00008948FF25CF99FF00C07FFF00BE7EFF00C07FFF25CF99FF008948FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00008A4AFF00C789FF00C88AFF00C689FF00C88AFF00C789FF008A4AFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00007B43AC009B5CFF00CE90FF00D194FF00CE90FF009B5CFF007B43ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E007B43AC008A4AFF008949FF008A4AFF007B43AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000002C70DC97296DDBFF286CDBFF296DDBFF2C70DC9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002D70DC974083E7FF95C2FFFF9BC7FFFF95C2FFFF4081E7FF2D70DC97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002B6EDBFF8FC3FFFF5AA4FFFF53A1FFFF5AA4FFFF8FC3FFFF2B6EDBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002B6DDBFF65B2FFFF449EFFFF449DFFFF449EFFFF65B2FFFF2B6DDBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002D6FDBFF4FA9FFFF4FA9FFFF4EA7FFFF4FA9FFFF4FA9FFFF2D6FDBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002863C1AC387FE4FF56B2FFFF58B6FFFF56B2FFFF387FE4FF2863C1ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E2862C1AC2D6EDBFF2D6DDBFF2D6EDBFF2862C1AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000009A6BDC979968DBFF9968DBFF9968DBFF9A6BDC9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF009A6BDC97A17DE7FFC6BCFFFFC9C1FFFFC6BCFFFFA17DE7FF9A6BDC97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF009A69DBFFC5BDFFFFAA9DFFFFA798FFFFAA9DFFFFC5BDFFFF9A69DBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF009A68DBFFB3ACFFFFA396FFFFA396FFFFA396FFFFB3ACFFFF9A68DBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF009A69DBFFACA5FFFFACA5FFFFABA3FFFFACA5FFFFACA5FFFF9A69DBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00885EC1ACA17BE4FFB3B1FFFFB4B6FFFFB3B1FFFFA17BE4FF885EC1ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E885EC1AC9A69DBFF9A68DBFF9A69DBFF885EC1AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0000000000AB499C97AA459AFFA94499FFAA459AFFAB499C9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00AB499C97B462AAFFD8B8D9FFDBBEDDFFD8B8D9FFB462AAFFAB499C97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00AA469AFFDCB6DAFFCA91C9FFC78CC5FFCA91C9FFDCB6DAFFAA469AFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00A94699FFD69ED4FFCA83C7FFCA83C6FFCA83C7FFD69ED4FFA94699FFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00AA489AFFD68ED1FFD68ED2FFD58DD1FFD68ED2FFD68ED1FFAA489AFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00964189ACB85CAAFFE195DAFFE499DEFFE195DAFFB85CAAFF964189ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E964189ACA94899FFA84799FFA94899FF964189AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0000000000354CCD973249CCFF3148CBFF3249CCFF354CCD9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00354CCD97455DDBFF90A6FCFF95ACFFFF90A6FCFF445DDBFF354CCD97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00334ACCFF90A5FDFF5A79FAFF5573F9FF5A79FAFF90A5FDFF334ACCFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00334ACBFF6D88FFFF4D6DFBFF4D6DFAFF4D6DFBFF6D88FFFF334ACBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00354BCBFF5F7CFFFF607CFFFF5F7BFDFF607CFFFF5F7CFFFF354BCBFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002F44B4AC425AD9FF6F88FFFF738CFFFF6F88FFFF425AD9FF2F44B4ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E2F44B4AC344BCBFF334ACAFF344BCBFF2F44B4AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000002CC1FF9729C0FFFF28C0FFFF29C0FFFF2CC1FF9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002DC1FF9741C6FFFF96DCFFFF9CDDFFFF96DCFFFF41C5FFFF2DC1FF97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002AC0FFFF95DDFFFF62CDFFFF5CCBFFFF62CDFFFF95DDFFFF2AC0FFFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002AC0FFFF75D7FFFF56CEFFFF56CEFFFF56CEFFFF75D7FFFF2AC0FFFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF002BC0FFFF68D8FFFF69D8FFFF68D8FFFF69D8FFFF68D8FFFF2BC0FFFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0028AAE0AC3EC9FFFF76E0FFFF7BE2FFFF76E0FFFF3EC9FFFF28AAE0ACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001E28AAE0AC2BC0FFFF2ABFFFFF2BC0FFFF28AAE0AC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0000000000DADADA97D9D9DAFFD9D9D9FFD9D9DAFFDADADA9700000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00DADADA97DADADBFFE5E5E4FFE6E6E4FFE5E5E4FFDADAD9FFDADADA97FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00D9DADAFFE6E6E5FFDBDBD9FFDADAD8FFDBDBD9FFE6E6E5FFD9DADAFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00D9DADAFFE2E1E0FFDBDAD9FFDBDAD9FFDBDAD9FFE2E1E0FFD9DADAFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00D9DADAFFE2E1E0FFE3E2E0FFE2E1E0FFE3E2E0FFE2E1E0FFD9DADAFFFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00BFBFBFACDDDDDDFFE8E7E6FFE9E8E7FFE8E7E6FFDDDDDDFFBFBFBFACFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF000000001EBFBFBFACD9D9D9FFD9D9D9FFD9D9D9FFBFBFBFAC0000001EFFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00000000000000001E0000003300000033000000330000001E00000000FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00
}
end
end

View File

@ -6,63 +6,222 @@ interface
uses
Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics,
Dialogs, ExtCtrls, Menus, ComCtrls, ce_widget, jsonparser, fpjson;
Dialogs, ExtCtrls, Menus, ComCtrls, ce_widget, jsonparser, fpjson,
ce_synmemo, process;
type
{ TCEStaticExplorerWidget }
TCEStaticExplorerWidget = class(TCEWidget)
imgList: TImageList;
Panel1: TPanel;
Tree: TTreeView;
TreeFilterEdit1: TTreeFilterEdit;
procedure TreeDeletion(Sender: TObject; Node: TTreeNode);
private
fDoc: TCESynMemo;
ndAlias, ndClass, ndEnum, ndFunc: TTreeNode;
ndImp, ndMix, ndStruct, ndTmp, ndVar: TTreeNode;
procedure Rescan;
procedure TreeDblClick(Sender: TObject);
protected
procedure UpdateByDelay; override;
public
constructor create(aOwner: TComponent); override;
//
procedure docNew(const aDoc: TCESynMemo); override;
procedure docFocused(const aDoc: TCESynMemo); override;
procedure docChanged(const aDoc: TCESynMemo); override;
procedure docClose(const aDoc: TCESynMemo); override;
end;
implementation
{$R *.lfm}
uses
ce_jsoninfos;
constructor TCEStaticExplorerWidget.create(aOwner: TComponent);
var
rt, nd, mb: TTreeNode;
infs: TDSourceInfos;
mods: TDSourceInfos;
dt: TJsonData;
memberKind: TInfKind;
i,j,k: Integer;
membinfs: TDSourceInfos;
begin
inherited;
fID := 'ID_SEXPL';
//
for i:= 0 to high(JSonInfos.fData) do
ndAlias := Tree.Items[0];
ndClass := Tree.Items[1];
ndEnum := Tree.Items[2];
ndFunc := Tree.Items[3];
ndImp := Tree.Items[4];
ndMix := Tree.Items[5];
ndStruct := Tree.Items[6];
ndTmp := Tree.Items[7];
ndVar := Tree.Items[8];
//
Tree.OnDblClick := @TreeDblClick;
end;
procedure TCEStaticExplorerWidget.docNew(const aDoc: TCESynMemo);
begin
end;
procedure TCEStaticExplorerWidget.docFocused(const aDoc: TCESynMemo);
begin
fDoc := aDoc;
beginUpdateByDelay;
end;
procedure TCEStaticExplorerWidget.docChanged(const aDoc: TCESynMemo);
begin
if fDoc <> aDoc then exit;
beginUpdateByDelay;
end;
procedure TCEStaticExplorerWidget.docClose(const aDoc: TCESynMemo);
begin
if fDoc <> aDoc then exit;
fDoc := nil;
beginUpdateByDelay;
end;
procedure TCEStaticExplorerWidget.UpdateByDelay;
begin
Rescan;
end;
procedure TCEStaticExplorerWidget.TreeDeletion(Sender: TObject; Node: TTreeNode);
begin
if (node.Data <> nil) then
FreeMem(node.Data)
end;
procedure TCEStaticExplorerWidget.TreeDblClick(Sender: TObject);
var
line: Int64;
begin
if fDoc = nil then exit;
if Tree.Selected = nil then exit;
if Tree.Selected.Data = nil then exit;
//
line := PInt64(Tree.Selected.Data)^;
fDoc.CaretY := line;
fDoc.SelectLine();
end;
procedure TCEStaticExplorerWidget.Rescan;
var
dmdproc: TProcess;
lines: TStringList;
str: TMemoryStream;
prs: TJsonParser;
dat: TJsonData;
memb: TJsonData;
submemb: TJsonData;
jsf, scf: string;
ndCat: TTreeNode;
ln: PInt64;
nme: string;
i, j: NativeInt;
begin
if ndAlias = nil then exit;
ndAlias.DeleteChildren;
ndClass.DeleteChildren;
ndEnum.DeleteChildren;
ndFunc.DeleteChildren;
ndImp.DeleteChildren;
ndMix.DeleteChildren;
ndStruct.DeleteChildren;
ndTmp.DeleteChildren;
ndVar.DeleteChildren;
if fDoc = nil then exit;
if fDoc.Lines.Count = 0 then exit;
subMemb := nil;
memb := nil;
// generate json
dmdproc := TProcess.Create(nil);
lines := TStringList.Create;
try
jsf := GetTempDir(false);
jsf += format('%.8X.json',[NativeUint(@dmdproc)]);
scf := GetTempDir(false);
scf += format('%.8X.d',[NativeUint(@dmdproc)]);
//
lines.Assign(fDoc.Lines);
lines.SaveToFile(scf);
//
dmdProc.ShowWindow := swoHIDE;
dmdproc.Options := [];
dmdproc.Executable := 'dmd';
dmdproc.Parameters.Add(scf);
dmdproc.Parameters.Add('-c');
dmdproc.Parameters.Add('-o-');
dmdproc.Parameters.Add('-X');
dmdproc.Parameters.Add('-Xf' + jsf );
dmdproc.Execute;
while dmdproc.Running do;
finally
i := dmdproc.ExitStatus;
dmdproc.Free;
lines.Free;
DeleteFile(scf);
end;
if i <> 0 then
exit;
// load json
str := TMemoryStream.Create;
try
str.LoadFromFile(jsf);
str.Position := 0;
prs := TJsonParser.Create(str);
try
dat := prs.Parse;
finally
prs.Free;
end;
finally
str.Free;
DeleteFile(jsf);
end;
// update tree
memb := dat.items[0].FindPath('members');
if memb <> nil then for i := 0 to memb.Count-1 do
begin
mods := JSonInfos.getFileModule(i);
for j := 0 to high(mods) do
begin
rt := Tree.Items.Add(nil, mods[j].infs);
for memberKind in InfKindNonModule do
begin
membinfs := JSonInfos.getMembers(i, j, memberKind);
nd := Tree.Items.AddChild(rt, InfKindStr[memberKind]);
for k := 0 to high(membinfs) do
begin
mb := Tree.Items.AddChild(nd, membinfs[k].infs);
mb.Data := @membinfs[k];
end;
end;
// category
ln := new(PInt64);
ln^ := memb.Items[i].GetPath('line').AsInt64;
nme := memb.Items[i].GetPath('name').AsString;
case memb.Items[i].GetPath('kind').AsString of
'alias' :ndCat := Tree.Items.AddChildObject(ndAlias, nme, ln);
'class' :ndCat := Tree.Items.AddChildObject(ndClass, nme, ln);
'enum' :ndCat := Tree.Items.AddChildObject(ndEnum, nme, ln);
'function':ndCat := Tree.Items.AddChildObject(ndFunc, nme, ln);
'import' :ndCat := Tree.Items.AddChildObject(ndImp, nme, ln);
'mixin' :ndCat := Tree.Items.AddChildObject(ndMix, nme, ln);
'struct' :ndCat := Tree.Items.AddChildObject(ndStruct, nme, ln);
'template':ndCat := Tree.Items.AddChildObject(ndTmp, nme, ln);
'variable':ndCat := Tree.Items.AddChildObject(ndVar, nme, ln);
end;
// optional item members
submemb := memb.Items[i].FindPath('members');
if subMemb <> nil then for j := 0 to submemb.Count-1 do
begin
ln := new(PInt64);
ln^ := submemb.Items[j].GetPath('line').AsInt64;
nme := submemb.Items[j].GetPath('name').AsString;
Tree.Items.AddChildObject(ndCat, nme, ln);
end;
end;
if dat <> nil then
begin
dat.Clear;
dat.Free;
end;
end;

View File

@ -1,13 +1,14 @@
object CEWidget: TCEWidget
Left = 1538
Left = 1159
Height = 121
Top = 721
Top = 91
Width = 332
BorderIcons = [biMinimize, biMaximize]
Caption = 'CEWidget'
ClientHeight = 121
ClientWidth = 332
ShowHint = True
ShowInTaskBar = stNever
LCLVersion = '1.2.4.0'
object Back: TPanel
Left = 0

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls,
AnchorDocking, AnchorDockStorage, ActnList, Menus,
ce_widgettypes, ce_project;
ce_synmemo, ce_widgettypes, ce_project;
type
@ -17,30 +17,52 @@ type
PTCEWidget = ^TCEWidget;
{ TCEWidget }
TCEWidget = class(TForm, ICEContextualActions, ICEProjectMonitor)
TCEWidget = class(TForm, ICEContextualActions, ICEProjectMonitor, ICEMultiDocMonitor)
Content: TPanel;
Back: TPanel;
contextMenu: TPopupMenu;
private
fAutoUpdater: TTimer;
fAutoUpdating: boolean;
fManuUpdating: boolean;
fUpdating: boolean;
fDelayDur: Integer;
fLoopInter: Integer;
fUpdaterAuto: TTimer;
fUpdaterDelay: TTimer;
fWidgUpdateCount: NativeInt;
procedure autoUpdaterEvent(Sender: TObject);
procedure setDelayDur(aValue: Integer);
procedure setLoopInt(aValue: Integer);
procedure updaterAutoProc(Sender: TObject);
procedure updaterLatchProc(Sender: TObject);
protected
fID: string;
fNeedAutoUpdate: boolean;
procedure autoWidgetUpdate; virtual;
procedure manualWidgetUpdate; virtual;
// a descendant overrides to implementi a periodic update.
procedure UpdateByLoop; virtual;
// a descendant overrides to implement an event driven update.
procedure UpdateByEvent; virtual;
// a descendant overrides to implement a delayed update event.
procedure UpdateByDelay; virtual;
published
property ID: string read fID write fID;
property updaterByLoopInterval: Integer read fLoopInter write setLoopInt;
property updaterByDelayDuration: Integer read fDelayDur write setDelayDur;
public
constructor create(aOwner: TComponent); override;
destructor destroy; override;
// restarts the wait period to the delayed update event.
// if not re-called during 'updaterByDelayDuration' ms then
// 'UpdateByDelay' is called once.
procedure beginUpdateByDelay;
// increments the updates count.
procedure beginUpdateByEvent;
// decrements the update count and call 'UpdateByEvent' if the
// counter value is null.
procedure endUpdateByEvent;
// immediate call the 'UpdateByEvent'
procedure forceUpdateByEvent;
//
procedure beginManualWidgetUpdate;
procedure endManualWidgetUpdate;
procedure forceManualWidgetUpdate;
procedure docNew(const aDoc: TCESynMemo); virtual;
procedure docFocused(const aDoc: TCESynMemo); virtual;
procedure docChanged(const aDoc: TCESynMemo); virtual;
procedure docClose(const aDoc: TCESynMemo); virtual;
//
procedure projNew(const aProject: TCEProject); virtual;
procedure projChange(const aProject: TCEProject); virtual;
@ -49,9 +71,8 @@ type
function contextName: string; virtual;
function contextActionCount: integer; virtual;
function contextAction(index: integer): TAction; virtual;
//
property isAutoUpdating: boolean read fAutoUpdating;
property isManualUpdating: boolean read fManuUpdating;
// returns true if one of the three updater is processing.
property updating: boolean read fUpdating;
end;
(**
@ -85,9 +106,15 @@ constructor TCEWidget.create(aOwner: TComponent);
begin
inherited;
fID := 'ID_XXXX';
fAutoUpdater := TTimer.Create(self);
fAutoUpdater.Interval := 50;
fAutoUpdater.OnTimer := @autoUpdaterEvent;
fUpdaterAuto := TTimer.Create(self);
fUpdaterAuto.Interval := 70;
fUpdaterAuto.OnTimer := @updaterAutoProc;
fUpdaterDelay := TTimer.Create(self);
updaterByLoopInterval := 50;
updaterByDelayDuration := 1000;
DockMaster.MakeDockable(Self, true, true, true);
DockMaster.GetAnchorSite(Self).Header.HeaderPosition := adlhpTop;
end;
@ -97,53 +124,76 @@ begin
inherited;
end;
procedure TCEWidget.beginManualWidgetUpdate;
procedure TCEWidget.setDelayDur(aValue: Integer);
begin
if aValue < 100 then aValue := 100;
if fDelayDur = aValue then exit;
fDelayDur := aValue;
fUpdaterDelay.Interval := fDelayDur;
end;
procedure TCEWidget.setLoopInt(aValue: Integer);
begin
if aValue < 30 then aValue := 30;
if fLoopInter = aValue then exit;
fLoopInter := aValue;
fUpdaterAuto.Interval := fLoopInter;
end;
procedure TCEWidget.beginUpdateByEvent;
begin
Inc(fWidgUpdateCount);
end;
procedure TCEWidget.endManualWidgetUpdate;
procedure TCEWidget.endUpdateByEvent;
begin
Dec(fWidgUpdateCount);
if fWidgUpdateCount > 0 then
begin
{$IFDEF DEBUG}
writeln('widget update count > 0');
{$ENDIF}
exit;
end;
fManuUpdating := true;
manualWidgetUpdate;
fManuUpdating := false;
if fWidgUpdateCount > 0 then exit;
fUpdating := true;
UpdateByEvent;
fUpdating := false;
fWidgUpdateCount := 0;
end;
procedure TCEWidget.forceManualWidgetUpdate;
procedure TCEWidget.forceUpdateByEvent;
begin
fManuUpdating := true;
manualWidgetUpdate;
fManuUpdating := false;
fUpdating := true;
UpdateByEvent;
fUpdating := false;
fWidgUpdateCount := 0;
end;
procedure TCEWidget.autoUpdaterEvent(Sender: TObject);
procedure TCEWidget.beginUpdateByDelay;
begin
if not fNeedAutoUpdate then exit;
fAutoUpdating := true;
try
autoWidgetUpdate;
finally
fAutoUpdating := false;
fNeedAutoUpdate := false;
end;
fUpdaterDelay.Enabled := false;
fUpdaterDelay.Enabled := true;
fUpdaterDelay.OnTimer := @updaterLatchProc;
end;
procedure TCEWidget.autoWidgetUpdate;
procedure TCEWidget.updaterAutoProc(Sender: TObject);
begin
fUpdating := true;
UpdateByLoop;
fUpdating := false;
end;
procedure TCEWidget.updaterLatchProc(Sender: TObject);
begin
fUpdating := true;
UpdateByDelay;
fUpdating := false;
fUpdaterDelay.OnTimer := nil;
end;
procedure TCEWidget.UpdateByLoop;
begin
end;
procedure TCEWidget.manualWidgetUpdate;
procedure TCEWidget.UpdateByEvent;
begin
end;
procedure TCEWidget.UpdateByDelay;
begin
end;
@ -174,6 +224,22 @@ begin
result := nil;
end;
procedure TCEWidget.docNew(const aDoc: TCESynMemo);
begin
end;
procedure TCEWidget.docFocused(const aDoc: TCESynMemo);
begin
end;
procedure TCEWidget.docChanged(const aDoc: TCESynMemo);
begin
end;
procedure TCEWidget.docClose(const aDoc: TCESynMemo);
begin
end;
(*******************************************************************************
* TCEWidgetList
*)

View File

@ -5,7 +5,7 @@ unit ce_widgettypes;
interface
uses
Classes, SysUtils, actnList, ce_project;
Classes, SysUtils, actnList, ce_synmemo, ce_project;
type
@ -13,8 +13,10 @@ type
* An implementer is informed when a new document is added, focused or closed.
*)
ICEMultiDocMonitor = interface
procedure docChange(const aNewIndex: integer);
procedure docClose(const aNewIndex: integer);
procedure docNew(const aDoc: TCESynMemo);
procedure docFocused(const aDoc: TCESynMemo);
procedure docChanged(const aDoc: TCESynMemo);
procedure docClose(const aDoc: TCESynMemo);
end;
(**