home *** CD-ROM | disk | FTP | other *** search
- {$I TeeDefs.inc}
- unit Chart_EditorPanel;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Base, TeeEdit, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls, Series,
- TeeTools, ComCtrls;
-
- type
- TChartEditorPanelForm = class(TBaseForm)
- ChartEditorPanel1: TChartEditorPanel;
- Series1: THorizLineSeries;
- Splitter1: TSplitter;
- Label1: TLabel;
- ComboBox1: TComboBox;
- Label2: TLabel;
- ComboBox2: TComboBox;
- ChartTool1: TMarksTipTool;
- procedure FormCreate(Sender: TObject);
- procedure ComboBox1Change(Sender: TObject);
- procedure ComboBox2Change(Sender: TObject);
- procedure Chart1MouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- implementation
-
- {$R *.DFM}
-
- procedure TChartEditorPanelForm.FormCreate(Sender: TObject);
- begin
- inherited;
- Series1.FillSampleValues(10);
- end;
-
- procedure TChartEditorPanelForm.ComboBox1Change(Sender: TObject);
- begin
- { change the tabs position }
- With ChartEditorPanel1.Editor.MainPage do
- Case ComboBox1.ItemIndex of
- 0: TabPosition:=tpTop;
- 1: begin {$IFDEF D4}Style:=tsTabs;{$ENDIF} TabPosition:=tpBottom; end;
- 2: begin {$IFDEF D4}Style:=tsTabs; TabPosition:=tpLeft;{$ENDIF} end;
- 3: begin {$IFDEF D4}Style:=tsTabs; TabPosition:=tpRight;{$ENDIF} end;
- end;
- end;
-
- procedure TChartEditorPanelForm.ComboBox2Change(Sender: TObject);
- begin
- { change the tabs style }
- With ChartEditorPanel1.Editor.MainPage do
- Case ComboBox2.ItemIndex of
- 0: {$IFDEF D4}Style:=tsTabs{$ENDIF};
- 1: begin TabPosition:=tpTop; {$IFDEF D4}Style:=tsButtons;{$ENDIF} end;
- 2: begin TabPosition:=tpTop; {$IFDEF D4}Style:=tsFlatButtons;{$ENDIF} end;
- end;
- end;
-
- procedure TChartEditorPanelForm.Chart1MouseDown(Sender: TObject;
- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- { On mouse down, show the appropiate tab in the editor... }
- ChartEditorPanel1.SelectUnderMouse;
- end;
-
- procedure TChartEditorPanelForm.FormShow(Sender: TObject);
- begin
- inherited;
- ComboBox1.ItemIndex:=0;
- ComboBox2.ItemIndex:=0;
-
- {$IFNDEF D4} { Delphi 3 does not support tab styles }
- ComboBox2.Visible:=False;
- Label2.Visible:=False;
- ComboBox1.Items.Delete(3);
- ComboBox1.Items.Delete(2);
- {$ENDIF}
- end;
-
- initialization
- RegisterClass(TChartEditorPanelForm);
- end.
-