Back
{Display format form)
author: Nikolai Shokhirev )
created: (June 6, 2002)
last modified: August 8, 2003)
ŠNikolai V. Shokhirev, 2002-2003 }
{
Display format
  Width      - total length of a number for Real and Integer
  Decimals   - number of decimal digits for Real
  The numbers are displayed in the Scientific notation if Decimals < 0

  Default values for Width and Decimals can be set before call for ShowModal

  seW.Value := 14;
  seD.Value := -1;

  The modified value is saved in rVal (TFloat), iVal (TInt) or sVal (string).

  ArrayName, Idx1 and Idx2 are used only in the caption and may not be set at all

}

unit fDisplayVal;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Spin, uMatTypes;

type

  TDisplayType = (dtReal, dtInt, dtStr);

  TFDisplVal = class(TForm)
    LabelArray: TLabel;
    EditValue: TEdit;
    LabelW: TLabel;
    LabelD: TLabel;
    seW: TSpinEdit;
    seD: TSpinEdit;
    procedure seWChange(Sender: TObject);
    procedure seDChange(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    dt: TDisplayType;
    frVal: TFloat;
    fiVal: TInt;
    fsVal: string;
    fArrayName: string;
    fIdx1: TInt;
    fIdx2: TInt;
    function GetDisplType: TDisplayType;
    function GetiVal: TInt;
    function GetrVal: TFloat;
    function GetsVal: string;
    procedure SetDisplType(const Value: TDisplayType);
    procedure SetiVal(const Value: TInt);
    procedure SetrVal(const Value: TFloat);
    procedure SetsVal(const Value: string);
    function GetIdx1: TInt;
    function GetIdx2: TInt;
    procedure SetIdx1(const Value: TInt);
    procedure SetIdx2(const Value: TInt);
    function GetArrayName: string;
    procedure SetArrayName(const Value: string);
  public
    { Public declarations }
    procedure Display;
    procedure Save;
    property ArrayName: string read GetArrayName write SetArrayName;
    property Idx1: TInt read GetIdx1 write SetIdx1;
    property Idx2: TInt read GetIdx2 write SetIdx2;
    property DisplType: TDisplayType read GetDisplType write SetDisplType;
    property rVal: TFloat read GetrVal write SetrVal;
    property iVal: TInt read GetiVal write SetiVal;
    property sVal: string read GetsVal write SetsVal;
  end;

var
  FDisplVal: TFDisplVal;

implementation

uses
  uDisplay;

end.
Top

Back

Generated by Lore's Source to HTML Converter(http://www.newty.de/lsc/index.html)