home *** CD-ROM | disk | FTP | other *** search
- unit Plotimagelist;
-
- {$I Plot.inc}
-
- {-----------------------------------------------------------------------------
- The contents of this file are subject to the Q Public License
- ("QPL"); you may not use this file except in compliance
- with the QPL. You may obtain a copy of the QPL from
- the file QPL.html in this distribution, derived from:
-
- http://www.trolltech.com/products/download/freelicense/license.html
-
- The QPL prohibits development of proprietary software.
- There is a Professional Version of this software available for this.
- Contact sales@chemware.hypermart.net for more information.
-
- Software distributed under the QPL is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the QPL for
- the specific language governing rights and limitations under the QPL.
-
- The Original Code is: Plot.PAS, released 12 September 2000.
-
- The Initial Developer of the Original Code is Mat Ballard.
- Portions created by Mat Ballard are Copyright (C) 1999 Mat Ballard.
- Portions created by Microsoft are Copyright (C) 1998, 1999 Microsoft Corp.
- All Rights Reserved.
-
- Contributor(s): Mat Ballard e-mail: mat.ballard@chemware.hypermart.net.
-
- Last Modified: 03/28/2001
- Current Version: 2.00
-
- You may retrieve the latest version of this file from:
-
- http://Chemware.hypermart.net/
-
- This work was created with the Project JEDI VCL guidelines:
-
- http://www.delphi-jedi.org/Jedi:VCLVCL
-
- in mind.
-
- Known Issues:
- - while TImageList exists from Delphi 2 onwards, TMenu and TPopupMenu
- do not have an Images property until Delphi 4, and so this unit is
- not needed until Delphi 4.
- - currently barfs under Kylix: see below
-
- -----------------------------------------------------------------------------}
-
- interface
-
- uses
- Classes, SysUtils,
- {$IFDEF WINDOWS}
- Controls, Graphics
- {$ENDIF}
- {$IFDEF WIN32}
- Controls, Graphics
- {$ENDIF}
- {$IFDEF LINUX}
- QControls, QGraphics, QImgList
- {$ENDIF}
- ;
-
- const
- TPLOTIMAGELIST_VERSION = 200;
-
- IMAGE_BASE = 5000;
-
- {.$ IFDEF FUNCTIONS}
- NO_IMAGES = 58;
-
- type
- TPlotImageList = class(TImageList)
- private
- { Private declarations }
- protected
- { Protected declarations }
- public
- Constructor Create(AOwner: TComponent); override;
- published
- { Published declarations }
- end;
-
- implementation
- {$R Images32.res}
-
- Constructor TPlotImageList.Create(AOwner: TComponent);
- var
- i: Integer;
- TheBitmap: TBitmap;
- begin
- inherited Create(AOwner);
-
- Height := 16;
- Width := 16;
-
- {$IFDEF MSWINDOWS}
- AllocBy := NO_IMAGES + 1;
- {$ENDIF}
- TheBitmap := TBitmap.Create;
-
- for i := 1 to NO_IMAGES do
- begin
- {This is where it goes "image format not recognized" in Kylix:}
- TheBitmap.LoadFromResourceID(HInstance, IMAGE_BASE + i);
- AddMasked(TheBitmap, clOlive);
- end;
- TheBitmap.Free;
- end;
-
- end.
-