| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 20.01.1998 - 18:00:00 $ =}
- {========================================================================}
- unit MMMrkLst;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinProcs,
- WinTypes,
- {$ENDIF}
- SysUtils,
- Classes,
- MMObj,
- MMMuldiv,
- MMUtils;
- type
- PMMMarker = ^TMMMarker;
- TMMMarker = record
- ID : Longint;
- NextID : Longint;
- Offset : Longint;
- Name : string[80];
- Comment: string[255];
- Fixed : Boolean;
- Visible: Boolean;
- Color : Longint;
- Flags : Longint;
- end;
- const
- { Maximum List size }
- {$IFDEF WIN32}
- MaxListSize = Maxint div (sizeOf(TMMMarker));
- {$ELSE}
- MaxListSize = 65520 div sizeOf(TMMMarker);
- {$ENDIF}
- type
- PMMMarkerArray = ^TMMMarkerArray;
- TMMMarkerArray = array[0..MaxListSize-1] of TMMMarker;
- TMMMarkerList = class(TMMObject)
- public
- constructor Create; virtual;
- destructor Destroy; override;
- procedure BeginUpdate;
- procedure EndUpdate;
- procedure Clear; virtual;
- procedure Assign(Source: TPersistent); virtual;
- procedure AddMarker(Marker: TMMMarker);
- procedure Insert(Index: Integer; Marker: TMMMarker);
- procedure Exchange(Index1, Index2: Integer);
- procedure Move(CurIndex, NewIndex: Integer);
- function Remove(Marker: PMMMarker): Integer;
- procedure Delete(Index: Integer);
- function IndexOf(Marker: PMMMarker): Integer;
- function FindFreeID: Longint;
- function LocateMarker(Offset: Longint): integer;
- function FindMarker(Offset: Longint): integer;
- function FindConnectedMarker(Index: integer): integer;
- function QueryMarker(Offset: Longint): Boolean;
- procedure Sort;
- function First: PMMMarker;
- function Last: PMMMarker;
- function Expand: TMMMarkerList;
- procedure SetOffset(Index: integer; Offset: Longint);
- procedure SetColor(Index: integer; Color: Longint);
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
- property Capacity: Integer read FCapacity write SetCapacity;
- property Count: Integer read FCount write SetCount;
- property Markers[Index: Integer]: PMMMarker read Get write Put; default;
- property List: PMMMarkerArray read FList;
- end;
- function CompareMarkers(Marker1,Marker2: PMMMarker): Boolean;
- implementation
|