This commit is contained in:
Basile Burg 2014-06-12 06:49:27 +02:00
parent d4f21ebded
commit d7f6c969b5
14 changed files with 258 additions and 89 deletions

View File

@ -50,6 +50,11 @@
<UseHeaptrc Value="True"/> <UseHeaptrc Value="True"/>
<UseExternalDbgSyms Value="True"/> <UseExternalDbgSyms Value="True"/>
</Debugging> </Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking> </Linking>
<Other> <Other>
<CompilerMessages> <CompilerMessages>
@ -75,7 +80,7 @@
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/> <SmartLinkUnit Value="True"/>
<Optimizations> <Optimizations>
<OptimizationLevel Value="3"/> <OptimizationLevel Value="2"/>
</Optimizations> </Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
@ -90,6 +95,9 @@
</Options> </Options>
</Linking> </Linking>
<Other> <Other>
<Verbosity>
<ShowHints Value="False"/>
</Verbosity>
<CompilerMessages> <CompilerMessages>
<MsgFileName Value=""/> <MsgFileName Value=""/>
</CompilerMessages> </CompilerMessages>
@ -133,12 +141,12 @@
<UnitName Value="ce_main"/> <UnitName Value="ce_main"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<Filename Value="..\src\ce_frame.pas"/> <Filename Value="..\src\ce_widget.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="CEWidget"/> <ComponentName Value="CEWidget"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="ce_frame"/> <UnitName Value="ce_widget"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="..\src\ce_common.pas"/> <Filename Value="..\src\ce_common.pas"/>

View File

@ -7,7 +7,7 @@ uses
cthreads, cthreads,
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, Interfaces,
Forms, lazcontrols, ce_main, ce_frame, ce_common, Forms, lazcontrols, ce_main, ce_widget, ce_common,
ce_messages, ce_editor, ce_project, ce_synmemo; ce_messages, ce_editor, ce_project, ce_synmemo;
{$R *.res} {$R *.res}

View File

@ -20,9 +20,17 @@ type
(** (**
* An implementer informs when a new document is added, focused or closed. * An implementer informs when a new document is added, focused or closed.
*) *)
ICEMultiDocEmitter = interface ICEMultiDocEmitter = interface(ICEMultiDocMonitor)
procedure docChange(const aNewIndex: integer); end;
procedure docClose(const aNewIndex: integer);
(**
* An implementer adds some menu actions when its context is valid.
* Called from mainForm to a widget when necessary.
*)
ICEContextualActions = interface
function contextName: string;
function contextActionCount: integer;
function contextAction(index: integer): TBasicAction;
end; end;
(***************************************************************************** (*****************************************************************************

View File

@ -314,7 +314,7 @@ begin
fCurrIAttrib.Foreground := clBlack; fCurrIAttrib.Foreground := clBlack;
fCurrIAttrib.FrameEdges:= sfeAround; fCurrIAttrib.FrameEdges:= sfeAround;
fCurrIAttrib.FrameColor:= clRed; fCurrIAttrib.FrameColor:= clGray;
fCommtAttrib.Style := [fsItalic]; fCommtAttrib.Style := [fsItalic];
fKeywdAttrib.Style := [fsBold]; fKeywdAttrib.Style := [fsBold];

View File

@ -1,28 +1,28 @@
inherited CEEditorWidget: TCEEditorWidget inherited CEEditorWidget: TCEEditorWidget
Left = 1248 Left = 1248
Height = 514 Height = 517
Top = 89 Top = 89
Width = 457 Width = 481
Caption = 'EditorWidget' Caption = 'EditorWidget'
ClientHeight = 514 ClientHeight = 517
ClientWidth = 457 ClientWidth = 481
inherited Back: TPanel inherited Back: TPanel
Height = 514 Height = 517
Width = 457 Width = 481
ClientHeight = 514 ClientHeight = 517
ClientWidth = 457 ClientWidth = 481
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 488 Height = 491
Width = 457 Width = 481
HorzScrollBar.Page = 453 HorzScrollBar.Page = 477
VertScrollBar.Page = 484 VertScrollBar.Page = 487
ClientHeight = 484 ClientHeight = 487
ClientWidth = 453 ClientWidth = 477
object PageControl: TExtendedNotebook[0] object PageControl: TExtendedNotebook[0]
Left = 2 Left = 2
Height = 480 Height = 483
Top = 2 Top = 2
Width = 449 Width = 473
Align = alClient Align = alClient
BorderSpacing.Around = 2 BorderSpacing.Around = 2
TabOrder = 0 TabOrder = 0
@ -30,13 +30,49 @@ inherited CEEditorWidget: TCEEditorWidget
end end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 457 Width = 481
end end
end end
object macRecorder: TSynMacroRecorder[1] object macRecorder: TSynMacroRecorder[1]
RecordShortCut = 24658 RecordShortCut = 24658
PlaybackShortCut = 24656 PlaybackShortCut = 24656
left = 8 end
top = 8 object imgList: TImageList[2]
left = 32
Bitmap = {
4C69010000001000000010000000CCCBC900CCCBC900CCCBC900CCCBC900CCCB
C900CCCBC900CCCBC900CDCCCA00D1D0CE00B0AFAD96817F7DFF7F7D7CFF7C7A
78FFA4A2A1977674720078767400CCCBC900CCCBC900CBCAC800CCCBC900CCCB
C900CCCBC900CCCBC900CECDCB00D2D2D0A77B7876FFEEEDECFFD5D3D2FFC3C2
C0FF73716EFF9B9997979C9A9800CCCBC900CCCBC900CDCCCA00D0CFCD00D2D1
CF00D2D1CF00D2D1CF00D3D2D097797775FFF5F5F4FF7E7B79FF787878876C6A
67FFB9B7B4FF6D6B6AFF706E6D00CCCBC900CDCCCA00D0CFCD007D7B7900817F
7D0083817E0082807E007F7D7BFFEEEDECFF7F7D7AFF00000033000000158D8D
8D98B2B0ADFF696865FF6E6C6900CCCBC900CDCCCA00D1D0CE00827F7D008381
7F0083818100838180007F7D7CFFD6D4D3FF797775FF6E6C69FF62605E005D5C
58FFA9A9A2FF5F625AFF64675E00CCCBC900CDCCCA00D2D1CF0083807E008583
810083817E00807E7C007D7B79FF777572FFF4F4F5FF575554FF605F5CFFA9A9
A2FFC78BDFFFC58CDCFFB47ED600CCCBC900CECDCB00D2D1CF00827F7D008482
800082807E007E7C7A007A7876FFF5F5F5FF565351FFB6B3B0FFABA7A4FF8687
81FFE3B3E3FFCC96C7FFAF7DCFFFCFCECC00CFCECC00D3D2D0967F7D7BFF807E
7CFF7F7D7BFF7A7876FFF6F5F5FF5B5552FF413B36FF6E655DFF8E8680FFECEA
E6FF898C83FFBA7AB6FF9869CAFFAEADAB00D4D3D1A7787675FFEEEDECFFD7D5
D5FF797775FFF6F6F6FF5B5652FF00000033000000332F80D1FFB2DEF3FF9289
80FFC1BFB8FF777C6EFF00000033B4B3B1AC7A7876FFEAEBEAFF848280FF7A78
76FFB9B8B7FF585553FF423B36FF3487D9003880CBFF47CAFFFF22ABFFFF84B1
D8FF7F7971FF000000339D6BCF007F7D7AFFEEEDECFF83817FFF000000336D6A
68FF595654FFB9B3AEFF76675AFF3680CEFF49CBFFFF2EACFFFF179DFFFF316B
A2FF000000337E8073009E6BCF007C7A78FFD5D3D2FF77777788A4A4A5000000
003375706CFFB4A69DFF2B7CCFFF43C8FFFF2CABFFFF1B9EFFFF3C6D9BFF0000
0033877F76007E8073009E6BCF00767472FFC1C1BEFF7F7D7BFFA3A4A474726F
6CFFA19993FF45B6FCFF8CE8FFFF81D5FFFF159BFFFF3D6D9BFF000000333471
AA00878076007E8073009E6BCF00A9A7A5AC6A6866FFB7B5B3FFB2B0AEFFAFAB
A8FF665F5BFF5C87A5FF81A8B7FF90D6FFFF376A9BFF000000333A73A6003472
AB00878076007E8073009E6BCF000000001E9F9C9BAC676564FF676564FF6461
60FF7D7874B1566C7EFF4A6784FF5291D9FF000000333B72A5003A73A7003472
AB00878076007E8073009E6BCF00000000000000001E00000033000000330000
00330000001F0000003300000033000000330000000000000000000000000000
0000000000000000000000000000
}
end end
end end

View File

@ -7,18 +7,19 @@ interface
uses uses
Classes, SysUtils, FileUtil, ExtendedNotebook, Forms, Controls, Graphics, Classes, SysUtils, FileUtil, ExtendedNotebook, Forms, Controls, Graphics,
SynEditKeyCmds, ComCtrls, SynEditHighlighter, SynEditHighlighterFoldBase, SynMacroRecorder, SynEditKeyCmds, ComCtrls, SynEditHighlighter, SynEditHighlighterFoldBase, SynMacroRecorder,
SynPluginSyncroEdit, SynEdit, Dialogs, ExtCtrls, ce_frame, ce_d2syn, ce_synmemo; SynPluginSyncroEdit, SynEdit, Dialogs, ExtCtrls, ce_widget, ce_d2syn, ce_synmemo;
type type
{ TCEWidgetEditor }
{ TCEEditorWidget } { TCEEditorWidget }
TCEEditorWidget = class(TCEWidget) TCEEditorWidget = class(TCEWidget)
imgList: TImageList;
PageControl: TExtendedNotebook; PageControl: TExtendedNotebook;
macRecorder: TSynMacroRecorder; macRecorder: TSynMacroRecorder;
procedure PageControlChange(Sender: TObject); procedure PageControlChange(Sender: TObject);
private private
// a TSynPluginSyncroEdit cannot be created from design(comp streaming err.)
fSyncEdit: TSynPluginSyncroEdit;
procedure focusedEditorChanged;
function getCurrentEditor: TCESynMemo; function getCurrentEditor: TCESynMemo;
function getEditor(index: NativeInt): TCESynMemo; function getEditor(index: NativeInt): TCESynMemo;
function getEditorCount: NativeInt; function getEditorCount: NativeInt;
@ -42,9 +43,19 @@ implementation
{$R *.lfm} {$R *.lfm}
constructor TCEEditorWidget.create(aOwner: TComponent); constructor TCEEditorWidget.create(aOwner: TComponent);
var
bmp: TBitmap;
begin begin
inherited; inherited;
fID := 'ID_EDIT'; fID := 'ID_EDIT';
fSyncEdit := TSynPluginSyncroEdit.Create(self);
bmp := TBitmap.Create;
try
imgList.GetBitmap(0,bmp);
fSyncEdit.GutterGlyph.Assign(bmp);
finally
bmp.Free;
end;
end; end;
destructor TCEEditorWidget.destroy; destructor TCEEditorWidget.destroy;
@ -73,10 +84,16 @@ begin
result := TCESynMemo(pageControl.Pages[index].Controls[0]); result := TCESynMemo(pageControl.Pages[index].Controls[0]);
end; end;
procedure TCEEditorWidget.focusedEditorChanged;
begin
macRecorder.Editor := getCurrentEditor;
fSyncEdit.Editor := getCurrentEditor;
end;
procedure TCEEditorWidget.PageControlChange(Sender: TObject); procedure TCEEditorWidget.PageControlChange(Sender: TObject);
begin begin
//http://bugs.freepascal.org/view.php?id=26320 //http://bugs.freepascal.org/view.php?id=26320
macRecorder.Editor := getCurrentEditor; focusedEditorChanged;
end; end;
procedure TCEEditorWidget.addEditor; procedure TCEEditorWidget.addEditor;
@ -94,7 +111,8 @@ begin
memo.OnKeyUp := @memoKeyDown; memo.OnKeyUp := @memoKeyDown;
memo.OnMouseDown := @memoMouseDown; memo.OnMouseDown := @memoMouseDown;
// //
macRecorder.Editor := memo; //http://bugs.freepascal.org/view.php?id=26320 //http://bugs.freepascal.org/view.php?id=26320
focusedEditorChanged;
end; end;
procedure TCEEditorWidget.identifierToD2Syn(const aMemo: TCESynMemo); procedure TCEEditorWidget.identifierToD2Syn(const aMemo: TCESynMemo);

View File

@ -12,6 +12,9 @@ object CEMainForm: TCEMainForm
object MenuItem5: TMenuItem object MenuItem5: TMenuItem
Action = actNewFile Action = actNewFile
end end
object MenuItem24: TMenuItem
Action = actNewRunnable
end
object MenuItem2: TMenuItem object MenuItem2: TMenuItem
Action = actOpenFile Action = actOpenFile
end end
@ -172,5 +175,13 @@ object CEMainForm: TCEMainForm
OnExecute = actMacPlayExecute OnExecute = actMacPlayExecute
ShortCut = 24656 ShortCut = 24656
end end
object actNewRunnable: TAction
Category = 'File'
Caption = 'New runnable module'
OnExecute = actNewRunnableExecute
end
end
object imgList: TImageList
left = 64
end end
end end

View File

@ -5,9 +5,9 @@ unit ce_main;
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, Classes, SysUtils, FileUtil, SynEditKeyCmds, Forms, Controls, Graphics,
ActnList, ce_common, ce_frame, ce_messages, ce_editor, ce_project, Dialogs, Menus, ActnList, ce_common, ce_widget, ce_messages, ce_editor,
ce_synmemo; ce_project, ce_synmemo, process;
type type
@ -19,6 +19,7 @@ type
ActCompAndRunFileWithArgs: TAction; ActCompAndRunFileWithArgs: TAction;
Action1: TAction; Action1: TAction;
actCut: TAction; actCut: TAction;
actNewRunnable: TAction;
actMacPlay: TAction; actMacPlay: TAction;
actMacStartStop: TAction; actMacStartStop: TAction;
actRedo: TAction; actRedo: TAction;
@ -32,6 +33,7 @@ type
Action3: TAction; Action3: TAction;
Action4: TAction; Action4: TAction;
Actions: TActionList; Actions: TActionList;
imgList: TImageList;
mainMenu: TMainMenu; mainMenu: TMainMenu;
MenuItem1: TMenuItem; MenuItem1: TMenuItem;
MenuItem10: TMenuItem; MenuItem10: TMenuItem;
@ -49,6 +51,7 @@ type
MenuItem21: TMenuItem; MenuItem21: TMenuItem;
MenuItem22: TMenuItem; MenuItem22: TMenuItem;
MenuItem23: TMenuItem; MenuItem23: TMenuItem;
MenuItem24: TMenuItem;
MenuItem3: TMenuItem; MenuItem3: TMenuItem;
MenuItem4: TMenuItem; MenuItem4: TMenuItem;
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
@ -64,6 +67,7 @@ type
procedure actMacPlayExecute(Sender: TObject); procedure actMacPlayExecute(Sender: TObject);
procedure actMacStartStopExecute(Sender: TObject); procedure actMacStartStopExecute(Sender: TObject);
procedure actNewFileExecute(Sender: TObject); procedure actNewFileExecute(Sender: TObject);
procedure actNewRunnableExecute(Sender: TObject);
procedure actOpenFileExecute(Sender: TObject); procedure actOpenFileExecute(Sender: TObject);
procedure actPasteExecute(Sender: TObject); procedure actPasteExecute(Sender: TObject);
procedure actRedoExecute(Sender: TObject); procedure actRedoExecute(Sender: TObject);
@ -77,6 +81,8 @@ type
fEditWidg: TCEEditorWidget; fEditWidg: TCEEditorWidget;
fProjWidg: TCEProjectWidget; fProjWidg: TCEProjectWidget;
// //
procedure ProcessOutputToMsg(const aProcess: TProcess);
//
procedure newFile; procedure newFile;
function findFile(const aFilename: string): NativeInt; function findFile(const aFilename: string): NativeInt;
procedure openFile(const aFilename: string); procedure openFile(const aFilename: string);
@ -87,6 +93,11 @@ type
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
//
property WidgetList: TCEWidgetList read fWidgList;
property MessageWidget: TCEMessagesWidget read fMesgWidg;
property EditWidget: TCEEditorWidget read fEditWidg;
property ProjectWidget: TCEProjectWidget read fProjWidg;
end; end;
var var
@ -96,7 +107,7 @@ implementation
{$R *.lfm} {$R *.lfm}
uses uses
process, SynMacroRecorder; SynMacroRecorder;
{$REGION std comp methods ******************************************************} {$REGION std comp methods ******************************************************}
constructor TCEMainForm.create(aOwner: TComponent); constructor TCEMainForm.create(aOwner: TComponent);
@ -279,6 +290,22 @@ begin
newFile; newFile;
end; end;
procedure TCEMainForm.actNewRunnableExecute(Sender: TObject);
begin
newFile;
fEditWidg.currentEditor.Text :=
'module runnable;' + #13#10 +
'' + #13#10 +
'import std.stdio;' + #13#10 +
'' + #13#10 +
'void main(string args[])' + #13#10 +
'{' + #13#10 +
' writeln("runnable module is just a `toy feature`");' + #13#10 +
' writeln;' + #13#10 +
' writeln("coedit just saves a temporar d module before compiling it and running it...");' + #13#10 +
'}' + #13#10;
end;
procedure TCEMainForm.actSaveFileAsExecute(Sender: TObject); procedure TCEMainForm.actSaveFileAsExecute(Sender: TObject);
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
@ -374,6 +401,38 @@ end;
{$ENDREGION} {$ENDREGION}
{$REGION run ******************************************************************} {$REGION run ******************************************************************}
procedure TCEMainForm.ProcessOutputToMsg(const aProcess: TProcess);
const
ioBuffSz = 2048;
var
str: TMemoryStream;
lns: TStringList;
readCnt: LongInt;
readSz: LongInt;
msg: string;
begin
If not (poUsePipes in aProcess.Options) then exit;
//
str := TMemorystream.Create;
lns := TStringList.Create;
readSz := 0;
try
while true do
begin
str.SetSize(readSz + ioBuffSz);
readCnt := aProcess.Output.Read((str.Memory + readSz)^, ioBuffSz);
if readCnt = 0 then break;
Inc(readSz, readCnt);
end;
Str.SetSize(readSz);
lns.LoadFromStream(Str);
for msg in lns do fMesgWidg.addMessage(msg);
finally
str.Free;
lns.Free;
end;
end;
procedure TCEMainForm.compileAndRunFile(const edIndex: NativeInt; const runArgs: string = ''); procedure TCEMainForm.compileAndRunFile(const edIndex: NativeInt; const runArgs: string = '');
var var
dmdproc: TProcess; dmdproc: TProcess;
@ -385,23 +444,23 @@ begin
try try
temppath := ''; temppath := '';
{$IFDEF DEBUG}{$WARNINGS OFF}{$HINTS OFF}{$ENDIF} {$IFDEF DEBUG}{$WARNINGS OFF}{$HINTS OFF}{$ENDIF}
fname := temppath + format('temp_%.8x',[NativeInt(@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]; dmdproc.Options:= [poWaitOnExit,poUsePipes,poStdErrToOutput];
dmdproc.Executable:= 'dmd'; dmdproc.Executable:= 'dmd';
dmdproc.Parameters.Text := '"'+ fname +'.d"'; dmdproc.Parameters.Text := '"'+ fname +'.d"';
try try
dmdproc.Execute; dmdproc.Execute;
ProcessOutputToMsg(dmdproc);
finally finally
DeleteFile(fname + '.d'); DeleteFile(fname + '.d');
end; end;
// + output to msgs widget
if dmdProc.ExitStatus = 0 then if dmdProc.ExitStatus = 0 then
begin begin
runproc.Options:= [poWaitOnExit,poStderrToOutPut]; 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;
@ -409,8 +468,7 @@ begin
runproc.Executable := fname; runproc.Executable := fname;
{$ENDIF} {$ENDIF}
runproc.Execute; runproc.Execute;
// + output to msgs widget ProcessOutputToMsg(runproc);
{$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
DeleteFile(fname + '.exe'); DeleteFile(fname + '.exe');
DeleteFile(fname + '.obj'); DeleteFile(fname + '.obj');

View File

@ -1,36 +1,46 @@
inherited CEMessagesWidget: TCEMessagesWidget inherited CEMessagesWidget: TCEMessagesWidget
Left = 1248 Left = 1249
Height = 139 Height = 186
Top = 640 Top = 643
Width = 652 Width = 656
Caption = 'MessagesWidget' Caption = 'MessagesWidget'
ClientHeight = 139 ClientHeight = 186
ClientWidth = 652 ClientWidth = 656
inherited Back: TPanel inherited Back: TPanel
Height = 139 Height = 186
Width = 652 Width = 656
ClientHeight = 139 ClientHeight = 186
ClientWidth = 652 ClientWidth = 656
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 113 Height = 160
Width = 652 Width = 656
HorzScrollBar.Page = 631 HorzScrollBar.Page = 652
VertScrollBar.Page = 109 VertScrollBar.Page = 156
ClientHeight = 109 ClientHeight = 156
ClientWidth = 631 ClientWidth = 652
object List: TListView[0] object List: TListView[0]
Left = 2 Left = 2
Height = 150 Height = 152
Top = 2 Top = 2
Width = 627 Width = 648
Align = alClient Align = alClient
AutoSort = False
AutoWidthLastColumn = True
BorderSpacing.Around = 2 BorderSpacing.Around = 2
Columns = <> Columns = <
item
Width = 644
end>
GridLines = True
IconOptions.Arrangement = iaLeft
ReadOnly = True
RowSelect = True
TabOrder = 0 TabOrder = 0
ViewStyle = vsReport
end end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 652 Width = 656
end end
end end
end end

View File

@ -5,13 +5,12 @@ unit ce_messages;
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
StdCtrls, ComCtrls, ce_frame, ce_common; ExtCtrls, ComCtrls, ce_widget, ce_common;
type type
{ TCEWidgetMessages } { TCEMessagesWidget }
TCEMessagesWidget = class(TCEWidget,ICEMultiDocMonitor) TCEMessagesWidget = class(TCEWidget,ICEMultiDocMonitor)
List: TListView; List: TListView;
private private
@ -19,13 +18,22 @@ type
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
// //
procedure addMessage(const aMsg: string);
//
procedure docChange(const aNewIndex: integer); procedure docChange(const aNewIndex: integer);
procedure docClose(const aNewIndex: integer); procedure docClose(const aNewIndex: integer);
end; end;
PTCEMessageItem = ^TCEMessageItem;
TCEMessageItem = class(TListItem)
end;
implementation implementation
{$R *.lfm} {$R *.lfm}
uses
ce_main;
constructor TCEMessagesWidget.create(aOwner: TComponent); constructor TCEMessagesWidget.create(aOwner: TComponent);
begin begin
inherited; inherited;
@ -37,6 +45,16 @@ begin
inherited; inherited;
end; end;
procedure TCEMessagesWidget.addMessage(const aMsg: string);
var
item: TCEMessageItem;
begin
item := TCEMessageItem.Create(List.Items);
item.Caption := aMsg;
item.Data := mainForm.EditWidget.currentEditor;
List.Items.AddItem(item);
end;
procedure TCEMessagesWidget.docChange(const aNewIndex: integer); procedure TCEMessagesWidget.docChange(const aNewIndex: integer);
begin begin
// can grow the list... // can grow the list...

View File

@ -1,28 +1,28 @@
inherited CEProjectWidget: TCEProjectWidget inherited CEProjectWidget: TCEProjectWidget
Left = 1721 Left = 1745
Height = 514 Height = 517
Top = 89 Top = 89
Width = 180 Width = 163
Caption = 'ProjectWidget' Caption = 'ProjectWidget'
ClientHeight = 514 ClientHeight = 517
ClientWidth = 180 ClientWidth = 163
inherited Back: TPanel inherited Back: TPanel
Height = 514 Height = 517
Width = 180 Width = 163
ClientHeight = 514 ClientHeight = 517
ClientWidth = 180 ClientWidth = 163
inherited Content: TScrollBox inherited Content: TScrollBox
Height = 488 Height = 491
Width = 180 Width = 163
HorzScrollBar.Page = 176 HorzScrollBar.Page = 159
VertScrollBar.Page = 484 VertScrollBar.Page = 487
ClientHeight = 484 ClientHeight = 487
ClientWidth = 176 ClientWidth = 159
object Tree: TTreeView[0] object Tree: TTreeView[0]
Left = 2 Left = 2
Height = 206 Height = 206
Top = 2 Top = 2
Width = 172 Width = 155
Align = alTop Align = alTop
BorderSpacing.Around = 2 BorderSpacing.Around = 2
DefaultItemHeight = 18 DefaultItemHeight = 18
@ -31,7 +31,7 @@ inherited CEProjectWidget: TCEProjectWidget
end end
end end
inherited Header: TPanel inherited Header: TPanel
Width = 180 Width = 163
end end
end end
end end

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
ComCtrls, ce_common, ce_frame; ComCtrls, ce_common, ce_widget;
type type

View File

@ -1,7 +1,7 @@
object CEWidget: TCEWidget object CEWidget: TCEWidget
Left = 1180 Left = 1337
Height = 327 Height = 327
Top = 523 Top = 424
Width = 320 Width = 320
Caption = 'CEWidget' Caption = 'CEWidget'
ClientHeight = 327 ClientHeight = 327
@ -16,6 +16,7 @@ object CEWidget: TCEWidget
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 327 ClientHeight = 327
ClientWidth = 320 ClientWidth = 320
FullRepaint = False
TabOrder = 0 TabOrder = 0
object Content: TScrollBox object Content: TScrollBox
Left = 0 Left = 0

View File

@ -1,11 +1,12 @@
unit ce_frame; unit ce_widget;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls, ce_common; Classes, SysUtils, FileUtil, DividerBevel, Forms, Controls, ExtCtrls,
ce_common;
type type