| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Fax.: +49 (0)351-8037944 =}
- {= 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: 13.04.98 - 18:24:10 $ =}
- {========================================================================}
- unit MMBmpLst;
- {$I COMPILER.INC}
- interface
- uses
- Windows,
- Messages,
- SysUtils,
- Classes,
- Controls,
- Graphics,
- Buttons,
- MMObj,
- MMUtils,
- MMString,
- MMObsrv;
- const
- CM_TRANSCOLORCHANGED = CM_BASE + 250;
- type
- {$IFNDEF DELPHI3}
- TTransparentMode = (tmAuto, tmFixed);
- {$ENDIF}
- {-- TMMBitmapList ---------------------------------------------------------}
- TMMBitmapList = class(TMMComponent)
- public
- constructor Create(aOwner: TComponent); override;
- destructor Destroy; override;
- procedure AddObserver(O: TMMObserver);
- procedure RemoveObserver(O: TMMObserver);
- procedure BeginUpdate;
- procedure EndUpdate;
- procedure Assign(Source: TPersistent); virtual;
- procedure LoadFromStream(Stream: TStream);
- procedure SaveToStream(Stream: TStream);
- procedure LoadFromFile(const FName: TFileName);
- procedure SaveToFile(const FName: TFileName);
- procedure AddListFromFile(const FName: TFileName);
- function First: TBitmap;
- function Last: TBitmap;
- procedure Clear;
- procedure AddFromFile(const FName: TFileName);
- procedure ExtractToFile(index: integer; const FName: TFileName);
- function Add(Item: TBitmap): integer;
- procedure AddList(List: TMMBitmapList);
- procedure Insert(Index: integer; Item: TBitmap);
- procedure Move(OldIndex, NewIndex: integer);
- procedure Exchange(Index1, Index2: integer);
- procedure Delete(index: integer);
- function Remove(Item: TBitmap): integer;
- function IndexOf(Item: TBitmap): integer;
- property Count: integer read GetCount;
- property Empty: Boolean read GetEmpty;
- property Items[Index: integer]: TBitmap read Get write Put; default;
- published
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
- end;
- {-- TMMCustomBitmapListControl --------------------------------------------}
- TMMCustomBitmapListControl = class(TMMGraphicControl)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function BitmapValid: Boolean;
- property Bitmap: TBitmap read GetBitmap;
- property BitmapList: TMMBitmapList read FBitmaps write SetBitmaps;
- property BitmapIndex: Integer read FBitmapIndex write SetBitmapIndex default -1;
- property TransparentColor: TColor read GetTransparentColor write SetTransparentColor stored TransparentColorStored;
- property TransparentMode: TTransparentMode read FTransMode write SetTransparentMode default tmAuto;
- end;
- TMMGlyphOrientation = (goHorizontal,goVertical);
- {-- TMMBitmapListImage ----------------------------------------------------}
- TMMBitmapListImage = class(TMMCustomBitmapListControl)
- public
- constructor Create(AOwner: TComponent); override;
- published
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDrag;
- property Align;
- property Enabled;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property BitmapList;
- property BitmapIndex;
- property AutoSize: Boolean read FAutoSize write SetAutoSize default False;
- property NumGlyphs: integer read FNumGlyphs write SetNumGlyphs default 1;
- property GlyphOrientation: TMMGlyphOrientation read FGlyphOrient write SetGlyphOrient default goHorizontal;
- property GlyphIndex: integer read FGlyphIndex write SetGlyphIndex default 0;
- end;
- implementation
|