mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 11:41:04 +02:00
TAChart: Extend TChartImageList to work for non-series icons also at designtime.
git-svn-id: trunk@59242 -
This commit is contained in:
parent
b94a7193a0
commit
e9f492c0d9
@ -1,16 +1,15 @@
|
|||||||
object frmMain: TfrmMain
|
object frmMain: TfrmMain
|
||||||
Left = 261
|
Left = 261
|
||||||
Height = 434
|
Height = 459
|
||||||
Top = 153
|
Top = 153
|
||||||
Width = 484
|
Width = 484
|
||||||
Caption = 'frmMain'
|
Caption = 'frmMain'
|
||||||
ClientHeight = 434
|
ClientHeight = 459
|
||||||
ClientWidth = 484
|
ClientWidth = 484
|
||||||
OnCreate = FormCreate
|
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object Chart1: TChart
|
object Chart1: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 223
|
Height = 217
|
||||||
Top = 38
|
Top = 38
|
||||||
Width = 484
|
Width = 484
|
||||||
AxisList = <
|
AxisList = <
|
||||||
@ -21,6 +20,7 @@ object frmMain: TfrmMain
|
|||||||
Title.LabelBrush.Style = bsClear
|
Title.LabelBrush.Style = bsClear
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
|
Intervals.MaxLength = 80
|
||||||
Alignment = calBottom
|
Alignment = calBottom
|
||||||
Marks.LabelBrush.Style = bsClear
|
Marks.LabelBrush.Style = bsClear
|
||||||
Minors = <>
|
Minors = <>
|
||||||
@ -59,17 +59,16 @@ object frmMain: TfrmMain
|
|||||||
object ListView1: TListView
|
object ListView1: TListView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 150
|
Height = 150
|
||||||
Top = 261
|
Top = 286
|
||||||
Width = 484
|
Width = 484
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Color = clBtnFace
|
Color = clWhite
|
||||||
Columns = <>
|
Columns = <>
|
||||||
Items.LazData = {
|
Items.LazData = {
|
||||||
940000000400000000000000FFFFFFFFFFFFFFFF000000000F0000006C697374
|
6C0000000400000000000000FFFFFFFFFFFFFFFF00000000050000004974656D
|
||||||
76696577206974656D203001000000FFFFFFFFFFFFFFFF000000000F0000006C
|
3001000000FFFFFFFFFFFFFFFF00000000050000004974656D3102000000FFFF
|
||||||
69737476696577206974656D203102000000FFFFFFFFFFFFFFFF000000000F00
|
FFFFFFFFFFFF00000000050000004974656D3203000000FFFFFFFFFFFFFFFF00
|
||||||
00006C69737476696577206974656D203203000000FFFFFFFFFFFFFFFF000000
|
000000050000004974656D34
|
||||||
000F0000006C69737476696577206974656D2033
|
|
||||||
}
|
}
|
||||||
SmallImages = ChartImageList
|
SmallImages = ChartImageList
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -84,7 +83,7 @@ object frmMain: TfrmMain
|
|||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
Caption = 'ToolBar1'
|
Caption = 'ToolBar1'
|
||||||
EdgeBorders = [ebBottom]
|
EdgeBorders = [ebBottom]
|
||||||
Images = ToolbarImages
|
Images = ChartImageList
|
||||||
ShowCaptions = True
|
ShowCaptions = True
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object tbAdd: TToolButton
|
object tbAdd: TToolButton
|
||||||
@ -112,10 +111,20 @@ object frmMain: TfrmMain
|
|||||||
object StatusBar1: TStatusBar
|
object StatusBar1: TStatusBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 411
|
Top = 436
|
||||||
Width = 484
|
Width = 484
|
||||||
Panels = <>
|
Panels = <>
|
||||||
end
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 0
|
||||||
|
Height = 15
|
||||||
|
Top = 271
|
||||||
|
Width = 484
|
||||||
|
Align = alBottom
|
||||||
|
BorderSpacing.Top = 16
|
||||||
|
Caption = 'This ImageList displays all images contained in the ChartImagelist:'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
object RandomChartSource1: TRandomChartSource
|
object RandomChartSource1: TRandomChartSource
|
||||||
PointsNumber = 10
|
PointsNumber = 10
|
||||||
RandSeed = 1965225964
|
RandSeed = 1965225964
|
||||||
@ -131,12 +140,6 @@ object frmMain: TfrmMain
|
|||||||
OnPopulate = ChartImageListPopulate
|
OnPopulate = ChartImageListPopulate
|
||||||
left = 192
|
left = 192
|
||||||
top = 97
|
top = 97
|
||||||
Bitmap = {
|
|
||||||
}
|
|
||||||
end
|
|
||||||
object ToolbarImages: TImageList
|
|
||||||
left = 328
|
|
||||||
top = 97
|
|
||||||
Bitmap = {
|
Bitmap = {
|
||||||
4C69020000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
4C69020000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, TAGraph, TAChartImageList, TASources,
|
Classes, SysUtils, FileUtil, TAGraph, TAChartImageList, TASources,
|
||||||
TAFuncSeries, Forms, Controls, Graphics, Dialogs, ComCtrls;
|
TAFuncSeries, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ type
|
|||||||
Chart1FuncSeries1: TFuncSeries;
|
Chart1FuncSeries1: TFuncSeries;
|
||||||
Chart1FuncSeries2: TFuncSeries;
|
Chart1FuncSeries2: TFuncSeries;
|
||||||
ChartImageList: TChartImageList;
|
ChartImageList: TChartImageList;
|
||||||
ToolbarImages: TImageList;
|
Label1: TLabel;
|
||||||
ListView1: TListView;
|
ListView1: TListView;
|
||||||
RandomChartSource1: TRandomChartSource;
|
RandomChartSource1: TRandomChartSource;
|
||||||
StatusBar1: TStatusBar;
|
StatusBar1: TStatusBar;
|
||||||
@ -28,7 +28,6 @@ type
|
|||||||
procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
||||||
procedure Chart1FuncSeries2Calculate(const AX: Double; out AY: Double);
|
procedure Chart1FuncSeries2Calculate(const AX: Double; out AY: Double);
|
||||||
procedure ChartImageListPopulate(Sender: TObject);
|
procedure ChartImageListPopulate(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure tbAddClick(Sender: TObject);
|
procedure tbAddClick(Sender: TObject);
|
||||||
procedure tbQuitClick(Sender: TObject);
|
procedure tbQuitClick(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
@ -64,13 +63,6 @@ begin
|
|||||||
[Count, SeriesCount, FirstSeriesIndex]);
|
[Count, SeriesCount, FirstSeriesIndex]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
ChartImageList.Chart := nil;
|
|
||||||
ChartImageList.AddImages(ToolbarImages);
|
|
||||||
ChartImageList.Chart := Chart1;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrmMain.tbAddClick(Sender: TObject);
|
procedure TfrmMain.tbAddClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
series: TLineSeries;
|
series: TLineSeries;
|
||||||
|
@ -170,9 +170,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartImageList.ReadData(AStream: TStream);
|
procedure TChartImageList.ReadData(AStream: TStream);
|
||||||
|
var
|
||||||
|
ch: TChart;
|
||||||
begin
|
begin
|
||||||
Unused(AStream);
|
ch := Chart;
|
||||||
|
Chart := nil;
|
||||||
Clear;
|
Clear;
|
||||||
|
inherited ReadData(AStream);
|
||||||
|
Chart := ch;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Notification procedure of the listener. Responds to chart broadcasts
|
// Notification procedure of the listener. Responds to chart broadcasts
|
||||||
@ -202,10 +207,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartImageList.WriteData(AStream: TStream);
|
procedure TChartImageList.WriteData(AStream: TStream);
|
||||||
|
var
|
||||||
|
ch: TChart;
|
||||||
begin
|
begin
|
||||||
|
ch := Chart;
|
||||||
|
Chart := nil;
|
||||||
|
inherited WriteData(AStream);
|
||||||
|
Chart := ch;{
|
||||||
|
|
||||||
// Don't write the series images to stream.
|
// Don't write the series images to stream.
|
||||||
// They will be recreated automatically when the chart is assigned on loading.
|
// They will be recreated automatically when the chart is assigned on loading.
|
||||||
Unused(AStream);
|
Unused(AStream);
|
||||||
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user