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