mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Add open file dialog panel to foundation
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package objc_Foundation
|
||||||
|
|
||||||
|
@(objc_class="NSOpenPanel")
|
||||||
|
OpenPanel :: struct{ using _: SavePanel }
|
||||||
|
|
||||||
|
@(objc_type=OpenPanel, objc_name="openPanel", objc_is_class_method=true)
|
||||||
|
OpenPanel_openPanel :: proc() -> ^OpenPanel {
|
||||||
|
return msgSend(^OpenPanel, OpenPanel, "openPanel")
|
||||||
|
}
|
||||||
|
|
||||||
|
@(objc_type=OpenPanel, objc_name="URLs")
|
||||||
|
OpenPanel_URLs :: proc(self: ^OpenPanel) -> ^Array {
|
||||||
|
return msgSend(^Array, self, "URLs")
|
||||||
|
}
|
||||||
|
|
||||||
|
@(objc_type=OpenPanel, objc_name="setCanChooseFiles")
|
||||||
|
OpenPanel_setCanChooseFiles :: proc(self: ^OpenPanel, setting: BOOL) {
|
||||||
|
msgSend(nil, self, "setCanChooseFiles:", setting)
|
||||||
|
}
|
||||||
|
@(objc_type=OpenPanel, objc_name="setCanChooseDirectories")
|
||||||
|
OpenPanel_setCanChooseDirectories :: proc(self: ^OpenPanel, setting: BOOL) {
|
||||||
|
msgSend(nil, self, "setCanChooseDirectories:", setting)
|
||||||
|
}
|
||||||
|
@(objc_type=OpenPanel, objc_name="setResolvesAliases")
|
||||||
|
OpenPanel_setResolvesAliases :: proc(self: ^OpenPanel, setting: BOOL) {
|
||||||
|
msgSend(nil, self, "setResolvesAliases:", setting)
|
||||||
|
}
|
||||||
|
@(objc_type=OpenPanel, objc_name="setAllowsMultipleSelection")
|
||||||
|
OpenPanel_setAllowsMultipleSelection :: proc(self: ^OpenPanel, setting: BOOL) {
|
||||||
|
msgSend(nil, self, "setAllowsMultipleSelection:", setting)
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package objc_Foundation
|
||||||
|
|
||||||
|
ModalResponse :: enum UInteger {
|
||||||
|
Cancel = 0,
|
||||||
|
OK = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
@(objc_class="NSPanel")
|
||||||
|
Panel :: struct{ using _: Window }
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package objc_Foundation
|
||||||
|
|
||||||
|
@(objc_class="NSSavePanel")
|
||||||
|
SavePanel :: struct{ using _: Panel }
|
||||||
|
|
||||||
|
@(objc_type=SavePanel, objc_name="runModal")
|
||||||
|
SavePanel_runModal :: proc(self: ^SavePanel) -> ModalResponse {
|
||||||
|
return msgSend(ModalResponse, self, "runModal")
|
||||||
|
}
|
||||||
Vendored
+3
-3
@@ -25,6 +25,6 @@ URL_initFileURLWithPath :: proc(self: ^URL, path: ^String) -> ^URL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@(objc_type=URL, objc_name="fileSystemRepresentation")
|
@(objc_type=URL, objc_name="fileSystemRepresentation")
|
||||||
URL_fileSystemRepresentation :: proc(self: ^URL) -> ^String {
|
URL_fileSystemRepresentation :: proc(self: ^URL) -> cstring {
|
||||||
return msgSend(^String, self, "fileSystemRepresentation")
|
return msgSend(cstring, self, "fileSystemRepresentation")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user