LazMapViewer: Fix trackdemo sample. Add checkbox to use threads.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8110 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-09-30 22:38:03 +00:00
parent 362b046840
commit 97d465e2b3
4 changed files with 27 additions and 8 deletions

View File

@ -211,6 +211,7 @@ object MainForm: TMainForm
FEEB0000FEC70000FE980000FD570000EA0CFFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
POIImagesWidth = 0
POITextBgColor = clCream
OnCenterMove = MapViewCenterMove
OnZoomChange = MapViewZoomChange
@ -249,10 +250,10 @@ object MainForm: TMainForm
OnPrepareCanvas = TrackGridPrepareCanvas
ColWidths = (
30
85
85
85
84
84
84
87
)
Cells = (
4
@ -277,7 +278,7 @@ object MainForm: TMainForm
Left = 0
Height = 19
Top = 565
Width = 152
Width = 150
Anchors = [akLeft, akBottom]
BorderSpacing.Top = 8
Caption = 'Trace track automatically'
@ -352,6 +353,19 @@ object MainForm: TMainForm
BorderSpacing.Top = 8
Shape = bsBottomLine
end
object cbUseThreads: TCheckBox
AnchorSideLeft.Control = cbAutoTrace
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbAutoTrace
Left = 166
Height = 19
Top = 565
Width = 79
BorderSpacing.Left = 16
Caption = 'Use threads'
OnChange = cbUseThreadsChange
TabOrder = 3
end
end
object Splitter1: TSplitter
Left = 606

View File

@ -15,6 +15,7 @@ type
TMainForm = class(TForm)
Bevel1: TBevel;
cbAutoTrace: TCheckBox;
cbUseThreads: TCheckBox;
clbTrackColor: TColorBox;
Label1: TLabel;
lblInfo: TLabel;
@ -25,6 +26,7 @@ type
TrackGrid: TStringGrid;
Timer: TTimer;
procedure cbAutoTraceChange(Sender: TObject);
procedure cbUseThreadsChange(Sender: TObject);
procedure clbTrackColorChange(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure MapViewCenterMove(Sender: TObject);
@ -104,6 +106,11 @@ begin
end;
end;
procedure TMainForm.cbUseThreadsChange(Sender: TObject);
begin
MapView.UseThreads := cbUseThreads.Checked;
end;
procedure TMainForm.clbTrackColorChange(Sender: TObject);
begin
MapView.DefaultTrackColor := clbTrackColor.Selected;

View File

@ -40,10 +40,9 @@
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="..\colored_tracks\main.pas"/>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
</Units>

View File

@ -10,8 +10,7 @@ uses
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main
{ you can add units after this };
Forms, main;
{$R *.res}