Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8ada322

Browse files
Merge pull request #1908 from livecode/bugfix-20794
[Bug 20794] Show warning when using map widget on OSX 10.9 and 10.10
2 parents 0a6454f + 6bc514a commit 8ada322

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,10 +3451,10 @@ on revIDECreateObject pObjectTypeID, pTarget, pLoc
34513451
if not __objectTypeIsControl(pObjectTypeID) then
34523452
return __revIDEError("Object must be a control")
34533453
end if
3454-
3454+
34553455
if not exists(pTarget) then return __revIDEError("Cannot create object. Target does not exist: " && pTarget)
34563456
if not pObjectTypeID begins with "com.livecode" then return __revIDEError("No such object type ID: " && pTarget)
3457-
3457+
34583458
if sClassicObjectProperties is empty then __objectPropertiesRead
34593459
# Set the default stack to the target we're creating the object on
34603460
set the defaultstack to revIDEStackOfObject(pTarget)
@@ -3478,10 +3478,10 @@ on revIDECreateObject pObjectTypeID, pTarget, pLoc
34783478
put round(the cTabButtonWidth of stack "revPreferences" / 2), round(the cTabButtonHeight of stack "revPreferences" / 2) into tCreateRect
34793479
put item 1 of tCreateRect + the cTabButtonWidth of stack "revPreferences" into item 3 of tCreateRect
34803480
put item 2 of tCreateRect + the cTabButtonHeight of stack "revPreferences" into item 4 of tCreateRect
3481-
3481+
34823482
local lDataGrid
34833483
put true into lDataGrid -- select data grid at end not single control
3484-
3484+
34853485
unlock messages
34863486
# tObjectId is passed by reference and will have the data grid group id placed into it
34873487
addDataGridToStack the short name of this stack, tCreateRect, empty, empty, tCreatedControlID
@@ -3509,6 +3509,17 @@ on revIDECreateObject pObjectTypeID, pTarget, pLoc
35093509
else
35103510
# Not a classic control
35113511
try
3512+
if pObjectTypeID is "com.livecode.widget.native.map" and the platform is "MacOS" and (revIDEPlatformVersion() begins with "10.9" or revIDEPlatformVersion() begins with "10.10") then
3513+
local tMessage
3514+
put "The Mac MapKit API is supported from OS X 10.9 onwards, but Apple restricts use of the API on 10.9 and 10.10 to apps which are distributed from the Mac AppStore with an appropriate entitlement. " & \
3515+
"Due to this, general use of the Map widget only supports OS X 10.11 onwards. " & CR & CR & \
3516+
"However, you can still create a standalone with the Map widget on OSX 10.9 or 10.10 (of course you will see an empty grid rather than the actual map), " & \
3517+
" BUT this standalone will run as expected on OSX 10.11 and above." into tMessage
3518+
3519+
answer warning revIDELocalise(tMessage) with "Cancel" and "Continue"
3520+
if it is "Cancel" then exit revIDECreateObject
3521+
end if
3522+
35123523
create widget as pObjectTypeID
35133524
put the long id of the last control into tCreatedControlID
35143525

@@ -3532,17 +3543,17 @@ on revIDECreateObject pObjectTypeID, pTarget, pLoc
35323543
__setSizeToPreference tCreatedControlID, pObjectTypeID
35333544

35343545
set the loc of tCreatedControlID to pLoc
3535-
3546+
35363547
unlock messages
35373548
unlock screen
3538-
3549+
35393550
## Prevent passing of ideNewControl message for objects created on IDE stacks
35403551
if revIDEObjectIsOnIDEStack(tCreatedControlID) is false then
35413552
// AL-2015-04-08: [[ Bug 14822 ]] Ensure 'edited' status of stack is set
35423553
revIDESetEdited the short name of this stack
35433554
ideMessageSend "ideNewControl", tCreatedControlID
35443555
end if
3545-
3556+
35463557
return tCreatedControlID
35473558
end revIDECreateObject
35483559

notes/bugfix-20794.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Show warning when creating a Map widget on OSX 10.9 and 10.10

0 commit comments

Comments
 (0)