LazMapViewer: Introduce TMvDrawPlugin as common descendant for plugs which draw into the map. Update demos.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9533 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
ce41a9f02c
commit
a2fdd960ea
@ -164,9 +164,9 @@ object MainForm: TMainForm
|
|||||||
Left = 0
|
Left = 0
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 279
|
Top = 279
|
||||||
Width = 41
|
Width = 108
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
Caption = 'Opacity'
|
Caption = 'Background Opacity'
|
||||||
end
|
end
|
||||||
object clbPenColor: TColorButton
|
object clbPenColor: TColorButton
|
||||||
AnchorSideLeft.Control = ParamsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
@ -85,7 +85,7 @@ begin
|
|||||||
MapView := FMapView1;
|
MapView := FMapView1;
|
||||||
|
|
||||||
edLegalNotice.Text := LegalNotice;
|
edLegalNotice.Text := LegalNotice;
|
||||||
seOpacity.Value := round(Opacity * 100);
|
seOpacity.Value := round(BackgroundOpacity * 100);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
with TLegalNoticePlugin.Create(FPluginManager) do
|
with TLegalNoticePlugin.Create(FPluginManager) do
|
||||||
@ -116,9 +116,9 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.FloatSpinEdit1Change(Sender: TObject);
|
procedure TMainForm.FloatSpinEdit1Change(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
(FPluginManager.Item[0] as TLegalNoticePlugin).Opacity := seOpacity.Value / 100;
|
(FPluginManager.Item[0] as TLegalNoticePlugin).BackgroundOpacity := seOpacity.Value / 100;
|
||||||
if FPluginManager.PluginList.Count > 1 then
|
if FPluginManager.PluginList.Count > 1 then
|
||||||
(FPluginManager.Item[1] as TLegalNoticePlugin).Opacity := seOpacity.Value / 100;
|
(FPluginManager.Item[1] as TLegalNoticePlugin).BackgroundOpacity := seOpacity.Value / 100;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.btnSaveToImageClick(Sender: TObject);
|
procedure TMainForm.btnSaveToImageClick(Sender: TObject);
|
||||||
|
@ -5,43 +5,66 @@ object MainForm: TMainForm
|
|||||||
Width = 1109
|
Width = 1109
|
||||||
Caption = 'Linked maps demo'
|
Caption = 'Linked maps demo'
|
||||||
ChildSizing.HorizontalSpacing = 4
|
ChildSizing.HorizontalSpacing = 4
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
ChildSizing.ControlsPerLine = 1
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 2
|
|
||||||
ClientHeight = 406
|
ClientHeight = 406
|
||||||
ClientWidth = 1109
|
ClientWidth = 1109
|
||||||
LCLVersion = '4.99.0.0'
|
LCLVersion = '4.99.0.0'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
object MapView1: TMapView
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 406
|
Height = 375
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 552
|
Width = 1109
|
||||||
Cyclic = True
|
Align = alClient
|
||||||
DownloadEngine = MapView1.BuiltInDLE
|
BevelOuter = bvNone
|
||||||
DrawingEngine = MapView1.BuiltInDE
|
ChildSizing.HorizontalSpacing = 4
|
||||||
Layers = <>
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
Font.Color = clBlack
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
MapProvider = 'OpenStreetMap Mapnik'
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
PluginManager = PluginManager
|
ChildSizing.ControlsPerLine = 2
|
||||||
UseThreads = True
|
ClientHeight = 375
|
||||||
ZoomToCursor = False
|
ClientWidth = 1109
|
||||||
|
TabOrder = 0
|
||||||
|
object MapView1: TMapView
|
||||||
|
Left = 0
|
||||||
|
Height = 375
|
||||||
|
Top = 0
|
||||||
|
Width = 552
|
||||||
|
Cyclic = True
|
||||||
|
DownloadEngine = MapView1.BuiltInDLE
|
||||||
|
DrawingEngine = MapView1.BuiltInDE
|
||||||
|
Layers = <>
|
||||||
|
Font.Color = clBlack
|
||||||
|
MapProvider = 'OpenStreetMap Mapnik'
|
||||||
|
PluginManager = PluginManager
|
||||||
|
UseThreads = True
|
||||||
|
ZoomToCursor = False
|
||||||
|
end
|
||||||
|
object MapView2: TMapView
|
||||||
|
Left = 556
|
||||||
|
Height = 375
|
||||||
|
Top = 0
|
||||||
|
Width = 553
|
||||||
|
Cyclic = True
|
||||||
|
DownloadEngine = MapView2.BuiltInDLE
|
||||||
|
DrawingEngine = MapView2.BuiltInDE
|
||||||
|
Layers = <>
|
||||||
|
Font.Color = clBlack
|
||||||
|
MapProvider = 'Maps For Free'
|
||||||
|
PluginManager = PluginManager
|
||||||
|
UseThreads = True
|
||||||
|
ZoomToCursor = False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object MapView2: TMapView
|
object Label1: TLabel
|
||||||
Left = 556
|
Left = 8
|
||||||
Height = 406
|
Height = 15
|
||||||
Top = 0
|
Top = 383
|
||||||
Width = 553
|
Width = 1093
|
||||||
Cyclic = True
|
Align = alBottom
|
||||||
DownloadEngine = MapView2.BuiltInDLE
|
Alignment = taCenter
|
||||||
DrawingEngine = MapView2.BuiltInDE
|
BorderSpacing.Around = 8
|
||||||
Layers = <>
|
Caption = 'Zoom or move one map, and the other map will follow.'
|
||||||
Font.Color = clBlack
|
|
||||||
MapProvider = 'Maps For Free'
|
|
||||||
PluginManager = PluginManager
|
|
||||||
UseThreads = True
|
|
||||||
ZoomToCursor = False
|
|
||||||
end
|
end
|
||||||
object PluginManager: TMvPluginManager
|
object PluginManager: TMvPluginManager
|
||||||
Left = 424
|
Left = 424
|
||||||
|
@ -5,13 +5,19 @@ unit main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, ExtCtrls, mvMapViewer, mvPluginCore, mvPlugins, SysUtils, Forms,
|
Classes, SysUtils,
|
||||||
Controls, Graphics;
|
Graphics, Controls, StdCtrls, ExtCtrls, Forms,
|
||||||
|
mvMapViewer, mvPluginCore, mvPlugins;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
|
Label1: TLabel;
|
||||||
MapView1: TMapView;
|
MapView1: TMapView;
|
||||||
MapView2: TMapView;
|
MapView2: TMapView;
|
||||||
|
Panel1: TPanel;
|
||||||
PluginManager: TMvPluginManager;
|
PluginManager: TMvPluginManager;
|
||||||
LinkedMapsPlugin: TLinkedMapsPlugin;
|
LinkedMapsPlugin: TLinkedMapsPlugin;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
@ -51,13 +51,15 @@ object Form1: TForm1
|
|||||||
end
|
end
|
||||||
object ValueListEditor1: TValueListEditor
|
object ValueListEditor1: TValueListEditor
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 255
|
Height = 288
|
||||||
Top = 72
|
Top = 72
|
||||||
Width = 192
|
Width = 192
|
||||||
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
FixedCols = 0
|
FixedCols = 0
|
||||||
RowCount = 2
|
RowCount = 2
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
DisplayOptions = [doColumnTitles, doAutoColResize]
|
DisplayOptions = [doColumnTitles, doAutoColResize]
|
||||||
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goAlwaysShowEditor, goThumbTracking]
|
||||||
TitleCaptions.Strings = (
|
TitleCaptions.Strings = (
|
||||||
'Index'
|
'Index'
|
||||||
'Plugin'
|
'Plugin'
|
||||||
@ -73,24 +75,24 @@ object Form1: TForm1
|
|||||||
Top = 120
|
Top = 120
|
||||||
object MvPluginManager1LegalNoticePlugin1: TLegalNoticePlugin
|
object MvPluginManager1LegalNoticePlugin1: TLegalNoticePlugin
|
||||||
BackgroundColor = clWhite
|
BackgroundColor = clWhite
|
||||||
|
BackgroundOpacity = 1
|
||||||
Font.Height = -19
|
Font.Height = -19
|
||||||
LegalNotice = 'Test 1'
|
LegalNotice = 'Test 1'
|
||||||
Opacity = 1
|
|
||||||
end
|
end
|
||||||
object MvPluginManager1LegalNoticePlugin2: TLegalNoticePlugin
|
object MvPluginManager1LegalNoticePlugin2: TLegalNoticePlugin
|
||||||
BackgroundColor = clYellow
|
BackgroundColor = clYellow
|
||||||
|
BackgroundOpacity = 1
|
||||||
Font.Color = clRed
|
Font.Color = clRed
|
||||||
Font.Height = -19
|
Font.Height = -19
|
||||||
LegalNotice = 'Test 2'
|
LegalNotice = 'Test 2'
|
||||||
Opacity = 1
|
|
||||||
Spacing = 14
|
Spacing = 14
|
||||||
end
|
end
|
||||||
object MvPluginManager1LegalNoticePlugin3: TLegalNoticePlugin
|
object MvPluginManager1LegalNoticePlugin3: TLegalNoticePlugin
|
||||||
BackgroundColor = clBlue
|
BackgroundColor = clBlue
|
||||||
|
BackgroundOpacity = 1
|
||||||
Font.Color = clWhite
|
Font.Color = clWhite
|
||||||
Font.Height = -19
|
Font.Height = -19
|
||||||
LegalNotice = 'Test 3'
|
LegalNotice = 'Test 3'
|
||||||
Opacity = 1
|
|
||||||
Spacing = 24
|
Spacing = 24
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
object MainForm: TMainForm
|
object MainForm: TMainForm
|
||||||
Left = 390
|
Left = 390
|
||||||
Height = 467
|
Height = 555
|
||||||
Top = 139
|
Top = 139
|
||||||
Width = 936
|
Width = 936
|
||||||
Caption = 'Map Scale Demo'
|
Caption = 'Map Scale Demo'
|
||||||
ClientHeight = 467
|
ClientHeight = 555
|
||||||
ClientWidth = 936
|
ClientWidth = 936
|
||||||
LCLVersion = '4.99.0.0'
|
LCLVersion = '4.99.0.0'
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
object MapView: TMapView
|
object MapView: TMapView
|
||||||
Left = 328
|
Left = 336
|
||||||
Height = 467
|
Height = 555
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 608
|
Width = 600
|
||||||
Align = alClient
|
Align = alClient
|
||||||
DownloadEngine = MapView.BuiltInDLE
|
DownloadEngine = MapView.BuiltInDLE
|
||||||
DrawingEngine = MapView.BuiltInDE
|
DrawingEngine = MapView.BuiltInDE
|
||||||
@ -32,15 +32,15 @@ object MainForm: TMainForm
|
|||||||
OnZoomChange = MapViewZoomChange
|
OnZoomChange = MapViewZoomChange
|
||||||
end
|
end
|
||||||
object ParamsPanel: TPanel
|
object ParamsPanel: TPanel
|
||||||
Left = 8
|
Left = 12
|
||||||
Height = 451
|
Height = 531
|
||||||
Top = 8
|
Top = 12
|
||||||
Width = 312
|
Width = 312
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 8
|
BorderSpacing.Around = 12
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 451
|
ClientHeight = 531
|
||||||
ClientWidth = 312
|
ClientWidth = 312
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object cbScaleVisible: TCheckBox
|
object cbScaleVisible: TCheckBox
|
||||||
@ -70,7 +70,7 @@ object MainForm: TMainForm
|
|||||||
AutoFill = True
|
AutoFill = True
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 12
|
BorderSpacing.Top = 12
|
||||||
Caption = 'Scale Align'
|
Caption = 'Scale Alignment'
|
||||||
ChildSizing.LeftRightSpacing = 6
|
ChildSizing.LeftRightSpacing = 6
|
||||||
ChildSizing.TopBottomSpacing = 6
|
ChildSizing.TopBottomSpacing = 6
|
||||||
ChildSizing.HorizontalSpacing = 6
|
ChildSizing.HorizontalSpacing = 6
|
||||||
@ -128,7 +128,7 @@ object MainForm: TMainForm
|
|||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'metric (km, m)'
|
'metric (km, m)'
|
||||||
'imperial (miles)'
|
'imperial (miles, feet)'
|
||||||
)
|
)
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnClick = rgLengthUnitsClick
|
OnClick = rgLengthUnitsClick
|
||||||
@ -144,7 +144,7 @@ object MainForm: TMainForm
|
|||||||
Top = 211
|
Top = 211
|
||||||
Width = 312
|
Width = 312
|
||||||
BorderSpacing.Top = 16
|
BorderSpacing.Top = 16
|
||||||
Caption = 'Zoom minimum'
|
Caption = 'Zoom Minimum'
|
||||||
ClientHeight = 85
|
ClientHeight = 85
|
||||||
ClientWidth = 308
|
ClientWidth = 308
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
@ -158,6 +158,7 @@ object MainForm: TMainForm
|
|||||||
Height = 30
|
Height = 30
|
||||||
Top = 39
|
Top = 39
|
||||||
Width = 284
|
Width = 284
|
||||||
|
Alignment = taCenter
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
BorderSpacing.Around = 12
|
BorderSpacing.Around = 12
|
||||||
@ -167,12 +168,12 @@ object MainForm: TMainForm
|
|||||||
object seZoomMin: TSpinEdit
|
object seZoomMin: TSpinEdit
|
||||||
AnchorSideLeft.Control = gbZoomMin
|
AnchorSideLeft.Control = gbZoomMin
|
||||||
AnchorSideTop.Control = gbZoomMin
|
AnchorSideTop.Control = gbZoomMin
|
||||||
Left = 12
|
Left = 24
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 92
|
Width = 92
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
BorderSpacing.Left = 12
|
BorderSpacing.Left = 24
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnChange = seZoomMinChange
|
OnChange = seZoomMinChange
|
||||||
end
|
end
|
||||||
@ -183,18 +184,221 @@ object MainForm: TMainForm
|
|||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = gbZoomMin
|
AnchorSideRight.Control = gbZoomMin
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 104
|
Left = 116
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 204
|
Width = 192
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
Caption = 'Current zoom level: '
|
Caption = 'Current zoom level: '
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object gbPen: TGroupBox
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = gbZoomMin
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ParamsPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 0
|
||||||
|
Height = 53
|
||||||
|
Top = 332
|
||||||
|
Width = 312
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Top = 16
|
||||||
|
Caption = 'Scale Bar Pen'
|
||||||
|
ClientHeight = 33
|
||||||
|
ClientWidth = 308
|
||||||
|
TabOrder = 4
|
||||||
|
object lblPenWidth: TLabel
|
||||||
|
AnchorSideLeft.Control = gbPen
|
||||||
|
AnchorSideTop.Control = sePenWidth
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 24
|
||||||
|
Height = 15
|
||||||
|
Top = 4
|
||||||
|
Width = 32
|
||||||
|
BorderSpacing.Left = 24
|
||||||
|
Caption = 'Width'
|
||||||
|
end
|
||||||
|
object sePenWidth: TSpinEdit
|
||||||
|
AnchorSideLeft.Control = lblPenWidth
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = Bevel1
|
||||||
|
Left = 68
|
||||||
|
Height = 23
|
||||||
|
Top = 0
|
||||||
|
Width = 74
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 12
|
||||||
|
MaxValue = 10
|
||||||
|
MinValue = 1
|
||||||
|
TabOrder = 0
|
||||||
|
Value = 1
|
||||||
|
OnChange = sePenWidthChange
|
||||||
|
end
|
||||||
|
object clbPenColor: TColorButton
|
||||||
|
AnchorSideLeft.Control = Bevel1
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = gbPen
|
||||||
|
AnchorSideRight.Control = gbPen
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 166
|
||||||
|
Height = 25
|
||||||
|
Top = 0
|
||||||
|
Width = 134
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Right = 8
|
||||||
|
BorderSpacing.Bottom = 8
|
||||||
|
BorderWidth = 2
|
||||||
|
ButtonColorAutoSize = False
|
||||||
|
ButtonColorSize = 16
|
||||||
|
ButtonColor = clBlack
|
||||||
|
Caption = 'Line color'
|
||||||
|
OnColorChanged = clbPenColorChanged
|
||||||
|
end
|
||||||
|
object Bevel1: TBevel
|
||||||
|
AnchorSideLeft.Control = gbPen
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
Left = 142
|
||||||
|
Height = 26
|
||||||
|
Top = 1
|
||||||
|
Width = 24
|
||||||
|
Shape = bsSpacer
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object gbFont: TGroupBox
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = gbPen
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ParamsPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 0
|
||||||
|
Height = 53
|
||||||
|
Top = 401
|
||||||
|
Width = 312
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Top = 16
|
||||||
|
Caption = 'Font'
|
||||||
|
ClientHeight = 33
|
||||||
|
ClientWidth = 308
|
||||||
|
TabOrder = 5
|
||||||
|
object btnFont: TButton
|
||||||
|
AnchorSideLeft.Control = gbFont
|
||||||
|
AnchorSideTop.Control = gbFont
|
||||||
|
Left = 24
|
||||||
|
Height = 25
|
||||||
|
Top = 0
|
||||||
|
Width = 75
|
||||||
|
BorderSpacing.Left = 24
|
||||||
|
BorderSpacing.Bottom = 8
|
||||||
|
Caption = 'Font...'
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = btnFontClick
|
||||||
|
end
|
||||||
|
object lblFontSample: TLabel
|
||||||
|
AnchorSideLeft.Control = btnFont
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = btnFont
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = gbFont
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 99
|
||||||
|
Height = 15
|
||||||
|
Top = 5
|
||||||
|
Width = 209
|
||||||
|
Alignment = taCenter
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
Caption = '1000 km'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object gbBackground: TGroupBox
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = gbFont
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ParamsPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 0
|
||||||
|
Height = 53
|
||||||
|
Top = 470
|
||||||
|
Width = 312
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Top = 16
|
||||||
|
Caption = 'Background'
|
||||||
|
ClientHeight = 33
|
||||||
|
ClientWidth = 308
|
||||||
|
TabOrder = 6
|
||||||
|
object lblOpacity: TLabel
|
||||||
|
AnchorSideLeft.Control = gbBackground
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 16
|
||||||
|
Height = 15
|
||||||
|
Top = 5
|
||||||
|
Width = 41
|
||||||
|
BorderSpacing.Left = 16
|
||||||
|
Caption = 'Opacity'
|
||||||
|
end
|
||||||
|
object clbBackgroundColor: TColorButton
|
||||||
|
AnchorSideLeft.Control = Bevel2
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = gbBackground
|
||||||
|
AnchorSideRight.Control = gbBackground
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 166
|
||||||
|
Height = 25
|
||||||
|
Top = 0
|
||||||
|
Width = 134
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Right = 8
|
||||||
|
BorderSpacing.Bottom = 8
|
||||||
|
BorderWidth = 2
|
||||||
|
ButtonColorAutoSize = False
|
||||||
|
ButtonColorSize = 16
|
||||||
|
ButtonColor = clBlack
|
||||||
|
Caption = 'Background color'
|
||||||
|
OnColorChanged = clbBackgroundColorChanged
|
||||||
|
end
|
||||||
|
object Bevel2: TBevel
|
||||||
|
AnchorSideLeft.Control = gbBackground
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
Left = 142
|
||||||
|
Height = 26
|
||||||
|
Top = 2
|
||||||
|
Width = 24
|
||||||
|
Shape = bsSpacer
|
||||||
|
end
|
||||||
|
object seOpacity: TFloatSpinEdit
|
||||||
|
AnchorSideLeft.Control = lblOpacity
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = Bevel2
|
||||||
|
Left = 69
|
||||||
|
Height = 23
|
||||||
|
Top = 2
|
||||||
|
Width = 73
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 12
|
||||||
|
Increment = 0.05
|
||||||
|
MaxValue = 1
|
||||||
|
TabOrder = 0
|
||||||
|
Value = 1
|
||||||
|
OnChange = seOpacityChange
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object PluginManager: TMvPluginManager
|
object PluginManager: TMvPluginManager
|
||||||
Left = 429
|
Left = 429
|
||||||
Top = 105
|
Top = 105
|
||||||
end
|
end
|
||||||
|
object FontDialog: TFontDialog
|
||||||
|
MinFontSize = 0
|
||||||
|
MaxFontSize = 0
|
||||||
|
Left = 132
|
||||||
|
Top = 398
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -14,8 +14,20 @@ type
|
|||||||
{ TMainForm }
|
{ TMainForm }
|
||||||
|
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
|
Bevel1: TBevel;
|
||||||
|
Bevel2: TBevel;
|
||||||
|
btnFont: TButton;
|
||||||
cbScaleVisible: TCheckBox;
|
cbScaleVisible: TCheckBox;
|
||||||
|
clbBackgroundColor: TColorButton;
|
||||||
|
clbPenColor: TColorButton;
|
||||||
|
FontDialog: TFontDialog;
|
||||||
|
gbFont: TGroupBox;
|
||||||
|
gbBackground: TGroupBox;
|
||||||
gbZoomMin: TGroupBox;
|
gbZoomMin: TGroupBox;
|
||||||
|
gbPen: TGroupBox;
|
||||||
|
lblFontSample: TLabel;
|
||||||
|
lblPenWidth: TLabel;
|
||||||
|
lblOpacity: TLabel;
|
||||||
lblZoomMinInfo: TLabel;
|
lblZoomMinInfo: TLabel;
|
||||||
lblCurrentZoom: TLabel;
|
lblCurrentZoom: TLabel;
|
||||||
MapView: TMapView;
|
MapView: TMapView;
|
||||||
@ -23,12 +35,19 @@ type
|
|||||||
ParamsPanel: TPanel;
|
ParamsPanel: TPanel;
|
||||||
rgLengthUnits: TRadioGroup;
|
rgLengthUnits: TRadioGroup;
|
||||||
rgScaleAlign: TRadioGroup;
|
rgScaleAlign: TRadioGroup;
|
||||||
|
seOpacity: TFloatSpinEdit;
|
||||||
seZoomMin: TSpinEdit;
|
seZoomMin: TSpinEdit;
|
||||||
|
sePenWidth: TSpinEdit;
|
||||||
|
procedure btnFontClick(Sender: TObject);
|
||||||
procedure cbScaleVisibleChange(Sender: TObject);
|
procedure cbScaleVisibleChange(Sender: TObject);
|
||||||
|
procedure clbBackgroundColorChanged(Sender: TObject);
|
||||||
|
procedure clbPenColorChanged(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure MapViewZoomChange(Sender: TObject);
|
procedure MapViewZoomChange(Sender: TObject);
|
||||||
procedure rgLengthUnitsClick(Sender: TObject);
|
procedure rgLengthUnitsClick(Sender: TObject);
|
||||||
procedure rgScaleAlignClick(Sender: TObject);
|
procedure rgScaleAlignClick(Sender: TObject);
|
||||||
|
procedure seOpacityChange(Sender: TObject);
|
||||||
|
procedure sePenWidthChange(Sender: TObject);
|
||||||
procedure seZoomMinChange(Sender: TObject);
|
procedure seZoomMinChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
FScalePlugin: TMapScalePlugin;
|
FScalePlugin: TMapScalePlugin;
|
||||||
@ -60,13 +79,23 @@ begin
|
|||||||
seZoomMin.MaxValue := zoomMax;
|
seZoomMin.MaxValue := zoomMax;
|
||||||
seZoomMin.MinValue := zoomMin;
|
seZoomMin.MinValue := zoomMin;
|
||||||
seZoomMin.Value := FScalePlugin.ZoomMin;
|
seZoomMin.Value := FScalePlugin.ZoomMin;
|
||||||
|
sePenWidth.Value := FScalePlugin.Pen.Width;
|
||||||
|
seOpacity.Value := FScalePlugin.BackgroundOpacity;
|
||||||
|
clbPenColor.ButtonColor := FScalePlugin.Pen.Color;
|
||||||
|
clbBackgroundColor.ButtonColor := FScalePlugin.BackgroundColor;
|
||||||
|
lblFontSample.Font.Assign(FScalePlugin.Font);
|
||||||
|
|
||||||
UpdateZoomInfo;
|
UpdateZoomInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.MapViewZoomChange(Sender: TObject);
|
procedure TMainForm.btnFontClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
UpdateZoomInfo;
|
FontDialog.Font.Assign(FScalePlugin.Font);
|
||||||
|
if FontDialog.Execute then
|
||||||
|
begin
|
||||||
|
FScalePlugin.Font.Assign(FontDialog.Font);
|
||||||
|
lblFontSample.Font.Assign(FontDialog.Font);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.cbScaleVisibleChange(Sender: TObject);
|
procedure TMainForm.cbScaleVisibleChange(Sender: TObject);
|
||||||
@ -74,11 +103,26 @@ begin
|
|||||||
FScalePlugin.Enabled := cbScaleVisible.Checked;
|
FScalePlugin.Enabled := cbScaleVisible.Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.clbBackgroundColorChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FScalePlugin.BackgroundColor := clbBackgroundColor.ButtonColor;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.clbPenColorChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FScalePlugin.Pen.Color := clbPenColor.ButtonColor;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.rgLengthUnitsClick(Sender: TObject);
|
procedure TMainForm.rgLengthUnitsClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FScalePlugin.Imperial := rgLengthUnits.ItemIndex = 1;
|
FScalePlugin.Imperial := rgLengthUnits.ItemIndex = 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.MapViewZoomChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdateZoomInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.rgScaleAlignClick(Sender: TObject);
|
procedure TMainForm.rgScaleAlignClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
alignSet: TScaleAlignSet;
|
alignSet: TScaleAlignSet;
|
||||||
@ -98,6 +142,16 @@ begin
|
|||||||
FScalePlugin.AlignSet := alignSet;
|
FScalePlugin.AlignSet := alignSet;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.seOpacityChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FScalePlugin.BackgroundOpacity := seOpacity.Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.sePenWidthChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FScalePlugin.Pen.Width := sePenWidth.Value;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.seZoomMinChange(Sender: TObject);
|
procedure TMainForm.seZoomMinChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FScalePlugin.ZoomMin := seZoomMin.Value;
|
FScalePlugin.ZoomMin := seZoomMin.Value;
|
||||||
|
@ -16,36 +16,25 @@ type
|
|||||||
TMapGridLabelPosition = (glpLeft, glpTop, glpRight, glpBottom);
|
TMapGridLabelPosition = (glpLeft, glpTop, glpRight, glpBottom);
|
||||||
TMapGridLabelPositions = set of TMapGridLabelPosition;
|
TMapGridLabelPositions = set of TMapGridLabelPosition;
|
||||||
|
|
||||||
TMapGridPlugin = class(TMvPlugin)
|
TMapGridPlugin = class(TMvDrawPlugin)
|
||||||
private
|
private
|
||||||
const
|
const
|
||||||
DEFAULT_LABEL_POSITIONS = [glpLeft, glpTop];
|
DEFAULT_LABEL_POSITIONS = [glpLeft, glpTop];
|
||||||
DEFAULT_MAX_DISTANCE = 200;
|
DEFAULT_MAX_DISTANCE = 200;
|
||||||
DEFAULT_MIN_DISTANCE = 80;
|
DEFAULT_MIN_DISTANCE = 80;
|
||||||
DEFAULT_OPACITY = 0.55;
|
|
||||||
type
|
type
|
||||||
TGridCoordType = (gctLatitude, gctLongitude);
|
TGridCoordType = (gctLatitude, gctLongitude);
|
||||||
private
|
private
|
||||||
FBackgroundColor: TColor;
|
|
||||||
FBackgroundOpacity: Single;
|
|
||||||
FFont: TFont;
|
|
||||||
FIncrement: Double;
|
FIncrement: Double;
|
||||||
FPen: TPen;
|
|
||||||
FLabelDistance: Integer;
|
FLabelDistance: Integer;
|
||||||
FLabelPositions: TMapGridLabelPositions;
|
FLabelPositions: TMapGridLabelPositions;
|
||||||
FMaxDistance: Integer;
|
FMaxDistance: Integer;
|
||||||
FMinDistance: Integer;
|
FMinDistance: Integer;
|
||||||
procedure SetBackgroundColor(AValue: TColor);
|
|
||||||
procedure SetBackgroundOpacity(AValue: Single);
|
|
||||||
procedure SetFont(AValue: TFont);
|
|
||||||
procedure SetIncrement(AValue: Double);
|
procedure SetIncrement(AValue: Double);
|
||||||
procedure SetLabelDistance(AValue: Integer);
|
procedure SetLabelDistance(AValue: Integer);
|
||||||
procedure SetLabelPositions(AValue: TMapGridLabelPositions);
|
procedure SetLabelPositions(AValue: TMapGridLabelPositions);
|
||||||
procedure SetMaxDistance(AValue: Integer);
|
procedure SetMaxDistance(AValue: Integer);
|
||||||
procedure SetMinDistance(AValue: Integer);
|
procedure SetMinDistance(AValue: Integer);
|
||||||
procedure SetPen(AValue: TPen);
|
|
||||||
private
|
|
||||||
procedure Changed(Sender: TObject);
|
|
||||||
protected
|
protected
|
||||||
procedure BeforeDrawObjects(AMapView: TMapView; var {%H-}Handled: Boolean); override;
|
procedure BeforeDrawObjects(AMapView: TMapView; var {%H-}Handled: Boolean); override;
|
||||||
function CalcIncrement(AMapView: TMapView; Area: TRealArea): Double;
|
function CalcIncrement(AMapView: TMapView; Area: TRealArea): Double;
|
||||||
@ -57,17 +46,18 @@ type
|
|||||||
function GetLatLonAsString(AValue: Double; ACoordType: TGridCoordType): String; virtual;
|
function GetLatLonAsString(AValue: Double; ACoordType: TGridCoordType): String; virtual;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
procedure Assign(ASource: TPersistent); override;
|
||||||
published
|
published
|
||||||
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clWhite;
|
|
||||||
property BackgroundOpacity: Single read FBackgroundOpacity write SetBackgroundOpacity;
|
|
||||||
property Font: TFont read FFont write SetFont;
|
|
||||||
property Increment: Double read FIncrement write SetIncrement; // 0 = automatic increment detection
|
property Increment: Double read FIncrement write SetIncrement; // 0 = automatic increment detection
|
||||||
property LabelDistance: Integer read FLabelDistance write SetLabelDistance default 0;
|
property LabelDistance: Integer read FLabelDistance write SetLabelDistance default 0;
|
||||||
property LabelPositions: TMapGridLabelPositions read FLabelPositions write SetLabelPositions default DEFAULT_LABEL_POSITIONS;
|
property LabelPositions: TMapGridLabelPositions read FLabelPositions write SetLabelPositions default DEFAULT_LABEL_POSITIONS;
|
||||||
property MaxDistance: Integer read FMaxDistance write SetMaxDistance default DEFAULT_MAX_DISTANCE;
|
property MaxDistance: Integer read FMaxDistance write SetMaxDistance default DEFAULT_MAX_DISTANCE;
|
||||||
property MinDistance: Integer read FMinDistance write SetMinDistance default DEFAULT_MIN_DISTANCE;
|
property MinDistance: Integer read FMinDistance write SetMinDistance default DEFAULT_MIN_DISTANCE;
|
||||||
property Pen: TPen read FPen write SetPen;
|
// inherited properties
|
||||||
|
property BackgroundColor;
|
||||||
|
property BackgroundOpacity;
|
||||||
|
property Font;
|
||||||
|
property Pen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -81,22 +71,19 @@ uses
|
|||||||
constructor TMapGridPlugin.Create(AOwner: TComponent);
|
constructor TMapGridPlugin.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
FBackgroundColor := clWhite;
|
|
||||||
FBackgroundOpacity := DEFAULT_OPACITY;
|
|
||||||
FFont := TFont.Create;
|
|
||||||
FFont.OnChange := @Changed;
|
|
||||||
FPen := TPen.Create;
|
|
||||||
FPen.OnChange := @Changed;
|
|
||||||
FMaxDistance := DEFAULT_MAX_DISTANCE;
|
FMaxDistance := DEFAULT_MAX_DISTANCE;
|
||||||
FMinDistance := DEFAULT_MIN_DISTANCE;
|
FMinDistance := DEFAULT_MIN_DISTANCE;
|
||||||
FLabelPositions := DEFAULT_LABEL_POSITIONS;
|
FLabelPositions := DEFAULT_LABEL_POSITIONS;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TMapGridPlugin.Destroy;
|
procedure TMapGridPlugin.Assign(ASource: TPersistent);
|
||||||
begin
|
begin
|
||||||
FPen.Free;
|
if (ASource is TMapGridPlugin) then
|
||||||
FFont.Free;
|
begin
|
||||||
inherited;
|
FLabelPositions := TMapGridPlugin(ASource).LabelPositions;
|
||||||
|
FMaxDistance := TMapGridPlugin(ASource).MaxDistance;
|
||||||
|
FMinDistance := TMapGridPlugin(ASource).MinDistance;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMapGridPlugin.BeforeDrawObjects(AMapView: TMapView; var Handled: Boolean);
|
procedure TMapGridPlugin.BeforeDrawObjects(AMapView: TMapView; var Handled: Boolean);
|
||||||
@ -120,14 +107,14 @@ begin
|
|||||||
else
|
else
|
||||||
incr := FIncrement;
|
incr := FIncrement;
|
||||||
|
|
||||||
AMapView.DrawingEngine.PenStyle := FPen.Style;
|
AMapView.DrawingEngine.PenStyle := Pen.Style;
|
||||||
AMapView.DrawingEngine.PenWidth := FPen.Width;
|
AMapView.DrawingEngine.PenWidth := Pen.Width;
|
||||||
AMapView.DrawingEngine.PenColor := FPen.Color;
|
AMapView.DrawingEngine.PenColor := Pen.Color;
|
||||||
AMapView.DrawingEngine.BrushColor := FBackgroundColor;
|
AMapView.DrawingEngine.BrushColor := BackgroundColor;
|
||||||
AMapView.DrawingEngine.FontName := FFont.Name;
|
AMapView.DrawingEngine.FontName := Font.Name;
|
||||||
AMapView.DrawingEngine.FontSize := FFont.Size;
|
AMapView.DrawingEngine.FontSize := Font.Size;
|
||||||
AMapView.DrawingEngine.FontStyle := FFont.Style;
|
AMapView.DrawingEngine.FontStyle := Font.Style;
|
||||||
AMapView.DrawingEngine.FontColor := FFont.Color;
|
AMapView.DrawingEngine.FontColor := Font.Color;
|
||||||
|
|
||||||
for coordType in TGridCoordType do
|
for coordType in TGridCoordType do
|
||||||
begin
|
begin
|
||||||
@ -191,11 +178,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMapGridPlugin.Changed(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMapGridPlugin.DrawGridLine(ADrawingEngine: TMvCustomDrawingEngine;
|
procedure TMapGridPlugin.DrawGridLine(ADrawingEngine: TMvCustomDrawingEngine;
|
||||||
AValue: Double; P1, P2: TPoint; AMapRect: TRect);
|
AValue: Double; P1, P2: TPoint; AMapRect: TRect);
|
||||||
var
|
var
|
||||||
@ -271,9 +253,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Draw (semi-transparent) background
|
// Draw (semi-transparent) background
|
||||||
if FBackgroundColor <> clNone then
|
if BackgroundColor <> clNone then
|
||||||
begin
|
begin
|
||||||
ADrawingEngine.Opacity := FBackgroundOpacity;
|
ADrawingEngine.Opacity := BackgroundOpacity;
|
||||||
ADrawingEngine.BrushStyle := bsSolid;
|
ADrawingEngine.BrushStyle := bsSolid;
|
||||||
case coordType of
|
case coordType of
|
||||||
gctLatitude:
|
gctLatitude:
|
||||||
@ -452,30 +434,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMapGridPlugin.SetBackgroundColor(AValue: TColor);
|
|
||||||
begin
|
|
||||||
if FBackgroundColor <> AValue then
|
|
||||||
begin
|
|
||||||
FBackgroundColor := AValue;
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMapGridPlugin.SetBackgroundOpacity(AValue: Single);
|
|
||||||
begin
|
|
||||||
if FBackgroundOpacity <> AValue then
|
|
||||||
begin
|
|
||||||
FBackgroundOpacity := AValue;
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMapGridPlugin.SetFont(AValue: TFont);
|
|
||||||
begin
|
|
||||||
FFont := AValue;
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMapGridPlugin.SetIncrement(AValue: Double);
|
procedure TMapGridPlugin.SetIncrement(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FIncrement <> AValue then
|
if FIncrement <> AValue then
|
||||||
@ -521,12 +479,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMapGridPlugin.SetPen(AValue: TPen);
|
|
||||||
begin
|
|
||||||
FPen.Assign(AValue);
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterPluginClass(TMapGridPlugin, 'Map grid');
|
RegisterPluginClass(TMapGridPlugin, 'Map grid');
|
||||||
|
@ -12,24 +12,20 @@ uses
|
|||||||
type
|
type
|
||||||
{ TCenterMarkerPlugin - draws a cross in the map center }
|
{ TCenterMarkerPlugin - draws a cross in the map center }
|
||||||
|
|
||||||
TCenterMarkerPlugin = class(TMvPlugin)
|
TCenterMarkerPlugin = class(TMvDrawPlugin)
|
||||||
private
|
private
|
||||||
const
|
const
|
||||||
DEFAULT_MARKER_SIZE = 15;
|
DEFAULT_MARKER_SIZE = 15;
|
||||||
private
|
private
|
||||||
FPen: TPen;
|
|
||||||
FSize: Integer;
|
FSize: Integer;
|
||||||
procedure Changed(Sender: TObject);
|
|
||||||
procedure SetPen(AValue: TPen);
|
|
||||||
procedure SetSize(AValue: Integer);
|
procedure SetSize(AValue: Integer);
|
||||||
protected
|
protected
|
||||||
procedure AfterDrawObjects(AMapView: TMapView; var {%H-}Handled: Boolean); override;
|
procedure AfterDrawObjects(AMapView: TMapView; var {%H-}Handled: Boolean); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
published
|
published
|
||||||
property Pen: TPen read FPen write SetPen;
|
property Pen;
|
||||||
property Size: Integer read FSize write SetSize default DEFAULT_MARKER_SIZE;
|
property Size: Integer read FSize write SetSize default DEFAULT_MARKER_SIZE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -57,17 +53,17 @@ type
|
|||||||
private
|
private
|
||||||
FLegalNotice: String;
|
FLegalNotice: String;
|
||||||
FLegalNoticeURL: String;
|
FLegalNoticeURL: String;
|
||||||
FOpacity: Single;
|
FBackgroundOpacity: Single;
|
||||||
FPosition: TLegalNoticePosition;
|
FPosition: TLegalNoticePosition;
|
||||||
FFont: TFont;
|
FFont: TFont;
|
||||||
FSpacing: Integer;
|
FSpacing: Integer;
|
||||||
FBackgroundColor: TColor;
|
FBackgroundColor: TColor;
|
||||||
private
|
private
|
||||||
procedure SetBackgroundColor(AValue: TColor);
|
procedure SetBackgroundColor(AValue: TColor);
|
||||||
|
procedure SetBackgroundOpacity(AValue: Single);
|
||||||
procedure SetFont(AValue: TFont);
|
procedure SetFont(AValue: TFont);
|
||||||
procedure SetLegalNotice(AValue: String);
|
procedure SetLegalNotice(AValue: String);
|
||||||
procedure SetLegalNoticeURL(AValue: String);
|
procedure SetLegalNoticeURL(AValue: String);
|
||||||
procedure SetOpacity(AValue: Single);
|
|
||||||
procedure SetPosition(AValue: TLegalNoticePosition);
|
procedure SetPosition(AValue: TLegalNoticePosition);
|
||||||
procedure SetSpacing(AValue: Integer);
|
procedure SetSpacing(AValue: Integer);
|
||||||
protected
|
protected
|
||||||
@ -86,29 +82,29 @@ type
|
|||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
published
|
published
|
||||||
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clNone;
|
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clNone;
|
||||||
|
property BackgroundOpacity: Single read FBackgroundOpacity write SetBackgroundOpacity default DEFAULT_LEGALNOTICE_OPACITY; // 0..1
|
||||||
property Font: TFont read FFont write SetFont;
|
property Font: TFont read FFont write SetFont;
|
||||||
property LegalNotice: String read FLegalNotice write SetLegalNotice;
|
property LegalNotice: String read FLegalNotice write SetLegalNotice;
|
||||||
property LegalNoticeURL: String read FLegalNoticeURL write SetLegalNoticeURL;
|
property LegalNoticeURL: String read FLegalNoticeURL write SetLegalNoticeURL;
|
||||||
property Opacity: Single read FOpacity write SetOpacity default DEFAULT_LEGALNOTICE_OPACITY;
|
|
||||||
property Position: TLegalNoticePosition read FPosition write SetPosition default lnpBottomRight;
|
property Position: TLegalNoticePosition read FPosition write SetPosition default lnpBottomRight;
|
||||||
property Spacing: Integer read FSpacing write SetSpacing default DEFAULT_LEGALNOTICE_SPACING;
|
property Spacing: Integer read FSpacing write SetSpacing default DEFAULT_LEGALNOTICE_SPACING;
|
||||||
// inherited properties
|
// inherited properties
|
||||||
property MapView;
|
property MapView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TDraggableMarkerPlugin }
|
||||||
|
|
||||||
TDraggableMarkerPlugin = class;
|
TDraggableMarkerPlugin = class;
|
||||||
TDraggableMarkerCanMoveEvent = function (Sender : TDraggableMarkerPlugin; AMarker : TGPSPoint) : Boolean of object;
|
TDraggableMarkerCanMoveEvent = function (Sender : TDraggableMarkerPlugin; AMarker : TGPSPoint) : Boolean of object;
|
||||||
TDraggableMarkerMovedEvent = procedure (Sender : TDraggableMarkerPlugin; AMarker : TGPSPoint; AOrgPosition : TRealPoint) of object;
|
TDraggableMarkerMovedEvent = procedure (Sender : TDraggableMarkerPlugin; AMarker : TGPSPoint; AOrgPosition : TRealPoint) of object;
|
||||||
|
|
||||||
{ TLegalNoticePluginData }
|
{ TDraggableMarkerData }
|
||||||
PDraggableMarkerData = ^TDraggableMarkerData;
|
PDraggableMarkerData = ^TDraggableMarkerData;
|
||||||
TDraggableMarkerData = record
|
TDraggableMarkerData = record
|
||||||
FDraggableMarker : TGPSPoint;
|
FDraggableMarker : TGPSPoint;
|
||||||
FOrgPosition : TRealPoint;
|
FOrgPosition : TRealPoint;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TDraggableMarkerPlugin }
|
|
||||||
|
|
||||||
TDraggableMarkerPlugin = class(TMvMultiMapsPlugin)
|
TDraggableMarkerPlugin = class(TMvMultiMapsPlugin)
|
||||||
private
|
private
|
||||||
FDraggableMarkerCanMoveEvent : TDraggableMarkerCanMoveEvent;
|
FDraggableMarkerCanMoveEvent : TDraggableMarkerCanMoveEvent;
|
||||||
@ -203,24 +199,13 @@ uses
|
|||||||
constructor TCenterMarkerPlugin.Create(AOwner: TComponent);
|
constructor TCenterMarkerPlugin.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
FPen := TPen.Create;
|
|
||||||
FPen.OnChange := @Changed;
|
|
||||||
FSize := DEFAULT_MARKER_SIZE;
|
FSize := DEFAULT_MARKER_SIZE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCenterMarkerPlugin.Destroy;
|
|
||||||
begin
|
|
||||||
FPen.Free;
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCenterMarkerPlugin.Assign(Source: TPersistent);
|
procedure TCenterMarkerPlugin.Assign(Source: TPersistent);
|
||||||
begin
|
begin
|
||||||
if Source is TCenterMarkerPlugin then
|
if Source is TCenterMarkerPlugin then
|
||||||
begin
|
|
||||||
FPen.Assign(TCenterMarkerPlugin(Source).Pen);
|
|
||||||
FSize := TCenterMarkerPlugin(Source).Size;
|
FSize := TCenterMarkerPlugin(Source).Size;
|
||||||
end;
|
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -230,25 +215,14 @@ var
|
|||||||
C: TPoint;
|
C: TPoint;
|
||||||
begin
|
begin
|
||||||
C := Point(AMapView.ClientWidth div 2, AMapView.ClientHeight div 2);
|
C := Point(AMapView.ClientWidth div 2, AMapView.ClientHeight div 2);
|
||||||
AMapView.DrawingEngine.PenColor := FPen.Color;
|
AMapView.DrawingEngine.PenColor := Pen.Color;
|
||||||
AMapView.DrawingEngine.PenStyle := FPen.Style;
|
AMapView.DrawingEngine.PenStyle := Pen.Style;
|
||||||
AMapView.DrawingEngine.PenWidth := FPen.Width;
|
AMapView.DrawingEngine.PenWidth := Pen.Width;
|
||||||
AMapView.DrawingEngine.Opacity := 1.0;
|
AMapView.DrawingEngine.Opacity := 1.0;
|
||||||
AMapView.DrawingEngine.Line(C.X, C.Y - FSize, C.X, C.Y + FSize);
|
AMapView.DrawingEngine.Line(C.X, C.Y - FSize, C.X, C.Y + FSize);
|
||||||
AMapView.DrawingEngine.Line(C.X - FSize, C.Y, C.X + FSize, C.Y);
|
AMapView.DrawingEngine.Line(C.X - FSize, C.Y, C.X + FSize, C.Y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCenterMarkerPlugin.Changed(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCenterMarkerPlugin.SetPen(AValue: TPen);
|
|
||||||
begin
|
|
||||||
FPen.Assign(AValue);
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCenterMarkerPlugin.SetSize(AValue: Integer);
|
procedure TCenterMarkerPlugin.SetSize(AValue: Integer);
|
||||||
begin
|
begin
|
||||||
if FSize <> AValue then
|
if FSize <> AValue then
|
||||||
@ -338,7 +312,7 @@ begin
|
|||||||
FPosition := lnpBottomRight;
|
FPosition := lnpBottomRight;
|
||||||
FFont := TFont.Create;
|
FFont := TFont.Create;
|
||||||
FFont.OnChange := @Changed;
|
FFont.OnChange := @Changed;
|
||||||
FOpacity := DEFAULT_LEGALNOTICE_OPACITY;
|
FBackgroundOpacity := DEFAULT_LEGALNOTICE_OPACITY;
|
||||||
FSpacing := DEFAULT_LEGALNOTICE_SPACING;
|
FSpacing := DEFAULT_LEGALNOTICE_SPACING;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -356,7 +330,7 @@ begin
|
|||||||
FFont.Assign(TLegalNoticePlugin(Source).Font);
|
FFont.Assign(TLegalNoticePlugin(Source).Font);
|
||||||
FLegalNotice := TLegalNoticePlugin(Source).LegalNotice;
|
FLegalNotice := TLegalNoticePlugin(Source).LegalNotice;
|
||||||
FLegalNoticeURL := TLegalNoticePlugin(Source).LegalNoticeURL;
|
FLegalNoticeURL := TLegalNoticePlugin(Source).LegalNoticeURL;
|
||||||
FOpacity := TLegalNoticePlugin(Source).Opacity;
|
FBackgroundOpacity := TLegalNoticePlugin(Source).BackgroundOpacity;
|
||||||
FPosition := TLegalNoticePlugin(Source).Position;
|
FPosition := TLegalNoticePlugin(Source).Position;
|
||||||
FSpacing := TLegalNoticePlugin(Source).Spacing;
|
FSpacing := TLegalNoticePlugin(Source).Spacing;
|
||||||
end;
|
end;
|
||||||
@ -380,7 +354,7 @@ begin
|
|||||||
try
|
try
|
||||||
if FBackgroundColor <> clNone then
|
if FBackgroundColor <> clNone then
|
||||||
begin
|
begin
|
||||||
AMapView.DrawingEngine.Opacity := FOpacity;
|
AMapView.DrawingEngine.Opacity := FBackgroundOpacity;
|
||||||
AMapView.DrawingEngine.BrushStyle := bsSolid;
|
AMapView.DrawingEngine.BrushStyle := bsSolid;
|
||||||
AMapView.DrawingEngine.BrushColor := ColorToRGB(FBackgroundColor);
|
AMapView.DrawingEngine.BrushColor := ColorToRGB(FBackgroundColor);
|
||||||
with lClickableRect do
|
with lClickableRect do
|
||||||
@ -464,9 +438,10 @@ var
|
|||||||
lClickableRect : TRect;
|
lClickableRect : TRect;
|
||||||
begin
|
begin
|
||||||
if GetMapViewData(AMapView,lClickableRect,SizeOf(lClickableRect)) < SizeOf(lClickableRect) then
|
if GetMapViewData(AMapView,lClickableRect,SizeOf(lClickableRect)) < SizeOf(lClickableRect) then
|
||||||
CalcClickableRect(AMapView,lClickableRect);
|
CalcClickableRect(AMapView, lClickableRect);
|
||||||
|
|
||||||
if PtInRect(lClickableRect, Point(X, Y)) and (not AMapView.Engine.InDrag) then
|
if PtInRect(lClickableRect, Point(X, Y)) and (not AMapView.Engine.InDrag) and
|
||||||
|
(FLegalNoticeURL <> '') then
|
||||||
begin
|
begin
|
||||||
FFont.Style := [fsUnderline];
|
FFont.Style := [fsUnderline];
|
||||||
AMapView.Cursor := crHandPoint;
|
AMapView.Cursor := crHandPoint;
|
||||||
@ -480,13 +455,6 @@ begin
|
|||||||
Update;
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLegalNoticePlugin.SetOpacity(AValue: Single);
|
|
||||||
begin
|
|
||||||
if FOpacity = AValue then Exit;
|
|
||||||
FOpacity := AValue;
|
|
||||||
Update;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TLegalNoticePlugin.SetPosition(AValue: TLegalNoticePosition);
|
procedure TLegalNoticePlugin.SetPosition(AValue: TLegalNoticePosition);
|
||||||
begin
|
begin
|
||||||
if FPosition = AValue then Exit;
|
if FPosition = AValue then Exit;
|
||||||
@ -515,6 +483,13 @@ begin
|
|||||||
Update;
|
Update;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLegalNoticePlugin.SetBackgroundOpacity(AValue: Single);
|
||||||
|
begin
|
||||||
|
if FBackgroundOpacity = AValue then Exit;
|
||||||
|
FBackgroundOpacity := AValue;
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLegalNoticePlugin.SetFont(AValue: TFont);
|
procedure TLegalNoticePlugin.SetFont(AValue: TFont);
|
||||||
begin
|
begin
|
||||||
FFont.Assign(AValue);
|
FFont.Assign(AValue);
|
||||||
|
@ -16,7 +16,7 @@ type
|
|||||||
|
|
||||||
TScaleAlignSet = set of alTop..alRight;
|
TScaleAlignSet = set of alTop..alRight;
|
||||||
|
|
||||||
TMapScalePlugin = class(TMvPlugin)
|
TMapScalePlugin = class(TMvDrawPlugin)
|
||||||
private
|
private
|
||||||
FSpaceY: Integer;
|
FSpaceY: Integer;
|
||||||
FAlignSet: TScaleAlignSet;
|
FAlignSet: TScaleAlignSet;
|
||||||
@ -41,6 +41,11 @@ type
|
|||||||
property SpaceY: Integer read FSpaceY write SetSpaceY default 10;
|
property SpaceY: Integer read FSpaceY write SetSpaceY default 10;
|
||||||
property WidthMax: Integer read FWidthMax write SetWidthMax default 250;
|
property WidthMax: Integer read FWidthMax write SetWidthMax default 250;
|
||||||
property ZoomMin: Integer read FZoomMin write SetZoomMin default 8;
|
property ZoomMin: Integer read FZoomMin write SetZoomMin default 8;
|
||||||
|
// inherited properties
|
||||||
|
property BackgroundColor;
|
||||||
|
property BackgroundOpacity;
|
||||||
|
property Font;
|
||||||
|
property Pen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -156,16 +161,16 @@ begin
|
|||||||
with AMapView.DrawingEngine do
|
with AMapView.DrawingEngine do
|
||||||
try
|
try
|
||||||
// Semitransparent background
|
// Semitransparent background
|
||||||
Opacity := 0.55;
|
Opacity := BackgroundOpacity;
|
||||||
BrushStyle := bsSolid;
|
BrushStyle := bsSolid;
|
||||||
BrushColor := clWhite;
|
BrushColor := BackgroundColor;
|
||||||
FillRect(R.Left, R.Top, R.Right, R.Bottom);
|
FillRect(R.Left, R.Top, R.Right, R.Bottom);
|
||||||
|
|
||||||
// Bar
|
// Bar
|
||||||
Opacity := 1.0;
|
Opacity := 1.0;
|
||||||
PenStyle := psSolid;
|
PenStyle := Self.Pen.Style;
|
||||||
PenColor := clBlack;
|
PenColor := Self.Pen.Color;
|
||||||
PenWidth := 1;
|
PenWidth := Self.Pen.Width;
|
||||||
Polyline([
|
Polyline([
|
||||||
R.TopLeft + Point(0, 10),
|
R.TopLeft + Point(0, 10),
|
||||||
R.TopLeft,
|
R.TopLeft,
|
||||||
@ -175,6 +180,8 @@ begin
|
|||||||
|
|
||||||
// Caption
|
// Caption
|
||||||
BrushStyle := bsClear;
|
BrushStyle := bsClear;
|
||||||
|
FontName := Self.Font.Name;
|
||||||
|
SetFont(Self.Font.Name, Self.Font.Size, Self.Font.Style, ColorToRGB(Self.Font.Color));
|
||||||
TextOut(R.CenterPoint.X - Extent.CX div 2, R.Top + 3, Capt);
|
TextOut(R.CenterPoint.X - Extent.CX div 2, R.Top + 3, Capt);
|
||||||
finally
|
finally
|
||||||
Opacity := OldOpacity;
|
Opacity := OldOpacity;
|
||||||
|
@ -5,8 +5,8 @@ unit mvPluginCore;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, StrUtils, Math, LazLoggerBase,
|
Classes, SysUtils, StrUtils, Contnrs, Math, LazLoggerBase,
|
||||||
Controls, Dialogs, Contnrs,
|
Graphics, Controls, Dialogs,
|
||||||
mvMapViewer, mvTypes, mvGpsObj, mvClassRegistration;
|
mvMapViewer, mvTypes, mvGpsObj, mvClassRegistration;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -82,6 +82,35 @@ type
|
|||||||
property MapView;
|
property MapView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TMvDrawPlugin - common ancestor of all plugins drawing something in the map }
|
||||||
|
|
||||||
|
TMvDrawPlugin = class(TMvPlugin)
|
||||||
|
private
|
||||||
|
const
|
||||||
|
DEFAULT_OPACITY = 0.55;
|
||||||
|
DEFAULT_BACKGROUND_COLOR = clWhite;
|
||||||
|
private
|
||||||
|
FBackgroundColor: TColor;
|
||||||
|
FBackgroundOpacity: Single;
|
||||||
|
FFont: TFont;
|
||||||
|
FPen: TPen;
|
||||||
|
function IsOpacityStored: Boolean;
|
||||||
|
procedure SetBackgroundColor(AValue: TColor);
|
||||||
|
procedure SetBackgroundOpacity(AValue: Single);
|
||||||
|
procedure SetFont(AValue: TFont);
|
||||||
|
procedure SetPen(AValue: TPen);
|
||||||
|
protected
|
||||||
|
procedure Changed(Sender: TObject);
|
||||||
|
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default DEFAULT_BACKGROUND_COLOR;
|
||||||
|
property BackgroundOpacity: Single read FBackgroundOpacity write SetBackgroundOpacity stored IsOpacityStored;
|
||||||
|
property Font: TFont read FFont write SetFont;
|
||||||
|
property Pen: TPen read FPen write SetPen;
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure Assign(ASource: TPersistent); override;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TMvMultiMapsPluginData }
|
{ TMvMultiMapsPluginData }
|
||||||
|
|
||||||
TMvMultiMapsPluginData = class(TObject)
|
TMvMultiMapsPluginData = class(TObject)
|
||||||
@ -233,9 +262,8 @@ end;
|
|||||||
procedure TMvCustomPlugin.Assign(Source: TPersistent);
|
procedure TMvCustomPlugin.Assign(Source: TPersistent);
|
||||||
begin
|
begin
|
||||||
if Source is TMvCustomPlugin then
|
if Source is TMvCustomPlugin then
|
||||||
FEnabled := TMvCustomPlugin(Source).Enabled
|
FEnabled := TMvCustomPlugin(Source).Enabled;
|
||||||
else
|
inherited Assign(Source);
|
||||||
inherited Assign(Source);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMvCustomPlugin.AfterPaint(AMapView: TMapView; var Handled: Boolean);
|
procedure TMvCustomPlugin.AfterPaint(AMapView: TMapView; var Handled: Boolean);
|
||||||
@ -393,6 +421,93 @@ begin
|
|||||||
end;
|
end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{ TMvDrawPlugin }
|
||||||
|
|
||||||
|
constructor TMvDrawPlugin.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(AOwner);
|
||||||
|
FBackgroundColor := DEFAULT_BACKGROUND_COLOR;
|
||||||
|
FBackgroundOpacity := DEFAULT_OPACITY;
|
||||||
|
FFont := TFont.Create;
|
||||||
|
FFont.OnChange := @Changed;
|
||||||
|
FPen := TPen.Create;
|
||||||
|
FPen.OnChange := @Changed;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TMvDrawPlugin.Destroy;
|
||||||
|
begin
|
||||||
|
FFont.Free;
|
||||||
|
FPen.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.Assign(ASource: TPersistent);
|
||||||
|
begin
|
||||||
|
if ASource is TMvDrawPlugin then
|
||||||
|
begin
|
||||||
|
FBackgroundColor := TMvDrawPlugin(ASource).BackgroundColor;
|
||||||
|
FBackgroundOpacity := TMvDrawPlugin(ASource).BackgroundOpacity;
|
||||||
|
FFont.Assign(TMvDrawPlugin(ASource).Font);
|
||||||
|
FPen.Assign(TMvDrawPlugin(ASource).Pen);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.Changed(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TMvDrawPlugin.IsOpacityStored: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FBackgroundOpacity <> DEFAULT_OPACITY;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.SetBackgroundColor(AValue: TColor);
|
||||||
|
begin
|
||||||
|
if FBackgroundColor <> AValue then
|
||||||
|
begin
|
||||||
|
FBackgroundColor := AValue;
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.SetBackgroundOpacity(AValue: Single);
|
||||||
|
begin
|
||||||
|
if FBackgroundOpacity <> AValue then
|
||||||
|
begin
|
||||||
|
FBackgroundOpacity := AValue;
|
||||||
|
Update;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.SetFont(AValue: TFont);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) then
|
||||||
|
exit;
|
||||||
|
if (AValue.Name = FFont.Name) and (AValue.Size = FFont.Size) and
|
||||||
|
(AValue.Style = FFont.Style) and (AValue.Color = FFont.Color)
|
||||||
|
then
|
||||||
|
exit;
|
||||||
|
FFont.Assign(AValue);
|
||||||
|
Changed(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMvDrawPlugin.SetPen(AValue: TPen);
|
||||||
|
begin
|
||||||
|
if (AValue = nil) then
|
||||||
|
exit;
|
||||||
|
if (AValue.Color = FPen.Color) and (AValue.Width = FPen.Width) and
|
||||||
|
(AValue.Style = FPen.Style) and (AValue.Mode = FPen.Mode) and
|
||||||
|
(AValue.JoinStyle = FPen.JoinStyle) and (AValue.EndCap = FPen.EndCap)
|
||||||
|
then
|
||||||
|
exit;
|
||||||
|
FPen.Assign(AValue);
|
||||||
|
Changed(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TMvMultiMapsPluginData }
|
{ TMvMultiMapsPluginData }
|
||||||
|
|
||||||
function TMvMultiMapsPluginData.GetDataSize: Integer;
|
function TMvMultiMapsPluginData.GetDataSize: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user