This commit is contained in:
Basile Burg 2014-06-15 16:58:14 +02:00
parent 3320792161
commit 509b76eac2
21 changed files with 2181 additions and 503 deletions

View File

@ -1,7 +1,7 @@
Coedit 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) Initial features (planed)
------------------------- -------------------------
@ -20,12 +20,12 @@ Project information
- draft - draft
- programmed in Object pascal. - programmed in Object pascal.
- [Lazarus](http://www.lazarus.freepascal.org) is used as IDE. - [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...) - no other third party dependencies (so far...)
Setup Setup
----- -----
- clone this repo. - clone this repo.
- optionally install [dmd](http://dlang.org/download.html) and or [Lazarus](http://www.lazarus.freepascal.org) - both [dmd](http://dlang.org/download.html) and [Lazarus](http://www.lazarus.freepascal.org) must be setup.
- open "coedit.lpr". - open "coedit.lpr" in Lazarus.
- press the Run button. - press the Run button.

View File

@ -48,7 +48,6 @@
<Debugging> <Debugging>
<DebugInfoType Value="dsDwarf2Set"/> <DebugInfoType Value="dsDwarf2Set"/>
<UseHeaptrc Value="True"/> <UseHeaptrc Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging> </Debugging>
</Linking> </Linking>
<Other> <Other>
@ -110,19 +109,22 @@
<FormatVersion Value="1"/> <FormatVersion Value="1"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="4"> <RequiredPackages Count="5">
<Item1> <Item1>
<PackageName Value="RunTimeTypeInfoControls"/> <PackageName Value="FCL"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="SynEdit"/> <PackageName Value="RunTimeTypeInfoControls"/>
</Item2> </Item2>
<Item3> <Item3>
<PackageName Value="LazControls"/> <PackageName Value="SynEdit"/>
</Item3> </Item3>
<Item4> <Item4>
<PackageName Value="LCL"/> <PackageName Value="LazControls"/>
</Item4> </Item4>
<Item5>
<PackageName Value="LCL"/>
</Item5>
</RequiredPackages> </RequiredPackages>
<Units Count="13"> <Units Count="13">
<Unit0> <Unit0>

View File

@ -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

16
lazproj/test/src/bar.d Normal file
View File

@ -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");
}
}

16
lazproj/test/src/foo.d Normal file
View File

@ -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");
}
}

20
lazproj/test/src/main.d Normal file
View File

@ -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;
}

View File

@ -32,7 +32,9 @@ type
* An implementer is informed when a project changes. * An implementer is informed when a project changes.
*) *)
ICEProjectMonitor = interface ICEProjectMonitor = interface
procedure projNew(const aProject: TCEProject);
procedure projChange(const aProject: TCEProject); procedure projChange(const aProject: TCEProject);
procedure projClose(const aProject: TCEProject);
end; end;
(***************************************************************************** (*****************************************************************************
@ -47,6 +49,7 @@ type
fOptsColl: TCollection; fOptsColl: TCollection;
fSrcs, fSrcsCop: TStringList; fSrcs, fSrcsCop: TStringList;
fConfIx: Integer; fConfIx: Integer;
fChangedCount: NativeInt;
procedure doChanged; procedure doChanged;
procedure subMemberChanged(sender : TObject); procedure subMemberChanged(sender : TObject);
procedure setOptsColl(const aValue: TCollection); procedure setOptsColl(const aValue: TCollection);
@ -63,6 +66,8 @@ type
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
procedure beforeChanged;
procedure afterChanged;
procedure reset; procedure reset;
function getAbsoluteSourceName(const aIndex: integer): string; function getAbsoluteSourceName(const aIndex: integer): string;
procedure addSource(const aFilename: string); procedure addSource(const aFilename: string);
@ -165,7 +170,7 @@ begin
continue; continue;
end; end;
if tok then if ln[pos] = ';'then if tok then if ln[pos] = ';' then
exit(id); exit(id);
id += ln[pos]; id += ln[pos];
@ -195,14 +200,15 @@ constructor TCEProject.create(aOwner: TComponent);
begin begin
inherited create(aOwner); inherited create(aOwner);
fSrcs := TStringList.Create; fSrcs := TStringList.Create;
fSrcs.OnChange := @subMemberChanged;
fSrcsCop := TStringList.Create; fSrcsCop := TStringList.Create;
fOptsColl := TCollection.create(TCompilerConfiguration); fOptsColl := TCollection.create(TCompilerConfiguration);
reset; reset;
fSrcs.OnChange := @subMemberChanged;
end; end;
destructor TCEProject.destroy; destructor TCEProject.destroy;
begin begin
fOnChange := nil;
fSrcs.free; fSrcs.free;
fSrcsCop.Free; fSrcsCop.Free;
fOptsColl.free; fOptsColl.free;
@ -238,6 +244,9 @@ var
i: NativeInt; i: NativeInt;
begin begin
if fFilename = aValue then exit; if fFilename = aValue then exit;
//
beforeChanged;
fFilename := aValue; fFilename := aValue;
oldBase := fBasePath; oldBase := fBasePath;
fBasePath := extractFilePath(fFilename); fBasePath := extractFilePath(fFilename);
@ -249,27 +258,47 @@ begin
fSrcs[i] := newRel; fSrcs[i] := newRel;
end; end;
// //
doChanged; afterChanged;
end; end;
procedure TCEProject.setSrcs(const aValue: TStringList); procedure TCEProject.setSrcs(const aValue: TStringList);
begin begin
beforeChanged;
fSrcs.Assign(aValue); fSrcs.Assign(aValue);
doChanged; afterChanged;
end; end;
procedure TCEProject.setConfIx(aValue: Integer); procedure TCEProject.setConfIx(aValue: Integer);
begin begin
if fConfIx = aValue then exit; if fConfIx = aValue then exit;
beforeChanged;
if aValue < 0 then aValue := 0; if aValue < 0 then aValue := 0;
if aValue > fOptsColl.Count-1 then aValue := fOptsColl.Count-1; if aValue > fOptsColl.Count-1 then aValue := fOptsColl.Count-1;
fConfIx := aValue; fConfIx := aValue;
doChanged; afterChanged;
end; end;
procedure TCEProject.subMemberChanged(sender : TObject); procedure TCEProject.subMemberChanged(sender : TObject);
begin begin
beforeChanged;
fModified := true; 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; doChanged;
end; end;
@ -285,7 +314,7 @@ end;
function TCEProject.getConfig(const ix: integer): TCompilerConfiguration; function TCEProject.getConfig(const ix: integer): TCompilerConfiguration;
begin begin
result := TCompilerConfiguration(fOptsColl.Items[ix]); result := TCompilerConfiguration(fOptsColl.Items[ix]);
result.onChanged := @subMemberChanged; //result.onChanged := @subMemberChanged;
end; end;
function TCEProject.getCurrConf: TCompilerConfiguration; function TCEProject.getCurrConf: TCompilerConfiguration;
@ -317,13 +346,14 @@ procedure TCEProject.reset;
var var
defConf: TCompilerConfiguration; defConf: TCompilerConfiguration;
begin begin
beforeChanged;
fConfIx := 0; fConfIx := 0;
fOptsColl.Clear; fOptsColl.Clear;
defConf := addConfiguration; defConf := addConfiguration;
defConf.name := 'default'; defConf.name := 'default';
fSrcs.Clear; fSrcs.Clear;
fFilename := ''; fFilename := '';
doChanged; afterChanged;
end; end;
function TCEProject.getOpts: string; function TCEProject.getOpts: string;
@ -335,9 +365,9 @@ begin
for rel in fSrcs do for rel in fSrcs do
begin begin
abs := expandFilenameEx(fBasePath,rel); abs := expandFilenameEx(fBasePath,rel);
result += '"' + abs + '"'; result += '"' + abs + '" ' ;
end; end;
result += ' ' + TCompilerConfiguration(fOptsColl.Items[fConfIx]).getOpts; result += TCompilerConfiguration(fOptsColl.Items[fConfIx]).getOpts;
end; end;
function TCEProject.getAbsoluteSourceName(const aIndex: integer): string; function TCEProject.getAbsoluteSourceName(const aIndex: integer): string;

View File

@ -447,7 +447,7 @@ TODO:
- binary literals. - binary literals.
- alternative attributes for ddoc comments. - alternative attributes for ddoc comments.
- asm range. - asm range.
- stricter number litterals. - stricter number literals.
- string literals: custom token, escape "\" not handled. - string literals: custom token, escape "\" not handled.
- correct nested comments handling. - correct nested comments handling.
} }

View File

@ -44,6 +44,7 @@ type
property DocumentationDirectory: string read fDocDir write setDocDir; property DocumentationDirectory: string read fDocDir write setDocDir;
property JSONFilename: string read fJsonFname write setJSONFile; property JSONFilename: string read fJsonFname write setJSONFile;
public public
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -79,6 +80,7 @@ type
property quiet: boolean read fQuiet write setQuiet; property quiet: boolean read fQuiet write setQuiet;
public public
constructor create; constructor create;
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -129,6 +131,7 @@ type
property unittest: boolean read fUt write setUt; property unittest: boolean read fUt write setUt;
property versionIdentifier: string read fVerId write setVerId; property versionIdentifier: string read fVerId write setVerId;
public public
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -154,6 +157,7 @@ type
property addCInformations: boolean read fDbgC write setDbgC; property addCInformations: boolean read fDbgC write setDbgC;
property generateMapFile: boolean read fMap write setMap; property generateMapFile: boolean read fMap write setMap;
public public
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -181,6 +185,7 @@ type
public public
constructor create; constructor create;
destructor destroy; override; destructor destroy; override;
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -196,6 +201,7 @@ type
public public
constructor create; constructor create;
destructor destroy; override; destructor destroy; override;
procedure assign(aValue: TPersistent); override;
function getOpts: string; override; function getOpts: string; override;
end; end;
@ -235,6 +241,7 @@ type
public public
constructor create(aCollection: TCollection); override; constructor create(aCollection: TCollection); override;
destructor destroy; override; destructor destroy; override;
procedure assign(aValue: TPersistent); override;
property getOpts: string read getCmdLine; property getOpts: string read getCmdLine;
property onChanged: TNotifyEvent read fOnChanged write fOnChanged; property onChanged: TNotifyEvent read fOnChanged write fOnChanged;
end; end;
@ -261,6 +268,21 @@ begin
if fJsonFname <> '' then result += '-Xf' + '"'+ fJsonFname + '" '; if fJsonFname <> '' then result += '-Xf' + '"'+ fJsonFname + '" ';
end; 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); procedure TDocOpts.setGenDoc(const aValue: boolean);
begin begin
if fGenDoc = aValue then exit; if fGenDoc = aValue then exit;
@ -309,6 +331,23 @@ begin
if fQuiet then result += '-quiet '; if fQuiet then result += '-quiet ';
end; 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); procedure TMsgOpts.setDepHandling(const aValue: TDepHandling);
begin begin
if fDepHandling = aValue then exit; if fDepHandling = aValue then exit;
@ -371,6 +410,27 @@ begin
if fRelease then result += '-release '; if fRelease then result += '-release ';
end; 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); procedure TOutputOpts.setUt(const aValue: boolean);
begin begin
if fUt = aValue then exit; if fUt = aValue then exit;
@ -454,6 +514,22 @@ begin
if fMap then result += '-map '; if fMap then result += '-map ';
end; 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); procedure TDebugOpts.setDbg(const aValue: boolean);
begin begin
if fDbg = aValue then exit; if fDbg = aValue then exit;
@ -514,6 +590,22 @@ begin
fImpt := TStringList.Create; fImpt := TStringList.Create;
end; 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; destructor TPathsOpts.destroy;
begin begin
fSrcs.free; fSrcs.free;
@ -562,6 +654,18 @@ begin
fCustom := TStringList.Create; fCustom := TStringList.Create;
end; 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; destructor TOtherOpts.destroy;
begin begin
fCustom.Destroy; fCustom.Destroy;
@ -618,6 +722,23 @@ begin
inherited; inherited;
end; 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; function TCompilerConfiguration.nameFromID: string;
begin begin
result := format('<configuration %d>',[ID]); result := format('<configuration %d>',[ID]);

View File

@ -1,28 +1,31 @@
inherited CEEditorWidget: TCEEditorWidget inherited CEEditorWidget: TCEEditorWidget
Left = 1248 Left = 1167
Height = 336 Height = 336
Top = 89 Top = 89
Width = 481 Width = 508
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
Caption = 'EditorWidget' Caption = 'EditorWidget'
ClientHeight = 336 ClientHeight = 336
ClientWidth = 481 ClientWidth = 508
inherited Back: TPanel inherited Back: TPanel
Height = 336 Height = 336
Width = 481 Width = 508
ClientHeight = 336 ClientHeight = 336
ClientWidth = 481 ClientWidth = 508
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 310 Height = 310
Width = 481 Width = 508
HorzScrollBar.Page = 477 HorzScrollBar.Page = 504
VertScrollBar.Page = 306 VertScrollBar.Page = 306
AutoSize = True
AutoScroll = True
ClientHeight = 306 ClientHeight = 306
ClientWidth = 477 ClientWidth = 504
object PageControl: TExtendedNotebook[0] object PageControl: TExtendedNotebook[0]
Left = 2 Left = 2
Height = 279 Height = 279
Top = 2 Top = 2
Width = 473 Width = 500
Align = alClient Align = alClient
BorderSpacing.Around = 2 BorderSpacing.Around = 2
TabOrder = 0 TabOrder = 0
@ -34,7 +37,7 @@ inherited CEEditorWidget: TCEEditorWidget
Left = 0 Left = 0
Height = 23 Height = 23
Top = 283 Top = 283
Width = 477 Width = 504
Panels = < Panels = <
item item
Width = 100 Width = 100
@ -49,7 +52,7 @@ inherited CEEditorWidget: TCEEditorWidget
end end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 481 Width = 508
end end
end end
object macRecorder: TSynMacroRecorder[2] object macRecorder: TSynMacroRecorder[2]

View File

@ -19,7 +19,7 @@ type
editorStatus: TStatusBar; editorStatus: TStatusBar;
procedure PageControlChange(Sender: TObject); procedure PageControlChange(Sender: TObject);
protected protected
procedure UpdaterProc; override; procedure autoWidgetUpdate; override;
private private
// http://bugs.freepascal.org/view.php?id=26329 // http://bugs.freepascal.org/view.php?id=26329
fSyncEdit: TSynPluginSyncroEdit; fSyncEdit: TSynPluginSyncroEdit;
@ -36,6 +36,7 @@ type
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
procedure addEditor; procedure addEditor;
procedure removeEditor(const aIndex: NativeInt);
// //
property currentEditor: TCESynMemo read getCurrentEditor; property currentEditor: TCESynMemo read getCurrentEditor;
property editor[index: NativeInt]: TCESynMemo read getEditor; property editor[index: NativeInt]: TCESynMemo read getEditor;
@ -112,7 +113,7 @@ var
sheet: TTabSheet; sheet: TTabSheet;
memo: TCESynMemo; memo: TCESynMemo;
begin begin
fNeedUpdate := true; fNeedAutoUpdate := true;
sheet := pageControl.AddTabSheet; sheet := pageControl.AddTabSheet;
memo := TCESynMemo.Create(sheet); memo := TCESynMemo.Create(sheet);
// //
@ -128,6 +129,12 @@ begin
focusedEditorChanged; focusedEditorChanged;
end; end;
procedure TCEEditorWidget.removeEditor(const aIndex: NativeInt);
begin
editor[aIndex].OnChange:= nil;
pageControl.Pages[aIndex].Free;
end;
procedure TCEEditorWidget.identifierToD2Syn(const aMemo: TCESynMemo); procedure TCEEditorWidget.identifierToD2Syn(const aMemo: TCESynMemo);
begin begin
D2Syn.CurrentIdentifier := aMemo.GetWordAtRowCol(aMemo.LogicalCaretXY); D2Syn.CurrentIdentifier := aMemo.GetWordAtRowCol(aMemo.LogicalCaretXY);
@ -135,14 +142,14 @@ end;
procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin begin
fNeedUpdate := true; fNeedAutoUpdate := true;
if (sender is TCESynMemo) then if (sender is TCESynMemo) then
identifierToD2Syn(TCESynMemo(Sender)); identifierToD2Syn(TCESynMemo(Sender));
end; end;
procedure TCEEditorWidget.memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure TCEEditorWidget.memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin begin
fNeedUpdate := true; fNeedAutoUpdate := true;
if (sender is TCESynMemo) then if (sender is TCESynMemo) then
identifierToD2Syn(TCESynMemo(Sender)); identifierToD2Syn(TCESynMemo(Sender));
end; end;
@ -151,12 +158,12 @@ procedure TCEEditorWidget.memoChange(Sender: TObject);
var var
ed: TCESynMemo; ed: TCESynMemo;
begin begin
fNeedUpdate := true; fNeedAutoUpdate := true;
ed := TCESynMemo(sender); ed := TCESynMemo(sender);
ed.modified := true; ed.modified := true;
end; end;
procedure TCEEditorWidget.UpdaterProc; procedure TCEEditorWidget.autoWidgetUpdate;
const const
modstr: array[boolean] of string = ('...','MODIFIED'); modstr: array[boolean] of string = ('...','MODIFIED');
var var

File diff suppressed because it is too large Load Diff

View File

@ -13,30 +13,32 @@ type
{ TCEMainForm } { TCEMainForm }
TCEMainForm = class(TForm) TCEMainForm = class(TForm)
actCompAndRunFile: TAction; actFileCompAndRun: TAction;
actCompileProj: TAction; actFileSaveAll: TAction;
actCompileAndRunProj: TAction; actFileClose: TAction;
ActCompAndRunFileWithArgs: TAction; actFileAddToProj: TAction;
actCompAndRunProjWithArgs: TAction; actFileNewRun: TAction;
actFileNew: TAction;
actFileOpen: TAction;
actFileSaveAs: TAction;
actFileSave: TAction;
actProjCompile: TAction;
actProjCompileAndRun: TAction;
ActFileCompAndRunWithArgs: TAction;
actProjCompAndRunWithArgs: TAction;
actProjClose: TAction;
actProjOpts: TAction; actProjOpts: TAction;
actNewProj: TAction; actProjNew: TAction;
actOpenProj: TAction; actProjOpen: TAction;
actSaveProjAs: TAction; actProjSave: TAction;
actCut: TAction; actProjSaveAs: TAction;
actAddCurrToProj: TAction;
actNewRunnable: TAction;
actMacPlay: TAction; actMacPlay: TAction;
actMacStartStop: TAction; actMacStartStop: TAction;
actRedo: TAction; actEdCut: TAction;
actUndo: TAction; actEdRedo: TAction;
actPaste: TAction; actEdUndo: TAction;
actNewFile: TAction; actEdPaste: TAction;
actOpenFile: TAction; actEdCopy: TAction;
actSaveFileAs: TAction;
actSaveFile: TAction;
actCopy: TAction;
actSaveProj: TAction;
Action4: TAction;
Actions: TActionList; Actions: TActionList;
imgList: TImageList; imgList: TImageList;
mainMenu: TMainMenu; mainMenu: TMainMenu;
@ -75,6 +77,8 @@ type
MenuItem39: TMenuItem; MenuItem39: TMenuItem;
MenuItem40: TMenuItem; MenuItem40: TMenuItem;
MenuItem41: TMenuItem; MenuItem41: TMenuItem;
MenuItem42: TMenuItem;
MenuItem43: TMenuItem;
mnuItemWin: TMenuItem; mnuItemWin: TMenuItem;
MenuItem4: TMenuItem; MenuItem4: TMenuItem;
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
@ -82,28 +86,31 @@ type
MenuItem7: TMenuItem; MenuItem7: TMenuItem;
MenuItem8: TMenuItem; MenuItem8: TMenuItem;
MenuItem9: TMenuItem; MenuItem9: TMenuItem;
procedure actAddCurrToProjExecute(Sender: TObject); procedure actFileAddToProjExecute(Sender: TObject);
procedure actCompAndRunFileExecute(Sender: TObject); procedure actFileCloseExecute(Sender: TObject);
procedure ActCompAndRunFileWithArgsExecute(Sender: TObject); procedure actFileCompAndRunExecute(Sender: TObject);
procedure actCompileProjExecute(Sender: TObject); procedure ActFileCompAndRunWithArgsExecute(Sender: TObject);
procedure actCopyExecute(Sender: TObject); procedure actFileSaveAllExecute(Sender: TObject);
procedure actCutExecute(Sender: TObject); procedure actProjCompileExecute(Sender: TObject);
procedure actEdCopyExecute(Sender: TObject);
procedure actEdCutExecute(Sender: TObject);
procedure ActionsUpdate(AAction: TBasicAction; var Handled: Boolean); procedure ActionsUpdate(AAction: TBasicAction; var Handled: Boolean);
procedure actMacPlayExecute(Sender: TObject); procedure actMacPlayExecute(Sender: TObject);
procedure actMacStartStopExecute(Sender: TObject); procedure actMacStartStopExecute(Sender: TObject);
procedure actNewFileExecute(Sender: TObject); procedure actFileNewExecute(Sender: TObject);
procedure actNewProjExecute(Sender: TObject); procedure actProjNewExecute(Sender: TObject);
procedure actNewRunnableExecute(Sender: TObject); procedure actFileNewRunExecute(Sender: TObject);
procedure actOpenFileExecute(Sender: TObject); procedure actFileOpenExecute(Sender: TObject);
procedure actOpenProjExecute(Sender: TObject); procedure actProjOpenExecute(Sender: TObject);
procedure actPasteExecute(Sender: TObject); procedure actEdPasteExecute(Sender: TObject);
procedure actProjCloseExecute(Sender: TObject);
procedure actProjOptsExecute(Sender: TObject); procedure actProjOptsExecute(Sender: TObject);
procedure actRedoExecute(Sender: TObject); procedure actEdRedoExecute(Sender: TObject);
procedure actSaveFileAsExecute(Sender: TObject); procedure actFileSaveAsExecute(Sender: TObject);
procedure actSaveFileExecute(Sender: TObject); procedure actFileSaveExecute(Sender: TObject);
procedure actSaveProjAsExecute(Sender: TObject); procedure actProjSaveAsExecute(Sender: TObject);
procedure actSaveProjExecute(Sender: TObject); procedure actProjSaveExecute(Sender: TObject);
procedure actUndoExecute(Sender: TObject); procedure actEdUndoExecute(Sender: TObject);
procedure FormDropFiles(Sender: TObject; const FileNames: array of String); procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
private private
fProject: TCEProject; fProject: TCEProject;
@ -188,15 +195,14 @@ begin
act.Caption := widg.Caption; act.Caption := widg.Caption;
act.OnExecute := @widgetShowFromAction; act.OnExecute := @widgetShowFromAction;
act.Tag := ptrInt(widg); act.Tag := ptrInt(widg);
act.ImageIndex := 25;
itm := TMenuItem.Create(self); itm := TMenuItem.Create(self);
itm.Action := act; itm.Action := act;
itm.Tag := ptrInt(widg); itm.Tag := ptrInt(widg);
mnuItemWin.Add(itm); mnuItemWin.Add(itm);
end; end;
fProject := TCEProject.Create(self); newProj;
fProject.onChange := @projChange;
projChange(nil);
end; end;
@ -207,6 +213,7 @@ begin
fEditWidg.Free; fEditWidg.Free;
fProjWidg.Free; fProjWidg.Free;
fPrjCfWidg.Free; fPrjCfWidg.Free;
fProject.Free;
// //
inherited; inherited;
end; end;
@ -215,6 +222,7 @@ procedure TCEMainForm.ActionsUpdate(AAction: TBasicAction; var Handled: Boolean)
var var
curr: TCESynMemo; curr: TCESynMemo;
hasEd: boolean; hasEd: boolean;
hasProj: boolean;
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
// //
@ -222,38 +230,49 @@ begin
hasEd := curr <> nil; hasEd := curr <> nil;
if hasEd then if hasEd then
begin begin
actCopy.Enabled := curr.SelAvail; actEdCopy.Enabled := curr.SelAvail;
actCut.Enabled := curr.SelAvail; actEdCut.Enabled := curr.SelAvail;
actPaste.Enabled := curr.CanPaste; actEdPaste.Enabled := curr.CanPaste;
actUndo.Enabled := curr.CanUndo; actEdUndo.Enabled := curr.CanUndo;
actRedo.Enabled := curr.CanRedo; actEdRedo.Enabled := curr.CanRedo;
actMacPlay.Enabled := true; actMacPlay.Enabled := true;
actMacStartStop.Enabled := true; actMacStartStop.Enabled := true;
// //
actCompAndRunFile.Enabled := true; actFileCompAndRun.Enabled := true;
actCompAndRunFileWithArgs.Enabled := true; actFileCompAndRunWithArgs.Enabled := true;
// actFileSave.Enabled := true;
actSaveFile.Enabled := true; actFileSaveAs.Enabled := true;
actSaveFileAs.Enabled := true; actFileClose.Enabled:=true;
actAddCurrToProj.Enabled := true; actFileSaveAll.Enabled:=true;
end end
else begin else begin
actCopy.Enabled := false; actEdCopy.Enabled := false;
actCut.Enabled := false ; actEdCut.Enabled := false ;
actPaste.Enabled := false ; actEdPaste.Enabled := false ;
actUndo.Enabled := false ; actEdUndo.Enabled := false ;
actRedo.Enabled := false ; actEdRedo.Enabled := false ;
actMacPlay.Enabled := false; actMacPlay.Enabled := false;
actMacStartStop.Enabled := false; actMacStartStop.Enabled := false;
// //
actCompAndRunFile.Enabled := false; actFileCompAndRun.Enabled := false;
actCompAndRunFileWithArgs.Enabled := false; actFileCompAndRunWithArgs.Enabled := false;
// actFileSave.Enabled := false;
actSaveFile.Enabled := false; actFileSaveAs.Enabled := false;
actSaveFileAs.Enabled := false; actFileClose.Enabled := false;
actAddCurrToProj.Enabled := false; actFileSaveAll.Enabled := false;
end; 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; end;
procedure TCEMainForm.checkWidgetActions(const aWidget: TCEWidget); procedure TCEMainForm.checkWidgetActions(const aWidget: TCEWidget);
@ -362,7 +381,7 @@ begin
end; end;
end; end;
procedure TCEMainForm.actOpenFileExecute(Sender: TObject); procedure TCEMainForm.actFileOpenExecute(Sender: TObject);
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
// //
@ -377,12 +396,12 @@ begin
end; end;
end; end;
procedure TCEMainForm.actNewFileExecute(Sender: TObject); procedure TCEMainForm.actFileNewExecute(Sender: TObject);
begin begin
newFile; newFile;
end; end;
procedure TCEMainForm.actNewRunnableExecute(Sender: TObject); procedure TCEMainForm.actFileNewRunExecute(Sender: TObject);
begin begin
newFile; newFile;
fEditWidg.currentEditor.Text := fEditWidg.currentEditor.Text :=
@ -398,7 +417,7 @@ begin
'}' + #13#10; '}' + #13#10;
end; end;
procedure TCEMainForm.actSaveFileAsExecute(Sender: TObject); procedure TCEMainForm.actFileSaveAsExecute(Sender: TObject);
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
if fEditWidg.editorIndex < 0 then exit; if fEditWidg.editorIndex < 0 then exit;
@ -414,7 +433,7 @@ begin
end; end;
end; end;
procedure TCEMainForm.actSaveFileExecute(Sender: TObject); procedure TCEMainForm.actFileSaveExecute(Sender: TObject);
var var
str: string; str: string;
begin begin
@ -423,10 +442,10 @@ begin
// //
str := fEditWidg.editor[fEditWidg.editorIndex].fileName; str := fEditWidg.editor[fEditWidg.editorIndex].fileName;
if fileExists(str) then saveFile(fEditWidg.editorIndex) if fileExists(str) then saveFile(fEditWidg.editorIndex)
else actSaveFileAs.Execute; else actFileSaveAs.Execute;
end; end;
procedure TCEMainForm.actAddCurrToProjExecute(Sender: TObject); procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject);
var var
str: string; str: string;
begin begin
@ -437,6 +456,18 @@ begin
fProject.addSource(str); fProject.addSource(str);
end; 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); procedure TCEMainForm.FormDropFiles(Sender: TObject;const FileNames: array of String);
var var
fname: string; fname: string;
@ -447,7 +478,7 @@ end;
{$ENDREGION} {$ENDREGION}
{$REGION edit ******************************************************************} {$REGION edit ******************************************************************}
procedure TCEMainForm.actCopyExecute(Sender: TObject); procedure TCEMainForm.actEdCopyExecute(Sender: TObject);
var var
curr: TCESynMemo; curr: TCESynMemo;
begin begin
@ -455,7 +486,7 @@ begin
if assigned(curr) then curr.CopyToClipboard; if assigned(curr) then curr.CopyToClipboard;
end; end;
procedure TCEMainForm.actCutExecute(Sender: TObject); procedure TCEMainForm.actEdCutExecute(Sender: TObject);
var var
curr: TCESynMemo; curr: TCESynMemo;
begin begin
@ -463,7 +494,7 @@ begin
if assigned(curr) then curr.CutToClipboard; if assigned(curr) then curr.CutToClipboard;
end; end;
procedure TCEMainForm.actPasteExecute(Sender: TObject); procedure TCEMainForm.actEdPasteExecute(Sender: TObject);
var var
curr: TCESynMemo; curr: TCESynMemo;
begin begin
@ -471,7 +502,7 @@ begin
if assigned(curr) then curr.PasteFromClipboard; if assigned(curr) then curr.PasteFromClipboard;
end; end;
procedure TCEMainForm.actUndoExecute(Sender: TObject); procedure TCEMainForm.actEdUndoExecute(Sender: TObject);
var var
curr: TCESynMemo; curr: TCESynMemo;
begin begin
@ -479,7 +510,7 @@ begin
if assigned(curr) then curr.Undo; if assigned(curr) then curr.Undo;
end; end;
procedure TCEMainForm.actRedoExecute(Sender: TObject); procedure TCEMainForm.actEdRedoExecute(Sender: TObject);
var var
curr: TCESynMemo; curr: TCESynMemo;
begin begin
@ -513,17 +544,17 @@ end;
{$REGION run ******************************************************************} {$REGION run ******************************************************************}
procedure TCEMainForm.ProcessOutputToMsg(const aProcess: TProcess); procedure TCEMainForm.ProcessOutputToMsg(const aProcess: TProcess);
const
ioBuffSz = 2048;
var var
str: TMemoryStream; str: TMemoryStream;
lns: TStringList; lns: TStringList;
readCnt: LongInt; readCnt: LongInt;
readSz: LongInt; readSz: LongInt;
ioBuffSz: LongInt;
msg: string; msg: string;
begin begin
If not (poUsePipes in aProcess.Options) then exit; If not (poUsePipes in aProcess.Options) then exit;
// //
ioBuffSz := aProcess.PipeBufferSize;
str := TMemorystream.Create; str := TMemorystream.Create;
lns := TStringList.Create; lns := TStringList.Create;
readSz := 0; readSz := 0;
@ -541,6 +572,7 @@ begin
finally finally
str.Free; str.Free;
lns.Free; lns.Free;
fMesgWidg.scrollToBack;
end; end;
end; end;
@ -553,16 +585,19 @@ begin
olddir := ''; olddir := '';
dmdproc := TProcess.Create(nil); dmdproc := TProcess.Create(nil);
runproc := TProcess.Create(nil); runproc := TProcess.Create(nil);
getDir(0,olddir); getDir(0, olddir);
try try
fMesgWidg.addCeInf( 'compiling ' + fEditWidg.editor[edIndex].fileName );
temppath := GetTempDir(false); temppath := GetTempDir(false);
chDir(temppath); chDir(temppath);
{$IFDEF DEBUG}{$WARNINGS OFF}{$HINTS OFF}{$ENDIF} {$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} {$IFDEF DEBUG}{$WARNINGS ON}{$HINTS ON}{$ENDIF}
fEditWidg.editor[edIndex].Lines.SaveToFile(fname + '.d'); fEditWidg.editor[edIndex].Lines.SaveToFile(fname + '.d');
dmdproc.Options:= [poWaitOnExit,poStdErrToOutput,poUsePipes]; dmdproc.Options:= [poWaitOnExit, poStdErrToOutput, poUsePipes];
dmdproc.Executable:= 'dmd'; dmdproc.Executable:= 'dmd';
dmdproc.Parameters.Text := '"'+ fname +'.d"'; dmdproc.Parameters.Text := '"'+ fname +'.d"';
try try
@ -574,7 +609,11 @@ begin
if dmdProc.ExitStatus = 0 then if dmdProc.ExitStatus = 0 then
begin begin
runproc.Options:= [poWaitOnExit,poStderrToOutPut,poUsePipes];
fMesgWidg.addCeInf( fEditWidg.editor[edIndex].fileName
+ ' successfully compiled' );
runproc.Options:= [poWaitOnExit, poStderrToOutPut, poUsePipes];
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
runproc.Executable := fname + '.exe'; runproc.Executable := fname + '.exe';
runproc.Parameters.Text := runArgs; runproc.Parameters.Text := runArgs;
@ -590,7 +629,10 @@ begin
DeleteFile(fname); DeleteFile(fname);
DeleteFile(fname + '.o'); DeleteFile(fname + '.o');
{$ENDIF} {$ENDIF}
end; end
else
fMesgWidg.addCeErr( fEditWidg.editor[edIndex].fileName
+ ' has not been compiled' );
finally finally
dmdproc.Free; dmdproc.Free;
@ -603,18 +645,39 @@ procedure TCEMainForm.compileProject(const aProject: TCEProject);
var var
dmdproc: TProcess; dmdproc: TProcess;
olddir, prjpath: string; olddir, prjpath: string;
const
// option -v causes an hang if poWaitOnExit is included
procopts: array[boolean] of TProcessOptions = (
[poWaitOnExit, poStdErrToOutput, poUsePipes],
[poStdErrToOutput, poUsePipes]
);
begin begin
olddir := '';
dmdproc := TProcess.Create(nil); dmdproc := TProcess.Create(nil);
getDir(0,olddir); getDir(0, olddir);
try try
fMesgWidg.addCeInf( 'compiling ' + aProject.fileName );
prjpath := extractFilePath(aProject.fileName); prjpath := extractFilePath(aProject.fileName);
if directoryExists(prjpath) then chDir(prjpath); if directoryExists(prjpath) then chDir(prjpath);
dmdproc.Options:= [poStdErrToOutput,poUsePipes];
dmdproc.Options :=
procopts[aProject.currentConfiguration.messagesOptions.verbose];
dmdproc.Executable := 'dmd'; dmdproc.Executable := 'dmd';
dmdproc.Parameters.Text := aProject.getOpts; dmdproc.Parameters.Text := aProject.getOpts;
dmdproc.Execute; try
ProcessOutputToMsg(dmdproc); 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 finally
dmdproc.Free; dmdproc.Free;
@ -628,7 +691,7 @@ begin
executable then exit; executable then exit;
end; end;
procedure TCEMainForm.actCompAndRunFileExecute(Sender: TObject); procedure TCEMainForm.actFileCompAndRunExecute(Sender: TObject);
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
if fEditWidg.editorIndex < 0 then exit; if fEditWidg.editorIndex < 0 then exit;
@ -636,7 +699,7 @@ begin
compileAndRunFile(fEditWidg.editorIndex); compileAndRunFile(fEditWidg.editorIndex);
end; end;
procedure TCEMainForm.ActCompAndRunFileWithArgsExecute(Sender: TObject); procedure TCEMainForm.ActFileCompAndRunWithArgsExecute(Sender: TObject);
var var
runargs: string; runargs: string;
begin begin
@ -648,7 +711,7 @@ begin
runargs) then compileAndRunFile(fEditWidg.editorIndex, runargs); runargs) then compileAndRunFile(fEditWidg.editorIndex, runargs);
end; end;
procedure TCEMainForm.actCompileProjExecute(Sender: TObject); procedure TCEMainForm.actProjCompileExecute(Sender: TObject);
begin begin
compileProject(fProject); compileProject(fProject);
end; end;
@ -665,28 +728,30 @@ end;
{$REGION project ***************************************************************} {$REGION project ***************************************************************}
procedure TCEMainForm.projChange(sender: TObject); procedure TCEMainForm.projChange(sender: TObject);
var var
i: NativeInt; widg: TCEWidget;
begin begin
for i:= 0 to WidgetList.Count-1 do for widg in WidgetList do
widgetList.widget[i].projChange(fProject); widg.projChange(fProject);
end;
procedure TCEMainForm.closeProj;
var
widg: TCEWidget;
begin
for widg in WidgetList do widg.projClose(fProject);
fProject.Free;
fProject := nil;
end; end;
procedure TCEMainForm.newProj; procedure TCEMainForm.newProj;
var var
// cf. with ce_projconf, fProject is hook widg: TCEWidget;
// ICEProjectMonitor would recquire beforeProjChanged-), afterProjChage(), ...
old: TCEProject;
begin begin
old := fProject;
fProject := nil;
projChange(nil);
//
old.Free;
old := nil;
//
fProject := TCEProject.Create(self); fProject := TCEProject.Create(self);
for widg in WidgetList do widg.projNew(fProject);
fProject.onChange := @projChange; fProject.onChange := @projChange;
projChange(nil); fProject.beforeChanged;
fProject.afterChanged;
end; end;
procedure TCEMainForm.saveProj; procedure TCEMainForm.saveProj;
@ -702,17 +767,21 @@ end;
procedure TCEMainForm.openProj(const aFilename: string); procedure TCEMainForm.openProj(const aFilename: string);
begin begin
closeProj;
newProj; newProj;
fProject.beforeChanged;
fProject.fileName := aFilename; fProject.fileName := aFilename;
loadCompFromTxtFile(fProject, aFilename); loadCompFromTxtFile(fProject, aFilename);
fProject.afterChanged;
end; end;
procedure TCEMainForm.closeProj; procedure TCEMainForm.actProjNewExecute(Sender: TObject);
begin begin
closeProj;
newProj; newProj;
end; end;
procedure TCEMainForm.actNewProjExecute(Sender: TObject); procedure TCEMainForm.actProjCloseExecute(Sender: TObject);
begin begin
closeProj; closeProj;
end; end;
@ -723,7 +792,7 @@ begin
fProject.addSource(aFilename); fProject.addSource(aFilename);
end; end;
procedure TCEMainForm.actSaveProjAsExecute(Sender: TObject); procedure TCEMainForm.actProjSaveAsExecute(Sender: TObject);
begin begin
with TSaveDialog.Create(nil) do with TSaveDialog.Create(nil) do
try try
@ -733,13 +802,13 @@ begin
end; end;
end; end;
procedure TCEMainForm.actSaveProjExecute(Sender: TObject); procedure TCEMainForm.actProjSaveExecute(Sender: TObject);
begin begin
if fProject.fileName <> '' then saveProj if fProject.fileName <> '' then saveProj
else actSaveProjAs.Execute; else actProjSaveAs.Execute;
end; end;
procedure TCEMainForm.actOpenProjExecute(Sender: TObject); procedure TCEMainForm.actProjOpenExecute(Sender: TObject);
begin begin
with TOpenDialog.Create(nil) do with TOpenDialog.Create(nil) do
try try

View File

@ -1,115 +1,84 @@
inherited CEMessagesWidget: TCEMessagesWidget inherited CEMessagesWidget: TCEMessagesWidget
Left = 1247 Left = 1168
Height = 85 Height = 220
Top = 463 Top = 463
Width = 658 Width = 737
Caption = 'MessagesWidget' Caption = 'MessagesWidget'
ClientHeight = 85 ClientHeight = 220
ClientWidth = 658 ClientWidth = 737
inherited Back: TPanel inherited Back: TPanel
Height = 85 Height = 220
Width = 658 Width = 737
ClientHeight = 85 ClientHeight = 220
ClientWidth = 658 ClientWidth = 737
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 59 Height = 194
Width = 658 Width = 737
HorzScrollBar.Page = 637 HorzScrollBar.Page = 733
VertScrollBar.Page = 55 VertScrollBar.Page = 190
ClientHeight = 55 ClientHeight = 190
ClientWidth = 637 ClientWidth = 733
object List: TListView[0] object List: TListView[0]
Left = 2 Left = 2
Height = 150 Height = 186
Top = 2 Top = 2
Width = 633 Width = 729
Align = alClient Align = alClient
AutoSort = False AutoSort = False
AutoWidthLastColumn = True AutoWidthLastColumn = True
BorderSpacing.Around = 2 BorderSpacing.Around = 2
Columns = < Columns = <
item item
Width = 629 Width = 725
end> end>
GridLines = True HideSelection = False
IconOptions.Arrangement = iaLeft
ReadOnly = True ReadOnly = True
RowSelect = True RowSelect = True
ShowColumnHeaders = False
SmallImages = imgList
TabOrder = 0 TabOrder = 0
ViewStyle = vsReport ViewStyle = vsReport
end end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 658 Width = 737
end end
end end
object imgList: TImageList[2] object imgList: TImageList[2]
Bitmap = { Bitmap = {
4C69030000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 4C69050000001000000010000000CF986200D1996200D1996234D0965DBCCF94
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 5BFFCE945AFFCE935AFFCE935AFFCE935AFFCE935AFFCE945AFFCF945BFFD096
FF00FFFFFF00FFFFFF00FFFFFF003B85CC003B85CC003B85CC003B85CC003B85 5DBCD1996234D1996200CF986200CF976100CF975E5AD09861FFF0D3B5FFFFF4
CC003B85CC003983CA213384CDFF3384CDFF3983CA213B85CC003B85CC003B85 E4FFFFFBEDFFFFFAEDFFFFFAEDFFFFFAEDFFFFFAEDFFFFFBEDFFFFF4E4FFF0D3
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85 B5FFD09861FFCF975E5ACF976100CE955F34CE9760FFFAE6D0FFFFF4E3FFFFE6
CC003983CB00337EC7CF84C3F1FF84C3F1FF337EC7CF3983CB003B85CC003B85 C4FFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE2BDFFFFE6C4FFFFF4
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003A84 E3FFFAE6D0FFCE9760FFCE955F34C78F57BFEED1B1FFFFF4E1FFFFE1B9FFFFDF
CB003580CA6D5398D7FFC1F0FFFFC1F0FFFF5398D7FF3580CA6D3A84CB003B85 B6FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB7FFFFDFB6FFFFE1
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003882 B9FFFFF4E1FFEED1B1FFC78F57BFC68E54FFFFF9E8FFFFE9CAFFFFE3BCFFFFE3
CA0A3A83CBFFB2E5FFFF9EC8DEFF9EC8DEFFB2E5FFFF3A83CBFF3882CA0A3B85 BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3BEFFFFE3
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003983CB00337E BCFFFFE9CAFFFFF9E8FFC68E54FFC38B50FFFFF7E4FFFFE8C9FFFFE5C2FFFFE5
C8CF86BEEAFFA4ECFFFF6C5D53FF6C5D53FFA4ECFFFF86BEEAFF337EC8CF3983 C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5C3FFFFE5
CB003B85CC003B85CC003B85CC003B85CC003B85CC003A84CC003580C9585797 C2FFFFE8C9FFFFF7E4FFC38B50FFC18A4FFFFFF8E4FFFFEACCFFFFE8C8FFFFE8
D5FFC6F3FFFF3ACAFFFF6C5B54FF6C5B54FF3ACAFFFFC6F3FFFF5797D5FF3580 C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8C8FFFFE8
C9583A84CC003B85CC003B85CC003B85CC003B85CC003882CA003C82C9FFC1E8 C8FFFFEACCFFFFF8E4FFC18A4FFFC0884FFFFFFCE6FFFFEED3FFFFEBCDFFFFEB
FDFF50CCFFFF27C5FFFF69554CFF69554CFF27C5FFFF50CCFFFFC1E8FDFF3C82 CDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEBCDFFFFEB
C9FF3882CA003B85CC003B85CC003B85CC003983CB00337EC8BB90BFE6FF6FD7 CDFFFFEED3FFFFFCE6FFC0884FFFB3814CC9EBD1AEFFFFF7E1FFFFF0D4FFFFEE
FFFF32C3FFFF34CBFFFF644B3FFF644B3FFF34CBFFFF32C3FFFF6FD7FFFF90BF D2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFEED2FFFFF0
E6FF337EC8BB3983CB003B85CC003A84CC003680C9445B97D4FF9EE8FFFF38C7 D4FFFFF7E1FFEBD1AEFFB3814CC97A593552C08C54FFF8E8CBFFFFF8E3FFFFF4
FFFF3DC8FFFF3DCFFFFF4BBCE9FF4BBCE9FF3DCFFFFF3DC8FFFF38C7FFFF9EE8 DAFFFFF2D8FFFFF1D7FFFFF2D9FFFFF3D9FFFFF3D9FFFFF3DAFFFFF4DDFFFFF8
FFFF5B97D4FF3680C9443A84CC003982CB003F82C9FFA3E0FAFF40CFFFFF44CE E3FFF8E8CBFFC08C54FF7A5935520000000A8B643B7BBE8A53FFEAD0AEFFFFF5
FFFF46CFFFFF44D6FFFF775C50FF775C50FF44D6FFFF46CFFFFF44CEFFFF40CF DEFFFFF7E1FFFFF6E1FFFFFAE5FFFFFDEAFFFFFEEBFFFFFFECFFFFF9E4FFEAD1
FFFFA3E0FAFF3F82C9FF3982CB003880C9947AB8E4FF52DBFFFF4BD5FFFF4DD5 AFFFBE8A53FF8B643B7B0000000AC28F570000000012664B2B5AA87741C1BC8A
FFFF4DD6FFFF4BDCFFFF67493FFF67493FFF4BDCFFFF4DD6FFFF4DD5FFFF4BD5 51FFFFFFEFFFFFFFF1FFCEA576FFB57E43FFB68046FFB68046FFB78247FFAC7C
FFFF52DBFFFF7AB8E4FF3880C9943B86CDFF55E3FFFF55E3FFFF56E1FFFF56E1 46C9694D2C5D00000012C28F5700C3905800C18D57000000000A66492845D2B0
FFFF56E2FFFF56E5FFFF55E9FFFF55E9FFFF56E5FFFF56E2FFFF56E1FFFF56E1 87FFFFFFFFFFD1B085FF9B6E3BA6000000330000003300000033000000330000
FFFF55E3FFFF55E3FFFF3B86CDFF3A82CAFF397FC8FF387DC7FF387CC7FF397C 00260000000AC08D5600C28F5700B7864E00B7874E00B7864D00B07E4698FFFB
C7FF397CC7FF387DC7FF387EC9FF387EC9FF387DC7FF397CC7FF397CC7FF387C E8FFD4B48CFF966B3A9A0000001DBD8B5400BD8B5400BD8B5400BD8B5400BD8B
C7FF387DC7FF397FC8FF3A82CAFF000000330000003300000033000000330000 5400BE8C5400C08D5600C28F5700B7864E00B7864E00B7864D00B5834BFFB482
0033000000330000003300000033000000330000003300000033000000330000 48FF7756306C0000001AB8874F00BD8B5400BD8B5400BD8B5400BD8B5400BD8B
0033000000330000003300000033FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 5400BE8C5400C08D5600C28F5700000000000000000000000000000000330000
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 00330000000E0000000000000000000000000000000000000000000000000000
FF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000000000000000 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
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
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D898 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D898
5223D4964D7DD2924CDBCD8C45F3CB8B41F3C98B40DBC78B407DC5873D23FFFF 5223D4964D7DD2924CDBCD8C45F3CB8B41F3C98B40DBC78B407DC5873D23FFFF
@ -141,6 +110,102 @@ inherited CEMessagesWidget: TCEMessagesWidget
35239453347D925234DB8A5034F3884F34F3895035DB8950357D84503623FFFF 35239453347D925234DB8A5034F3884F34F3895035DB8950357D84503623FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
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 FF00FFFFFF00FFFFFF00FFFFFF00
} }
end end

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
ExtCtrls, ComCtrls, ce_widget, ActnList; ExtCtrls, ComCtrls, ce_widget, ActnList, Menus;
type type
@ -23,7 +23,11 @@ type
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
// //
procedure scrollToBack;
procedure addMessage(const aMsg: string); 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 contextName: string; override;
function contextActionCount: integer; override; function contextActionCount: integer; override;
@ -34,6 +38,10 @@ type
TCEMessageItem = class(TListItem) TCEMessageItem = class(TListItem)
end; end;
TMessageKind = (msgkUnknown, msgkInfo, msgkHint, msgkWarn, msgkError);
function semanticMsgAna(const aMessg: string): TMessageKind;
implementation implementation
{$R *.lfm} {$R *.lfm}
@ -41,6 +49,8 @@ uses
ce_main; ce_main;
constructor TCEMessagesWidget.create(aOwner: TComponent); constructor TCEMessagesWidget.create(aOwner: TComponent);
var
itm: TMenuItem;
begin begin
inherited; inherited;
fID := 'ID_MSGS'; fID := 'ID_MSGS';
@ -51,6 +61,14 @@ begin
fActSaveMsg := TAction.Create(self); fActSaveMsg := TAction.Create(self);
fActSaveMsg.OnExecute := @actSaveMsgExecute; fActSaveMsg.OnExecute := @actSaveMsgExecute;
fActSaveMsg.caption := 'Save messages to...'; 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; end;
destructor TCEMessagesWidget.destroy; destructor TCEMessagesWidget.destroy;
@ -58,6 +76,45 @@ begin
inherited; inherited;
end; 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); procedure TCEMessagesWidget.addMessage(const aMsg: string);
var var
item: TCEMessageItem; item: TCEMessageItem;
@ -65,6 +122,7 @@ begin
item := TCEMessageItem.Create(List.Items); item := TCEMessageItem.Create(List.Items);
item.Caption := aMsg; item.Caption := aMsg;
item.Data := mainForm.EditWidget.currentEditor; item.Data := mainForm.EditWidget.currentEditor;
item.ImageIndex := Integer( semanticMsgAna(aMsg) );
List.Items.AddItem(item); List.Items.AddItem(item);
end; end;
@ -114,5 +172,44 @@ begin
end; end;
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. end.

View File

@ -1,35 +1,42 @@
inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Left = 1249 Left = 1170
Height = 377 Height = 278
Top = 587 Top = 722
Width = 546 Width = 445
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
Caption = 'ProjectConfigurationWidget' Caption = 'ProjectConfigurationWidget'
ClientHeight = 377 ClientHeight = 278
ClientWidth = 546 ClientWidth = 445
inherited Back: TPanel inherited Back: TPanel
Height = 377 Height = 278
Width = 546 Width = 445
ClientHeight = 377 ClientHeight = 278
ClientWidth = 546 ClientWidth = 445
DragKind = dkDrag
DragMode = dmManual
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 351 Height = 252
Width = 546 Width = 445
HorzScrollBar.Page = 542 HorzScrollBar.Page = 441
VertScrollBar.Page = 347 VertScrollBar.Page = 248
ClientHeight = 347 AutoSize = True
ClientWidth = 542 AutoScroll = True
ClientHeight = 248
ClientWidth = 441
object Tree: TTreeView[0] object Tree: TTreeView[0]
Left = 4 Left = 4
Height = 313 Height = 214
Top = 30 Top = 30
Width = 190 Width = 190
Align = alLeft Align = alLeft
AutoExpand = True
BorderSpacing.Around = 4 BorderSpacing.Around = 4
DefaultItemHeight = 18 DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoBoth ScrollBars = ssAutoBoth
ShowRoot = False ShowRoot = False
TabOrder = 0 TabOrder = 0
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoShowButtons, tvoShowLines, tvoToolTips, tvoThemedDraw] Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoToolTips, tvoThemedDraw]
Items.Data = { Items.Data = {
F9FFFFFF020003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000 F9FFFFFF020003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000
0000000700000047656E6572616CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500 0000000700000047656E6572616CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
@ -45,21 +52,22 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
end end
inline frameEditAll: TCEProjConfAll[1] inline frameEditAll: TCEProjConfAll[1]
Left = 198 Left = 198
Height = 317 Height = 218
Top = 28 Top = 28
Width = 342 Width = 241
Align = alClient Align = alClient
BorderSpacing.Around = 2 BorderSpacing.Around = 2
ClientHeight = 317 ClientHeight = 218
ClientWidth = 342 ClientWidth = 241
TabOrder = 1 TabOrder = 1
DesignLeft = 1406 DesignLeft = 1406
DesignTop = 572 DesignTop = 572
inherited Grid: TTIPropertyGrid inherited Grid: TTIPropertyGrid
Left = 2 Left = 2
Height = 313 Height = 214
Top = 2 Top = 2
Width = 338 Width = 237
BackgroundColor = clDefault
BorderSpacing.Around = 2 BorderSpacing.Around = 2
DefaultItemHeight = 22 DefaultItemHeight = 22
PreferredSplitterX = 150 PreferredSplitterX = 150
@ -70,18 +78,18 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Left = 2 Left = 2
Height = 24 Height = 24
Top = 2 Top = 2
Width = 538 Width = 437
Align = alTop Align = alTop
BorderSpacing.Around = 2 BorderSpacing.Around = 2
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 24 ClientHeight = 24
ClientWidth = 538 ClientWidth = 437
TabOrder = 2 TabOrder = 2
object selConf: TComboBox object selConf: TComboBox
Left = 0 Left = 0
Height = 23 Height = 23
Top = 1 Top = 1
Width = 297 Width = 346
Align = alClient Align = alClient
BorderSpacing.Top = 1 BorderSpacing.Top = 1
BorderSpacing.Right = 1 BorderSpacing.Right = 1
@ -90,30 +98,215 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0
end end
object btnAddConf: TButton object btnAddConf: TSpeedButton
Left = 298 Left = 347
Height = 24 Height = 24
Top = 0 Top = 0
Width = 120 Width = 30
Align = alRight 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 OnClick = btnAddConfClick
TabOrder = 1 ShowCaption = False
end end
object btnDelConf: TButton object btnDelConf: TSpeedButton
Left = 418 Left = 377
Height = 24 Height = 24
Top = 0 Top = 0
Width = 120 Width = 30
Align = alRight 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 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 end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 546 Width = 445
end end
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 end

View File

@ -6,47 +6,75 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 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 type
{ TCEProjectConfigurationWidget } { TCEProjectConfigurationWidget }
TCEProjectConfigurationWidget = class(TCEWidget) TCEProjectConfigurationWidget = class(TCEWidget)
btnAddConf: TButton; imgList: TImageList;
btnDelConf: TButton;
selConf: TComboBox; selConf: TComboBox;
frameEditAll: TCEProjConfAll; frameEditAll: TCEProjConfAll;
Panel1: TPanel; Panel1: TPanel;
btnAddConf: TSpeedButton;
btnDelConf: TSpeedButton;
btnCloneConf: TSpeedButton;
Tree: TTreeView; Tree: TTreeView;
procedure btnAddConfClick(Sender: TObject); procedure btnAddConfClick(Sender: TObject);
procedure btnDelConfClick(Sender: TObject); procedure btnDelConfClick(Sender: TObject);
procedure btnCloneCurrClick(Sender: TObject);
procedure selConfChange(Sender: TObject); procedure selConfChange(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private private
fProj: TCEProject; fProj: TCEProject;
protected protected
procedure updaterProc2; //override; procedure manualWidgetUpdate; override;
public public
procedure projNew(const aProject: TCEProject); override;
procedure projChange(const aProject: TCEProject); override; procedure projChange(const aProject: TCEProject); override;
procedure projClose(const aProject: TCEProject); override;
property project: TCEProject read fProj; property project: TCEProject read fProj;
end; end;
implementation implementation
{$R *.lfm} {$R *.lfm}
procedure TCEProjectConfigurationWidget.projNew(const aProject: TCEProject);
begin
beginManualWidgetUpdate;
fProj := aProject;
endManualWidgetUpdate;
end;
procedure TCEProjectConfigurationWidget.projChange(const aProject: TCEProject); procedure TCEProjectConfigurationWidget.projChange(const aProject: TCEProject);
begin begin
beginManualWidgetUpdate;
fProj := aProject; fProj := aProject;
updaterProc2; endManualWidgetUpdate;
end;
procedure TCEProjectConfigurationWidget.projClose(const aProject: TCEProject);
begin
frameEditAll.Grid.TIObject := nil;
frameEditAll.Grid.ItemIndex :=-1;
fProj := nil;
end; end;
procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject); procedure TCEProjectConfigurationWidget.selConfChange(Sender: TObject);
begin begin
if fUpdating then exit;
if fProj = nil then exit; if fProj = nil then exit;
if isManualUpdating then exit;
if selConf.ItemIndex = -1 then exit; if selConf.ItemIndex = -1 then exit;
// //
beginManualWidgetUpdate;
fProj.ConfigurationIndex := selConf.ItemIndex; fProj.ConfigurationIndex := selConf.ItemIndex;
updaterProc2; endManualWidgetUpdate;
end;
procedure TCEProjectConfigurationWidget.SpeedButton1Click(Sender: TObject);
begin
end; end;
procedure TCEProjectConfigurationWidget.btnAddConfClick(Sender: TObject); procedure TCEProjectConfigurationWidget.btnAddConfClick(Sender: TObject);
@ -56,10 +84,12 @@ var
begin begin
if fProj = nil then exit; if fProj = nil then exit;
// //
cfg := fProj.addConfiguration;
nme := ''; nme := '';
beginManualWidgetUpdate;
cfg := fProj.addConfiguration;
if InputQuery('Configuration name', '', nme) then cfg.name := nme; if InputQuery('Configuration name', '', nme) then cfg.name := nme;
fProj.ConfigurationIndex := cfg.Index; fProj.ConfigurationIndex := cfg.Index;
endManualWidgetUpdate;
end; end;
procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject); procedure TCEProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
@ -67,40 +97,44 @@ begin
if fProj = nil then exit; if fProj = nil then exit;
if fProj.OptionsCollection.Count = 1 then exit; if fProj.OptionsCollection.Count = 1 then exit;
// //
beginManualWidgetUpdate;
frameEditAll.Grid.TIObject := nil; frameEditAll.Grid.TIObject := nil;
frameEditAll.Grid.Clear; frameEditAll.Grid.Clear;
frameEditAll.Invalidate; frameEditAll.Invalidate;
fProj.OptionsCollection.Delete(selConf.ItemIndex); fProj.OptionsCollection.Delete(selConf.ItemIndex);
fProj.ConfigurationIndex := 0; fProj.ConfigurationIndex := 0;
updaterProc2; endManualWidgetUpdate;
end; 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 var
i: NativeInt; i: NativeInt;
obj: TPersistent;
begin begin
selConf.ItemIndex:= -1;
selConf.Clear; 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 for i:= 0 to fProj.OptionsCollection.Count-1 do
selConf.Items.Add(fProj.configuration[i].name); selConf.Items.Add(fProj.configuration[i].name);
selConf.ItemIndex := fProj.ConfigurationIndex; selConf.ItemIndex := fProj.ConfigurationIndex;
obj := fProj.configuration[fProj.ConfigurationIndex]; frameEditAll.Grid.TIObject :=
if frameEditAll.Grid.TIObject <> obj then fProj.configuration[fProj.ConfigurationIndex];
frameEditAll.Grid.TIObject := obj;
end; end;
end. end.

View File

@ -1,28 +1,28 @@
inherited CEProjectWidget: TCEProjectWidget inherited CEProjectWidget: TCEProjectWidget
Left = 1745 Left = 1691
Height = 336 Height = 336
Top = 89 Top = 89
Width = 163 Width = 217
Caption = 'ProjectWidget' Caption = 'ProjectWidget'
ClientHeight = 336 ClientHeight = 336
ClientWidth = 163 ClientWidth = 217
inherited Back: TPanel inherited Back: TPanel
Height = 336 Height = 336
Width = 163 Width = 217
ClientHeight = 336 ClientHeight = 336
ClientWidth = 163 ClientWidth = 217
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 310 Height = 310
Width = 163 Width = 217
HorzScrollBar.Page = 159 HorzScrollBar.Page = 213
VertScrollBar.Page = 306 VertScrollBar.Page = 306
ClientHeight = 306 ClientHeight = 306
ClientWidth = 159 ClientWidth = 213
object Tree: TTreeView[0] object Tree: TTreeView[0]
Left = 2 Left = 2
Height = 302 Height = 276
Top = 2 Top = 28
Width = 155 Width = 209
Align = alClient Align = alClient
AutoExpand = True AutoExpand = True
BorderSpacing.Around = 2 BorderSpacing.Around = 2
@ -39,9 +39,170 @@ inherited CEProjectWidget: TCEProjectWidget
FFFFFF0000000000000000000E000000436F6E66696775726174696F6E73 FFFFFF0000000000000000000E000000436F6E66696775726174696F6E73
} }
end 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 end
inherited Header: TPanel inherited Header: TPanel
Width = 163 Width = 217
end end
end end
object imgList: TImageList[2] object imgList: TImageList[2]

View File

@ -5,24 +5,33 @@ unit ce_project;
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics,
ComCtrls, ce_common, ce_widget; Dialogs, ExtCtrls, ComCtrls, Menus, Buttons, ce_common, ce_widget;
type type
{ TCEProjectWidget } { TCEProjectWidget }
TCEProjectWidget = class(TCEWidget) TCEProjectWidget = class(TCEWidget)
imgList: TImageList; imgList: TImageList;
Panel1: TPanel;
btnAddFile: TSpeedButton;
btnProjOpts: TSpeedButton;
btnAddFold: TSpeedButton;
Tree: TTreeView; Tree: TTreeView;
TreeFilterEdit1: TTreeFilterEdit;
procedure btnAddFileClick(Sender: TObject);
procedure btnAddFoldClick(Sender: TObject);
protected
procedure manualWidgetUpdate; override;
private private
fProject: TCEProject; fProject: TCEProject;
fFileNode, fConfNode: TTreeNode; fFileNode, fConfNode: TTreeNode;
procedure updateView;
procedure TreeDblClick(sender: TObject); procedure TreeDblClick(sender: TObject);
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override;
// //
procedure projNew(const aProject: TCEProject); override;
procedure projChange(const aProject: TCEProject); override; procedure projChange(const aProject: TCEProject); override;
procedure projClose(const aProject: TCEProject); override;
end; end;
implementation implementation
@ -40,15 +49,22 @@ begin
fConfNode := Tree.Items[1]; fConfNode := Tree.Items[1];
end; end;
destructor TCEProjectWidget.destroy; procedure TCEProjectWidget.projNew(const aProject: TCEProject);
begin begin
inherited; fProject := aProject;
manualWidgetUpdate;
end; end;
procedure TCEProjectWidget.projChange(const aProject: TCEProject); procedure TCEProjectWidget.projChange(const aProject: TCEProject);
begin begin
fProject := aProject; fProject := aProject;
updateView; manualWidgetUpdate;
end;
procedure TCEProjectWidget.projClose(const aProject: TCEProject);
begin
fProject := nil;
manualWidgetUpdate;
end; end;
procedure TCEProjectWidget.TreeDblClick(sender: TObject); procedure TCEProjectWidget.TreeDblClick(sender: TObject);
@ -74,11 +90,58 @@ begin
begin begin
i := Tree.Selected.Index; i := Tree.Selected.Index;
fProject.ConfigurationIndex := i; fProject.ConfigurationIndex := i;
updateView; manualWidgetUpdate;
end; end;
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 var
src, conf: string; src, conf: string;
itm: TTreeNode; itm: TTreeNode;

View File

@ -1,31 +1,33 @@
object CEWidget: TCEWidget object CEWidget: TCEWidget
Left = 1264 Left = 1538
Height = 327 Height = 121
Top = 448 Top = 735
Width = 320 Width = 320
BorderIcons = [biMinimize, biMaximize]
Caption = 'CEWidget' Caption = 'CEWidget'
ClientHeight = 0 ClientHeight = 121
ClientWidth = 0 ClientWidth = 320
LCLVersion = '1.2.2.0' LCLVersion = '1.2.2.0'
object Back: TPanel object Back: TPanel
Left = 0 Left = 0
Height = 327 Height = 121
Top = 0 Top = 0
Width = 320 Width = 320
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 327 ClientHeight = 121
ClientWidth = 320 ClientWidth = 320
FullRepaint = False FullRepaint = False
TabOrder = 0 TabOrder = 0
object Content: TScrollBox object Content: TScrollBox
Left = 0 Left = 0
Height = 301 Height = 95
Top = 26 Top = 26
Width = 320 Width = 320
HorzScrollBar.Page = 316 HorzScrollBar.Page = 316
VertScrollBar.Page = 297 VertScrollBar.Page = 86
Align = alClient Align = alClient
AutoScroll = False
TabOrder = 0 TabOrder = 0
end end
object Header: TPanel object Header: TPanel
@ -38,7 +40,6 @@ object CEWidget: TCEWidget
TabOrder = 1 TabOrder = 1
end end
end end
object Updater: TTimer object contextMenu: TPopupMenu
Interval = 50
end end
end end

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls,
ce_common, ActnList; ce_common, ActnList, Menus, syncobjs;
type type
@ -20,25 +20,39 @@ type
Content: TScrollBox; Content: TScrollBox;
Back: TPanel; Back: TPanel;
Header: TPanel; Header: TPanel;
Updater: TTimer; contextMenu: TPopupMenu;
private private
procedure updaterTimer(Sender: TObject); fAutoUpdater: TTimer;
fAutoUpdating: boolean;
fManuUpdating: boolean;
fWidgUpdateCount: NativeInt;
procedure autoUpdaterEvent(Sender: TObject);
protected protected
fID: string; fID: string;
fNeedUpdate: boolean; fNeedAutoUpdate: boolean;
fUpdating: boolean; fLocker: TCriticalSection;
procedure UpdaterProc; virtual; procedure autoWidgetUpdate; virtual;
procedure manualWidgetUpdate; virtual;
published published
property ID: string read fID write fID; property ID: string read fID write fID;
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
// //
procedure beginManualWidgetUpdate;
procedure endManualWidgetUpdate;
procedure forceManualWidgetUpdate;
//
procedure projNew(const aProject: TCEProject); virtual;
procedure projChange(const aProject: TCEProject); virtual; procedure projChange(const aProject: TCEProject); virtual;
procedure projClose(const aProject: TCEProject); virtual;
// //
function contextName: string; virtual; function contextName: string; virtual;
function contextActionCount: integer; virtual; function contextActionCount: integer; virtual;
function contextAction(index: integer): TAction; virtual; function contextAction(index: integer): TAction; virtual;
//
property isAutoUpdating: boolean read fAutoUpdating;
property isManualUpdating: boolean read fManuUpdating;
end; end;
(** (**
@ -72,27 +86,75 @@ constructor TCEWidget.create(aOwner: TComponent);
begin begin
inherited; inherited;
fID := 'ID_XXXX'; fID := 'ID_XXXX';
Updater.OnTimer := @updaterTimer; fAutoUpdater := TTimer.Create(self);
fAutoUpdater.Interval := 50;
fAutoUpdater.OnTimer := @autoUpdaterEvent;
fLocker := TCriticalSection.Create;
end; end;
destructor TCEWidget.destroy; destructor TCEWidget.destroy;
begin begin
fLocker.Leave;
fLocker.Free;
inherited; inherited;
end; end;
procedure TCEWidget.updaterTimer(Sender: TObject); procedure TCEWidget.beginManualWidgetUpdate;
begin begin
if not fNeedUpdate then exit; Inc(fWidgUpdateCount);
fUpdating := true; 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 try
UpdaterProc; //fLocker.Enter;
autoWidgetUpdate;
finally finally
fUpdating := false; //fLocker.Leave;
fNeedUpdate := false; fAutoUpdating := false;
fNeedAutoUpdate := false;
end; end;
end; end;
procedure TCEWidget.UpdaterProc; procedure TCEWidget.autoWidgetUpdate;
begin
end;
procedure TCEWidget.manualWidgetUpdate;
begin
end;
procedure TCEWidget.projNew(const aProject: TCEProject);
begin begin
end; end;
@ -100,6 +162,10 @@ procedure TCEWidget.projChange(const aProject: TCEProject);
begin begin
end; end;
procedure TCEWidget.projClose(const aProject: TCEProject);
begin
end;
function TCEWidget.contextName: string; function TCEWidget.contextName: string;
begin begin
result := ''; result := '';