{********************************************}
{ TeeChart Pro - Map Series Editor           }
{ Copyright (c) 1995-2020 by Steema Software }
{ All Rights Reserved                        }
{********************************************}
unit TeeMapSeriesEdit;
{$I TeeDefs.inc}

interface

uses
  {$IFNDEF LINUX}
  Windows, Messages,
  {$ENDIF}
  SysUtils, Classes,

  Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, Grids,
  Buttons,

  TeCanvas, TeeProcs, TeeMapSeries, TeEngine, TeePenDlg, TeeChartGrid,
  TeeLisB, TeeNavigator, TeeBrushDlg, TeeEdiGrad,

  {$IFDEF MSWINDOWS}
  TeeGDIPlus,
  {$ENDIF}

  Series, Chart, TeeTools, TeeDragPoint;

type
  TMapSeriesEditor = class(TForm)
    PageControl2: TPageControl;
    TabGlobal: TTabSheet;
    TabShapes: TTabSheet;
    PageControl1: TPageControl;
    TabFormat: TTabSheet;
    CBGlobalPen: TCheckBox;
    CBGlobalBrush: TCheckBox;
    TabData: TTabSheet;
    Splitter1: TSplitter;
    Panel1: TPanel;
    ButtonColor1: TButtonColor;
    ChartListBox1: TChartListBox;
    Panel2: TPanel;
    SBDelete: TSpeedButton;
    SBAdd: TSpeedButton;
    CBDefaultColor: TCheckBox;
    CBClosed: TCheckBox;
    TabValues: TTabSheet;
    Label2: TLabel;
    EText: TEdit;
    Label1: TLabel;
    EditZ: TEdit;
    Label3: TLabel;
    ShapeIndex: TLabel;
    CBVisible: TCheckBox;
    Label4: TLabel;
    TabShadow: TTabSheet;
    TabEmboss: TTabSheet;
    PageOptions: TPageControl;
    TabOptions: TTabSheet;
    TabBorder: TTabSheet;
    TabPattern: TTabSheet;
    TBShapeTransp: TTrackBar;
    TabShapeBorder: TTabSheet;
    TabShapePattern: TTabSheet;
    PageControl4: TPageControl;
    TabChartPoints: TTabSheet;
    TabPoints: TTabSheet;
    ChartGrid1: TChartGrid;
    ChartGridNavigator1: TChartGridNavigator;
    Chart1: TChart;
    Series1: TLineSeries;
    ChartTool1: TMarksTipTool;
    ChartTool2: TDragPointTool;
    CBSort: TCheckBox;
    LCode: TLabel;
    ECode: TEdit;
    TabPointer: TTabSheet;
    TabMapMarks: TTabSheet;
    CBMarksStyle: TComboFlat;
    CBMarksAutoSize: TCheckBox;
    CBMarksUpper: TCheckBox;
    CBMarksCentroid: TCheckBox;
    TabLegend: TTabSheet;
    CBIncludeZero: TCheckBox;
    CBAutoTextColor: TCheckBox;
    GBLegendSort: TGroupBox;
    RGLegendSort: TRadioGroup;
    CBLegendSort: TCheckBox;
    CBIncludeUnnamed: TCheckBox;
    CBMarksVisible: TCheckBox;
    Label8: TLabel;
    LParentShape: TLabel;
    PanelShapesTop: TPanel;
    Label7: TLabel;
    LShapeCount: TLabel;
    PanelLeft: TPanel;
    PanelOptions: TPanel;
    Label5: TLabel;
    Label6: TLabel;
    Label9: TLabel;
    CBTransp: TCheckBox;
    EPointSize: TEdit;
    TBTransp: TTrackBar;
    CBRenderMode: TComboFlat;
    CBPointUnits: TComboFlat;
    CBLegendStyle: TComboFlat;
    LLegendStyle: TLabel;
    TabSheet1: TTabSheet;
    GBOffset: TGroupBox;
    LHorizOffset: TLabel;
    TBHorizOffset: TTrackBar;
    LVertOffset: TLabel;
    TBVertOffset: TTrackBar;
    procedure FormShow(Sender: TObject);
    procedure ETextChange(Sender: TObject);
    procedure ChartListBox1Click(Sender: TObject);
    procedure CBGlobalPenClick(Sender: TObject);
    procedure CBGlobalBrushClick(Sender: TObject);
    procedure EditZChange(Sender: TObject);
    procedure ButtonColor1Click(Sender: TObject);
    procedure PageControl2Change(Sender: TObject);
    procedure SBDeleteClick(Sender: TObject);
    procedure SBAddClick(Sender: TObject);
    procedure ChartGrid1SetEditText(Sender: TObject; ACol, ARow: Integer;
      const Value: String);
    procedure ChartListBox1ChangeColor(Sender: TChartListBox;
      Series: TCustomChartSeries);
    procedure CBDefaultColorClick(Sender: TObject);
    procedure CBClosedClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure CBVisibleClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure ChartListBox1ChangeActive(Sender: TChartListBox;
      Series: TCustomChartSeries);
    procedure CBTranspClick(Sender: TObject);
    procedure EPointSizeChange(Sender: TObject);
    procedure PageOptionsChange(Sender: TObject);
    procedure TBTranspChange(Sender: TObject);
    procedure TBShapeTranspChange(Sender: TObject);
    procedure PageControl1Change(Sender: TObject);
    procedure CBRenderModeChange(Sender: TObject);
    procedure ChartTool2DragPoint(Sender: TDragPointTool; Index: Integer);
    procedure CBSortClick(Sender: TObject);
    procedure ECodeChange(Sender: TObject);
    procedure CBMarksStyleChange(Sender: TObject);
    procedure CBMarksAutoSizeClick(Sender: TObject);
    procedure CBMarksUpperClick(Sender: TObject);
    procedure CBMarksCentroidClick(Sender: TObject);
    procedure CBPointUnitsChange(Sender: TObject);
    procedure CBIncludeZeroClick(Sender: TObject);
    procedure CBAutoTextColorClick(Sender: TObject);
    procedure CBLegendSortClick(Sender: TObject);
    procedure RGLegendSortClick(Sender: TObject);
    procedure CBIncludeUnnamedClick(Sender: TObject);
    procedure CBMarksVisibleClick(Sender: TObject);
    procedure LParentShapeClick(Sender: TObject);
    procedure CBLegendStyleChange(Sender: TObject);
    procedure TBHorizOffsetChange(Sender: TObject);
    procedure TBVertOffsetChange(Sender: TObject);
  private
    { Private declarations }
    ChangingColor,
    ChangingText : Boolean;
    Grid3DForm : TCustomForm;

    IShapeBorder : TPenDialog;
    IShapePattern : TBrushDialog;

    procedure CheckDefaultColor;
    procedure ClearButtonColorLink;
    procedure EnableTabs;
    Procedure FillShapes;
    procedure InitializeShapesListBox;
    Function SelectedShape:TTeePolygon;
  protected
    Map : TMapSeries;
    DirtyList : Boolean;
  public
    { Public declarations }
    InitialShape : TObject;
  end;

implementation

{$IFNDEF LCL}
{$R *.DFM}
{$ELSE}
{$R *.lfm}
{$ENDIF}

Uses
  TeeGriEd, TeePoEdi, TeeShadowEditor;

procedure TMapSeriesEditor.FormShow(Sender: TObject);

  procedure SetLegend(const ALegend:TMapLegend);
  begin
    CBLegendStyle.ItemIndex:=Ord(ALegend.Style);
    CBIncludeZero.Checked:=ALegend.IncludeZero;
    CBIncludeUnnamed.Checked:=ALegend.IncludeUnNamed;
    CBLegendSort.Checked:=ALegend.Sort.Inverted;

    RGLegendSort.ItemIndex:=Ord(ALegend.Sort.By);
    RGLegendSort.Enabled:=ALegend.Style<>lsPalette;
  end;

  procedure SetMarks(const AMarks:TMapMarks);
  begin
    CBMarksStyle.ItemIndex:=Ord(AMarks.TextStyle);
    CBMarksAutoSize.Checked:=AMarks.AutoSize;
    CBMarksUpper.Checked:=AMarks.UpperCase;
    CBMarksCentroid.Checked:=AMarks.Centroid;
    CBAutoTextColor.Checked:=AMarks.AutoTextColor;
    CBMarksVisible.Checked:=Map.Marks.Visible;
  end;

begin
  ChangingText:=False;

  if Assigned(Parent) then
     Align:=alClient;

  Map:=TMapSeries(Tag);

  if Assigned(Map) then
  begin
    TBTransp.Position:=Map.Transparency;
    CBTransp.Checked:=Map.Transparent;
    EPointSize.Text:=FormatFloat('0.##',Map.PointSize);
    CBPointUnits.ItemIndex:=Ord(Map.Pointer.SizeUnits);

    if not Assigned(Grid3DForm) then
       Grid3DForm:=TeeInsertGrid3DForm(Parent,Map);

    TTeeShadowEditor.InsertForm(Map.Shadow,TabShadow);
    TTeeShadowEditor.InsertForm(Map.Emboss,TabEmboss);

    LShapeCount.Caption:=IntToStr(Map.Shapes.Count);

    CBRenderMode.ItemIndex:=Ord(Map.RenderMode);

    // Map Marks
    SetMarks(Map.MapMarks);

    // Legend
    SetLegend(Map.MapLegend);
  end;

  PageControl2.ActivePage:=TabGlobal;
  ChartGrid1.ShowFields:=False;
  EnableTabs;

  ChartGridNavigator1.Buttons[nbInsert].Visible:=True;
  ChartGridNavigator1.Buttons[nbDelete].Visible:=True;

  PageControl1.ActivePage:=TabFormat;

  if Assigned(Map) and (Map.Shapes.Count>0) then
     InitializeShapesListBox;

  PageControl2.ActivePage:=TabGlobal;
  PageControl1.ActivePage:=TabValues;

  PageOptions.ActivePage:=TabOptions;
end;

procedure TMapSeriesEditor.EnableTabs;

  procedure EnableControls(Tab:TTabSheet; Value:Boolean);
  var t   : Integer;
  begin
    for t:=0 to Tab.ControlCount-1 do
        Tab.Controls[t].Enabled:=Value;
  end;

var tmp : Boolean;
begin
  tmp:=Assigned(Map) and (Map.Shapes.Count>0);

  EnableControls(TabValues,tmp);
  EnableControls(TabFormat,tmp);
  EnableControls(TabData,tmp);
end;

procedure TMapSeriesEditor.ETextChange(Sender: TObject);
var tmp : String;
begin
  if not ChangingText then
  begin
    tmp:=SelectedShape.Text;

    if tmp<>EText.Text then
    begin
      SelectedShape.Text:=EText.Text;

      With ChartListBox1 do
           Items[ItemIndex]:=SelectedShape.Text;
    end;
  end;
end;

procedure TMapSeriesEditor.ChartListBox1Click(Sender: TObject);
begin
  EnableTabs;

  if SelectedShape<>nil then
  begin

    With SelectedShape do
    begin
      ShapeIndex.Caption:=IntToStr(Index);

      if ParentShape=nil then
         LParentShape.Caption:=''
      else
         LParentShape.Caption:=IntToStr(ParentShape.Index);

      ButtonColor1.LinkProperty(SelectedShape,'Color');
      ButtonColor1.Repaint;

      CBGlobalPen.Checked:=ParentPen;
      CheckDefaultColor;
      CBGlobalBrush.Checked:=ParentBrush;

      ChangingText:=True;
      try
        EText.Text:=Text;
        ECode.Text:=Code;
        EditZ.Text:=FloatToStr(Z);
      finally
        ChangingText:=False;
      end;

      CBClosed.Checked:=Closed;
      CBVisible.Checked:=Points.Visible;
      TBShapeTransp.Position:=Transparency;

      ChartGrid1.Series:=Points;
      Series1.AssignValues(Points);

      TBHorizOffset.Position:=Round(Offset.X);
      TBVertOffset.Position:=Round(Offset.Y);

      if Assigned(IShapeBorder) then
         IShapeBorder.RefreshPen(Pen);

      if Assigned(IShapePattern) then
         IShapePattern.RefreshBrush(Brush);
    end;

    SBDelete.Enabled:=True;

  end
  else
  begin
    Series1.Clear;
    ShapeIndex.Caption:='';
    ButtonColor1.LinkProperty(nil,'');
    ChangingText:=True;
    EText.Text:='';
    EditZ.Text:='0';
    ChangingText:=False;
  end;
end;

procedure TMapSeriesEditor.CBGlobalPenClick(Sender: TObject);
begin
  SelectedShape.ParentPen:=CBGlobalPen.Checked;
end;

procedure TMapSeriesEditor.CBGlobalBrushClick(Sender: TObject);
begin
  SelectedShape.ParentBrush:=CBGlobalBrush.Checked;
end;

function TMapSeriesEditor.SelectedShape: TTeePolygon;
begin
  if ChartListBox1.ItemIndex>=0 then
     result:=(ChartListBox1.SelectedSeries as TPolygonSeries).Polygon
  else
     result:=nil;
end;

procedure TMapSeriesEditor.EditZChange(Sender: TObject);
var tmp : Double;
begin
  if not ChangingText then
  begin
    tmp:=StrToFloat(EditZ.Text);

    if SelectedShape.Z<>tmp then
    begin
      SelectedShape.Z:=tmp;
      Map.Repaint;
    end;
  end;
end;

type
  TSeriesAccess=class(TChartSeries);

procedure TMapSeriesEditor.CheckDefaultColor;
var tmp : TColor;
begin
  ChangingColor:=True;

  tmp:=TSeriesAccess(SelectedShape.ParentSeries).InternalColor(SelectedShape.Index);

  CBDefaultColor.Checked:=tmp=clTeeColor;
  ChangingColor:=False;

  CBDefaultColor.Enabled:=not CBDefaultColor.Checked;
end;

procedure TMapSeriesEditor.ButtonColor1Click(Sender: TObject);
begin
  CheckDefaultColor;
  ChartListBox1.Repaint;
end;

procedure TMapSeriesEditor.ClearButtonColorLink;
begin
  ButtonColor1.LinkProperty(nil,'');
end;

procedure TMapSeriesEditor.PageControl2Change(Sender: TObject);
begin
  if (ChartListBox1.Items.Count<>Map.Shapes.Count) or DirtyList then
  begin
    ClearButtonColorLink;
    FillShapes;
    ChartListBox1Click(Self);
  end;
end;

Procedure TMapSeriesEditor.FillShapes;
var t : Integer;
    tmp : String;
begin
  With ChartListBox1 do
  begin
    ClearItems;
    Items.BeginUpdate;

    try
      for t:=0 to Map.Shapes.Count-1 do
      begin
        tmp:=Map.Labels[t];
        if tmp='' then tmp:=IntToStr(t);
        Items.AddObject(tmp,Map.Shapes[t].Points);
      end;
    finally
      Items.EndUpdate;
    end;
  end;

  DirtyList:=False;
end;

procedure TMapSeriesEditor.SBDeleteClick(Sender: TObject);
var tmpLast : Boolean;
    tmp     : Integer;
begin
  tmp:=ChartListBox1.ItemIndex;
  tmpLast:=ChartListBox1.ItemIndex=ChartListBox1.Items.Count-1;
  Map.Delete(ChartListBox1.ItemIndex);
  SBDelete.Enabled:=Map.Shapes.Count>0;

  ClearButtonColorLink;
  
  FillShapes;

  if Map.Shapes.Count>0 then
  begin
    if tmpLast then tmp:=ChartListBox1.Items.Count-1;
  end
  else tmp:=-1;

  with ChartListBox1 do
  begin
    ItemIndex:=tmp;
    if tmp>=0 then
       Selected[tmp]:=True;
  end;

  ChartListBox1Click(Self);
  EnableTabs;
end;

procedure TMapSeriesEditor.SBAddClick(Sender: TObject);
begin
  with Map.Shapes.Add do
       Text:=IntToStr(Map.Count);

  FillShapes;

  with ChartListBox1 do
  begin
    ItemIndex:=Items.Count-1;
    Selected[ItemIndex]:=True;
    SetFocus;
  end;

  ChartListBox1Click(Self);
  EnableTabs;
end;

procedure TMapSeriesEditor.ChartGrid1SetEditText(Sender: TObject; ACol,
  ARow: Integer; const Value: String);
begin
  Map.Repaint;
end;

procedure TMapSeriesEditor.ChartListBox1ChangeColor(Sender: TChartListBox;
  Series: TCustomChartSeries);
begin
  ButtonColor1.Invalidate;
  ChartListBox1.Invalidate;
end;

procedure TMapSeriesEditor.CBDefaultColorClick(Sender: TObject);
begin
  if not ChangingColor then
  begin
    SelectedShape.Color:=clTeeColor;
    ButtonColor1.Invalidate;
    ChartListBox1.Invalidate;
  end;
end;

procedure TMapSeriesEditor.CBClosedClick(Sender: TObject);
begin
  SelectedShape.Closed:=CBClosed.Checked;
end;

procedure TMapSeriesEditor.FormCreate(Sender: TObject);
begin
  PageControl2.ActivePage:=TabGlobal;
  PageOptions.ActivePage:=TabOptions;

  LParentShape.Caption:='';
  InitialShape:=nil;
end;

procedure TMapSeriesEditor.CBVisibleClick(Sender: TObject);
begin
  SelectedShape.Points.Visible:=CBVisible.Checked;
  ChartListBox1.SelectedSeries.Visible:=CBVisible.Checked;
  ChartListBox1.Invalidate;
end;

procedure TMapSeriesEditor.FormDestroy(Sender: TObject);
begin
  FreeAndNil(Grid3DForm);
end;

procedure TMapSeriesEditor.ChartListBox1ChangeActive(Sender: TChartListBox;
  Series: TCustomChartSeries);
begin
  CBVisible.Checked:=SelectedShape.Points.Visible;
end;

procedure TMapSeriesEditor.CBTranspClick(Sender: TObject);
begin
  Map.Transparent:=CBTransp.Checked;
end;

procedure TMapSeriesEditor.EPointSizeChange(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     if not ChangingText then
        Map.PointSize:=StrToFloatDef(EPointSize.Text,Map.PointSize);
end;

procedure TMapSeriesEditor.PageOptionsChange(Sender: TObject);
begin
  if (PageOptions.ActivePage=TabBorder) and (TabBorder.ControlCount=0) then
     TPenDialog.InsertForm(Map.Pen,TabBorder)
  else
  if (PageOptions.ActivePage=TabPattern) and (TabPattern.ControlCount=0) then
     TBrushDialog.AddDialog(Map.Brush,TabPattern)
  else
  if (PageOptions.ActivePage=TabPointer) and (TabPointer.ControlCount=0) then
     TSeriesPointerEditor.InsertForm(Map.Pointer,TabPointer);
end;

procedure TMapSeriesEditor.TBTranspChange(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.Transparency:=TBTransp.Position;
end;

procedure TMapSeriesEditor.TBShapeTranspChange(Sender: TObject);
begin
  if Showing and (SelectedShape<>nil) then
     SelectedShape.Transparency:=TBShapeTransp.Position;
end;

procedure TMapSeriesEditor.PageControl1Change(Sender: TObject);
var tmp : TTeePolygon;
begin
  tmp:=SelectedShape;

  if Assigned(tmp) then
    if PageControl1.ActivePage=TabShapeBorder then
    begin
       if TabShapeBorder.ControlCount=0 then
          IShapeBorder:=TPenDialog.InsertForm(tmp.Pen,TabShapeBorder)
       else
          IShapeBorder.RefreshPen(tmp.Pen);
    end
    else
    if PageControl1.ActivePage=TabShapePattern then
    begin
       if TabShapePattern.ControlCount=0 then
          IShapePattern:=TBrushDialog.AddDialog(tmp.Brush,TabShapePattern)
       else
          IShapePattern.RefreshBrush(tmp.Brush);
    end;
end;

procedure TMapSeriesEditor.CBRenderModeChange(Sender: TObject);
begin
  if Showing then
     Map.RenderMode:=TMapRenderMode(CBRenderMode.ItemIndex);
end;

procedure TMapSeriesEditor.ChartTool2DragPoint(Sender: TDragPointTool;
  Index: Integer);
begin
  with ChartGrid1.Series do
  begin
    BeginUpdate;

    XValue[Index]:=Series1.XValue[Index];
    YValue[Index]:=Series1.YValue[Index];

    EndUpdate;
  end;
end;

procedure TMapSeriesEditor.InitializeShapesListBox;
begin
  FillShapes;

  if Assigned(InitialShape) then
  begin
    PageControl2.ActivePage:=TabShapes;
    PageControl2Change(Self);
    ChartListBox1.ItemIndex:=ChartListBox1.Items.IndexOfObject(InitialShape);
  end
  else
     ChartListBox1.ItemIndex:=0;

  ChartListBox1Click(Self);
end;

procedure TMapSeriesEditor.CBSortClick(Sender: TObject);
var Old : TChartSeries;
begin
  Old:=ChartListBox1.SelectedSeries;

  if CBSort.Checked then
     ChartListBox1.Sorted:=True
  else
  begin
    ChartListBox1.Sorted:=False;
    InitializeShapesListBox;
  end;

  ChartListBox1.SelectedSeries:=Old;
end;

procedure TMapSeriesEditor.ECodeChange(Sender: TObject);
begin
  if not ChangingText then
     SelectedShape.Code:=ECode.Text;
end;

procedure TMapSeriesEditor.CBMarksStyleChange(Sender: TObject);
begin
  Map.MapMarks.TextStyle:=TMapMarksText(CBMarksStyle.ItemIndex);
end;

procedure TMapSeriesEditor.CBMarksAutoSizeClick(Sender: TObject);
begin
  Map.MapMarks.AutoSize:=CBMarksAutoSize.Checked;
end;

procedure TMapSeriesEditor.CBMarksUpperClick(Sender: TObject);
begin
  Map.MapMarks.UpperCase:=CBMarksUpper.Checked;
  Map.Repaint;
end;

procedure TMapSeriesEditor.CBMarksCentroidClick(Sender: TObject);
begin
  Map.MapMarks.Centroid:=CBMarksCentroid.Checked;
  Map.Repaint;
end;

procedure TMapSeriesEditor.CBPointUnitsChange(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.Pointer.SizeUnits:=TPointerSizeUnits(CBPointUnits.ItemIndex);
end;

procedure TMapSeriesEditor.CBIncludeZeroClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.MapLegend.IncludeZero:=CBIncludeZero.Checked;
end;

procedure TMapSeriesEditor.CBAutoTextColorClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.MapMarks.AutoTextColor:=CBAutoTextColor.Checked;
end;

procedure TMapSeriesEditor.CBLegendSortClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.MapLegend.Sort.Inverted:=CBLegendSort.Checked;
end;

procedure TMapSeriesEditor.RGLegendSortClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.MapLegend.Sort.By:=TMapLegendSortBy(RGLegendSort.ItemIndex);
end;

procedure TMapSeriesEditor.CBIncludeUnnamedClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.MapLegend.IncludeUnNamed:=CBIncludeUnnamed.Checked;
end;

procedure TMapSeriesEditor.CBMarksVisibleClick(Sender: TObject);
begin
  if Showing and Assigned(Map) then
     Map.Marks.Visible:=CBMarksVisible.Checked;
end;

procedure TMapSeriesEditor.LParentShapeClick(Sender: TObject);
var tmp : TTeePolygon;
begin
  tmp:=SelectedShape;

  if tmp<>nil then
  begin
    ChartListBox1.ItemIndex:=tmp.ParentShape.Index;
    ChartListBox1Click(Self);
  end;
end;

procedure TMapSeriesEditor.CBLegendStyleChange(Sender: TObject);
begin
  if Showing and Assigned(Map) then
  begin
    Map.MapLegend.Style:=TMapLegendStyle(CBLegendStyle.ItemIndex);
    RGLegendSort.Enabled:=Map.MapLegend.Style<>lsPalette;
  end;
end;

procedure TMapSeriesEditor.TBHorizOffsetChange(Sender: TObject);
begin
  SelectedShape.Offset.X:=TBHorizOffset.Position;
end;

procedure TMapSeriesEditor.TBVertOffsetChange(Sender: TObject);
begin
  SelectedShape.Offset.Y:=TBVertOffset.Position;
end;

initialization
  RegisterClass(TMapSeriesEditor);
end.
