mirror of https://gitlab.com/basile.b/dexed.git
This commit is contained in:
parent
3320792161
commit
509b76eac2
|
@ -1,7 +1,7 @@
|
|||
Coedit
|
||||
======
|
||||
|
||||
Coedit is a simple IDE for the D2 lang. (**Co**mpile & **Edit**).
|
||||
Coedit is a simple IDE for the [D2](http://dlang.org) lang. (**Co** mpile & **Edit**).
|
||||
|
||||
Initial features (planed)
|
||||
-------------------------
|
||||
|
@ -20,12 +20,12 @@ Project information
|
|||
- draft
|
||||
- programmed in Object pascal.
|
||||
- [Lazarus](http://www.lazarus.freepascal.org) is used as IDE.
|
||||
- based on dmd (specific gdc or lmd options are not wrapped).
|
||||
- based on dmd (gdc or lmd characteristics are not hanlded).
|
||||
- no other third party dependencies (so far...)
|
||||
|
||||
Setup
|
||||
-----
|
||||
- clone this repo.
|
||||
- optionally install [dmd](http://dlang.org/download.html) and or [Lazarus](http://www.lazarus.freepascal.org)
|
||||
- open "coedit.lpr".
|
||||
- both [dmd](http://dlang.org/download.html) and [Lazarus](http://www.lazarus.freepascal.org) must be setup.
|
||||
- open "coedit.lpr" in Lazarus.
|
||||
- press the Run button.
|
|
@ -48,7 +48,6 @@
|
|||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
|
@ -110,19 +109,22 @@
|
|||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="4">
|
||||
<RequiredPackages Count="5">
|
||||
<Item1>
|
||||
<PackageName Value="RunTimeTypeInfoControls"/>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="SynEdit"/>
|
||||
<PackageName Value="RunTimeTypeInfoControls"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="LazControls"/>
|
||||
<PackageName Value="SynEdit"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<PackageName Value="LCL"/>
|
||||
<PackageName Value="LazControls"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item5>
|
||||
</RequiredPackages>
|
||||
<Units Count="13">
|
||||
<Unit0>
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
object TCEProject
|
||||
OptionsCollection = <
|
||||
item
|
||||
name = 'default'
|
||||
documentationOptions.generateDocumentation = True
|
||||
documentationOptions.generateJSON = False
|
||||
documentationOptions.DocumentationDirectory = '..\doc'
|
||||
debugingOptions.debug = True
|
||||
debugingOptions.debugIdentifier = '2'
|
||||
debugingOptions.addDInformations = False
|
||||
debugingOptions.addCInformations = False
|
||||
debugingOptions.generateMapFile = False
|
||||
messagesOptions.depreciationHandling = warning
|
||||
messagesOptions.verbose = False
|
||||
messagesOptions.warnings = True
|
||||
messagesOptions.additionalWarnings = True
|
||||
messagesOptions.tlsInformations = False
|
||||
messagesOptions.quiet = False
|
||||
outputOptions.targetKind = auto
|
||||
outputOptions.binaryKind = executable
|
||||
outputOptions.inlining = False
|
||||
outputOptions.noBoundsCheck = False
|
||||
outputOptions.optimizations = False
|
||||
outputOptions.generateStackFrame = False
|
||||
outputOptions.addMain = False
|
||||
outputOptions.release = False
|
||||
outputOptions.unittest = True
|
||||
outputOptions.versionIdentifier = 'revision_1'
|
||||
pathsOptions.outputFilename = '..\output\main.exe'
|
||||
end
|
||||
item
|
||||
name = 'alternative'
|
||||
documentationOptions.generateDocumentation = True
|
||||
documentationOptions.generateJSON = False
|
||||
documentationOptions.DocumentationDirectory = '..\doc'
|
||||
debugingOptions.debug = True
|
||||
debugingOptions.debugIdentifier = '2'
|
||||
debugingOptions.addDInformations = False
|
||||
debugingOptions.addCInformations = False
|
||||
debugingOptions.generateMapFile = False
|
||||
messagesOptions.depreciationHandling = warning
|
||||
messagesOptions.verbose = False
|
||||
messagesOptions.warnings = True
|
||||
messagesOptions.additionalWarnings = True
|
||||
messagesOptions.tlsInformations = False
|
||||
messagesOptions.quiet = False
|
||||
outputOptions.targetKind = auto
|
||||
outputOptions.binaryKind = executable
|
||||
outputOptions.inlining = True
|
||||
outputOptions.noBoundsCheck = True
|
||||
outputOptions.optimizations = True
|
||||
outputOptions.generateStackFrame = False
|
||||
outputOptions.addMain = False
|
||||
outputOptions.release = False
|
||||
outputOptions.unittest = True
|
||||
outputOptions.versionIdentifier = 'revision_1'
|
||||
pathsOptions.outputFilename = '..\output\main.exe'
|
||||
end>
|
||||
Sources.Strings = (
|
||||
'..\src\main.d'
|
||||
'..\src\foo.d'
|
||||
'..\src\bar.d'
|
||||
)
|
||||
ConfigurationIndex = 1
|
||||
end
|
|
@ -0,0 +1,16 @@
|
|||
module barclass;
|
||||
|
||||
import std.stdio;
|
||||
|
||||
class Bar{
|
||||
this(){
|
||||
version(revision_1) writeln("bar says: revision 1");
|
||||
version(revision_2) writeln("bar says: revision 2");
|
||||
version(unittest) writeln("bar says: unittest");
|
||||
debug writeln("bar says: debug");
|
||||
debug(0) writeln("bar says: debug level < 1");
|
||||
debug(1) writeln("bar says: debug level < 2");
|
||||
debug(2) writeln("bar says: debug level < 3");
|
||||
debug(3) writeln("bar says: debug level < 4");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
module fooclass;
|
||||
|
||||
import std.stdio;
|
||||
|
||||
class Foo{
|
||||
this(){
|
||||
version(revision_1) writeln("foo says: revision 1");
|
||||
version(revision_2) writeln("foo says: revision 2");
|
||||
version(unittest) writeln("foo says: unittest");
|
||||
debug writeln("foo says: debug");
|
||||
debug(0) writeln("foo says: debug level < 1");
|
||||
debug(1) writeln("foo says: debug level < 2");
|
||||
debug(2) writeln("foo says: debug level < 3");
|
||||
debug(3) writeln("foo says: debug level < 4");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Test:
|
||||
- prj save/load
|
||||
- prj compile
|
||||
- multiples sources
|
||||
- relative paths
|
||||
- various switches
|
||||
*/
|
||||
|
||||
module main;
|
||||
|
||||
import std.stdio;
|
||||
import fooclass;
|
||||
import barclass;
|
||||
|
||||
void main(string args[])
|
||||
{
|
||||
auto foo = new Foo;
|
||||
auto bar = new Bar;
|
||||
}
|
|
@ -32,7 +32,9 @@ type
|
|||
* An implementer is informed when a project changes.
|
||||
*)
|
||||
ICEProjectMonitor = interface
|
||||
procedure projNew(const aProject: TCEProject);
|
||||
procedure projChange(const aProject: TCEProject);
|
||||
procedure projClose(const aProject: TCEProject);
|
||||
end;
|
||||
|
||||
(*****************************************************************************
|
||||
|
@ -47,6 +49,7 @@ type
|
|||
fOptsColl: TCollection;
|
||||
fSrcs, fSrcsCop: TStringList;
|
||||
fConfIx: Integer;
|
||||
fChangedCount: NativeInt;
|
||||
procedure doChanged;
|
||||
procedure subMemberChanged(sender : TObject);
|
||||
procedure setOptsColl(const aValue: TCollection);
|
||||
|
@ -63,6 +66,8 @@ type
|
|||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
procedure beforeChanged;
|
||||
procedure afterChanged;
|
||||
procedure reset;
|
||||
function getAbsoluteSourceName(const aIndex: integer): string;
|
||||
procedure addSource(const aFilename: string);
|
||||
|
@ -165,7 +170,7 @@ begin
|
|||
continue;
|
||||
end;
|
||||
|
||||
if tok then if ln[pos] = ';'then
|
||||
if tok then if ln[pos] = ';' then
|
||||
exit(id);
|
||||
|
||||
id += ln[pos];
|
||||
|
@ -195,14 +200,15 @@ constructor TCEProject.create(aOwner: TComponent);
|
|||
begin
|
||||
inherited create(aOwner);
|
||||
fSrcs := TStringList.Create;
|
||||
fSrcs.OnChange := @subMemberChanged;
|
||||
fSrcsCop := TStringList.Create;
|
||||
fOptsColl := TCollection.create(TCompilerConfiguration);
|
||||
reset;
|
||||
fSrcs.OnChange := @subMemberChanged;
|
||||
end;
|
||||
|
||||
destructor TCEProject.destroy;
|
||||
begin
|
||||
fOnChange := nil;
|
||||
fSrcs.free;
|
||||
fSrcsCop.Free;
|
||||
fOptsColl.free;
|
||||
|
@ -238,6 +244,9 @@ var
|
|||
i: NativeInt;
|
||||
begin
|
||||
if fFilename = aValue then exit;
|
||||
//
|
||||
beforeChanged;
|
||||
|
||||
fFilename := aValue;
|
||||
oldBase := fBasePath;
|
||||
fBasePath := extractFilePath(fFilename);
|
||||
|
@ -249,27 +258,47 @@ begin
|
|||
fSrcs[i] := newRel;
|
||||
end;
|
||||
//
|
||||
doChanged;
|
||||
afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEProject.setSrcs(const aValue: TStringList);
|
||||
begin
|
||||
beforeChanged;
|
||||
fSrcs.Assign(aValue);
|
||||
doChanged;
|
||||
afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEProject.setConfIx(aValue: Integer);
|
||||
begin
|
||||
if fConfIx = aValue then exit;
|
||||
beforeChanged;
|
||||
if aValue < 0 then aValue := 0;
|
||||
if aValue > fOptsColl.Count-1 then aValue := fOptsColl.Count-1;
|
||||
fConfIx := aValue;
|
||||
doChanged;
|
||||
afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEProject.subMemberChanged(sender : TObject);
|
||||
begin
|
||||
beforeChanged;
|
||||
fModified := true;
|
||||
afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEProject.beforeChanged;
|
||||
begin
|
||||
Inc(fChangedCount);
|
||||
end;
|
||||
|
||||
procedure TCEProject.afterChanged;
|
||||
begin
|
||||
Dec(fChangedCount);
|
||||
if fChangedCount > 0 then
|
||||
begin
|
||||
writeln('project update count > 0');
|
||||
exit;
|
||||
end;
|
||||
fChangedCount := 0;
|
||||
doChanged;
|
||||
end;
|
||||
|
||||
|
@ -285,7 +314,7 @@ end;
|
|||
function TCEProject.getConfig(const ix: integer): TCompilerConfiguration;
|
||||
begin
|
||||
result := TCompilerConfiguration(fOptsColl.Items[ix]);
|
||||
result.onChanged := @subMemberChanged;
|
||||
//result.onChanged := @subMemberChanged;
|
||||
end;
|
||||
|
||||
function TCEProject.getCurrConf: TCompilerConfiguration;
|
||||
|
@ -317,13 +346,14 @@ procedure TCEProject.reset;
|
|||
var
|
||||
defConf: TCompilerConfiguration;
|
||||
begin
|
||||
beforeChanged;
|
||||
fConfIx := 0;
|
||||
fOptsColl.Clear;
|
||||
defConf := addConfiguration;
|
||||
defConf.name := 'default';
|
||||
fSrcs.Clear;
|
||||
fFilename := '';
|
||||
doChanged;
|
||||
afterChanged;
|
||||
end;
|
||||
|
||||
function TCEProject.getOpts: string;
|
||||
|
@ -335,9 +365,9 @@ begin
|
|||
for rel in fSrcs do
|
||||
begin
|
||||
abs := expandFilenameEx(fBasePath,rel);
|
||||
result += '"' + abs + '"';
|
||||
result += '"' + abs + '" ' ;
|
||||
end;
|
||||
result += ' ' + TCompilerConfiguration(fOptsColl.Items[fConfIx]).getOpts;
|
||||
result += TCompilerConfiguration(fOptsColl.Items[fConfIx]).getOpts;
|
||||
end;
|
||||
|
||||
function TCEProject.getAbsoluteSourceName(const aIndex: integer): string;
|
||||
|
|
|
@ -447,7 +447,7 @@ TODO:
|
|||
- binary literals.
|
||||
- alternative attributes for ddoc comments.
|
||||
- asm range.
|
||||
- stricter number litterals.
|
||||
- stricter number literals.
|
||||
- string literals: custom token, escape "\" not handled.
|
||||
- correct nested comments handling.
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ type
|
|||
property DocumentationDirectory: string read fDocDir write setDocDir;
|
||||
property JSONFilename: string read fJsonFname write setJSONFile;
|
||||
public
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -79,6 +80,7 @@ type
|
|||
property quiet: boolean read fQuiet write setQuiet;
|
||||
public
|
||||
constructor create;
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -129,6 +131,7 @@ type
|
|||
property unittest: boolean read fUt write setUt;
|
||||
property versionIdentifier: string read fVerId write setVerId;
|
||||
public
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -154,6 +157,7 @@ type
|
|||
property addCInformations: boolean read fDbgC write setDbgC;
|
||||
property generateMapFile: boolean read fMap write setMap;
|
||||
public
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -181,6 +185,7 @@ type
|
|||
public
|
||||
constructor create;
|
||||
destructor destroy; override;
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -196,6 +201,7 @@ type
|
|||
public
|
||||
constructor create;
|
||||
destructor destroy; override;
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
function getOpts: string; override;
|
||||
end;
|
||||
|
||||
|
@ -235,6 +241,7 @@ type
|
|||
public
|
||||
constructor create(aCollection: TCollection); override;
|
||||
destructor destroy; override;
|
||||
procedure assign(aValue: TPersistent); override;
|
||||
property getOpts: string read getCmdLine;
|
||||
property onChanged: TNotifyEvent read fOnChanged write fOnChanged;
|
||||
end;
|
||||
|
@ -261,6 +268,21 @@ begin
|
|||
if fJsonFname <> '' then result += '-Xf' + '"'+ fJsonFname + '" ';
|
||||
end;
|
||||
|
||||
procedure TDocOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TDocOpts;
|
||||
begin
|
||||
if (aValue is TDocOpts) then
|
||||
begin
|
||||
src := TDocOpts(aValue);
|
||||
fGenDoc := src.fGenDoc;
|
||||
fGenJson := src.fGenJson;
|
||||
fDocDir := src.fDocDir;
|
||||
fJsonFname:= src.fJsonFname;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
procedure TDocOpts.setGenDoc(const aValue: boolean);
|
||||
begin
|
||||
if fGenDoc = aValue then exit;
|
||||
|
@ -309,6 +331,23 @@ begin
|
|||
if fQuiet then result += '-quiet ';
|
||||
end;
|
||||
|
||||
procedure TMsgOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TMsgOpts;
|
||||
begin
|
||||
if (aValue is TMsgOpts) then
|
||||
begin
|
||||
src := TMsgOpts(aValue);
|
||||
fDepHandling := src.fDepHandling;
|
||||
fVerb := src.fVerb;
|
||||
fWarn := src.fWarn;
|
||||
fWarnEx := src.fWarnEx;
|
||||
fVtls := src.fVtls;
|
||||
fQuiet := src.fQuiet;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
procedure TMsgOpts.setDepHandling(const aValue: TDepHandling);
|
||||
begin
|
||||
if fDepHandling = aValue then exit;
|
||||
|
@ -371,6 +410,27 @@ begin
|
|||
if fRelease then result += '-release ';
|
||||
end;
|
||||
|
||||
procedure TOutputOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TOutputOpts;
|
||||
begin
|
||||
if (aValue is TOutputOpts) then
|
||||
begin
|
||||
src := TOutputOpts(aValue);
|
||||
fBinKind := src.fBinKind;
|
||||
fTrgKind := src.fTrgKind;
|
||||
fUt := src.fUt;
|
||||
fVerId := src.fVerId;
|
||||
fInline := src.fInline;
|
||||
fNoBounds := src.fNoBounds;
|
||||
fOptimz := src.fOptimz;
|
||||
fGenStack := src.fGenStack;
|
||||
fMain := src.fMain;
|
||||
fRelease := src.fRelease;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
procedure TOutputOpts.setUt(const aValue: boolean);
|
||||
begin
|
||||
if fUt = aValue then exit;
|
||||
|
@ -454,6 +514,22 @@ begin
|
|||
if fMap then result += '-map ';
|
||||
end;
|
||||
|
||||
procedure TDebugOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TDebugOpts;
|
||||
begin
|
||||
if (aValue is TDebugOpts) then
|
||||
begin
|
||||
src := TDebugOpts(aValue);
|
||||
fDbg := src.fDbg;
|
||||
fDbgIdent := src.fDbgIdent;
|
||||
fDbgD := src.fDbgD;
|
||||
fDbgC := src.fDbgC;
|
||||
fMap := src.fMap;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
procedure TDebugOpts.setDbg(const aValue: boolean);
|
||||
begin
|
||||
if fDbg = aValue then exit;
|
||||
|
@ -514,6 +590,22 @@ begin
|
|||
fImpt := TStringList.Create;
|
||||
end;
|
||||
|
||||
procedure TPathsOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TPathsOpts;
|
||||
begin
|
||||
if (aValue is TPathsOpts) then
|
||||
begin
|
||||
src := TPathsOpts(aValue);
|
||||
fSrcs.Assign(src.fSrcs);
|
||||
fIncl.Assign(src.fIncl);
|
||||
fImpt.Assign(src.fImpt);
|
||||
fFName := src.fFname;
|
||||
fObjDir := src.fObjDir;
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
destructor TPathsOpts.destroy;
|
||||
begin
|
||||
fSrcs.free;
|
||||
|
@ -562,6 +654,18 @@ begin
|
|||
fCustom := TStringList.Create;
|
||||
end;
|
||||
|
||||
procedure TOtherOpts.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TOtherOpts;
|
||||
begin
|
||||
if (aValue is TOtherOpts) then
|
||||
begin
|
||||
src := TOtherOpts(aValue);
|
||||
fCustom.Assign(src.fCustom);
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
destructor TOtherOpts.destroy;
|
||||
begin
|
||||
fCustom.Destroy;
|
||||
|
@ -618,6 +722,23 @@ begin
|
|||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCompilerConfiguration.assign(aValue: TPersistent);
|
||||
var
|
||||
src: TCompilerConfiguration;
|
||||
begin
|
||||
if (aValue is TCompilerConfiguration) then
|
||||
begin
|
||||
src := TCompilerConfiguration(aValue);
|
||||
fDocOpts.assign(src.fDocOpts);
|
||||
fDebugOpts.assign(src.fDebugOpts);
|
||||
fMsgOpts.assign(src.fMsgOpts);
|
||||
fOutputOpts.assign(src.fOutputOpts);
|
||||
fPathsOpts.assign(src.fPathsOpts);
|
||||
fOthers.assign(src.fOthers);
|
||||
end
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
function TCompilerConfiguration.nameFromID: string;
|
||||
begin
|
||||
result := format('<configuration %d>',[ID]);
|
||||
|
|
|
@ -1,28 +1,31 @@
|
|||
inherited CEEditorWidget: TCEEditorWidget
|
||||
Left = 1248
|
||||
Left = 1167
|
||||
Height = 336
|
||||
Top = 89
|
||||
Width = 481
|
||||
Width = 508
|
||||
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
|
||||
Caption = 'EditorWidget'
|
||||
ClientHeight = 336
|
||||
ClientWidth = 481
|
||||
ClientWidth = 508
|
||||
inherited Back: TPanel
|
||||
Height = 336
|
||||
Width = 481
|
||||
Width = 508
|
||||
ClientHeight = 336
|
||||
ClientWidth = 481
|
||||
ClientWidth = 508
|
||||
inherited Content: TScrollBox
|
||||
Height = 310
|
||||
Width = 481
|
||||
HorzScrollBar.Page = 477
|
||||
Width = 508
|
||||
HorzScrollBar.Page = 504
|
||||
VertScrollBar.Page = 306
|
||||
AutoSize = True
|
||||
AutoScroll = True
|
||||
ClientHeight = 306
|
||||
ClientWidth = 477
|
||||
ClientWidth = 504
|
||||
object PageControl: TExtendedNotebook[0]
|
||||
Left = 2
|
||||
Height = 279
|
||||
Top = 2
|
||||
Width = 473
|
||||
Width = 500
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 2
|
||||
TabOrder = 0
|
||||
|
@ -34,7 +37,7 @@ inherited CEEditorWidget: TCEEditorWidget
|
|||
Left = 0
|
||||
Height = 23
|
||||
Top = 283
|
||||
Width = 477
|
||||
Width = 504
|
||||
Panels = <
|
||||
item
|
||||
Width = 100
|
||||
|
@ -49,7 +52,7 @@ inherited CEEditorWidget: TCEEditorWidget
|
|||
end
|
||||
end
|
||||
inherited Header: TPanel
|
||||
Width = 481
|
||||
Width = 508
|
||||
end
|
||||
end
|
||||
object macRecorder: TSynMacroRecorder[2]
|
||||
|
|
|
@ -19,7 +19,7 @@ type
|
|||
editorStatus: TStatusBar;
|
||||
procedure PageControlChange(Sender: TObject);
|
||||
protected
|
||||
procedure UpdaterProc; override;
|
||||
procedure autoWidgetUpdate; override;
|
||||
private
|
||||
// http://bugs.freepascal.org/view.php?id=26329
|
||||
fSyncEdit: TSynPluginSyncroEdit;
|
||||
|
@ -36,6 +36,7 @@ type
|
|||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
procedure addEditor;
|
||||
procedure removeEditor(const aIndex: NativeInt);
|
||||
//
|
||||
property currentEditor: TCESynMemo read getCurrentEditor;
|
||||
property editor[index: NativeInt]: TCESynMemo read getEditor;
|
||||
|
@ -112,7 +113,7 @@ var
|
|||
sheet: TTabSheet;
|
||||
memo: TCESynMemo;
|
||||
begin
|
||||
fNeedUpdate := true;
|
||||
fNeedAutoUpdate := true;
|
||||
sheet := pageControl.AddTabSheet;
|
||||
memo := TCESynMemo.Create(sheet);
|
||||
//
|
||||
|
@ -128,6 +129,12 @@ begin
|
|||
focusedEditorChanged;
|
||||
end;
|
||||
|
||||
procedure TCEEditorWidget.removeEditor(const aIndex: NativeInt);
|
||||
begin
|
||||
editor[aIndex].OnChange:= nil;
|
||||
pageControl.Pages[aIndex].Free;
|
||||
end;
|
||||
|
||||
procedure TCEEditorWidget.identifierToD2Syn(const aMemo: TCESynMemo);
|
||||
begin
|
||||
D2Syn.CurrentIdentifier := aMemo.GetWordAtRowCol(aMemo.LogicalCaretXY);
|
||||
|
@ -135,14 +142,14 @@ end;
|
|||
|
||||
procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
fNeedUpdate := true;
|
||||
fNeedAutoUpdate := true;
|
||||
if (sender is TCESynMemo) then
|
||||
identifierToD2Syn(TCESynMemo(Sender));
|
||||
end;
|
||||
|
||||
procedure TCEEditorWidget.memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
fNeedUpdate := true;
|
||||
fNeedAutoUpdate := true;
|
||||
if (sender is TCESynMemo) then
|
||||
identifierToD2Syn(TCESynMemo(Sender));
|
||||
end;
|
||||
|
@ -151,12 +158,12 @@ procedure TCEEditorWidget.memoChange(Sender: TObject);
|
|||
var
|
||||
ed: TCESynMemo;
|
||||
begin
|
||||
fNeedUpdate := true;
|
||||
fNeedAutoUpdate := true;
|
||||
ed := TCESynMemo(sender);
|
||||
ed.modified := true;
|
||||
end;
|
||||
|
||||
procedure TCEEditorWidget.UpdaterProc;
|
||||
procedure TCEEditorWidget.autoWidgetUpdate;
|
||||
const
|
||||
modstr: array[boolean] of string = ('...','MODIFIED');
|
||||
var
|
||||
|
|
965
src/ce_main.lfm
965
src/ce_main.lfm
File diff suppressed because it is too large
Load Diff
289
src/ce_main.pas
289
src/ce_main.pas
|
@ -13,30 +13,32 @@ type
|
|||
|
||||
{ TCEMainForm }
|
||||
TCEMainForm = class(TForm)
|
||||
actCompAndRunFile: TAction;
|
||||
actCompileProj: TAction;
|
||||
actCompileAndRunProj: TAction;
|
||||
ActCompAndRunFileWithArgs: TAction;
|
||||
actCompAndRunProjWithArgs: TAction;
|
||||
actFileCompAndRun: TAction;
|
||||
actFileSaveAll: TAction;
|
||||
actFileClose: TAction;
|
||||
actFileAddToProj: TAction;
|
||||
actFileNewRun: TAction;
|
||||
actFileNew: TAction;
|
||||
actFileOpen: TAction;
|
||||
actFileSaveAs: TAction;
|
||||
actFileSave: TAction;
|
||||
actProjCompile: TAction;
|
||||
actProjCompileAndRun: TAction;
|
||||
ActFileCompAndRunWithArgs: TAction;
|
||||
actProjCompAndRunWithArgs: TAction;
|
||||
actProjClose: TAction;
|
||||
actProjOpts: TAction;
|
||||
actNewProj: TAction;
|
||||
actOpenProj: TAction;
|
||||
actSaveProjAs: TAction;
|
||||
actCut: TAction;
|
||||
actAddCurrToProj: TAction;
|
||||
actNewRunnable: TAction;
|
||||
actProjNew: TAction;
|
||||
actProjOpen: TAction;
|
||||
actProjSave: TAction;
|
||||
actProjSaveAs: TAction;
|
||||
actMacPlay: TAction;
|
||||
actMacStartStop: TAction;
|
||||
actRedo: TAction;
|
||||
actUndo: TAction;
|
||||
actPaste: TAction;
|
||||
actNewFile: TAction;
|
||||
actOpenFile: TAction;
|
||||
actSaveFileAs: TAction;
|
||||
actSaveFile: TAction;
|
||||
actCopy: TAction;
|
||||
actSaveProj: TAction;
|
||||
Action4: TAction;
|
||||
actEdCut: TAction;
|
||||
actEdRedo: TAction;
|
||||
actEdUndo: TAction;
|
||||
actEdPaste: TAction;
|
||||
actEdCopy: TAction;
|
||||
Actions: TActionList;
|
||||
imgList: TImageList;
|
||||
mainMenu: TMainMenu;
|
||||
|
@ -75,6 +77,8 @@ type
|
|||
MenuItem39: TMenuItem;
|
||||
MenuItem40: TMenuItem;
|
||||
MenuItem41: TMenuItem;
|
||||
MenuItem42: TMenuItem;
|
||||
MenuItem43: TMenuItem;
|
||||
mnuItemWin: TMenuItem;
|
||||
MenuItem4: TMenuItem;
|
||||
MenuItem5: TMenuItem;
|
||||
|
@ -82,28 +86,31 @@ type
|
|||
MenuItem7: TMenuItem;
|
||||
MenuItem8: TMenuItem;
|
||||
MenuItem9: TMenuItem;
|
||||
procedure actAddCurrToProjExecute(Sender: TObject);
|
||||
procedure actCompAndRunFileExecute(Sender: TObject);
|
||||
procedure ActCompAndRunFileWithArgsExecute(Sender: TObject);
|
||||
procedure actCompileProjExecute(Sender: TObject);
|
||||
procedure actCopyExecute(Sender: TObject);
|
||||
procedure actCutExecute(Sender: TObject);
|
||||
procedure actFileAddToProjExecute(Sender: TObject);
|
||||
procedure actFileCloseExecute(Sender: TObject);
|
||||
procedure actFileCompAndRunExecute(Sender: TObject);
|
||||
procedure ActFileCompAndRunWithArgsExecute(Sender: TObject);
|
||||
procedure actFileSaveAllExecute(Sender: TObject);
|
||||
procedure actProjCompileExecute(Sender: TObject);
|
||||
procedure actEdCopyExecute(Sender: TObject);
|
||||
procedure actEdCutExecute(Sender: TObject);
|
||||
procedure ActionsUpdate(AAction: TBasicAction; var Handled: Boolean);
|
||||
procedure actMacPlayExecute(Sender: TObject);
|
||||
procedure actMacStartStopExecute(Sender: TObject);
|
||||
procedure actNewFileExecute(Sender: TObject);
|
||||
procedure actNewProjExecute(Sender: TObject);
|
||||
procedure actNewRunnableExecute(Sender: TObject);
|
||||
procedure actOpenFileExecute(Sender: TObject);
|
||||
procedure actOpenProjExecute(Sender: TObject);
|
||||
procedure actPasteExecute(Sender: TObject);
|
||||
procedure actFileNewExecute(Sender: TObject);
|
||||
procedure actProjNewExecute(Sender: TObject);
|
||||
procedure actFileNewRunExecute(Sender: TObject);
|
||||
procedure actFileOpenExecute(Sender: TObject);
|
||||
procedure actProjOpenExecute(Sender: TObject);
|
||||
procedure actEdPasteExecute(Sender: TObject);
|
||||
procedure actProjCloseExecute(Sender: TObject);
|
||||
procedure actProjOptsExecute(Sender: TObject);
|
||||
procedure actRedoExecute(Sender: TObject);
|
||||
procedure actSaveFileAsExecute(Sender: TObject);
|
||||
procedure actSaveFileExecute(Sender: TObject);
|
||||
procedure actSaveProjAsExecute(Sender: TObject);
|
||||
procedure actSaveProjExecute(Sender: TObject);
|
||||
procedure actUndoExecute(Sender: TObject);
|
||||
procedure actEdRedoExecute(Sender: TObject);
|
||||
procedure actFileSaveAsExecute(Sender: TObject);
|
||||
procedure actFileSaveExecute(Sender: TObject);
|
||||
procedure actProjSaveAsExecute(Sender: TObject);
|
||||
procedure actProjSaveExecute(Sender: TObject);
|
||||
procedure actEdUndoExecute(Sender: TObject);
|
||||
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||
private
|
||||
fProject: TCEProject;
|
||||
|
@ -188,15 +195,14 @@ begin
|
|||
act.Caption := widg.Caption;
|
||||
act.OnExecute := @widgetShowFromAction;
|
||||
act.Tag := ptrInt(widg);
|
||||
act.ImageIndex := 25;
|
||||
itm := TMenuItem.Create(self);
|
||||
itm.Action := act;
|
||||
itm.Tag := ptrInt(widg);
|
||||
mnuItemWin.Add(itm);
|
||||
end;
|
||||
|
||||
fProject := TCEProject.Create(self);
|
||||
fProject.onChange := @projChange;
|
||||
projChange(nil);
|
||||
newProj;
|
||||
|
||||
end;
|
||||
|
||||
|
@ -207,6 +213,7 @@ begin
|
|||
fEditWidg.Free;
|
||||
fProjWidg.Free;
|
||||
fPrjCfWidg.Free;
|
||||
fProject.Free;
|
||||
//
|
||||
inherited;
|
||||
end;
|
||||
|
@ -215,6 +222,7 @@ procedure TCEMainForm.ActionsUpdate(AAction: TBasicAction; var Handled: Boolean)
|
|||
var
|
||||
curr: TCESynMemo;
|
||||
hasEd: boolean;
|
||||
hasProj: boolean;
|
||||
begin
|
||||
if fEditWidg = nil then exit;
|
||||
//
|
||||
|
@ -222,38 +230,49 @@ begin
|
|||
hasEd := curr <> nil;
|
||||
if hasEd then
|
||||
begin
|
||||
actCopy.Enabled := curr.SelAvail;
|
||||
actCut.Enabled := curr.SelAvail;
|
||||
actPaste.Enabled := curr.CanPaste;
|
||||
actUndo.Enabled := curr.CanUndo;
|
||||
actRedo.Enabled := curr.CanRedo;
|
||||
actEdCopy.Enabled := curr.SelAvail;
|
||||
actEdCut.Enabled := curr.SelAvail;
|
||||
actEdPaste.Enabled := curr.CanPaste;
|
||||
actEdUndo.Enabled := curr.CanUndo;
|
||||
actEdRedo.Enabled := curr.CanRedo;
|
||||
actMacPlay.Enabled := true;
|
||||
actMacStartStop.Enabled := true;
|
||||
//
|
||||
actCompAndRunFile.Enabled := true;
|
||||
actCompAndRunFileWithArgs.Enabled := true;
|
||||
//
|
||||
actSaveFile.Enabled := true;
|
||||
actSaveFileAs.Enabled := true;
|
||||
actAddCurrToProj.Enabled := true;
|
||||
actFileCompAndRun.Enabled := true;
|
||||
actFileCompAndRunWithArgs.Enabled := true;
|
||||
actFileSave.Enabled := true;
|
||||
actFileSaveAs.Enabled := true;
|
||||
actFileClose.Enabled:=true;
|
||||
actFileSaveAll.Enabled:=true;
|
||||
end
|
||||
else begin
|
||||
actCopy.Enabled := false;
|
||||
actCut.Enabled := false ;
|
||||
actPaste.Enabled := false ;
|
||||
actUndo.Enabled := false ;
|
||||
actRedo.Enabled := false ;
|
||||
actEdCopy.Enabled := false;
|
||||
actEdCut.Enabled := false ;
|
||||
actEdPaste.Enabled := false ;
|
||||
actEdUndo.Enabled := false ;
|
||||
actEdRedo.Enabled := false ;
|
||||
actMacPlay.Enabled := false;
|
||||
actMacStartStop.Enabled := false;
|
||||
//
|
||||
actCompAndRunFile.Enabled := false;
|
||||
actCompAndRunFileWithArgs.Enabled := false;
|
||||
//
|
||||
actSaveFile.Enabled := false;
|
||||
actSaveFileAs.Enabled := false;
|
||||
actAddCurrToProj.Enabled := false;
|
||||
actFileCompAndRun.Enabled := false;
|
||||
actFileCompAndRunWithArgs.Enabled := false;
|
||||
actFileSave.Enabled := false;
|
||||
actFileSaveAs.Enabled := false;
|
||||
actFileClose.Enabled := false;
|
||||
actFileSaveAll.Enabled := false;
|
||||
end;
|
||||
|
||||
hasProj := fProject <> nil;
|
||||
actProjSave.Enabled := hasProj;
|
||||
actProjSaveAs.Enabled := hasProj;
|
||||
actProjOpts.Enabled := hasProj;
|
||||
actProjClose.Enabled := hasProj;
|
||||
actProjCompile.Enabled := hasProj;
|
||||
actProjCompileAndRun.Enabled := hasProj;
|
||||
actProjCompAndRunWithArgs.Enabled := hasProj;
|
||||
|
||||
actFileAddToProj.Enabled := hasEd and hasProj;
|
||||
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.checkWidgetActions(const aWidget: TCEWidget);
|
||||
|
@ -362,7 +381,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actOpenFileExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileOpenExecute(Sender: TObject);
|
||||
begin
|
||||
if fEditWidg = nil then exit;
|
||||
//
|
||||
|
@ -377,12 +396,12 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actNewFileExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileNewExecute(Sender: TObject);
|
||||
begin
|
||||
newFile;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actNewRunnableExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileNewRunExecute(Sender: TObject);
|
||||
begin
|
||||
newFile;
|
||||
fEditWidg.currentEditor.Text :=
|
||||
|
@ -398,7 +417,7 @@ begin
|
|||
'}' + #13#10;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actSaveFileAsExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileSaveAsExecute(Sender: TObject);
|
||||
begin
|
||||
if fEditWidg = nil then exit;
|
||||
if fEditWidg.editorIndex < 0 then exit;
|
||||
|
@ -414,7 +433,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actSaveFileExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileSaveExecute(Sender: TObject);
|
||||
var
|
||||
str: string;
|
||||
begin
|
||||
|
@ -423,10 +442,10 @@ begin
|
|||
//
|
||||
str := fEditWidg.editor[fEditWidg.editorIndex].fileName;
|
||||
if fileExists(str) then saveFile(fEditWidg.editorIndex)
|
||||
else actSaveFileAs.Execute;
|
||||
else actFileSaveAs.Execute;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actAddCurrToProjExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject);
|
||||
var
|
||||
str: string;
|
||||
begin
|
||||
|
@ -437,6 +456,18 @@ begin
|
|||
fProject.addSource(str);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actFileCloseExecute(Sender: TObject);
|
||||
begin
|
||||
fEditWidg.removeEditor(fEditWidg.editorIndex);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actFileSaveAllExecute(Sender: TObject);
|
||||
var
|
||||
i: NativeInt;
|
||||
begin
|
||||
for i:= 0 to fEditWidg.editorCount-1 do saveFile(i);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.FormDropFiles(Sender: TObject;const FileNames: array of String);
|
||||
var
|
||||
fname: string;
|
||||
|
@ -447,7 +478,7 @@ end;
|
|||
{$ENDREGION}
|
||||
|
||||
{$REGION edit ******************************************************************}
|
||||
procedure TCEMainForm.actCopyExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actEdCopyExecute(Sender: TObject);
|
||||
var
|
||||
curr: TCESynMemo;
|
||||
begin
|
||||
|
@ -455,7 +486,7 @@ begin
|
|||
if assigned(curr) then curr.CopyToClipboard;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actCutExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actEdCutExecute(Sender: TObject);
|
||||
var
|
||||
curr: TCESynMemo;
|
||||
begin
|
||||
|
@ -463,7 +494,7 @@ begin
|
|||
if assigned(curr) then curr.CutToClipboard;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actPasteExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actEdPasteExecute(Sender: TObject);
|
||||
var
|
||||
curr: TCESynMemo;
|
||||
begin
|
||||
|
@ -471,7 +502,7 @@ begin
|
|||
if assigned(curr) then curr.PasteFromClipboard;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actUndoExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actEdUndoExecute(Sender: TObject);
|
||||
var
|
||||
curr: TCESynMemo;
|
||||
begin
|
||||
|
@ -479,7 +510,7 @@ begin
|
|||
if assigned(curr) then curr.Undo;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actRedoExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actEdRedoExecute(Sender: TObject);
|
||||
var
|
||||
curr: TCESynMemo;
|
||||
begin
|
||||
|
@ -513,17 +544,17 @@ end;
|
|||
|
||||
{$REGION run ******************************************************************}
|
||||
procedure TCEMainForm.ProcessOutputToMsg(const aProcess: TProcess);
|
||||
const
|
||||
ioBuffSz = 2048;
|
||||
var
|
||||
str: TMemoryStream;
|
||||
lns: TStringList;
|
||||
readCnt: LongInt;
|
||||
readSz: LongInt;
|
||||
ioBuffSz: LongInt;
|
||||
msg: string;
|
||||
begin
|
||||
If not (poUsePipes in aProcess.Options) then exit;
|
||||
//
|
||||
ioBuffSz := aProcess.PipeBufferSize;
|
||||
str := TMemorystream.Create;
|
||||
lns := TStringList.Create;
|
||||
readSz := 0;
|
||||
|
@ -541,6 +572,7 @@ begin
|
|||
finally
|
||||
str.Free;
|
||||
lns.Free;
|
||||
fMesgWidg.scrollToBack;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -553,16 +585,19 @@ begin
|
|||
olddir := '';
|
||||
dmdproc := TProcess.Create(nil);
|
||||
runproc := TProcess.Create(nil);
|
||||
getDir(0,olddir);
|
||||
getDir(0, olddir);
|
||||
try
|
||||
|
||||
fMesgWidg.addCeInf( 'compiling ' + fEditWidg.editor[edIndex].fileName );
|
||||
|
||||
temppath := GetTempDir(false);
|
||||
chDir(temppath);
|
||||
{$IFDEF DEBUG}{$WARNINGS OFF}{$HINTS OFF}{$ENDIF}
|
||||
fname := temppath + format('temp_%.8x',[LongWord(@dmdproc)]);
|
||||
fname := temppath + format('temp_%.8x', [LongWord(@dmdproc)]);
|
||||
{$IFDEF DEBUG}{$WARNINGS ON}{$HINTS ON}{$ENDIF}
|
||||
fEditWidg.editor[edIndex].Lines.SaveToFile(fname + '.d');
|
||||
|
||||
dmdproc.Options:= [poWaitOnExit,poStdErrToOutput,poUsePipes];
|
||||
dmdproc.Options:= [poWaitOnExit, poStdErrToOutput, poUsePipes];
|
||||
dmdproc.Executable:= 'dmd';
|
||||
dmdproc.Parameters.Text := '"'+ fname +'.d"';
|
||||
try
|
||||
|
@ -574,7 +609,11 @@ begin
|
|||
|
||||
if dmdProc.ExitStatus = 0 then
|
||||
begin
|
||||
runproc.Options:= [poWaitOnExit,poStderrToOutPut,poUsePipes];
|
||||
|
||||
fMesgWidg.addCeInf( fEditWidg.editor[edIndex].fileName
|
||||
+ ' successfully compiled' );
|
||||
|
||||
runproc.Options:= [poWaitOnExit, poStderrToOutPut, poUsePipes];
|
||||
{$IFDEF MSWINDOWS}
|
||||
runproc.Executable := fname + '.exe';
|
||||
runproc.Parameters.Text := runArgs;
|
||||
|
@ -590,7 +629,10 @@ begin
|
|||
DeleteFile(fname);
|
||||
DeleteFile(fname + '.o');
|
||||
{$ENDIF}
|
||||
end;
|
||||
end
|
||||
else
|
||||
fMesgWidg.addCeErr( fEditWidg.editor[edIndex].fileName
|
||||
+ ' has not been compiled' );
|
||||
|
||||
finally
|
||||
dmdproc.Free;
|
||||
|
@ -603,18 +645,39 @@ procedure TCEMainForm.compileProject(const aProject: TCEProject);
|
|||
var
|
||||
dmdproc: TProcess;
|
||||
olddir, prjpath: string;
|
||||
const
|
||||
// option -v causes an hang if poWaitOnExit is included
|
||||
procopts: array[boolean] of TProcessOptions = (
|
||||
[poWaitOnExit, poStdErrToOutput, poUsePipes],
|
||||
[poStdErrToOutput, poUsePipes]
|
||||
);
|
||||
begin
|
||||
olddir := '';
|
||||
dmdproc := TProcess.Create(nil);
|
||||
getDir(0,olddir);
|
||||
getDir(0, olddir);
|
||||
try
|
||||
|
||||
fMesgWidg.addCeInf( 'compiling ' + aProject.fileName );
|
||||
|
||||
prjpath := extractFilePath(aProject.fileName);
|
||||
if directoryExists(prjpath) then chDir(prjpath);
|
||||
dmdproc.Options:= [poStdErrToOutput,poUsePipes];
|
||||
|
||||
dmdproc.Options :=
|
||||
procopts[aProject.currentConfiguration.messagesOptions.verbose];
|
||||
|
||||
dmdproc.Executable := 'dmd';
|
||||
dmdproc.Parameters.Text := aProject.getOpts;
|
||||
dmdproc.Execute;
|
||||
ProcessOutputToMsg(dmdproc);
|
||||
try
|
||||
dmdproc.Execute;
|
||||
ProcessOutputToMsg(dmdproc);
|
||||
finally
|
||||
if dmdProc.ExitStatus = 0 then
|
||||
fMesgWidg.addCeInf( aProject.fileName
|
||||
+ ' successfully compiled' )
|
||||
else
|
||||
fMesgWidg.addCeErr( aProject.fileName
|
||||
+ ' has not been compiled' );
|
||||
end;
|
||||
|
||||
finally
|
||||
dmdproc.Free;
|
||||
|
@ -628,7 +691,7 @@ begin
|
|||
executable then exit;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actCompAndRunFileExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actFileCompAndRunExecute(Sender: TObject);
|
||||
begin
|
||||
if fEditWidg = nil then exit;
|
||||
if fEditWidg.editorIndex < 0 then exit;
|
||||
|
@ -636,7 +699,7 @@ begin
|
|||
compileAndRunFile(fEditWidg.editorIndex);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.ActCompAndRunFileWithArgsExecute(Sender: TObject);
|
||||
procedure TCEMainForm.ActFileCompAndRunWithArgsExecute(Sender: TObject);
|
||||
var
|
||||
runargs: string;
|
||||
begin
|
||||
|
@ -648,7 +711,7 @@ begin
|
|||
runargs) then compileAndRunFile(fEditWidg.editorIndex, runargs);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actCompileProjExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actProjCompileExecute(Sender: TObject);
|
||||
begin
|
||||
compileProject(fProject);
|
||||
end;
|
||||
|
@ -665,28 +728,30 @@ end;
|
|||
{$REGION project ***************************************************************}
|
||||
procedure TCEMainForm.projChange(sender: TObject);
|
||||
var
|
||||
i: NativeInt;
|
||||
widg: TCEWidget;
|
||||
begin
|
||||
for i:= 0 to WidgetList.Count-1 do
|
||||
widgetList.widget[i].projChange(fProject);
|
||||
for widg in WidgetList do
|
||||
widg.projChange(fProject);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.closeProj;
|
||||
var
|
||||
widg: TCEWidget;
|
||||
begin
|
||||
for widg in WidgetList do widg.projClose(fProject);
|
||||
fProject.Free;
|
||||
fProject := nil;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.newProj;
|
||||
var
|
||||
// cf. with ce_projconf, fProject is hook
|
||||
// ICEProjectMonitor would recquire beforeProjChanged-), afterProjChage(), ...
|
||||
old: TCEProject;
|
||||
widg: TCEWidget;
|
||||
begin
|
||||
old := fProject;
|
||||
fProject := nil;
|
||||
projChange(nil);
|
||||
//
|
||||
old.Free;
|
||||
old := nil;
|
||||
//
|
||||
fProject := TCEProject.Create(self);
|
||||
for widg in WidgetList do widg.projNew(fProject);
|
||||
fProject.onChange := @projChange;
|
||||
projChange(nil);
|
||||
fProject.beforeChanged;
|
||||
fProject.afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.saveProj;
|
||||
|
@ -702,17 +767,21 @@ end;
|
|||
|
||||
procedure TCEMainForm.openProj(const aFilename: string);
|
||||
begin
|
||||
closeProj;
|
||||
newProj;
|
||||
fProject.beforeChanged;
|
||||
fProject.fileName := aFilename;
|
||||
loadCompFromTxtFile(fProject, aFilename);
|
||||
fProject.afterChanged;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.closeProj;
|
||||
procedure TCEMainForm.actProjNewExecute(Sender: TObject);
|
||||
begin
|
||||
closeProj;
|
||||
newProj;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actNewProjExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actProjCloseExecute(Sender: TObject);
|
||||
begin
|
||||
closeProj;
|
||||
end;
|
||||
|
@ -723,7 +792,7 @@ begin
|
|||
fProject.addSource(aFilename);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actSaveProjAsExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actProjSaveAsExecute(Sender: TObject);
|
||||
begin
|
||||
with TSaveDialog.Create(nil) do
|
||||
try
|
||||
|
@ -733,13 +802,13 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actSaveProjExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actProjSaveExecute(Sender: TObject);
|
||||
begin
|
||||
if fProject.fileName <> '' then saveProj
|
||||
else actSaveProjAs.Execute;
|
||||
else actProjSaveAs.Execute;
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.actOpenProjExecute(Sender: TObject);
|
||||
procedure TCEMainForm.actProjOpenExecute(Sender: TObject);
|
||||
begin
|
||||
with TOpenDialog.Create(nil) do
|
||||
try
|
||||
|
|
|
@ -1,115 +1,84 @@
|
|||
inherited CEMessagesWidget: TCEMessagesWidget
|
||||
Left = 1247
|
||||
Height = 85
|
||||
Left = 1168
|
||||
Height = 220
|
||||
Top = 463
|
||||
Width = 658
|
||||
Width = 737
|
||||
Caption = 'MessagesWidget'
|
||||
ClientHeight = 85
|
||||
ClientWidth = 658
|
||||
ClientHeight = 220
|
||||
ClientWidth = 737
|
||||
inherited Back: TPanel
|
||||
Height = 85
|
||||
Width = 658
|
||||
ClientHeight = 85
|
||||
ClientWidth = 658
|
||||
Height = 220
|
||||
Width = 737
|
||||
ClientHeight = 220
|
||||
ClientWidth = 737
|
||||
inherited Content: TScrollBox
|
||||
Height = 59
|
||||
Width = 658
|
||||
HorzScrollBar.Page = 637
|
||||
VertScrollBar.Page = 55
|
||||
ClientHeight = 55
|
||||
ClientWidth = 637
|
||||
Height = 194
|
||||
Width = 737
|
||||
HorzScrollBar.Page = 733
|
||||
VertScrollBar.Page = 190
|
||||
ClientHeight = 190
|
||||
ClientWidth = 733
|
||||
object List: TListView[0]
|
||||
Left = 2
|
||||
Height = 150
|
||||
Height = 186
|
||||
Top = 2
|
||||
Width = 633
|
||||
Width = 729
|
||||
Align = alClient
|
||||
AutoSort = False
|
||||
AutoWidthLastColumn = True
|
||||
BorderSpacing.Around = 2
|
||||
Columns = <
|
||||
item
|
||||
Width = 629
|
||||
Width = 725
|
||||
end>
|
||||
GridLines = True
|
||||
IconOptions.Arrangement = iaLeft
|
||||
HideSelection = False
|
||||
ReadOnly = True
|
||||
RowSelect = True
|
||||
ShowColumnHeaders = False
|
||||
SmallImages = imgList
|
||||
TabOrder = 0
|
||||
ViewStyle = vsReport
|
||||
end
|
||||
end
|
||||
inherited Header: TPanel
|
||||
Width = 658
|
||||
Width = 737
|
||||
end
|
||||
end
|
||||
object imgList: TImageList[2]
|
||||
Bitmap = {
|
||||
4C69030000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF003B85CC003B85CC003B85CC003B85CC003B85
|
||||
CC003B85CC003983CA213384CDFF3384CDFF3983CA213B85CC003B85CC003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85
|
||||
CC003983CB00337EC7CF84C3F1FF84C3F1FF337EC7CF3983CB003B85CC003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003A84
|
||||
CB003580CA6D5398D7FFC1F0FFFFC1F0FFFF5398D7FF3580CA6D3A84CB003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003882
|
||||
CA0A3A83CBFFB2E5FFFF9EC8DEFF9EC8DEFFB2E5FFFF3A83CBFF3882CA0A3B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003983CB00337E
|
||||
C8CF86BEEAFFA4ECFFFF6C5D53FF6C5D53FFA4ECFFFF86BEEAFF337EC8CF3983
|
||||
CB003B85CC003B85CC003B85CC003B85CC003B85CC003A84CC003580C9585797
|
||||
D5FFC6F3FFFF3ACAFFFF6C5B54FF6C5B54FF3ACAFFFFC6F3FFFF5797D5FF3580
|
||||
C9583A84CC003B85CC003B85CC003B85CC003B85CC003882CA003C82C9FFC1E8
|
||||
FDFF50CCFFFF27C5FFFF69554CFF69554CFF27C5FFFF50CCFFFFC1E8FDFF3C82
|
||||
C9FF3882CA003B85CC003B85CC003B85CC003983CB00337EC8BB90BFE6FF6FD7
|
||||
FFFF32C3FFFF34CBFFFF644B3FFF644B3FFF34CBFFFF32C3FFFF6FD7FFFF90BF
|
||||
E6FF337EC8BB3983CB003B85CC003A84CC003680C9445B97D4FF9EE8FFFF38C7
|
||||
FFFF3DC8FFFF3DCFFFFF4BBCE9FF4BBCE9FF3DCFFFFF3DC8FFFF38C7FFFF9EE8
|
||||
FFFF5B97D4FF3680C9443A84CC003982CB003F82C9FFA3E0FAFF40CFFFFF44CE
|
||||
FFFF46CFFFFF44D6FFFF775C50FF775C50FF44D6FFFF46CFFFFF44CEFFFF40CF
|
||||
FFFFA3E0FAFF3F82C9FF3982CB003880C9947AB8E4FF52DBFFFF4BD5FFFF4DD5
|
||||
FFFF4DD6FFFF4BDCFFFF67493FFF67493FFF4BDCFFFF4DD6FFFF4DD5FFFF4BD5
|
||||
FFFF52DBFFFF7AB8E4FF3880C9943B86CDFF55E3FFFF55E3FFFF56E1FFFF56E1
|
||||
FFFF56E2FFFF56E5FFFF55E9FFFF55E9FFFF56E5FFFF56E2FFFF56E1FFFF56E1
|
||||
FFFF55E3FFFF55E3FFFF3B86CDFF3A82CAFF397FC8FF387DC7FF387CC7FF397C
|
||||
C7FF397CC7FF387DC7FF387EC9FF387EC9FF387DC7FF397CC7FF397CC7FF387C
|
||||
C7FF387DC7FF397FC8FF3A82CAFF000000330000003300000033000000330000
|
||||
0033000000330000003300000033000000330000003300000033000000330000
|
||||
0033000000330000003300000033FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000
|
||||
000000000000000000001B73A8FF000000000000000000000000000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
000000000000186EA4FFD0F9FFFF186EA3FF0000000000000000000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
00001B6FA3FF83DCFFFF16B2FFFF82DBFFFF1A6EA2FF00000000000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000001B6F
|
||||
A3FF52B8F1FF22B9FFFF23BAFFFF21B8FFFF81DDFFFF1A6DA2FF000000000000
|
||||
00000000000000000000FFFFFF000000000000000000000000001A6EA2FF7EDF
|
||||
FFFF29BBFFFF2AC0FFFF3B1707FF2AC0FFFF27BAFFFF7DDEFFFF1A6DA2FF0000
|
||||
00000000000000000000FFFFFF0000000000000000001A6DA2FF7CDFFFFF2CBD
|
||||
FFFF2FBEFFFF2FC7FFFF452619FF2FC6FFFF2EBEFFFF2CBDFFFF7CDFFFFF1A6D
|
||||
A2FF0000000000000000FFFFFF0000000000196DA3FF78E0FFFF32C1FFFF34C0
|
||||
FFFF35C2FFFF34CBFFFF503024FF34CBFFFF35C2FFFF34C0FFFF32C1FFFF78E0
|
||||
FFFF196DA3FF00000000FFFFFF001C73A8FF9BF5FFFF36C8FFFF39C4FFFF3BC4
|
||||
FFFF3BC6FFFF39CEFFFF5A3A2DFF39CEFFFF3BC6FFFF3BC4FFFF39C4FFFF36C8
|
||||
FFFF9BF5FFFF1C73A8FFFFFFFF0000000033196DA3FF6FE2FFFF3ECCFFFF3FC9
|
||||
FFFF3FCAFFFF3DD1FFFF654233FF3DD1FFFF3FCAFFFF3FC9FFFF3ECCFFFF6FE2
|
||||
FFFF196DA3FF00000033FFFFFF0000000000000000331B6DA3FF4EC1F0FF44D1
|
||||
FFFF44CEFFFF44D4FFFF3AA1CAFF44D4FFFF44CEFFFF44D0FFFF4EC1F0FF1B6D
|
||||
A3FF0000003300000000FFFFFF000000000000000000000000331B6DA3FF6AE6
|
||||
FFFF4BD5FFFF4AD7FFFF471D11FF49D6FFFF4AD4FFFF6AE5FFFF1B6DA3FF0000
|
||||
00330000000000000000FFFFFF00000000000000000000000000000000331B6D
|
||||
A3FF4DC4F0FF4FDBFFFF4DDAFFFF4EDAFFFF66E6FFFF1A6CA2FF000000330000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
00331B6DA3FF63E8FFFF55E0FFFF63E7FFFF1A6CA2FF00000033000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
0000000000331B6DA4FF66F0FFFF1B6DA3FF0000003300000000000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
000000000000000000331E73A8FF000000330000000000000000000000000000
|
||||
00000000000000000000FFFFFF00000000000000000000000000000000000000
|
||||
0000000000000000000000000033000000000000000000000000000000000000
|
||||
00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
4C69050000001000000010000000CF986200D1996200D1996234D0965DBCCF94
|
||||
5BFFCE945AFFCE935AFFCE935AFFCE935AFFCE935AFFCE945AFFCF945BFFD096
|
||||
5DBCD1996234D1996200CF986200CF976100CF975E5AD09861FFF0D3B5FFFFF4
|
||||
E4FFFFFBEDFFFFFAEDFFFFFAEDFFFFFAEDFFFFFAEDFFFFFBEDFFFFF4E4FFF0D3
|
||||
B5FFD09861FFCF975E5ACF976100CE955F34CE9760FFFAE6D0FFFFF4E3FFFFE6
|
||||
C4FFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE6C4FFFFF4
|
||||
E3FFFAE6D0FFCE9760FFCE955F34C78F57BFEED1B1FFFFF4E1FFFFE1B9FFFFDF
|
||||
B6FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB6FFFFE1
|
||||
B9FFFFF4E1FFEED1B1FFC78F57BFC68E54FFFFF9E8FFFFE9CAFFFFE3BCFFFFE3
|
||||
BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3
|
||||
BCFFFFE9CAFFFFF9E8FFC68E54FFC38B50FFFFF7E4FFFFE8C9FFFFE5C2FFFFE5
|
||||
C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5
|
||||
C2FFFFE8C9FFFFF7E4FFC38B50FFC18A4FFFFFF8E4FFFFEACCFFFFE8C8FFFFE8
|
||||
C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8
|
||||
C8FFFFEACCFFFFF8E4FFC18A4FFFC0884FFFFFFCE6FFFFEED3FFFFEBCDFFFFEB
|
||||
CDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEB
|
||||
CDFFFFEED3FFFFFCE6FFC0884FFFB3814CC9EBD1AEFFFFF7E1FFFFF0D4FFFFEE
|
||||
D2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFF0
|
||||
D4FFFFF7E1FFEBD1AEFFB3814CC97A593552C08C54FFF8E8CBFFFFF8E3FFFFF4
|
||||
DAFFFFF2D8FFFFF1D7FFFFF2D9FFFFF3D9FFFFF3D9FFFFF3DAFFFFF4DDFFFFF8
|
||||
E3FFF8E8CBFFC08C54FF7A5935520000000A8B643B7BBE8A53FFEAD0AEFFFFF5
|
||||
DEFFFFF7E1FFFFF6E1FFFFFAE5FFFFFDEAFFFFFEEBFFFFFFECFFFFF9E4FFEAD1
|
||||
AFFFBE8A53FF8B643B7B0000000AC28F570000000012664B2B5AA87741C1BC8A
|
||||
51FFFFFFEFFFFFFFF1FFCEA576FFB57E43FFB68046FFB68046FFB78247FFAC7C
|
||||
46C9694D2C5D00000012C28F5700C3905800C18D57000000000A66492845D2B0
|
||||
87FFFFFFFFFFD1B085FF9B6E3BA6000000330000003300000033000000330000
|
||||
00260000000AC08D5600C28F5700B7864E00B7874E00B7864D00B07E4698FFFB
|
||||
E8FFD4B48CFF966B3A9A0000001DBD8B5400BD8B5400BD8B5400BD8B5400BD8B
|
||||
5400BE8C5400C08D5600C28F5700B7864E00B7864E00B7864D00B5834BFFB482
|
||||
48FF7756306C0000001AB8874F00BD8B5400BD8B5400BD8B5400BD8B5400BD8B
|
||||
5400BE8C5400C08D5600C28F5700000000000000000000000000000000330000
|
||||
00330000000E0000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D898
|
||||
5223D4964D7DD2924CDBCD8C45F3CB8B41F3C98B40DBC78B407DC5873D23FFFF
|
||||
|
@ -141,6 +110,102 @@ inherited CEMessagesWidget: TCEMessagesWidget
|
|||
35239453347D925234DB8A5034F3884F34F3895035DB8950357D84503623FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00EBE2
|
||||
D25CE9DFCDB5E7DCC8E2E3D7C0F7DFD1B7F8DCCCB0EDDAC9ABD1DCCCB080FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00EBE2D219EAE1D0B7EDE5
|
||||
D6FFF2ECE1FFF5F1E9FFF8F5EFFFF8F5F0FFF5F1E9FFEDE5D6FFD9C8A9FFD4C1
|
||||
9DDEDCCCAF2CFFFFFF00FFFFFF00FFFFFF00EBE2D20BE7DCC9CAF0EADEFFF8F5
|
||||
EFFFF7F3EDFFF5F1E9FFF3EEE5FFF2ECE2FFF2ECE1FFF5F1E9FFFAF8F4FFE3D7
|
||||
C0FFCEB890EDDBCBAE17FFFFFF00FFFFFF00E5DAC589EDE5D6FFF9F7F2FFF6F2
|
||||
ECFFF9F7F2FFFBFAF7FFFEFEFDFFFEFEFDFFFBF9F6FFF4EFE6FFEDE5D6FFFBF9
|
||||
F6FFD9C8A8FFD3BF9BB6FFFFFF00FFFFFF00E0D3BAE4F3EEE5FFF6F2ECFFF7F3
|
||||
EDFFFBF9F6FFFBF9F6FFFBF9F6FFFBF9F6FFFAF8F4FFF8F5EFFFEEE7D9FFEAE1
|
||||
D0FFF2ECE1FFCAB287F7FFFFFF00FFFFFF00DDCEB2F9F7F3EDFFF2ECE2FFF3EE
|
||||
E4FFF5F1E9FFF4EFE6FFF3EEE5FFF2ECE2FFF1EBE0FFEFE8DAFFE5DAC5FFDDCE
|
||||
B2FFF8F5EFFFC7AE81FEFFFFFF00FFFFFF00DAC9ABE3F2ECE1FFF5F0E8FFDFD1
|
||||
B7FFE2D5BEFFA7BDC3FFACC0C5FFA9BFC4FF9CB4BBFFE0D3BAFFD7C5A5FFE4D8
|
||||
C1FFF2ECE1FFC8AF82F7FFFFFF00FFFFFF00DCCCB088E1D4BBFFFBF9F6FFDFD1
|
||||
B6FF8DA9B0FFDDCEB3FFDDCEB3FFDACAACFFDDCEB2FF7799A1FFD2BE9AFFF7F3
|
||||
EDFFD9C8A8FFCFB992BFFFFFFF00FFFFFF00DFD1B604D8C7A7D8E8DECBFFF7F3
|
||||
EDFF91AEB3FFDDCEB3FFDBCBAEFFD8C7A7FFDDCEB2FF7FA1A7FFF0EADEFFE9DF
|
||||
CDFFC4AA7AF8D8C7A725FFFFFF00FFFFFF00FFFFFF00DCCCAF2FD4C19EEBE8DE
|
||||
CBFFD9C8A8FFDDCEB3FFDDCEB2FFDDCEB2FFDDCEB2FFD2BE9AFFE5D9C4FFC5AB
|
||||
7BFBD6C3A15AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00DBCBAE34D4C1
|
||||
9DE7CFBA93FFD4C19EFFD5C2A0FFD4C19DFFD7C5A4FFC3A876FFC6AD7EF2D6C4
|
||||
A246FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D5C2
|
||||
A04B638195FA98A19AFF699186FF64887BFF817F71FF2D4357FED3BF9B40FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF0068777DE2A6A5A2FFA8A2A2FF9D9998FF948F8BFF434B53EBFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF005F6E77C6BCBCBBFFEBEAEAFFCDCCCCFFA3A19FFF3F4C55DBFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF0088A7BB5D485055F5444545FE3F4141FE3F474AF67D9CB16AFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF003B85CC003B85CC003B85CC003B85CC003B85
|
||||
CC003B85CC003983CA213384CDFF3384CDFF3983CA213B85CC003B85CC003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85
|
||||
CC003983CB00337EC7CF84C3F1FF84C3F1FF337EC7CF3983CB003B85CC003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003A84
|
||||
CB003580CA6D5398D7FFC1F0FFFFC1F0FFFF5398D7FF3580CA6D3A84CB003B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003882
|
||||
CA0A3A83CBFFB2E5FFFF9EC8DEFF9EC8DEFFB2E5FFFF3A83CBFF3882CA0A3B85
|
||||
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003983CB00337E
|
||||
C8CF86BEEAFFA4ECFFFF6C5D53FF6C5D53FFA4ECFFFF86BEEAFF337EC8CF3983
|
||||
CB003B85CC003B85CC003B85CC003B85CC003B85CC003A84CC003580C9585797
|
||||
D5FFC6F3FFFF3ACAFFFF6C5B54FF6C5B54FF3ACAFFFFC6F3FFFF5797D5FF3580
|
||||
C9583A84CC003B85CC003B85CC003B85CC003B85CC003882CA003C82C9FFC1E8
|
||||
FDFF50CCFFFF27C5FFFF69554CFF69554CFF27C5FFFF50CCFFFFC1E8FDFF3C82
|
||||
C9FF3882CA003B85CC003B85CC003B85CC003983CB00337EC8BB90BFE6FF6FD7
|
||||
FFFF32C3FFFF34CBFFFF644B3FFF644B3FFF34CBFFFF32C3FFFF6FD7FFFF90BF
|
||||
E6FF337EC8BB3983CB003B85CC003A84CC003680C9445B97D4FF9EE8FFFF38C7
|
||||
FFFF3DC8FFFF3DCFFFFF4BBCE9FF4BBCE9FF3DCFFFFF3DC8FFFF38C7FFFF9EE8
|
||||
FFFF5B97D4FF3680C9443A84CC003982CB003F82C9FFA3E0FAFF40CFFFFF44CE
|
||||
FFFF46CFFFFF44D6FFFF775C50FF775C50FF44D6FFFF46CFFFFF44CEFFFF40CF
|
||||
FFFFA3E0FAFF3F82C9FF3982CB003880C9947AB8E4FF52DBFFFF4BD5FFFF4DD5
|
||||
FFFF4DD6FFFF4BDCFFFF67493FFF67493FFF4BDCFFFF4DD6FFFF4DD5FFFF4BD5
|
||||
FFFF52DBFFFF7AB8E4FF3880C9943B86CDFF55E3FFFF55E3FFFF56E1FFFF56E1
|
||||
FFFF56E2FFFF56E5FFFF55E9FFFF55E9FFFF56E5FFFF56E2FFFF56E1FFFF56E1
|
||||
FFFF55E3FFFF55E3FFFF3B86CDFF3A82CAFF397FC8FF387DC7FF387CC7FF397C
|
||||
C7FF397CC7FF387DC7FF387EC9FF387EC9FF387DC7FF397CC7FF397CC7FF387C
|
||||
C7FF387DC7FF397FC8FF3A82CAFF000000330000003300000033000000330000
|
||||
0033000000330000003300000033000000330000003300000033000000330000
|
||||
0033000000330000003300000033FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006A85
|
||||
FC236984FA7D6782F9DB6580F7F3637EF5F3617CF3DB5F7AF17D5D77EF23FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006984FA536882
|
||||
F9E66E83EEFF92A6F4FFA0B4F8FFA0B4F8FF91A6F3FF687DE9FF5973EBE65671
|
||||
E953FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006883F9536681F8F48497
|
||||
F1FFA9BDFBFF8AA3F8FF6B89F6FF6B89F6FF89A2F8FFA8BCFAFF7F92ECFF526C
|
||||
E4F44F69E253FFFFFF00FFFFFF00FFFFFF006781F822657FF6E58397F0FFA9BD
|
||||
FBFF6382F5FF6382F5FFFFFFFFFFFFFFFFFF617EF3FF607CF3FFA6B9F9FF7B8D
|
||||
EAFF4A64DEE54862DB22FFFFFF00FFFFFF00637EF57E6C81ECFFA9BDFBFF6382
|
||||
F5FF6281F5FF6280F4FFFFFFFFFFFFFFFFFF5F7AF1FF5F78F0FF5D76EFFFA5B5
|
||||
F8FF5D70DDFF435DD77EFFFFFF00FFFFFF005F7AF1DB91A6F3FF88A1F8FF6280
|
||||
F4FF617EF3FF607CF3FFFFFFFFFFFFFFFFFF5D76EFFF5C73EEFF5B70ECFF8293
|
||||
F1FF8998ECFF3E58D2DBFFFFFF00FFFFFF005B76EDF6A1B6F8FF6784F4FF607C
|
||||
F3FF5F7AF1FF5F78F0FFFFFFFFFFFFFFFFFF5B70ECFF5A6EEBFF596CEAFF5F6F
|
||||
E9FF9BA8F1FF3A53CEF6FFFFFF00FFFFFF005771E9F6A0B3F7FF6580F2FF5F78
|
||||
F0FF5D76EFFF5C73EEFFD3D9FAFFFFFFFFFF596CEAFF5869E8FF5767E7FF5D6C
|
||||
E7FF99A5F1FF354FCAF6FFFFFF00FFFFFF00526DE5DB8E9FF0FF8499F4FF5C73
|
||||
EEFF5B70ECFF5A6EEBFF909DF1FFA6AFF3FF5767E7FF5665E6FF5562E5FF7D89
|
||||
EBFF8591E7FF314AC6DBFFFFFF00FFFFFF004E68E17E6073E0FFA4B3F7FF5A6E
|
||||
EBFF596CEAFF5869E8FFFFFFFFFFFFFFFFFF5562E5FF5461E3FF535FE2FF9FA9
|
||||
F2FF5061D1FF2D46C27EFFFFFF00FFFFFF004963DC224660DAE57888E6FFA3B0
|
||||
F5FF5767E7FF5665E6FF8992EDFF8892ECFF535FE2FF525DE1FF9FA9F2FF6F7D
|
||||
DDFF2B44C0E52942BE22FFFFFF00FFFFFF00FFFFFF00425CD5533F59D3F47584
|
||||
E3FFA1ACF4FF7F8BECFF5C67E4FF5B66E3FF7D87EAFF9FA8F1FF6F7CDDFF2943
|
||||
BFF42741BD53FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF003A54CF533852
|
||||
CCE65264D4FF8490E7FF95A0EEFF959FEDFF838EE5FF4C5DCEFF2841BDE6263F
|
||||
BB53FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00334D
|
||||
C823314BC67D2F48C4DB2C46C2F32A44C0F32842BEDB2640BC7D243EBA23FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
|
||||
ExtCtrls, ComCtrls, ce_widget, ActnList;
|
||||
ExtCtrls, ComCtrls, ce_widget, ActnList, Menus;
|
||||
|
||||
type
|
||||
|
||||
|
@ -23,7 +23,11 @@ type
|
|||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
//
|
||||
procedure scrollToBack;
|
||||
procedure addMessage(const aMsg: string);
|
||||
procedure addCeInf(const aMsg: string);
|
||||
procedure addCeErr(const aMsg: string);
|
||||
procedure addCeWarn(const aMsg: string);
|
||||
//
|
||||
function contextName: string; override;
|
||||
function contextActionCount: integer; override;
|
||||
|
@ -34,6 +38,10 @@ type
|
|||
TCEMessageItem = class(TListItem)
|
||||
end;
|
||||
|
||||
TMessageKind = (msgkUnknown, msgkInfo, msgkHint, msgkWarn, msgkError);
|
||||
|
||||
function semanticMsgAna(const aMessg: string): TMessageKind;
|
||||
|
||||
implementation
|
||||
{$R *.lfm}
|
||||
|
||||
|
@ -41,6 +49,8 @@ uses
|
|||
ce_main;
|
||||
|
||||
constructor TCEMessagesWidget.create(aOwner: TComponent);
|
||||
var
|
||||
itm: TMenuItem;
|
||||
begin
|
||||
inherited;
|
||||
fID := 'ID_MSGS';
|
||||
|
@ -51,6 +61,14 @@ begin
|
|||
fActSaveMsg := TAction.Create(self);
|
||||
fActSaveMsg.OnExecute := @actSaveMsgExecute;
|
||||
fActSaveMsg.caption := 'Save messages to...';
|
||||
//
|
||||
List.PopupMenu := contextMenu;
|
||||
itm := TMenuItem.Create(self);
|
||||
itm.Action := fActClear;
|
||||
contextMenu.Items.Add(itm);
|
||||
itm := TMenuItem.Create(self);
|
||||
itm.Action := fActSaveMsg;
|
||||
contextMenu.Items.Add(itm);
|
||||
end;
|
||||
|
||||
destructor TCEMessagesWidget.destroy;
|
||||
|
@ -58,6 +76,45 @@ begin
|
|||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.scrollToBack;
|
||||
begin
|
||||
if not Visible then exit;
|
||||
List.ViewOrigin := Point(0,List.Items.Count * 25);
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.addCeInf(const aMsg: string);
|
||||
var
|
||||
item: TCEMessageItem;
|
||||
begin
|
||||
item := TCEMessageItem.Create(List.Items);
|
||||
item.Caption := 'Coedit information: ' + aMsg;
|
||||
item.ImageIndex := 1;
|
||||
List.Items.AddItem(item);
|
||||
scrollToBack;
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.addCeWarn(const aMsg: string);
|
||||
var
|
||||
item: TCEMessageItem;
|
||||
begin
|
||||
item := TCEMessageItem.Create(List.Items);
|
||||
item.Caption := 'Coedit warning: ' + aMsg;
|
||||
item.ImageIndex := 3;
|
||||
List.Items.AddItem(item);
|
||||
scrollToBack;
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.addCeErr(const aMsg: string);
|
||||
var
|
||||
item: TCEMessageItem;
|
||||
begin
|
||||
item := TCEMessageItem.Create(List.Items);
|
||||
item.Caption := 'Coedit error: ' + aMsg;
|
||||
item.ImageIndex := 4;
|
||||
List.Items.AddItem(item);
|
||||
scrollToBack;
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.addMessage(const aMsg: string);
|
||||
var
|
||||
item: TCEMessageItem;
|
||||
|
@ -65,6 +122,7 @@ begin
|
|||
item := TCEMessageItem.Create(List.Items);
|
||||
item.Caption := aMsg;
|
||||
item.Data := mainForm.EditWidget.currentEditor;
|
||||
item.ImageIndex := Integer( semanticMsgAna(aMsg) );
|
||||
List.Items.AddItem(item);
|
||||
end;
|
||||
|
||||
|
@ -114,5 +172,44 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function semanticMsgAna(const aMessg: string): TMessageKind;
|
||||
var
|
||||
pos: Nativeint;
|
||||
idt: string;
|
||||
begin
|
||||
idt := '';
|
||||
pos := 1;
|
||||
result := msgkUnknown;
|
||||
while(true) do
|
||||
begin
|
||||
if pos > length(aMessg) then exit;
|
||||
if aMessg[pos] in [#0..#32] then
|
||||
begin
|
||||
Inc(pos);
|
||||
idt := '';
|
||||
continue;
|
||||
end;
|
||||
if not (aMessg[pos] in ['a'..'z', 'A'..'Z']) then
|
||||
begin
|
||||
Inc(pos);
|
||||
idt := '';
|
||||
continue;
|
||||
end;
|
||||
idt += aMessg[pos];
|
||||
case idt of
|
||||
'ERROR', 'error', 'Error', 'Invalid', 'invalid',
|
||||
'illegal', 'Illegal', 'fatal', 'Fatal', 'Critical', 'critical':
|
||||
exit(msgkError);
|
||||
'Warning', 'warning':
|
||||
exit(msgkWarn);
|
||||
'Hint', 'hint', 'Tip', 'tip':
|
||||
exit(msgkHint);
|
||||
'Information', 'information':
|
||||
exit(msgkInfo);
|
||||
end;
|
||||
Inc(pos);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
@ -1,35 +1,42 @@
|
|||
inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
|
||||
Left = 1249
|
||||
Height = 377
|
||||
Top = 587
|
||||
Width = 546
|
||||
Left = 1170
|
||||
Height = 278
|
||||
Top = 722
|
||||
Width = 445
|
||||
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
|
||||
Caption = 'ProjectConfigurationWidget'
|
||||
ClientHeight = 377
|
||||
ClientWidth = 546
|
||||
ClientHeight = 278
|
||||
ClientWidth = 445
|
||||
inherited Back: TPanel
|
||||
Height = 377
|
||||
Width = 546
|
||||
ClientHeight = 377
|
||||
ClientWidth = 546
|
||||
Height = 278
|
||||
Width = 445
|
||||
ClientHeight = 278
|
||||
ClientWidth = 445
|
||||
DragKind = dkDrag
|
||||
DragMode = dmManual
|
||||
inherited Content: TScrollBox
|
||||
Height = 351
|
||||
Width = 546
|
||||
HorzScrollBar.Page = 542
|
||||
VertScrollBar.Page = 347
|
||||
ClientHeight = 347
|
||||
ClientWidth = 542
|
||||
Height = 252
|
||||
Width = 445
|
||||
HorzScrollBar.Page = 441
|
||||
VertScrollBar.Page = 248
|
||||
AutoSize = True
|
||||
AutoScroll = True
|
||||
ClientHeight = 248
|
||||
ClientWidth = 441
|
||||
object Tree: TTreeView[0]
|
||||
Left = 4
|
||||
Height = 313
|
||||
Height = 214
|
||||
Top = 30
|
||||
Width = 190
|
||||
Align = alLeft
|
||||
AutoExpand = True
|
||||
BorderSpacing.Around = 4
|
||||
DefaultItemHeight = 18
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
ShowRoot = False
|
||||
TabOrder = 0
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoShowButtons, tvoShowLines, tvoToolTips, tvoThemedDraw]
|
||||
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoToolTips, tvoThemedDraw]
|
||||
Items.Data = {
|
||||
F9FFFFFF020003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000
|
||||
0000000700000047656E6572616CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
|
||||
|
@ -45,21 +52,22 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
|
|||
end
|
||||
inline frameEditAll: TCEProjConfAll[1]
|
||||
Left = 198
|
||||
Height = 317
|
||||
Height = 218
|
||||
Top = 28
|
||||
Width = 342
|
||||
Width = 241
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 2
|
||||
ClientHeight = 317
|
||||
ClientWidth = 342
|
||||
ClientHeight = 218
|
||||
ClientWidth = 241
|
||||
TabOrder = 1
|
||||
DesignLeft = 1406
|
||||
DesignTop = 572
|
||||
inherited Grid: TTIPropertyGrid
|
||||
Left = 2
|
||||
Height = 313
|
||||
Height = 214
|
||||
Top = 2
|
||||
Width = 338
|
||||
Width = 237
|
||||
BackgroundColor = clDefault
|
||||
BorderSpacing.Around = 2
|
||||
DefaultItemHeight = 22
|
||||
PreferredSplitterX = 150
|
||||
|
@ -70,18 +78,18 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
|
|||
Left = 2
|
||||
Height = 24
|
||||
Top = 2
|
||||
Width = 538
|
||||
Width = 437
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 2
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 24
|
||||
ClientWidth = 538
|
||||
ClientWidth = 437
|
||||
TabOrder = 2
|
||||
object selConf: TComboBox
|
||||
Left = 0
|
||||
Height = 23
|
||||
Top = 1
|
||||
Width = 297
|
||||
Width = 346
|
||||
Align = alClient
|
||||
BorderSpacing.Top = 1
|
||||
BorderSpacing.Right = 1
|
||||
|
@ -90,30 +98,215 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
|
|||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
end
|
||||
object btnAddConf: TButton
|
||||
Left = 298
|
||||
object btnAddConf: TSpeedButton
|
||||
Left = 347
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 120
|
||||
Width = 30
|
||||
Align = alRight
|
||||
Caption = 'Add configuration'
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000003300000033000000330000
|
||||
00000000001E0000003300000033000000330000001E000000007B7977007B79
|
||||
770000000024000000237B79770077757300757371FF75716FFF826F73FF0000
|
||||
0019008C55A9009E5EFF009D5DFF009E5EFF008C55AC0000001E7B7977000000
|
||||
00236D6B69C16C6A69BF0000002F00000033716F6DFFF0EBEBFF7E6B6FFF0086
|
||||
4D9800A669FF00BA86FF77DFC4FF00BA86FF00A66AFF008C55AC7B7977006F6D
|
||||
6BBFA19F9DFF9E9C9AFF706E6CEF716F6DFF898785FFE3DFDFFF998589FF009E
|
||||
58FF00C08BFF00BB82FFFFFFFFFF00BB82FF00C08CFF009E5EFF7D7B79007A78
|
||||
76ED9F9D9BFFDFDDDBFFB8B6B4FFDBD9D7FFD8D6D4FFD9D5D3FFEAD7DBFF0099
|
||||
52FF74E5CBFFFFFFFFFFFFFFFFFFFFFFFFFF77E5CCFF009C5CFF7E7C7A007C7A
|
||||
7800767572FEB7B3B3FFD2D0CFFFD1CFCFFFD3D1D0FFD6D1D2FFE5D3D8FF009A
|
||||
53FF00CB96FF00C88FFFFFFFFFFF00C88FFF00CC98FF009D5DFF000000330000
|
||||
0033787674FFD2D0CEFFCECCCAFFBEBCBAFF92908EFF8F8C8AFF9E9394FF46A3
|
||||
7EFF00AE6CFF00D29BFF73EDD3FF00D39DFF00AF71FF009F5F94817F7DFF7C7A
|
||||
78FF9D9B99FFCCC9C8FFCCC9C8FF93918FFF7A78769C7F7C7A227D79789CA594
|
||||
97FF53B18AFF009951FF009851FF009B54FF3A8E6BFF00A45E00817F7DFFE3E1
|
||||
DFFFDCDAD8FFC6C5C2FFC8C6C4FF8F8D8BFF4847463D000000074947473D948F
|
||||
8EFFD4C7C9FFD7C6C9FFECD9DDFFF0DEE2FF8D7C7FFF91808300848280FF807E
|
||||
7CFF949492FFD0CECCFFC3C0BFFF93918FFF72716FAD3A39384E72716FAD9492
|
||||
90FFC5C0C0FFD3CECDFF979492FF817D7CFF868280FF88838200868482008583
|
||||
8100807E7CFFDAD9D8FFBEBBB9FFBCB9B7FF94918EFF928F8DFF94918FFFB3B2
|
||||
B0FFBEBBB9FFDBD9D8FF807E7CFF83817F008583810086848200858381000000
|
||||
0023827F7DEFACAAA8FFC7C5C3FFBBB8B7FFBAB7B6FFBBB8B7FFBBB8B7FFBBB8
|
||||
B7FFC7C5C3FFACAAA8FF817F7DEF0000002385838100858381008C8A88008280
|
||||
7EBAA4A2A0FFDAD8D7FFC6C4C2FFE4E3E1FFDBD9D7FFC2BFBEFFD7D5D4FFE4E3
|
||||
E1FFC5C4C2FFDAD8D7FFA4A2A0FF82807EBA8C8A88008C8A88008D8B89008B89
|
||||
87B2B2B1AFFFAFAEACFF858381EB868482FF9A9897FFBCBAB7FF9A9897FF8684
|
||||
82FF858381FEAFAEACFFB2B1AFFF8B8987B28D8B89008D8B89008D8B89008C8A
|
||||
88008D8B89B28D8B89AF8B8987008B8987008B8987FFE9E7E7FF8B8987FF8B89
|
||||
87008D8B89008C8A88ED8D8B89B08C8A88008D8B89008D8B89008D8B89008D8B
|
||||
89008F8D8B008F8D8B008C8A880092908E00908E8CFF8F8D8BFF908E8CFF9290
|
||||
8E008F8D8B008F8D8B008F8D8B008D8B89008D8B89008D8B8900
|
||||
}
|
||||
OnClick = btnAddConfClick
|
||||
TabOrder = 1
|
||||
ShowCaption = False
|
||||
end
|
||||
object btnDelConf: TButton
|
||||
Left = 418
|
||||
object btnDelConf: TSpeedButton
|
||||
Left = 377
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 120
|
||||
Width = 30
|
||||
Align = alRight
|
||||
Caption = 'Delete configuration'
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000003300000033000000330000
|
||||
00000000001E0000003300000033000000330000001E000000007B7977007B79
|
||||
770000000024000000237B79770077757300757371FF75726EFF7C7868FF0000
|
||||
00192F43B5A9384DCCFF384DCBFF384DCCFF3145B4AC0000001E7B7977000000
|
||||
00236D6B69C16C6A69BF0000002F00000033716F6DFFEFEDEAFF787464FF263B
|
||||
B0983751D9FF385DF9FF375DFAFF385DF9FF3852D7FF3044B4AC7B7977006F6D
|
||||
6BBFA19F9DFF9E9C9AFF706E6CEF716F6DFF898785FFE2E0DDFF928D7EFF2942
|
||||
D1FF4064FCFF3C60FAFF3A5DF8FF3C60FAFF4165FBFF344BCCFF7D7B79007A78
|
||||
76ED9F9D9BFFDFDDDBFFB8B6B4FFDBD9D7FFD8D6D4FFD8D6D2FFE4E0D0FF233C
|
||||
CDFFA7B8FFFFFFFFFFFFFFFFFFFFFFFFFFFFA9BAFFFF3148CAFF7E7C7A007C7A
|
||||
7800767572FEB7B3B3FFD2D0CFFFD1CFCFFFD3D1D0FFD5D3D0FFDFDBCEFF223C
|
||||
CFFF5976FFFF5775FEFF5473FDFF5776FEFF5D79FFFF334ACBFF000000330000
|
||||
0033787674FFD2D0CEFFCECCCAFFBEBCBAFF92908EFF8F8C89FF9B988EFF6572
|
||||
BEFF3C57E1FF6C86FFFF7189FFFF6D87FFFF435DE0FF334BCF94817F7DFF7C7A
|
||||
78FF9D9B99FFCCC9C8FFCCC9C8FF93918FFF7A78769C7F7C7A227D7B769C9F9B
|
||||
8DFF7380CCFF223CCDFF233DCCFF253FD0FF5762A6FF2D48D800817F7DFFE3E1
|
||||
DFFFDCDAD8FFC6C5C2FFC8C6C4FF8F8D8BFF4847463D000000074948463D9390
|
||||
8BFFD0CCC2FFD2CDBFFFE6E2D3FFEAE6D8FF888376FF8C877900848280FF807E
|
||||
7CFF949492FFD0CECCFFC3C0BFFF93918FFF72716FAD3A39384E72716FAD9492
|
||||
90FFC5C1BFFFD2D0CCFF969591FF817E7AFF85837FFF87858100868482008583
|
||||
8100807E7CFFDAD9D8FFBEBBB9FFBCB9B7FF94918EFF928F8DFF94918FFFB3B2
|
||||
B0FFBEBBB9FFDBD9D8FF807E7CFF83817F008583810086848200858381000000
|
||||
0023827F7DEFACAAA8FFC7C5C3FFBBB8B7FFBAB7B6FFBBB8B7FFBBB8B7FFBBB8
|
||||
B7FFC7C5C3FFACAAA8FF817F7DEF0000002385838100858381008C8A88008280
|
||||
7EBAA4A2A0FFDAD8D7FFC6C4C2FFE4E3E1FFDBD9D7FFC2BFBEFFD7D5D4FFE4E3
|
||||
E1FFC5C4C2FFDAD8D7FFA4A2A0FF82807EBA8C8A88008C8A88008D8B89008B89
|
||||
87B2B2B1AFFFAFAEACFF858381EB868482FF9A9897FFBCBAB7FF9A9897FF8684
|
||||
82FF858381FEAFAEACFFB2B1AFFF8B8987B28D8B89008D8B89008D8B89008C8A
|
||||
88008D8B89B28D8B89AF8B8987008B8987008B8987FFE9E7E7FF8B8987FF8B89
|
||||
87008D8B89008C8A88ED8D8B89B08C8A88008D8B89008D8B89008D8B89008D8B
|
||||
89008F8D8B008F8D8B008C8A880092908E00908E8CFF8F8D8BFF908E8CFF9290
|
||||
8E008F8D8B008F8D8B008F8D8B008D8B89008D8B89008D8B8900
|
||||
}
|
||||
OnClick = btnDelConfClick
|
||||
TabOrder = 2
|
||||
ShowCaption = False
|
||||
end
|
||||
object btnCloneConf: TSpeedButton
|
||||
Left = 407
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 30
|
||||
Align = alRight
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000003300000033000000330000
|
||||
00000000003300000033000000220000000000000000000000007B7977007B79
|
||||
770000000024000000237B79770078757300777472FF787171FF847176FF0090
|
||||
4A00008A4AFF00C684FF007C41BD00000021008F4F00008F4F007B7977000000
|
||||
00236D6B69C16C6A69BF0000002F000000337C7173FFFFEEF4FF8B6E77FF0000
|
||||
0033008847FF00E4A6FF00BE80FF007C41B900000021008F4F007B7977006F6D
|
||||
6BBFA19F9DFF9E9C9AFF716E6DEF7C7172FF208254FF00893FFF008842FF0088
|
||||
45FF008341FF00D9A1FF00D8A0FF00BC80FF007C41B9000000227D7B79007A78
|
||||
76ED9F9D9BFFDFDDDBFFBBB7B5FFEDDDE0FF00863CFF3DE8BFFF00D79FFF00D7
|
||||
A0FF00D59FFF00D09CFF00D09CFF00D39FFF00B981FF007E43BD7E7C7A007C7A
|
||||
7800767572FEB7B3B3FFD5D1D1FFE3D3D8FF008239FF6CE8CEFF00C899FF00C8
|
||||
99FF00C899FF00C797FF00C898FF00CA9AFF63E6CDFF008A47FF000000330000
|
||||
0033787674FFD2D0CEFFD0CDCBFFCDBDC1FF00853AFF94EFE2FF4DE9D4FF4FE8
|
||||
D3FF4DE6D1FF93E8D8FF00C397FF5EE0C6FF00B37FFF008B48A9817F7DFF7C7A
|
||||
78FF9D9B99FFCCC9C8FFCDC9C9FF9C9092FF148552E5008A41FF00883FFF0086
|
||||
3EFF008239FF81E4D5FF56D9C3FF00AD7AFF318359FF008F4700817F7DFFE3E1
|
||||
DFFFDCDAD8FFC6C5C2FFC8C6C4FF948D8DFF483F4236000000064A3E4135AD91
|
||||
99FF00873EFF73E3D5FF00A979FF52AD7FFF947E83FF92818500848280FF807E
|
||||
7CFF949492FFD0CECCFFC3C0BFFF949190FF757070AD3A36364D777070ADA495
|
||||
98FF00873AFF00A87AFF258455FF918083FF8A8383FF88848300868482008583
|
||||
8100807E7CFFDAD9D8FFBEBBB9FFBCB9B7FF94908FFF938F8DFF959190FFB9B3
|
||||
B3FFCCBEC0FFEBDBDFFF8B8081FF888281008684820086848200858381000000
|
||||
0023827F7DEFACAAA8FFC7C5C3FFBBB8B7FFBAB7B6FFBBB8B7FFBBB8B7FFBCB8
|
||||
B8FFC9C5C4FFAFABAAFF83807EEF0000002385838100858381008C8A88008280
|
||||
7EBAA4A2A0FFDAD8D7FFC6C4C2FFE4E3E1FFDBD9D7FFC2BFBEFFD7D5D4FFE4E3
|
||||
E1FFC5C4C2FFDAD8D7FFA4A2A0FF82807EBA8C8A88008C8A88008D8B89008B89
|
||||
87B2B2B1AFFFAFAEACFF858381EB868482FF9A9897FFBCBAB7FF9A9897FF8684
|
||||
82FF858381FEAFAEACFFB2B1AFFF8B8987B28D8B89008D8B89008D8B89008C8A
|
||||
88008D8B89B28D8B89AF8B8987008B8987008B8987FFE9E7E7FF8B8987FF8B89
|
||||
87008D8B89008C8A88ED8D8B89B08C8A88008D8B89008D8B89008D8B89008D8B
|
||||
89008F8D8B008F8D8B008C8A880092908E00908E8CFF8F8D8BFF908E8CFF9290
|
||||
8E008F8D8B008F8D8B008F8D8B008D8B89008D8B89008D8B8900
|
||||
}
|
||||
OnClick = btnCloneCurrClick
|
||||
ShowCaption = False
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited Header: TPanel
|
||||
Width = 546
|
||||
Width = 445
|
||||
end
|
||||
end
|
||||
object imgList: TImageList[2]
|
||||
left = 32
|
||||
Bitmap = {
|
||||
4C690200000010000000100000008D8B89008D8B89008F8D8B008F8D8B008C8A
|
||||
880092908E00908E8CFF8F8D8BFF908E8CFF92908E008F8D8B008F8D8B008F8D
|
||||
8B008D8B89008D8B89008D8B89008D8B89008C8A88008D8B89B28D8B89AF8B89
|
||||
87008B8987008B8987FFE9E7E7FF8B8987FF8B8987008D8B89008C8A88ED8D8B
|
||||
89B08C8A88008D8B89008D8B89008D8B89008B8987B2B2B1AFFFAFAEACFF8583
|
||||
81EB868482FF9A9897FFBCBAB7FF9A9897FF868482FF858381FEAFAEACFFB2B1
|
||||
AFFF8B8987B28D8B89008D8B89008C8A880082807EBAA4A2A0FFDAD8D7FFC6C4
|
||||
C2FFE4E3E1FFDBD9D7FFC2BFBEFFD7D5D4FFE4E3E1FFC5C4C2FFDAD8D7FFA4A2
|
||||
A0FF82807EBA8C8A88008C8A88008583810000000023827F7DEFACAAA8FFC7C5
|
||||
C3FFBBB8B7FFBAB7B6FFBBB8B7FFBBB8B7FFBBB8B7FFC7C5C3FFACAAA8FF817F
|
||||
7DEF0000002385838100858381008684820085838100807E7CFFDAD9D8FFBEBB
|
||||
B9FFBCB9B7FF94918EFF928F8DFF94918FFFB3B2B0FFBEBBB9FFDBD9D8FF807E
|
||||
7CFF83817F008583810086848200848280FF807E7CFF949492FFD0CECCFFC3C0
|
||||
BFFF93918FFF72716FAD3A39384E72716FAD949290FFC5C0C0FFD3CECDFF9794
|
||||
92FF817D7CFF868280FF88838200817F7DFFE3E1DFFFDCDAD8FFC6C5C2FFC8C6
|
||||
C4FF8F8D8BFF4847463D000000074947473D948F8EFFD4C7C9FFD7C6C9FFECD9
|
||||
DDFFF0DEE2FF8D7C7FFF91808300817F7DFF7C7A78FF9D9B99FFCCC9C8FFCCC9
|
||||
C8FF93918FFF7A78769C7F7C7A227D79789CA59497FF53B18AFF009951FF0098
|
||||
51FF009B54FF3A8E6BFF00A45E000000003300000033787674FFD2D0CEFFCECC
|
||||
CAFFBEBCBAFF92908EFF8F8C8AFF9E9394FF46A37EFF00AE6CFF00D29BFF73ED
|
||||
D3FF00D39DFF00AF71FF009F5F947E7C7A007C7A7800767572FEB7B3B3FFD2D0
|
||||
CFFFD1CFCFFFD3D1D0FFD6D1D2FFE5D3D8FF009A53FF00CB96FF00C88FFFFFFF
|
||||
FFFF00C88FFF00CC98FF009D5DFF7D7B79007A7876ED9F9D9BFFDFDDDBFFB8B6
|
||||
B4FFDBD9D7FFD8D6D4FFD9D5D3FFEAD7DBFF009952FF74E5CBFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFF77E5CCFF009C5CFF7B7977006F6D6BBFA19F9DFF9E9C9AFF706E
|
||||
6CEF716F6DFF898785FFE3DFDFFF998589FF009E58FF00C08BFF00BB82FFFFFF
|
||||
FFFF00BB82FF00C08CFF009E5EFF7B797700000000236D6B69C16C6A69BF0000
|
||||
002F00000033716F6DFFF0EBEBFF7E6B6FFF00864D9800A669FF00BA86FF77DF
|
||||
C4FF00BA86FF00A66AFF008C55AC7B7977007B79770000000024000000237B79
|
||||
770077757300757371FF75716FFF826F73FF00000019008C55A9009E5EFF009D
|
||||
5DFF009E5EFF008C55AC0000001E000000000000000000000000000000000000
|
||||
000000000000000000330000003300000033000000000000001E000000330000
|
||||
0033000000330000001E000000008D8B89008D8B89008F8D8B008F8D8B008C8A
|
||||
880092908E00908E8CFF8F8D8BFF908E8CFF92908E008F8D8B008F8D8B008F8D
|
||||
8B008D8B89008D8B89008D8B89008D8B89008C8A88008D8B89B28D8B89AF8B89
|
||||
87008B8987008B8987FFE9E7E7FF8B8987FF8B8987008D8B89008C8A88ED8D8B
|
||||
89B08C8A88008D8B89008D8B89008D8B89008B8987B2B2B1AFFFAFAEACFF8583
|
||||
81EB868482FF9A9897FFBCBAB7FF9A9897FF868482FF858381FEAFAEACFFB2B1
|
||||
AFFF8B8987B28D8B89008D8B89008C8A880082807EBAA4A2A0FFDAD8D7FFC6C4
|
||||
C2FFE4E3E1FFDBD9D7FFC2BFBEFFD7D5D4FFE4E3E1FFC5C4C2FFDAD8D7FFA4A2
|
||||
A0FF82807EBA8C8A88008C8A88008583810000000023827F7DEFACAAA8FFC7C5
|
||||
C3FFBBB8B7FFBAB7B6FFBBB8B7FFBBB8B7FFBBB8B7FFC7C5C3FFACAAA8FF817F
|
||||
7DEF0000002385838100858381008684820085838100807E7CFFDAD9D8FFBEBB
|
||||
B9FFBCB9B7FF94918EFF928F8DFF94918FFFB3B2B0FFBEBBB9FFDBD9D8FF807E
|
||||
7CFF83817F008583810086848200848280FF807E7CFF949492FFD0CECCFFC3C0
|
||||
BFFF93918FFF72716FAD3A39384E72716FAD949290FFC5C1BFFFD2D0CCFF9695
|
||||
91FF817E7AFF85837FFF87858100817F7DFFE3E1DFFFDCDAD8FFC6C5C2FFC8C6
|
||||
C4FF8F8D8BFF4847463D000000074948463D93908BFFD0CCC2FFD2CDBFFFE6E2
|
||||
D3FFEAE6D8FF888376FF8C877900817F7DFF7C7A78FF9D9B99FFCCC9C8FFCCC9
|
||||
C8FF93918FFF7A78769C7F7C7A227D7B769C9F9B8DFF7380CCFF223CCDFF233D
|
||||
CCFF253FD0FF5762A6FF2D48D8000000003300000033787674FFD2D0CEFFCECC
|
||||
CAFFBEBCBAFF92908EFF8F8C89FF9B988EFF6572BEFF3C57E1FF6C86FFFF7189
|
||||
FFFF6D87FFFF435DE0FF334BCF947E7C7A007C7A7800767572FEB7B3B3FFD2D0
|
||||
CFFFD1CFCFFFD3D1D0FFD5D3D0FFDFDBCEFF223CCFFF5976FFFF5775FEFF5473
|
||||
FDFF5776FEFF5D79FFFF334ACBFF7D7B79007A7876ED9F9D9BFFDFDDDBFFB8B6
|
||||
B4FFDBD9D7FFD8D6D4FFD8D6D2FFE4E0D0FF233CCDFFA7B8FFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFA9BAFFFF3148CAFF7B7977006F6D6BBFA19F9DFF9E9C9AFF706E
|
||||
6CEF716F6DFF898785FFE2E0DDFF928D7EFF2942D1FF4064FCFF3C60FAFF3A5D
|
||||
F8FF3C60FAFF4165FBFF344BCCFF7B797700000000236D6B69C16C6A69BF0000
|
||||
002F00000033716F6DFFEFEDEAFF787464FF263BB0983751D9FF385DF9FF375D
|
||||
FAFF385DF9FF3852D7FF3044B4AC7B7977007B79770000000024000000237B79
|
||||
770077757300757371FF75726EFF7C7868FF000000192F43B5A9384DCCFF384D
|
||||
CBFF384DCCFF3145B4AC0000001E000000000000000000000000000000000000
|
||||
000000000000000000330000003300000033000000000000001E000000330000
|
||||
0033000000330000001E00000000
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,47 +6,75 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
ComCtrls, StdCtrls, ce_widget, ce_common, ce_projconfall, ce_dmdwrap;
|
||||
ComCtrls, StdCtrls, Menus, Buttons, ce_widget, ce_common, ce_projconfall,
|
||||
ce_dmdwrap;
|
||||
|
||||
type
|
||||
|
||||
{ TCEProjectConfigurationWidget }
|
||||
TCEProjectConfigurationWidget = class(TCEWidget)
|
||||
btnAddConf: TButton;
|
||||
btnDelConf: TButton;
|
||||
imgList: TImageList;
|
||||
selConf: TComboBox;
|
||||
frameEditAll: TCEProjConfAll;
|
||||
Panel1: TPanel;
|
||||
btnAddConf: TSpeedButton;
|
||||
btnDelConf: TSpeedButton;
|
||||
btnCloneConf: TSpeedButton;
|
||||
Tree: TTreeView;
|
||||
procedure btnAddConfClick(Sender: TObject);
|
||||
procedure btnDelConfClick(Sender: TObject);
|
||||
procedure btnCloneCurrClick(Sender: TObject);
|
||||
procedure selConfChange(Sender: TObject);
|
||||
procedure SpeedButton1Click(Sender: TObject);
|
||||
private
|
||||
fProj: TCEProject;
|
||||
protected
|
||||
procedure updaterProc2; //override;
|
||||
procedure manualWidgetUpdate; override;
|
||||
public
|
||||
procedure projNew(const aProject: TCEProject); override;
|
||||
procedure projChange(const aProject: TCEProject); override;
|
||||
procedure projClose(const aProject: TCEProject); override;
|
||||
property project: TCEProject read fProj;
|
||||
end;
|
||||
|
||||
implementation
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TCEProjectConfigurationWidget.projNew(const aProject: TCEProject);
|
||||
begin
|
||||
beginManualWidgetUpdate;
|
||||
fProj := aProject;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.projChange(const aProject: TCEProject);
|
||||
begin
|
||||
beginManualWidgetUpdate;
|
||||
fProj := aProject;
|
||||
updaterProc2;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.projClose(const aProject: TCEProject);
|
||||
begin
|
||||
frameEditAll.Grid.TIObject := nil;
|
||||
frameEditAll.Grid.ItemIndex :=-1;
|
||||
fProj := nil;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject);
|
||||
begin
|
||||
if fUpdating then exit;
|
||||
if fProj = nil then exit;
|
||||
if isManualUpdating then exit;
|
||||
if selConf.ItemIndex = -1 then exit;
|
||||
//
|
||||
beginManualWidgetUpdate;
|
||||
fProj.ConfigurationIndex := selConf.ItemIndex;
|
||||
updaterProc2;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.SpeedButton1Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.btnAddConfClick(Sender: TObject);
|
||||
|
@ -56,10 +84,12 @@ var
|
|||
begin
|
||||
if fProj = nil then exit;
|
||||
//
|
||||
cfg := fProj.addConfiguration;
|
||||
nme := '';
|
||||
beginManualWidgetUpdate;
|
||||
cfg := fProj.addConfiguration;
|
||||
if InputQuery('Configuration name', '', nme) then cfg.name := nme;
|
||||
fProj.ConfigurationIndex := cfg.Index;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
|
||||
|
@ -67,40 +97,44 @@ begin
|
|||
if fProj = nil then exit;
|
||||
if fProj.OptionsCollection.Count = 1 then exit;
|
||||
//
|
||||
beginManualWidgetUpdate;
|
||||
frameEditAll.Grid.TIObject := nil;
|
||||
frameEditAll.Grid.Clear;
|
||||
frameEditAll.Invalidate;
|
||||
fProj.OptionsCollection.Delete(selConf.ItemIndex);
|
||||
fProj.ConfigurationIndex := 0;
|
||||
updaterProc2;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.updaterProc2;
|
||||
procedure TCEProjectConfigurationWidget.btnCloneCurrClick(Sender: TObject);
|
||||
var
|
||||
nme: string;
|
||||
trg,src: TCompilerConfiguration;
|
||||
begin
|
||||
if fProj = nil then exit;
|
||||
//
|
||||
nme := '';
|
||||
beginManualWidgetUpdate;
|
||||
src := fProj.currentConfiguration;
|
||||
trg := fProj.addConfiguration;
|
||||
trg.assign(src);
|
||||
if InputQuery('Configuration name', '', nme) then trg.name := nme;
|
||||
fProj.ConfigurationIndex := trg.Index;
|
||||
endManualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.manualWidgetUpdate;
|
||||
var
|
||||
i: NativeInt;
|
||||
obj: TPersistent;
|
||||
begin
|
||||
|
||||
selConf.ItemIndex:= -1;
|
||||
selConf.Clear;
|
||||
|
||||
if (fProj = nil) then
|
||||
begin
|
||||
frameEditAll.Grid.Selection.Clear;
|
||||
frameEditAll.Grid.Clear;
|
||||
// AV if the previous TIObject is already destroyed
|
||||
frameEditAll.Grid.TIObject := nil;
|
||||
frameEditAll.Invalidate;
|
||||
exit;
|
||||
end;
|
||||
|
||||
for i:= 0 to fProj.OptionsCollection.Count-1 do
|
||||
selConf.Items.Add(fProj.configuration[i].name);
|
||||
selConf.ItemIndex := fProj.ConfigurationIndex;
|
||||
|
||||
obj := fProj.configuration[fProj.ConfigurationIndex];
|
||||
if frameEditAll.Grid.TIObject <> obj then
|
||||
frameEditAll.Grid.TIObject := obj;
|
||||
|
||||
frameEditAll.Grid.TIObject :=
|
||||
fProj.configuration[fProj.ConfigurationIndex];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
inherited CEProjectWidget: TCEProjectWidget
|
||||
Left = 1745
|
||||
Left = 1691
|
||||
Height = 336
|
||||
Top = 89
|
||||
Width = 163
|
||||
Width = 217
|
||||
Caption = 'ProjectWidget'
|
||||
ClientHeight = 336
|
||||
ClientWidth = 163
|
||||
ClientWidth = 217
|
||||
inherited Back: TPanel
|
||||
Height = 336
|
||||
Width = 163
|
||||
Width = 217
|
||||
ClientHeight = 336
|
||||
ClientWidth = 163
|
||||
ClientWidth = 217
|
||||
inherited Content: TScrollBox
|
||||
Height = 310
|
||||
Width = 163
|
||||
HorzScrollBar.Page = 159
|
||||
Width = 217
|
||||
HorzScrollBar.Page = 213
|
||||
VertScrollBar.Page = 306
|
||||
ClientHeight = 306
|
||||
ClientWidth = 159
|
||||
ClientWidth = 213
|
||||
object Tree: TTreeView[0]
|
||||
Left = 2
|
||||
Height = 302
|
||||
Top = 2
|
||||
Width = 155
|
||||
Height = 276
|
||||
Top = 28
|
||||
Width = 209
|
||||
Align = alClient
|
||||
AutoExpand = True
|
||||
BorderSpacing.Around = 2
|
||||
|
@ -39,9 +39,170 @@ inherited CEProjectWidget: TCEProjectWidget
|
|||
FFFFFF0000000000000000000E000000436F6E66696775726174696F6E73
|
||||
}
|
||||
end
|
||||
object Panel1: TPanel[1]
|
||||
Left = 2
|
||||
Height = 24
|
||||
Top = 2
|
||||
Width = 209
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 2
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 24
|
||||
ClientWidth = 209
|
||||
TabOrder = 1
|
||||
object btnAddFile: TSpeedButton
|
||||
Left = 0
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 30
|
||||
Align = alLeft
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
|
||||
FF0000000000000000000000000000000000000000000000002A000000330000
|
||||
00330000003300000033000000330000003300000023FFFFFF00FFFFFF00FFFF
|
||||
FF0000000030000000330000003300000033000000333E7F42DB4A854CFF4B84
|
||||
4CFF4C844CFF4B844CFF4B844BFF4B854DFF477D49C0FFFFFF00FFFFFF00FFFF
|
||||
FF00B1B1AFF2AFAFADFFAEAEABFFAFAFADFFBAB3B7FF3F7F41FF4EC592FF45BF
|
||||
89FF47BF8AFF45BE89FF44BE89FF5DCB9CFF4B854DFFFFFFFF00FFFFFF00FFFF
|
||||
FF00B0B0ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF397A3AFF50C191FFFFFF
|
||||
FFFF2CAE74FF8CD3B4FFFFFFFFFF54C395FF4A844AFFFFFFFF00FFFFFF00FFFF
|
||||
FF00AEAEABFFFFFFFFFFFDFDFCFFFFFEFEFFFFFFFFFF367737FF59C095FFFFFF
|
||||
FFFF73C7A2FFFFFFFFFF81CDACFF64C69EFF49844AFFFFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFF8F8F8FFFBFAFBFFFFFFFFFF357736FF68C5A1FFFFFF
|
||||
FFFFFFFFFFFF69C29CFF0F9D62FF76CBABFF488449FFFFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFF6F5F5FFF9F7F8FFFFFFFFFF347736FF7FCDB0FFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFF87D1B6FF478349FFFFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFF3F2F2FFF5F3F4FFFFFBFFFF327736FF8FD5BCFF89D1
|
||||
B6FF86CFB3FF87CFB4FF8CD2B8FF95D9C2FF47854AFFFFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFF0F0EFFFF1F1F0FFFAF6F8FF7DA780FF327736FF3478
|
||||
36FF337736FF337736FF357938FF3D7F41FF47864BA8FFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFEEECEBFFEEEDECFFF1EFEFFFF7F3F5FFFCF5F9FFFDF5
|
||||
FAFFFDF5FAFFFDF5FAFFFFFFFFFFBEB5BBFF00000000FFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFEAE9E9FFEBEAEAFFEBEAEAFFEBEAEAFFF6F5F5FFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFB2B0B0FF00000000FFFFFF00FFFFFF00FFFF
|
||||
FF00ADADABFFFFFFFFFFE7E7E6FFE8E8E7FFE8E8E7FFE6E7E5FFFFFFFFFFCBCB
|
||||
CAFFA6A6A4FFA5A5A2FFFFFFFFFFAFAFADFF00000000FFFFFF00FFFFFF00FFFF
|
||||
FF00AEAEABFFFFFFFFFFE4E3E2FFE5E4E3FFE5E4E3FFE4E3E2FFFFFFFFFFA6A6
|
||||
A4FFFBFBFAFFFFFFFFFFE9E9E9FFB0B0AEAC00000000FFFFFF00FFFFFF00FFFF
|
||||
FF00AEAEACFFFFFFFFFFE0DFDEFFE1DFDEFFE1DFDEFFE0DFDEFFFFFFFFFFA5A5
|
||||
A2FFFFFFFFFFE7E7E8FFAFAFACA70000000000000000FFFFFF00FFFFFF00FFFF
|
||||
FF00AFAFADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFE9E9E9FFAEAEACA6000000000000000000000000FFFFFF00FFFFFF00FFFF
|
||||
FF00B3B3B1EFB0B0ADFFAEAEACFFAEAEABFFAEAEABFFADAEABFFAEAEABFFAFAF
|
||||
ADFFB0B0AEEA00000000000000000000000000000000FFFFFF00
|
||||
}
|
||||
OnClick = btnAddFileClick
|
||||
ShowCaption = False
|
||||
end
|
||||
object btnProjOpts: TSpeedButton
|
||||
Left = 60
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 30
|
||||
Action = CEMainForm.actProjOpts
|
||||
Align = alLeft
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000FFFFFF000000
|
||||
0023000000330000003300000022000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF001278
|
||||
D4C01C8FEBFF1A8CEAFF1178D3BD000000210000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF001F94
|
||||
EBFF4DD6FFFF38BDFFFF1F99F7FF0C77D7B90000002100000000000000000000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF001F93
|
||||
EBFF65D0FFFF42C9FFFF31B4FFFF1B97FAFF0D78D7B900000021000000000000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF001382
|
||||
E6AC2FABF2FF63CDFFFF3BC1FFFF2BACFFFF1A94F8FF1078D2B9000000220000
|
||||
00000000000000000000000000000000000000000000FFFFFF00FFFFFF000000
|
||||
00001281E6A73CBDF7FF63CEFFFF35BBFFFF25A6FFFF1490FAFF087ADEBB0000
|
||||
00010000000000000000000000000000000000000000FFFFFF00FFFFFF000000
|
||||
0000000000001180E6A73FB7F7FF64CFFFFF23A6FFFF169FFFFF357FC0FF1211
|
||||
10330000000000000000000000000000000000000000FFFFFF00FFFFFF000000
|
||||
000000000000000000001181E6A734B8F8FF5DD1FFFF63B8EEFFC6B9AEFF7974
|
||||
70E50000003300000033000000330000002600000000FFFFFF00FFFFFF000000
|
||||
00000000000000000000000000000D82EBAA397FBFFFF5E9DFFFD0CAC7FFA9A7
|
||||
A4FF757370FF8E8C8AFF7F7D7BFF737170CC0000002FFFFFFF00FFFFFF000000
|
||||
00000000000000000000000000000000000000000000837B76EED3D0D0FFC9C7
|
||||
C6FFD4D2D1FFECEBEBFFEFEFEFFFDCDCDCFF807E7CF0FFFFFF00FFFFFF000000
|
||||
0000000000000000000000000000000000000000000083807DF3DBD9D8FFCECC
|
||||
CCFFCDCBC9FFCBC9CAFF898684FF878582FF8A8886FFFFFFFF00FFFFFF000000
|
||||
000000000000000000000000000000000000000000008C8986FFE1E1E0FFCAC8
|
||||
C7FFCCCAC9FF8E8C89FF000000000000000000000000FFFFFF00FFFFFF000000
|
||||
0000000000000000000000000000000000000000000092908CFFE2E2E1FFBBB9
|
||||
B8FFBCBABAFF94928FFF000000330000003300000033FFFFFF00FFFFFF000000
|
||||
00000000000000000000000000000000000000000000999794FAD4D3D3FFDDDB
|
||||
DBFFB4B1AFFFA9A6A4FF9D9B98FF9E9C98FF9C9B97FFFFFFFF00FFFFFF000000
|
||||
00000000000000000000000000000000000000000000A19F9C48AEACAAFFDADA
|
||||
D9FFF0EEEFFFECEBEAFFE2E0E0FFBFBCBCFFA3A19EFFFFFFFF00FFFFFF000000
|
||||
0000000000000000000000000000000000000000000000000000A6A4A133A5A3
|
||||
9FE5AEACA9FFB9B6B5FFABA9A5FFA7A5A2D2A8A6A323FFFFFF00
|
||||
}
|
||||
ShowCaption = False
|
||||
end
|
||||
object btnAddFold: TSpeedButton
|
||||
Left = 30
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 30
|
||||
Align = alLeft
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000001E0000003300000033000000330000001E00000000469AD300469A
|
||||
D300469AD300469AD300469AD300469AD300469AD300479AD5004D99DF000000
|
||||
001E008C53AC009E5EFF009D5DFF009E5EFF008C55AC0000001E469AD3000000
|
||||
000B0000000A0000000A0000000A0000000A0000000A0000000A00000008008D
|
||||
4BAA00A668FF00BA86FF77DFC4FF00BA86FF00A66AFF008C55AC0000002F2959
|
||||
7A5F2655755C2655745C2655745C2655745C2655745C2653745A24486851009E
|
||||
52FF00C08AFF00BB82FFFFFFFFFF00BB82FF00C08CFF009E5EFF4598D0F14398
|
||||
D2FF4094D0FF3E92CFFF3E92CEFF3F92CEFF3F92CEFF4092D1FF4792DAFF009B
|
||||
4EFF75E5CAFFFFFFFFFFFFFFFFFFFFFFFFFF77E5CCFF009C5CFF4499D2FF3F94
|
||||
D0FFABFBFFFF9BF3FFFF92F1FFFF93F1FFFF93F1FFFF95F1FFFF9EF4FFFF0096
|
||||
4AFF00CA93FF00C78EFFFFFFFFFF00C88FFF00CC97FF009D5CFF4397D1FF56AC
|
||||
DDFF8EDAF5FFA2EDFFFF82E5FEFF84E5FEFF84E5FEFF86E6FFFF8DE9FFFF35BA
|
||||
9EFF00A965FF00D299FF74ECD1FF00D29AFF00AE6CFF009F56924296D1FF71C4
|
||||
EAFF6CBCE6FFBBF2FFFF75DEFDFF77DEFCFF78DEFCFF7CDFFDFF80E1FFFF89E4
|
||||
FFFF32B89EFF009549FF00954AFF00974BFF1F9E91FF000000124095D0FF90DD
|
||||
F8FF44A0D8FFDDFCFFFFDAFAFFFFDBF9FFFFDEFAFFFF74DCFCFF76DBFBFF78DB
|
||||
FEFF7CDDFFFF7FDFFFFF7FDFFFFFADECFFFF82C1EEFF3575A7703E93CFFFB2F6
|
||||
FFFF51ACDEFF358ACAFF358ACAFF358ACAFF368ACAFF5BBDE9FF6ED9FBFF6AD6
|
||||
FAFF69D5FBFF69D5FBFF68D5FCFF84DEFEFFABE1F8FF3A8AC1C83D92CFFFB8F3
|
||||
FFFF77DFFEFF7BE0FEFF7CE1FEFF7CE1FFFF7DE2FFFF52ABDDFF56B9E8FFDAF8
|
||||
FFFFD6F6FFFFD6F6FFFFD5F6FFFFD5F7FFFFDBFCFFFF3E94D0FF3C92CFFFC0F3
|
||||
FFFF70D9FBFF73DAFBFF74DAFBFF74DAFBFF74DBFBFF76DEFDFF4FA9DCFF368B
|
||||
CAFF358BCBFF338BCBFF338CCCFF3790CEFF3D94D0FF4398D2AE3B92CFFFCAF6
|
||||
FFFF69D5F9FF6CD5F9FF6AD4F9FF69D4F9FF69D5F9FF6AD6FAFF6BD8FBFF6BD9
|
||||
FCFF6BDAFDFF69DAFDFFDAFDFFFF3C93D0FF367BAA2F469AD3003B92CFFFD5F7
|
||||
FFFF60D1F9FF61D0F8FFB4EBFDFFD9F6FFFFDAF8FFFFDAF8FFFFDAF9FFFFDBF9
|
||||
FFFFDAF9FFFFDAFAFFFFDFFEFFFF3D94D0FF4599D335469AD3003D94D0FFDCFC
|
||||
FFFFD8F7FFFFD8F7FFFFDBFAFFFF358ECDFF3991CEFF3A92CFFF3A92CFFF3A92
|
||||
CFFF3A92CFFF3A92CFFF3D94D0FF4298D2EA469AD300469AD3004398D2EF3D94
|
||||
D0FF3A92CFFF3A92CFFF3D94D0FF4197D1E44398D22B4498D2324498D2334498
|
||||
D2334498D2334499D2334499D337459AD300469AD300469AD300
|
||||
}
|
||||
OnClick = btnAddFoldClick
|
||||
ShowCaption = False
|
||||
end
|
||||
object TreeFilterEdit1: TTreeFilterEdit
|
||||
Left = 92
|
||||
Height = 20
|
||||
Top = 2
|
||||
Width = 115
|
||||
ButtonWidth = 30
|
||||
NumGlyphs = 1
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 2
|
||||
MaxLength = 0
|
||||
TabOrder = 0
|
||||
FilteredTreeview = Tree
|
||||
ExpandAllInitially = True
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited Header: TPanel
|
||||
Width = 163
|
||||
Width = 217
|
||||
end
|
||||
end
|
||||
object imgList: TImageList[2]
|
||||
|
|
|
@ -5,24 +5,33 @@ unit ce_project;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
ComCtrls, ce_common, ce_widget;
|
||||
Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics,
|
||||
Dialogs, ExtCtrls, ComCtrls, Menus, Buttons, ce_common, ce_widget;
|
||||
|
||||
type
|
||||
{ TCEProjectWidget }
|
||||
TCEProjectWidget = class(TCEWidget)
|
||||
imgList: TImageList;
|
||||
Panel1: TPanel;
|
||||
btnAddFile: TSpeedButton;
|
||||
btnProjOpts: TSpeedButton;
|
||||
btnAddFold: TSpeedButton;
|
||||
Tree: TTreeView;
|
||||
TreeFilterEdit1: TTreeFilterEdit;
|
||||
procedure btnAddFileClick(Sender: TObject);
|
||||
procedure btnAddFoldClick(Sender: TObject);
|
||||
protected
|
||||
procedure manualWidgetUpdate; override;
|
||||
private
|
||||
fProject: TCEProject;
|
||||
fFileNode, fConfNode: TTreeNode;
|
||||
procedure updateView;
|
||||
procedure TreeDblClick(sender: TObject);
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
//
|
||||
procedure projNew(const aProject: TCEProject); override;
|
||||
procedure projChange(const aProject: TCEProject); override;
|
||||
procedure projClose(const aProject: TCEProject); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
@ -40,15 +49,22 @@ begin
|
|||
fConfNode := Tree.Items[1];
|
||||
end;
|
||||
|
||||
destructor TCEProjectWidget.destroy;
|
||||
procedure TCEProjectWidget.projNew(const aProject: TCEProject);
|
||||
begin
|
||||
inherited;
|
||||
fProject := aProject;
|
||||
manualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.projChange(const aProject: TCEProject);
|
||||
begin
|
||||
fProject := aProject;
|
||||
updateView;
|
||||
manualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.projClose(const aProject: TCEProject);
|
||||
begin
|
||||
fProject := nil;
|
||||
manualWidgetUpdate;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.TreeDblClick(sender: TObject);
|
||||
|
@ -74,11 +90,58 @@ begin
|
|||
begin
|
||||
i := Tree.Selected.Index;
|
||||
fProject.ConfigurationIndex := i;
|
||||
updateView;
|
||||
manualWidgetUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.updateView;
|
||||
procedure TCEProjectWidget.btnAddFileClick(Sender: TObject);
|
||||
begin
|
||||
if fProject = nil then exit;
|
||||
//
|
||||
with TOpenDialog.Create(nil) do
|
||||
try
|
||||
filter := 'd source|*.d|d interface|*.di|all files|*.*';
|
||||
if execute then
|
||||
fProject.addSource(filename);
|
||||
finally
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.btnAddFoldClick(Sender: TObject);
|
||||
var
|
||||
dir, ext, fname: string;
|
||||
sr: TSearchRec;
|
||||
lst: TStringList;
|
||||
begin
|
||||
if fProject = nil then exit;
|
||||
//
|
||||
if fileexists(fProject.fileName) then
|
||||
dir := extractfilePath(fProject.fileName)
|
||||
else dir := '';
|
||||
if selectDirectory(dir, [], 0) then
|
||||
begin
|
||||
if FindFirst(dir + DirectorySeparator + '*.*', faAnyFile, sr ) = 0 then
|
||||
try
|
||||
lst := TStringList.Create;
|
||||
ext := ExtractFileExt(sr.Name);
|
||||
if (ext = '.d') or (ext = '.di') then
|
||||
lst.Add(dir + DirectorySeparator + sr.Name);
|
||||
while FindNext(sr) = 0 do
|
||||
begin
|
||||
ext := ExtractFileExt(sr.Name);
|
||||
if (ext = '.d') or (ext = '.di') then
|
||||
lst.Add(dir + DirectorySeparator + sr.Name);
|
||||
end;
|
||||
for fname in lst do
|
||||
fProject.addSource(fname);
|
||||
finally
|
||||
lst.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEProjectWidget.manualWidgetUpdate;
|
||||
var
|
||||
src, conf: string;
|
||||
itm: TTreeNode;
|
||||
|
|
|
@ -1,31 +1,33 @@
|
|||
object CEWidget: TCEWidget
|
||||
Left = 1264
|
||||
Height = 327
|
||||
Top = 448
|
||||
Left = 1538
|
||||
Height = 121
|
||||
Top = 735
|
||||
Width = 320
|
||||
BorderIcons = [biMinimize, biMaximize]
|
||||
Caption = 'CEWidget'
|
||||
ClientHeight = 0
|
||||
ClientWidth = 0
|
||||
ClientHeight = 121
|
||||
ClientWidth = 320
|
||||
LCLVersion = '1.2.2.0'
|
||||
object Back: TPanel
|
||||
Left = 0
|
||||
Height = 327
|
||||
Height = 121
|
||||
Top = 0
|
||||
Width = 320
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 327
|
||||
ClientHeight = 121
|
||||
ClientWidth = 320
|
||||
FullRepaint = False
|
||||
TabOrder = 0
|
||||
object Content: TScrollBox
|
||||
Left = 0
|
||||
Height = 301
|
||||
Height = 95
|
||||
Top = 26
|
||||
Width = 320
|
||||
HorzScrollBar.Page = 316
|
||||
VertScrollBar.Page = 297
|
||||
VertScrollBar.Page = 86
|
||||
Align = alClient
|
||||
AutoScroll = False
|
||||
TabOrder = 0
|
||||
end
|
||||
object Header: TPanel
|
||||
|
@ -38,7 +40,6 @@ object CEWidget: TCEWidget
|
|||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object Updater: TTimer
|
||||
Interval = 50
|
||||
object contextMenu: TPopupMenu
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls,
|
||||
ce_common, ActnList;
|
||||
ce_common, ActnList, Menus, syncobjs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -20,25 +20,39 @@ type
|
|||
Content: TScrollBox;
|
||||
Back: TPanel;
|
||||
Header: TPanel;
|
||||
Updater: TTimer;
|
||||
contextMenu: TPopupMenu;
|
||||
private
|
||||
procedure updaterTimer(Sender: TObject);
|
||||
fAutoUpdater: TTimer;
|
||||
fAutoUpdating: boolean;
|
||||
fManuUpdating: boolean;
|
||||
fWidgUpdateCount: NativeInt;
|
||||
procedure autoUpdaterEvent(Sender: TObject);
|
||||
protected
|
||||
fID: string;
|
||||
fNeedUpdate: boolean;
|
||||
fUpdating: boolean;
|
||||
procedure UpdaterProc; virtual;
|
||||
fNeedAutoUpdate: boolean;
|
||||
fLocker: TCriticalSection;
|
||||
procedure autoWidgetUpdate; virtual;
|
||||
procedure manualWidgetUpdate; virtual;
|
||||
published
|
||||
property ID: string read fID write fID;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
//
|
||||
procedure beginManualWidgetUpdate;
|
||||
procedure endManualWidgetUpdate;
|
||||
procedure forceManualWidgetUpdate;
|
||||
//
|
||||
procedure projNew(const aProject: TCEProject); virtual;
|
||||
procedure projChange(const aProject: TCEProject); virtual;
|
||||
procedure projClose(const aProject: TCEProject); virtual;
|
||||
//
|
||||
function contextName: string; virtual;
|
||||
function contextActionCount: integer; virtual;
|
||||
function contextAction(index: integer): TAction; virtual;
|
||||
//
|
||||
property isAutoUpdating: boolean read fAutoUpdating;
|
||||
property isManualUpdating: boolean read fManuUpdating;
|
||||
end;
|
||||
|
||||
(**
|
||||
|
@ -72,27 +86,75 @@ constructor TCEWidget.create(aOwner: TComponent);
|
|||
begin
|
||||
inherited;
|
||||
fID := 'ID_XXXX';
|
||||
Updater.OnTimer := @updaterTimer;
|
||||
fAutoUpdater := TTimer.Create(self);
|
||||
fAutoUpdater.Interval := 50;
|
||||
fAutoUpdater.OnTimer := @autoUpdaterEvent;
|
||||
fLocker := TCriticalSection.Create;
|
||||
end;
|
||||
|
||||
destructor TCEWidget.destroy;
|
||||
begin
|
||||
fLocker.Leave;
|
||||
fLocker.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCEWidget.updaterTimer(Sender: TObject);
|
||||
procedure TCEWidget.beginManualWidgetUpdate;
|
||||
begin
|
||||
if not fNeedUpdate then exit;
|
||||
fUpdating := true;
|
||||
Inc(fWidgUpdateCount);
|
||||
end;
|
||||
|
||||
procedure TCEWidget.endManualWidgetUpdate;
|
||||
begin
|
||||
Dec(fWidgUpdateCount);
|
||||
if fWidgUpdateCount > 0 then
|
||||
begin
|
||||
writeln('widget update count > 0');
|
||||
exit;
|
||||
|
||||
end;
|
||||
|
||||
fManuUpdating := true;
|
||||
//fLocker.Enter;
|
||||
manualWidgetUpdate;
|
||||
//fLocker.Leave;
|
||||
fManuUpdating := false;
|
||||
fWidgUpdateCount := 0;
|
||||
|
||||
end;
|
||||
|
||||
procedure TCEWidget.forceManualWidgetUpdate;
|
||||
begin
|
||||
fManuUpdating := true;
|
||||
//fLocker.Enter;
|
||||
manualWidgetUpdate;
|
||||
//fLocker.Leave;
|
||||
fManuUpdating := false;
|
||||
end;
|
||||
|
||||
procedure TCEWidget.autoUpdaterEvent(Sender: TObject);
|
||||
begin
|
||||
if not fNeedAutoUpdate then exit;
|
||||
fAutoUpdating := true;
|
||||
try
|
||||
UpdaterProc;
|
||||
//fLocker.Enter;
|
||||
autoWidgetUpdate;
|
||||
finally
|
||||
fUpdating := false;
|
||||
fNeedUpdate := false;
|
||||
//fLocker.Leave;
|
||||
fAutoUpdating := false;
|
||||
fNeedAutoUpdate := false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEWidget.UpdaterProc;
|
||||
procedure TCEWidget.autoWidgetUpdate;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TCEWidget.manualWidgetUpdate;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TCEWidget.projNew(const aProject: TCEProject);
|
||||
begin
|
||||
end;
|
||||
|
||||
|
@ -100,6 +162,10 @@ procedure TCEWidget.projChange(const aProject: TCEProject);
|
|||
begin
|
||||
end;
|
||||
|
||||
procedure TCEWidget.projClose(const aProject: TCEProject);
|
||||
begin
|
||||
end;
|
||||
|
||||
function TCEWidget.contextName: string;
|
||||
begin
|
||||
result := '';
|
||||
|
|
Loading…
Reference in New Issue