1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2025-08-24 21:49:04 +02:00

Version 1.0 DEV 1.16b

Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Dennis07
2017-05-26 04:35:40 +02:00
parent b0dd4aab81
commit f0d57e3927
15 changed files with 113 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -42,7 +42,7 @@ type
TComponentManagerUpdateEvent = procedure(Sender: TObject) of object;
TParamDefinerUpdateEvent = procedure(Sender: TObject) of object;
TDiagramDrawValueEvent = procedure(Sender: TObject; Index: Integer) of object;
TDiagramCustomDrawValueEvent = procedure(Sender: TObject; Index: Integer) of object;
TDiagramCustomDrawValueEvent = procedure(Sender: TObject; Index: Integer; Rect: TRect) of object;
{ Hauptklassen }
@@ -512,7 +512,7 @@ type
property Visible: Boolean read FVIsible write SetVisible default True;
property ArtLine: Boolean read FArtLine write SetArtLine default False;
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsSingle;
property BorderWith: Integer read FBorderWidth write SetBorderWidth default 1;
property BorderWidth: Integer read FBorderWidth write SetBorderWidth default 1;
property BorderColor: TColor read FBorderColor write SetBorderColor default clNone;
end;
@@ -699,10 +699,15 @@ type
function ZeroHeight: Integer;
function ValueHeight(Value: Integer): Integer;
function HeightValue(Height: Integer): Integer;
function ValueLeft(Index: Integer): Integer;
function ValueWidth: Integer;
function ValueSpace: Integer;
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function ValueRect(Index: Integer): TRect; overload;
function ValueRect(Value: TDiagramValue): TRect; overload;
published
{ Published-Deklarationen }
{ Ereignisse }
@@ -2708,14 +2713,14 @@ begin
end;
dloCustom: for Index := 0 to Values.Count - 1 do
begin
if Assigned(OnCustomDrawValue) then
begin
OnCustomDrawValue(Self,Index,ValueRect(Index));
end;
if Assigned(OnDrawValue) then
begin
OnDrawValue(Self,Index);
end;
if Assigned(OnCustomDrawValue) then
begin
OnCustomDrawValue(Self,Index);
end;
end;
end;
if Scale.Values.Visible then
@@ -2875,22 +2880,63 @@ end;
procedure TDiagram.DrawValue(Index: Integer);
begin
with Canvas do
begin
end;
end;
procedure TDiagram.DrawColumn(Index: Integer);
begin
with Canvas do
begin
Pen.Width := (Values.Items[Index] as TDiagramValue).BorderWidth;
Pen.Color := (Values.Items[Index] as TDiagramValue).BorderColor;
Pen.Style := psSolid;
Brush.Color := (Values.Items[Index] as TDiagramValue).Color;
if (Values.Items[Index] as TDiagramValue).Value > 0 then
begin
Rectangle(ValueLeft(Index),ZeroHeight,ValueLeft(Index) + ValueWidth,ValueHeight((Values.Items[Index] as TDiagramValue).Value));
end else
begin
Rectangle(ValueLeft(Index),ZeroHeight,ValueLeft(Index) + ValueWidth,ValueHeight((Values.Items[Index] as TDiagramValue).Value) - 1);
end;
end;
end;
procedure TDiagram.DrawPoint(Index: Integer);
begin
with Canvas do
begin
Pen.Width := (Values.Items[Index] as TDiagramValue).BorderWidth;
Pen.Color := (Values.Items[Index] as TDiagramValue).BorderColor;
Pen.Style := psSolid;
Brush.Color := (Values.Items[Index] as TDiagramValue).Color;
if (Values.Items[Index] as TDiagramValue).Value > 0 then
begin
Ellipse(ValueLeft(Index),ValueHeight((Values.Items[Index] as TDiagramValue).Value) - ValueSpace div 2,ValueLeft(Index) + ValueWidth,ValueHeight((Values.Items[Index] as TDiagramValue).Value) + ValueSpace div 2);
end else
begin
Ellipse(ValueLeft(Index),ValueHeight((Values.Items[Index] as TDiagramValue).Value) - ValueSpace div 2,ValueLeft(Index) + ValueWidth,ValueHeight((Values.Items[Index] as TDiagramValue).Value) + ValueSpace div 2 - 1);
end;
end;
end;
procedure TDiagram.DrawLine(Index: Integer);
begin
with Canvas do
begin
Pen.Width := (Values.Items[Index] as TDiagramValue).BorderWidth;
Pen.Color := (Values.Items[Index] as TDiagramValue).Color;
Pen.Style := psSolid;
if Index = 0 then
begin
MoveTo(ZeroWidth + Padding.Left,ValueHeight((Values.Items[Index] as TDiagramValue).Value));
end else
begin
//MoveTo(
end;
end;
end;
function TDiagram.ZeroWidth: Integer;
@@ -2984,4 +3030,29 @@ begin
end;
end;
function TDiagram.ValueLeft(Index: Integer): Integer;
begin
Result := ZeroWidth + (Index + 1) * Padding.Left + Index * Padding.Right + Index * ValueWidth;
end;
function TDiagram.ValueWidth: Integer;
begin
Result := ValueSpace - Padding.Left - Padding.Right;
end;
function TDiagram.ValueSpace: Integer;
begin
Result := (Width - ZeroWidth) div Values.Count;
end;
function TDiagram.ValueRect(Index: Integer): TRect;
begin
Result := ValueRect(Values.Items[Index] as TDiagramValue);
end;
function TDiagram.ValueRect(Value: TDiagramValue): TRect;
begin
Result := Rect(ValueLeft(Value.Index),Padding.Top,ValueLeft(Value.Index) + ValueWidth,Height - Padding.Bottom);
end;
end.

View File

@@ -458,11 +458,15 @@ type
function SetToArray(Elements: TCharSet): TCharArray; overload;
function ArrayToSet(Elements: array of Byte): TByteSet; overload;
function ArrayToSet(Elements: array of Char): TCharSet; overload;
{ Sonstige }
{ Primzahlen-Bestimmung }
function Prime(X: ShortInt): Boolean; overload;
function Prime(X: Byte): Boolean; overload;
function Prime(X: Integer): Boolean; overload;
function Prime(X: Cardinal): Boolean; overload;
{ Sonstige }
function Congruent(A,B,Divisor: Integer): Boolean; overload;
function Congruent(A,B,Divisor: Extended): Boolean; overload;
procedure ExtEuclideanAlg(A,B: Integer; var D,S,T: Integer);
function StringToRange(const S: String; var Range: TRange): Boolean;
function ExprInStr(const S: String; Position: Integer): String;
function Factional(X: Byte): Cardinal;
@@ -1897,21 +1901,46 @@ var
Index: Integer;
begin
Result := Prime(Byte(X));
if (not Result) and (X > MAXBYTE) then
if (not Result) and (X > MAXBYTE) and Odd(X) then
begin
Index := 2;
Index := 3;
while Index <= X div Index do
begin
if X mod Index = 0 then
begin
Exit;
end;
Inc(Index);
Inc(Index,2);
end;
Result := True;
end;
end;
function Congruent(A,B,Divisor: Integer): Boolean;
begin
Result := (A mod Divisor) = (B mod Divisor);
end;
function Congruent(A,B,Divisor: Extended): Boolean;
begin
Result := FloatMod(A,Divisor) = FloatMod(B,Divisor);
end;
procedure ExtEuclideanAlg(A,B: Integer; var D,S,T: Integer);
{ Erweiterter Euklidischer Algorithmus }
begin
if B = 0 then
begin
D := A;
S := 1;
T := 0;
end else
begin
ExtEuclideanAlg(B,A mod B,D,T,S);
T := T - A div B * T;
end;
end;
function StringToRange(const S: String; var Range: TRange): Boolean;
var
Current: PChar;