MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ShowBrowseFolderDialog

Method ShowBrowseFolderDialog

Source/Engine/Platform/Mac/MacFileSystem.cpp:120–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool MacFileSystem::ShowBrowseFolderDialog(Window* parentWindow, const StringView& initialDirectory, const StringView& title, String& path)
121{
122 bool result = true;
123 @autoreleasepool {
124 NSWindow* focusedWindow = [[NSApplication sharedApplication] keyWindow];
125
126 NSOpenPanel* dialog = [NSOpenPanel openPanel];
127 [dialog setCanChooseFiles:NO];
128 [dialog setCanChooseDirectories:YES];
129 [dialog setCanCreateDirectories:YES];
130 [dialog setAllowsMultipleSelection:NO];
131 InitMacDialog(dialog, initialDirectory, StringView::Empty, title);
132
133 if ([dialog runModal] == NSModalResponseOK)
134 {
135 const NSURL* url = [dialog URL];
136 path = AppleUtils::ToString((CFStringRef)[url path]);
137 result = false;
138 }
139
140 [focusedWindow makeKeyAndOrderFront:nil];
141 }
142 return result;
143}
144

Callers 3

CreateScriptMethod · 0.45
ExportSelectionMethod · 0.45

Calls 2

InitMacDialogFunction · 0.85
ToStringFunction · 0.50

Tested by

no test coverage detected