LazMapViewer: Fix write-permission and file-not-found issues in fulldemo on Mac.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8267 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-04-27 16:28:40 +00:00
parent 550f90402e
commit 6b48ad28ce
2 changed files with 32 additions and 5 deletions

View File

@ -77,6 +77,7 @@ object MainForm: TMainForm
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'Zoom:' Caption = 'Zoom:'
ParentColor = False
end end
object CbMouseCoords: TGroupBox object CbMouseCoords: TGroupBox
AnchorSideLeft.Control = PgData AnchorSideLeft.Control = PgData
@ -107,6 +108,7 @@ object MainForm: TMainForm
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Caption = 'Longitude' Caption = 'Longitude'
ParentColor = False
end end
object LblPositionLatitude: TLabel object LblPositionLatitude: TLabel
AnchorSideLeft.Control = CbMouseCoords AnchorSideLeft.Control = CbMouseCoords
@ -120,6 +122,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Latitude' Caption = 'Latitude'
ParentColor = False
end end
object InfoPositionLongitude: TLabel object InfoPositionLongitude: TLabel
AnchorSideLeft.Control = CbMouseCoords AnchorSideLeft.Control = CbMouseCoords
@ -135,6 +138,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Right = 16 BorderSpacing.Right = 16
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
object InfoPositionLatitude: TLabel object InfoPositionLatitude: TLabel
AnchorSideLeft.Control = CbMouseCoords AnchorSideLeft.Control = CbMouseCoords
@ -152,6 +156,7 @@ object MainForm: TMainForm
BorderSpacing.Right = 16 BorderSpacing.Right = 16
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
end end
object GbCenterCoords: TGroupBox object GbCenterCoords: TGroupBox
@ -181,6 +186,7 @@ object MainForm: TMainForm
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Caption = 'Longitude' Caption = 'Longitude'
ParentColor = False
end end
object LblCenterLatitude: TLabel object LblCenterLatitude: TLabel
AnchorSideLeft.Control = GbCenterCoords AnchorSideLeft.Control = GbCenterCoords
@ -194,6 +200,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Latitude' Caption = 'Latitude'
ParentColor = False
end end
object InfoCenterLongitude: TLabel object InfoCenterLongitude: TLabel
AnchorSideLeft.Control = GbCenterCoords AnchorSideLeft.Control = GbCenterCoords
@ -209,6 +216,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Right = 16 BorderSpacing.Right = 16
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
object InfoCenterLatitude: TLabel object InfoCenterLatitude: TLabel
AnchorSideLeft.Control = GbCenterCoords AnchorSideLeft.Control = GbCenterCoords
@ -226,6 +234,7 @@ object MainForm: TMainForm
BorderSpacing.Right = 16 BorderSpacing.Right = 16
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
end end
object GbScreenSize: TGroupBox object GbScreenSize: TGroupBox
@ -255,6 +264,7 @@ object MainForm: TMainForm
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Caption = 'Width' Caption = 'Width'
ParentColor = False
end end
object LblViewportHeight: TLabel object LblViewportHeight: TLabel
AnchorSideLeft.Control = GbScreenSize AnchorSideLeft.Control = GbScreenSize
@ -268,6 +278,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Height' Caption = 'Height'
ParentColor = False
end end
object InfoViewportWidth: TLabel object InfoViewportWidth: TLabel
AnchorSideTop.Control = GbScreenSize AnchorSideTop.Control = GbScreenSize
@ -282,6 +293,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Right = 16 BorderSpacing.Right = 16
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
object InfoViewportHeight: TLabel object InfoViewportHeight: TLabel
AnchorSideTop.Control = InfoViewportWidth AnchorSideTop.Control = InfoViewportWidth
@ -298,6 +310,7 @@ object MainForm: TMainForm
BorderSpacing.Right = 16 BorderSpacing.Right = 16
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Label2' Caption = 'Label2'
ParentColor = False
end end
end end
object CbDistanceUnits: TComboBox object CbDistanceUnits: TComboBox
@ -385,6 +398,7 @@ object MainForm: TMainForm
Width = 177 Width = 177
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Select one of the found locations:' Caption = 'Select one of the found locations:'
ParentColor = False
end end
object BtnGoTo: TButton object BtnGoTo: TButton
AnchorSideTop.Control = CbFoundLocations AnchorSideTop.Control = CbFoundLocations
@ -470,6 +484,7 @@ object MainForm: TMainForm
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Caption = 'Click with right mouse button to add a GPS point.'#13#10'Settings on page "Config".' Caption = 'Click with right mouse button to add a GPS point.'#13#10'Settings on page "Config".'
ParentColor = False
WordWrap = True WordWrap = True
end end
object GPSPointInfo: TLabel object GPSPointInfo: TLabel
@ -489,6 +504,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 16 BorderSpacing.Top = 16
BorderSpacing.Right = 6 BorderSpacing.Right = 6
Caption = 'GPSPointInfo' Caption = 'GPSPointInfo'
ParentColor = False
WordWrap = True WordWrap = True
end end
end end
@ -535,6 +551,7 @@ object MainForm: TMainForm
BorderSpacing.Top = 8 BorderSpacing.Top = 8
Caption = 'Providers:' Caption = 'Providers:'
FocusControl = CbProviders FocusControl = CbProviders
ParentColor = False
end end
object CbProviders: TComboBox object CbProviders: TComboBox
AnchorSideLeft.Control = PgConfig AnchorSideLeft.Control = PgConfig
@ -743,6 +760,7 @@ object MainForm: TMainForm
Width = 39 Width = 39
BorderSpacing.Left = 8 BorderSpacing.Left = 8
Caption = 'Backgr.' Caption = 'Backgr.'
ParentColor = False
end end
object Bevel1: TBevel object Bevel1: TBevel
AnchorSideLeft.Control = CbDebugTiles AnchorSideLeft.Control = CbDebugTiles

View File

@ -133,12 +133,12 @@ type
const const
MAX_LOCATIONS_HISTORY = 50; MAX_LOCATIONS_HISTORY = 50;
HOMEDIR = '../../../../'; // share the cache in both example projects
MAP_PROVIDER_FILENAME = 'map-providers.xml'; MAP_PROVIDER_FILENAME = 'map-providers.xml';
USE_DMS = true; USE_DMS = true;
var var
PointFormatSettings: TFormatsettings; PointFormatSettings: TFormatsettings;
CacheDir: String = '../../../../'; // share the cache in both example projects
function CalcIniName: String; function CalcIniName: String;
@ -333,13 +333,22 @@ begin
end; end;
procedure TMainForm.FormCreate(Sender: TObject); procedure TMainForm.FormCreate(Sender: TObject);
var
fn: String;
begin begin
cInputQueryEditSizePercents := 0; cInputQueryEditSizePercents := 0;
fn := Application.Location + 'mapmarker.png';
if not FileExists(fn) then
MessageDlg('Copy the file "mapmarker.png" from the source to the app binary directory.',
mtError, [mbOK], 0)
else
begin
// FMapMarker := CreateMapMarker(32, clRed, clBlack); // FMapMarker := CreateMapMarker(32, clRed, clBlack);
POIImage := TPortableNetworkGraphic.Create; POIImage := TPortableNetworkGraphic.Create;
POIImage.PixelFormat := pf32bit; POIImage.PixelFormat := pf32bit;
POIImage.LoadFromFile('../../mapmarker.png'); POIImage.LoadFromFile(fn);
end;
ForceDirectories(HOMEDIR + 'cache/'); ForceDirectories(HOMEDIR + 'cache/');
MapView.CachePath := HOMEDIR + 'cache/'; MapView.CachePath := HOMEDIR + 'cache/';