Last change
on this file was 238, checked in by chronos, 16 months ago |
- Modified: Removed U prefix from unit names.
- Fixed: Memory leaks.
|
File size:
1.3 KB
|
Line | |
---|
1 | unit FormMessages;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TSelectEvent = procedure (Position: TPoint) of object;
|
---|
10 |
|
---|
11 | { TFormMessages }
|
---|
12 |
|
---|
13 | TFormMessages = class(TForm)
|
---|
14 | ListView1: TListView;
|
---|
15 | procedure ListView1Data(Sender: TObject; Item: TListItem);
|
---|
16 | procedure ListView1DblClick(Sender: TObject);
|
---|
17 | private
|
---|
18 | FOnSelect: TSelectEvent;
|
---|
19 | public
|
---|
20 | procedure Reload;
|
---|
21 | property OnSelect: TSelectEvent read FOnSelect write FOnSelect;
|
---|
22 | end;
|
---|
23 |
|
---|
24 |
|
---|
25 | implementation
|
---|
26 |
|
---|
27 | {$R *.lfm}
|
---|
28 |
|
---|
29 | uses
|
---|
30 | Core, Message, FormAssembler;
|
---|
31 |
|
---|
32 | { TFormMessages }
|
---|
33 |
|
---|
34 | procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem);
|
---|
35 | begin
|
---|
36 | with Core.Core.Assembler do
|
---|
37 | if (Item.Index >= 0) and (Item.Index < Message.Count) then
|
---|
38 | with TMessage(Message[Item.Index]) do begin
|
---|
39 | Item.Caption := IntToStr(Position.X) + ', ' + IntToStr(Position.Y);
|
---|
40 | Item.Data := Message[Item.Index];
|
---|
41 | Item.SubItems.Add(Text);
|
---|
42 | end;
|
---|
43 | end;
|
---|
44 |
|
---|
45 | procedure TFormMessages.ListView1DblClick(Sender: TObject);
|
---|
46 | begin
|
---|
47 | if Assigned(ListView1.Selected) then begin
|
---|
48 | if Assigned(FOnSelect) then
|
---|
49 | FOnSelect(TMessage(ListView1.Selected.Data).Position);
|
---|
50 | end;
|
---|
51 | end;
|
---|
52 |
|
---|
53 | procedure TFormMessages.Reload;
|
---|
54 | begin
|
---|
55 | ListView1.Items.Count := Core.Core.Assembler.Message.Count;
|
---|
56 | ListView1.Refresh;
|
---|
57 | end;
|
---|
58 |
|
---|
59 | end.
|
---|
60 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.