Hier:
Code:
EnableExplicit
ImportC ""
GetIconRef(vRefNum.w, creator.i, iconType.i, *theIconRef)
ReleaseIconRef(theIconRef.i) ;Deprecated
EndImport
Procedure.i German_MessageRequester(title.s, info.s, flags.i = #PB_MessageRequester_Ok)
Protected.i alert, nimage, icon, picon
Protected.i rtype
alert = CocoaMessage(0, CocoaMessage(0, 0, "NSAlert new"), "autorelease")
CocoaMessage(0, alert, "setMessageText:$", @title)
CocoaMessage(0, alert, "setInformativeText:$", @info)
Select flags
Case 0, 4, 8, 16
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Ok")
Case 1, 5, 9, 17
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Ja")
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Nein")
Case 2, 6, 10, 18
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Ja")
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Nein")
CocoaMessage(0, Alert, "addButtonWithTitle:$", @"Abbrechen")
EndSelect
Select flags
Case 4, 5, 6
icon = $6E6F7465
Case 8, 9, 10
icon = $73746F70
Case 16, 17, 18
icon = $63617574
Default
icon = $4150504C
EndSelect
If GetIconRef(-32768, $6D616373, icon, @picon) = 0
CocoaMessage(@nimage, 0, "NSImage alloc")
CocoaMessage(0, nimage, "initWithIconRef:", picon)
CocoaMessage(0, alert, "setIcon:@", @nimage)
rtype = CocoaMessage(0, alert, "runModal")
CocoaMessage(0, nimage, "release")
ReleaseIconRef(picon)
EndIf
If rtype = 1000 And (flags = 0 Or flags = 4 Or flags = 8 Or flags = 16)
ProcedureReturn 0
ElseIf rtype = 1000
ProcedureReturn #PB_MessageRequester_Yes
ElseIf rtype = 1001
ProcedureReturn #PB_MessageRequester_No
ElseIf rtype = 1002
ProcedureReturn #PB_MessageRequester_Cancel
ElseIf rtype = 0
ProcedureReturn -1
EndIf
EndProcedure
Debug German_MessageRequester("Meldung", "Dies ist ein Infotext", #PB_MessageRequester_Info|#PB_MessageRequester_YesNo)
Viel Spaß beim Ausprobieren.