{Display utilities)
author: Nikolai V. Shokhirev )
created: (May 05, 2002)
last modified: June 15, 2004)
ŠNikolai V. Shokhirev, 2002-2004 }
unit uDisplay;
interface
uses
Math, uMatTypes, Sysutils, Classes, Grids, controls;
// function BoolToStr(b: boolean): string; - moved to uMatTypes
// function StrToBool(b: string): boolean; - moved to uMatTypes
function CopyFromTo(const s: string; i1, i2: integer): string;
function RealToStr(x: TFloat; Width, Decimals: TInt): string;
function StrToFloatDef(const S: string; Default: TFloat = 0.0): TFloat;
function IntgToStr(x, Width: TInt): string;
function IntgToStrPrefix(x: TInt; Prefix: string; Truncate: boolean = false): string;
{ output format: 1.1 + i * 2.2 }
function CplxToStr(x, y: TFloat; Width, Decimals: TInt): string;
{ input formats: 1, i, j, I, J, +1.1-i*2.2, 1.1+i*2.2, i-1, i 1 - 2 }
procedure StrToCplx(const s: string; var x, y: TFloat);
{ minimal decimals:
Minimal necessary number of decimals for labeling the interval [Xmin,Xmax] }
function MinDec(Xmin, Xmax: TFloat): TInt;
{ Compact output of real numbers in scientific notation
decimals = 0 example: 7e+12
decimals = 1 example: 1.3e+0
decimals = 2 example: 1.23e-1 }
function CompactFloatToStr(z: TFloat; decimals: TInt): string;
// function BoolToStr(Value: boolean): string;
// function StrToBool(Value: string): boolean;
// Alphabetic sort; does not move the first row
function SGSortA(List: TStringList; Index1, Index2: Integer): Integer;
// Date sort; does not move the first row
function SGSortD(List: TStringList; Index1, Index2: Integer): Integer;
// By Erwien Ekosaputra - erwieneko@bigfoot.com
procedure SortGrid (AGrid : TStringGrid; const SortIndex : integer;
Compare: TStringListSortCompare);
procedure FixStringGrid(const SG: TStringGrid; dh: TInt = 16; dw: TInt = 8);
procedure FixStringGrid2(const SG: TStringGrid);
procedure CenterControl(Control: TControl);
implementation
uses
StdCtrls, DateUtils;
end.
Top
Generated by Lore's Source to HTML Converter(http://www.newty.de/lsc/index.html)