You've already forked lazarus-ccr
jvcllaz: Fix text background color error in JvPenEditor of JvChartDemo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7178 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -569,9 +569,9 @@ object JvChartDemoForm: TJvChartDemoForm
|
||||
ShortCut = 16455
|
||||
OnClick = ShowgapinLineChart1Click
|
||||
end
|
||||
object DateTimeAxisMode: TMenuItem
|
||||
object mnuDateTimeAxisMode: TMenuItem
|
||||
Caption = 'Date/Time Axis Mode'
|
||||
OnClick = DateTimeAxisModeClick
|
||||
OnClick = mnuDateTimeAxisModeClick
|
||||
end
|
||||
object MenuNegValueTest: TMenuItem
|
||||
AutoCheck = True
|
||||
|
@ -105,7 +105,7 @@ type
|
||||
ShowDataInListbox1: TMenuItem;
|
||||
N4: TMenuItem;
|
||||
LargeDataset576samples1: TMenuItem;
|
||||
DateTimeAxisMode: TMenuItem;
|
||||
mnuDateTimeAxisMode: TMenuItem;
|
||||
PrintOptions1: TMenuItem;
|
||||
PrinterSetupDialog1: TPrinterSetupDialog;
|
||||
PrintDialog1: TPrintDialog;
|
||||
@ -145,7 +145,7 @@ type
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
procedure ShowDataInListbox1Click(Sender: TObject);
|
||||
procedure LargeDataset576samples1Click(Sender: TObject);
|
||||
procedure DateTimeAxisModeClick(Sender: TObject);
|
||||
procedure mnuDateTimeAxisModeClick(Sender: TObject);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
@ -281,7 +281,7 @@ begin
|
||||
Fds := Fdt + (FGenerationIndex / 576);
|
||||
|
||||
// There are TWO ways to get an X Axis label plotted:
|
||||
if DateTimeAxisMode.Checked then
|
||||
if mnuDateTimeAxisMode.Checked then
|
||||
Chart.Data.Timestamp[I] := Fds // X legends generated by timestamps
|
||||
else
|
||||
// X Legends generated by user are used by default.
|
||||
@ -366,7 +366,7 @@ begin
|
||||
|
||||
Randomize;
|
||||
|
||||
Chart.Options.XAxisDateTimeMode := DateTimeAxisMode.Checked; // Use datetime timestamp labels, just Fer Instance.
|
||||
Chart.Options.XAxisDateTimeMode := mnuDateTimeAxisMode.Checked; // Use datetime timestamp labels, just Fer Instance.
|
||||
|
||||
if not Chart.Options.XAxisDateTimeMode then
|
||||
Chart.Options.XAxisLegendSkipBy := 5;
|
||||
@ -869,11 +869,11 @@ begin
|
||||
NewValues;
|
||||
end;
|
||||
|
||||
procedure TJvChartDemoForm.DateTimeAxisModeClick(Sender: TObject);
|
||||
procedure TJvChartDemoForm.mnuDateTimeAxisModeClick(Sender: TObject);
|
||||
begin
|
||||
DateTimeAxisMode.Checked := not DateTimeAxisMode.Checked;
|
||||
mnuDateTimeAxisMode.Checked := not mnuDateTimeAxisMode.Checked;
|
||||
if SpeedButtonTestMouseOver.Down then begin
|
||||
Chart.Options.XLegends.Clear;
|
||||
Chart.Options.XLegends.Clear;
|
||||
end else
|
||||
NewValues;
|
||||
end;
|
||||
@ -996,7 +996,6 @@ begin
|
||||
marker1.Caption :='Start';
|
||||
marker1.Visible := true;
|
||||
|
||||
|
||||
marker2 := Chart.AddFloatingMarker;
|
||||
marker2.XPosition := 66;
|
||||
marker2.YPosition := Chart.Data.Value[0,marker2.XPosition]; // Snap to Pen 1
|
||||
|
@ -8,6 +8,7 @@ object PenEditorForm: TPenEditorForm
|
||||
ClientWidth = 505
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.1.0.0'
|
||||
object btnPenColor: TButton
|
||||
Left = 232
|
||||
|
@ -6,8 +6,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
|
||||
Spin, ButtonPanel,Contnrs,
|
||||
JvChart, Types;
|
||||
ButtonPanel, Contnrs, Types,
|
||||
JvChart;
|
||||
|
||||
type
|
||||
TPenObj = class
|
||||
@ -236,6 +236,7 @@ begin
|
||||
end;
|
||||
|
||||
// Text
|
||||
lbPens.Canvas.Brush.Style := bsClear;
|
||||
lbPens.Canvas.TextOut(R.Right + 2, (R.Top + R.Bottom - lbPens.Canvas.TextHeight('Rg')) div 2, pen.Legend);
|
||||
|
||||
// Focus rect
|
||||
|
@ -103,8 +103,6 @@ unit JvChart;
|
||||
interface
|
||||
|
||||
uses
|
||||
{
|
||||
Windows, Messages, }
|
||||
LCLType, LCLIntf,
|
||||
Classes, Types, Graphics, Controls, Contnrs,
|
||||
JvComponent;
|
||||
@ -115,7 +113,7 @@ const
|
||||
JvDefaultHintColor = TColor($00DDFBFA);
|
||||
JvDefaultAvgLineColor = TColor($00EEDDDD);
|
||||
JvDefaultDivisionLineColor = clLtGray; //NEW!
|
||||
JvDefaultShadowColor = clLtGray; //NEW!
|
||||
JvDefaultShadowColor = clDkGray; //NEW!
|
||||
JvDefaultPaperColor = clWhite;
|
||||
|
||||
JvDefaultYLegends = 20;
|
||||
@ -4587,6 +4585,9 @@ procedure TJvChart.MyXHeader(ACanvas: TCanvas; StrText: string);
|
||||
var
|
||||
X, Y, H: Integer;
|
||||
begin
|
||||
if StrText = '' then
|
||||
exit;
|
||||
|
||||
H := ACanvas.TextHeight(StrText);
|
||||
MyAxisFont(ACanvas);
|
||||
Y := Options.YStartOffset + Options.YEnd + Round(1.6 * H);
|
||||
@ -4598,6 +4599,7 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
{ center title within range covered by x axis }
|
||||
X := (Options.XStartOffset + Options.XEnd) div 2;
|
||||
MyCenterTextOut(ACanvas, X, Y, StrText);
|
||||
end;
|
||||
@ -4605,28 +4607,21 @@ end;
|
||||
|
||||
procedure TJvChart.MyYHeader(ACanvas: TCanvas; StrText: string);
|
||||
var
|
||||
{ht,} // not used (ahuser)
|
||||
WD, Vert, Horiz: Integer;
|
||||
begin
|
||||
if Length(StrText) = 0 then
|
||||
Exit;
|
||||
ACanvas.Brush.Color := Color;
|
||||
{ !!warning: uses Win32 only font-handle stuff!!}
|
||||
ACanvas.Font.Assign(FOptions.AxisTitleFont);
|
||||
// MyGraphVertFont(ACanvas); // Select Vertical Font Output.
|
||||
if Options.XStartOffset > 10 then
|
||||
begin
|
||||
{ht := MyTextHeight(StrText); }// not used (ahuser)
|
||||
WD := ACanvas.TextWidth(StrText);
|
||||
//Vert := Options.YStartOffset + WD; // top-aligned
|
||||
Vert := Max(0, Options.YStartOffset + (Options.YEnd + WD) div 2); // centered
|
||||
Horiz := 2;
|
||||
// NOTE: Because of the logical font selected, this time TextOut goes vertical.
|
||||
// If this doesn't go vertical, it may be because the font selection above failed.
|
||||
MyLeftTextOut(ACanvas, Horiz, Vert, StrText);
|
||||
end;
|
||||
MyAxisFont(ACanvas);
|
||||
// Self.MyLeftTextOut(Horiz, Vert+50, '*');
|
||||
end;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user