home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kompon / d123456 / CHEMPLOT.ZIP / TPlot / Displace.pas < prev    next >
Pascal/Delphi Source File  |  2001-07-24  |  5KB  |  168 lines

  1. unit Displace;
  2.  
  3. {$I Plot.inc}
  4.  
  5. {-----------------------------------------------------------------------------
  6. The contents of this file are subject to the Q Public License
  7. ("QPL"); you may not use this file except in compliance
  8. with the QPL. You may obtain a copy of the QPL from 
  9. the file QPL.html in this distribution, derived from:
  10.  
  11. http://www.trolltech.com/products/download/freelicense/license.html
  12.  
  13. The QPL prohibits development of proprietary software. 
  14. There is a Professional Version of this software available for this. 
  15. Contact sales@chemware.hypermart.net for more information.
  16.  
  17. Software distributed under the QPL is distributed on an "AS IS" basis,
  18. WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the QPL for
  19. the specific language governing rights and limitations under the QPL.
  20.  
  21. The Original Code is: Axis.pas, released 12 September 2000.
  22.  
  23. The Initial Developer of the Original Code is Mat Ballard.
  24. Portions created by Mat Ballard are Copyright (C) 1999 Mat Ballard.
  25. Portions created by Microsoft are Copyright (C) 1998, 1999 Microsoft Corp.
  26. All Rights Reserved.
  27.  
  28. Contributor(s): Mat Ballard                 e-mail: mat.ballard@chemware.hypermart.net.
  29.  
  30. Last Modified: 02/25/2001
  31. Current Version: 2.00
  32.  
  33. You may retrieve the latest version of this file from:
  34.  
  35.         http://Chemware.hypermart.net/
  36.  
  37. This work was created with the Project JEDI VCL guidelines:
  38.  
  39.         http://www.delphi-jedi.org/Jedi:VCLVCL
  40.  
  41. in mind. 
  42.  
  43. Purpose:
  44. To facilitate user setting of the displacement of a series.
  45.  
  46. Known Issues:
  47. -----------------------------------------------------------------------------}
  48.  
  49. interface
  50.  
  51. uses
  52.   Classes, SysUtils,
  53. {$IFDEF WINDOWS}
  54.   WinTypes, WinProcs,
  55.   Buttons, Controls, Forms, Graphics, StdCtrls, 
  56. {$ENDIF}
  57. {$IFDEF WIN32}
  58.   Windows,
  59.   Buttons, Controls, Forms, Graphics, StdCtrls,
  60. {$ENDIF}
  61. {$IFDEF LINUX}
  62.   QT,
  63.   QButtons, QControls, QForms, QGraphics, QStdCtrls,
  64. {$ENDIF}
  65.   Misc, NEdit, Plotdefs;
  66.  
  67. type
  68.   TDisplacementForm = class(TForm)
  69.     CancelBitBtn: TBitBtn;
  70.     OKBitBtn: TBitBtn;
  71.     SeriesLabel: TLabel;
  72.     XLabel: TLabel;
  73.     YLabel: TLabel;
  74.     DeltaXNEdit: TNEdit;
  75.     DeltaYNEdit: TNEdit;
  76.     ApplyBitBtn: TBitBtn;
  77.     HelpBitBtn: TBitBtn;
  78.     procedure FormCreate(Sender: TObject);
  79.     procedure ApplyBitBtnClick(Sender: TObject);
  80.   private
  81.     { Private declarations }
  82.   public
  83.     TheSeries: TObject;
  84.  
  85. {$IFNDEF LANG_ENGLISH}
  86.     procedure DoCaptionsFromResource;
  87. {$ENDIF}
  88.     procedure DoHintsFromResource;
  89.   end;
  90.  
  91. var
  92.   DisplacementForm: TDisplacementForm;
  93.  
  94. implementation
  95.  
  96. {$R *.dfm}
  97.  
  98. uses
  99.   Data;
  100.  
  101. {------------------------------------------------------------------------------
  102.     Procedure: TDisplaceForm.FormCreate
  103.   Description: standard FormCreate procedure
  104.        Author: Mat Ballard
  105.  Date created: 04/25/2000
  106. Date modified: 04/25/2000 by Mat Ballard
  107.       Purpose: sets the position
  108.  Known Issues:
  109.  ------------------------------------------------------------------------------}
  110. procedure TDisplacementForm.FormCreate(Sender: TObject);
  111. var
  112.   i: Integer;
  113. begin
  114. {$IFNDEF LANG_ENGLISH}
  115.   DoCaptionsFromResource;
  116. {$ENDIF}
  117.   DoHintsFromResource;
  118. {set all widths:}
  119.   for i := 0 to Self.ComponentCount - 1 do
  120.     TControl(Self.Components[i]).Width := 97;
  121.   SeriesLabel.AutoSize := TRUE;
  122.   
  123.   SetDialogGeometry(Self, OKBitBtn, SeriesLabel.Left);
  124. end;
  125.  
  126. {------------------------------------------------------------------------------
  127.     Procedure: TDisplacementForm.DoCaptionsFromResource
  128.   Description: standard loading of labels from resources
  129.        Author: Mat Ballard
  130.  Date created: 06/25/2001
  131. Date modified: 06/25/2001 by Mat Ballard
  132.       Purpose: display in different languages
  133.  Known Issues:
  134.  ------------------------------------------------------------------------------}
  135. {$IFNDEF LANG_ENGLISH}
  136. procedure TDisplacementForm.DoCaptionsFromResource;
  137. begin
  138.   Self.Caption := sDisplacement;
  139.   XLabel.Caption := 'X (' + sPixels + ')';
  140.   YLabel.Caption := 'Y (' + sPixels + ')';
  141.   OKBitBtn.Caption := sOK;
  142.   CancelBitBtn.Caption := sCancel;
  143.   ApplyBitBtn.Caption := sApply;
  144. end;
  145. {$ENDIF}
  146.  
  147. {------------------------------------------------------------------------------
  148.     Procedure: TDisplacementForm.DoHintsFromResource
  149.   Description: standard loading of labels from resources
  150.        Author: Mat Ballard
  151.  Date created: 06/25/2001
  152. Date modified: 06/25/2001 by Mat Ballard
  153.       Purpose: display hints in different languages
  154.  Known Issues:
  155.  ------------------------------------------------------------------------------}
  156. procedure TDisplacementForm.DoHintsFromResource;
  157. begin
  158.   ApplyBitBtn.Hint := sApplyHint;
  159. end;
  160.  
  161. procedure TDisplacementForm.ApplyBitBtnClick(Sender: TObject);
  162. begin
  163.   TSeries(TheSeries).ApplyDisplacementChange(Self);
  164. end;
  165.  
  166.  
  167. end.
  168.