📄 iplotmanagers.pas
字号:
//****************************************************************************************************************************************************
{ TiPlotCursorManager }
//****************************************************************************************************************************************************
function TiPlotDataCursorManager.CreateObject: TiPlotObject;
begin
Result := TiPlotDataCursor.Create(FOwner, FOnChange, FOnInsert, FOnRemove, FOnRename);
end;
//****************************************************************************************************************************************************
procedure TiPlotDataCursorManager.NotificationInsert(Sender: TObject);
var
iPlotDataCursor : TiPlotDataCursor;
begin
if Sender is TiPlotDataCursor then
begin
iPlotDataCursor := Sender as TiPlotDataCursor;
InsertObject(iPlotDataCursor);
if iPlotDataCursor.Name = '' then
begin
iPlotDataCursor.Name := GetNextName;
if Assigned(FDataViewManager) then if FDataViewManager.Count <> 0 then TiPlotDataCursorAccess(iPlotDataCursor).DataView := FDataViewManager.Items[0];
if Assigned(FChannelManager ) then if FChannelManager.Count <> 0 then iPlotDataCursor.ChannelName := FChannelManager.Items[0].Name;
end;
end;
end;
//****************************************************************************************************************************************************
procedure TiPlotDataCursorManager.NotificationRemove(Sender: TObject);
begin
inherited;
if Sender = FChannelManager then FChannelManager := nil;
end;
//****************************************************************************************************************************************************
function TiPlotDataCursorManager.GetItem(Index: Integer): TiPlotDataCursor;
begin
Result := GetObject(Index) as TiPlotDataCursor;
end;
//****************************************************************************************************************************************************
function TiPlotDataCursorManager.GetName: String;
begin
Result := 'Cursor';
end;
//****************************************************************************************************************************************************
{ TiPlotLimitManager }
//****************************************************************************************************************************************************
function TiPlotLimitManager.CreateObject: TiPlotObject;
begin
Result := TiPlotLimit.Create(FOwner, FOnChange, FOnInsert, FOnRemove, FOnRename);
end;
//****************************************************************************************************************************************************
function TiPlotLimitManager.GetItem(Index: Integer): TiPlotLimit;
begin
Result := GetObject(Index) as TiPlotLimit;
end;
//****************************************************************************************************************************************************
function TiPlotLimitManager.GetName: String;
begin
Result := 'Limit';
end;
//****************************************************************************************************************************************************
procedure TiPlotLimitManager.NotificationInsert(Sender: TObject);
var
iPlotLimit : TiPlotLimit;
begin
if Sender is TiPlotLimit then
begin
iPlotLimit := Sender as TiPlotLimit;
InsertObject(iPlotLimit);
if iPlotLimit.Name = '' then
begin
iPlotLimit.Name := GetNextName;
if Assigned(FXAxisManager) then if FXAxisManager.Count <> 0 then iPlotLimit.XAxisName := FXAxisManager.Items[0].Name;
if Assigned(FYAxisManager) then if FYAxisManager.Count <> 0 then iPlotLimit.YAxisName := FYAxisManager.Items[0].Name;
end;
end;
end;
//****************************************************************************************************************************************************
procedure TiPlotLimitManager.NotificationRemove(Sender: TObject);
begin
inherited NotificationRemove(Sender);
if Sender = FXAxisManager then FXAxisManager := nil;
if Sender = FYAxisManager then FYAxisManager := nil;
end;
//****************************************************************************************************************************************************
{ TiPlotLabelManager }
//****************************************************************************************************************************************************
function TiPlotLabelManager.CreateObject: TiPlotObject;
begin
Result := TiPlotLabel.Create(FOwner, FOnChange, FOnInsert, FOnRemove, FOnRename);
end;
//****************************************************************************************************************************************************
function TiPlotLabelManager.GetItem(Index: Integer): TiPlotLabel;
begin
Result := GetObject(Index) as TiPlotLabel;
end;
//****************************************************************************************************************************************************
function TiPlotLabelManager.GetName: String;
begin
Result := 'Label';
end;
//****************************************************************************************************************************************************
procedure TiPlotLabelManager.NotificationInsert(Sender: TObject);
var
iPlotLabel : TiPlotLabel;
begin
if Sender is TiPlotLabel then
begin
iPlotLabel := Sender as TiPlotLabel;
InsertObject(iPlotLabel);
if iPlotLabel.Name = '' then
begin
iPlotLabel.Name := GetNextName;
iPlotLabel.Caption := iPlotLabel.Name;
end;
end;
end;
//****************************************************************************************************************************************************
{ TiPlotAnnotationManager }
function TiPlotAnnotationManager.CreateObject: TiPlotObject;
begin
Result := TiPlotAnnotation.Create(FOwner, FOnChange, FOnInsert, FOnRemove, FOnRename);
end;
//****************************************************************************************************************************************************
function TiPlotAnnotationManager.GetItem(Index: Integer): TiPlotAnnotation;
begin
Result := GetObject(Index) as TiPlotAnnotation;
end;
//****************************************************************************************************************************************************
function TiPlotAnnotationManager.GetName: String;
begin
Result := 'Annotation';
end;
//****************************************************************************************************************************************************
procedure TiPlotAnnotationManager.NotificationInsert(Sender: TObject);
begin
if Sender is TiPlotAnnotation then
begin
InsertObject(TiPlotObject(Sender));
end;
end;
//****************************************************************************************************************************************************
{ TiPlotTableManager }
//****************************************************************************************************************************************************
function TiPlotTableManager.CreateObject: TiPlotObject;
begin
Result := TiPlotTable.Create(FOwner, FOnChange, FOnInsert, FOnRemove, FOnRename);
end;
//****************************************************************************************************************************************************
function TiPlotTableManager.GetItem(Index: Integer): TiPlotTable;
begin
Result := GetObject(Index) as TiPlotTable;
end;
//****************************************************************************************************************************************************
function TiPlotTableManager.GetName: String;
begin
Result := 'Table';
end;
//****************************************************************************************************************************************************
procedure TiPlotTableManager.NotificationInsert(Sender: TObject);
var
iPlotTable : TiPlotTable;
begin
if Sender is TiPlotTable then
begin
iPlottable := Sender as TiPlotTable;
InsertObject(iPlotTable);
if iPlotTable.Name = '' then
begin
iPlotTable.Name := GetNextName;
end;
end;
end;
//****************************************************************************************************************************************************
{ TiPlotViewManager }
//****************************************************************************************************************************************************
function TiPlotObjectManager.CreateObject: TiPlotObject;
begin
raise Exception.Create('Object Manager does not support creation of objects');
end;
//****************************************************************************************************************************************************
function TiPlotObjectManager.GetName: String;
begin
Result := 'n/a';
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.NotificationInsert(Sender: TObject);
begin
if Sender is TiPlotObject then
begin
InsertObject(Sender as TiPlotObject);
end;
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.ClearAllUserSelections;
var
x : Integer;
begin
for x := 0 to Count-1 do
TiPlotObjectAccess(Items[x]).SetUserSelected(False);
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.SetShiftState(Value: TShiftState);
var
x : Integer;
begin
for x := 0 to Count-1 do
TiPlotObjectAccess(Items[x]).SetShiftState(Value);
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.MouseDownFocusObjects(Button: TMouseButton; Shift: TShiftState; X, Y, ScreenX, ScreenY: Integer; PopupMenu : TPopupMenu);
var
i : Integer;
begin
for i := 0 to Count-1 do
if TiPlotObjectAccess(Items[i]).UserSelected
then TiPlotObjectAccess(Items[i]).iMouseDown(Button, Shift, X, Y, ScreenX, ScreenY, PopUpMenu);
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.MouseMoveFocusObjects(HintData: TiHintData; Shift: TShiftState; X, Y, ScreenX, ScreenY: Integer; DblClickActive: Boolean);
var
i : Integer;
begin
for i := 0 to Count-1 do
if TiPlotObjectAccess(Items[i]).UserSelected then
TiPlotObjectAccess(Items[i]).iMouseMove(HintData, Shift, X, Y, ScreenX, ScreenY, DblClickActive);
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.MouseUpFocusObjects(Button: TMouseButton; Shift: TShiftState; X, Y, ScreenX, ScreenY: Integer; DblClickActive: Boolean);
var
i : Integer;
begin
for i := 0 to Count-1 do
if TiPlotObjectAccess(Items[i]).UserSelected then
TiPlotObjectAccess(Items[i]).iMouseUp(Button, Shift, X, Y, ScreenX, ScreenY, DblClickActive);
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.KeyDownFocusObjects(var CharCode: Word; Shift: TShiftState);
var
i : Integer;
begin
for i := 0 to Count-1 do
if TiPlotObjectAccess(Items[i]).UserSelected then
TiPlotObjectAccess(Items[i]).iKeyDown(CharCode, Shift);
end;
//****************************************************************************************************************************************************
function TiPlotObjectManager.MouseWheelFocusObjects(WheelDelta: Integer; Shift: TShiftState; const MousePos: TPoint): Boolean;
var
i : Integer;
begin
Result := False;
for i := 0 to Count-1 do
if TiPlotObjectAccess(Items[i]).UserSelected then
if TiPlotObjectAccess(Items[i]).iMouseWheel(WheelDelta, Shift, MousePos) then Result := True
end;
//****************************************************************************************************************************************************
procedure TiPlotObjectManager.ShutDownSetup;
var
i : Integer;
begin
for i := 0 to Count-1 do
begin
TiPlotObjectAccess(Items[i]).OnRemove := nil;
TiPlotObjectAccess(Items[i]).OnLayoutChange := nil;
TiPlotObjectAccess(Items[i]).OnChange := nil;
end;
end;
//****************************************************************************************************************************************************
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -