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

Commit 7457b39

Browse files
committed
Changed signature to use default param and updated docs
1 parent fb4b7ca commit 7457b39

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

docs/dictionary/command/answer-file.lcdoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ file dialog box.
4848
windowTitle:
4949
If specified, appears in the title bar of the dialog box.
5050
If no <windowTitle> is given, the title bar is blank. This parameter
51-
has no effect on Mac OS systems, because Mac OS file dialog boxes don't
52-
have a title bar.
51+
has no effect on OSX 10.11 (El Capitan) and above, so make sure that any important information is placed in the <prompt> param.
5352

5453
It:
5554
The <answer file> command places the absolute file path(s) of the

docs/dictionary/command/answer-folder.lcdoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Synonyms: answer directory
44

55
Type: command
66

7-
Syntax: answer folder <prompt> [with <defaultPath>] [as sheet]
7+
Syntax: answer folder <prompt> [with <defaultPath>] [titled <windowTitle>] [as sheet]
88

99
Summary:
1010
Displays a <file dialog box|standard file dialog> for the user to choose
@@ -36,6 +36,11 @@ The name and location of the folder whose contents are listed when the
3636
dialog box appears. If no defaultPath is specified, the dialog box lists
3737
the contents of the last folder you used with a file dialog box.
3838

39+
windowTitle:
40+
If specified, appears in the title bar of the dialog box.
41+
If no <windowTitle> is given, the title bar is blank. This parameter
42+
has no effect on OSX 10.11 (El Capitan) and above, so make sure that any important information is placed in the <prompt> param.
43+
3944
It:
4045
The absolute file path of the folder the user selects is placed in the
4146
it <variable>.

engine/src/desktop-ans.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int MCA_folder(MCStringRef p_title, MCStringRef p_prompt, MCStringRef p_initial,
6060
MCPlatformWindowRef t_owner;
6161
t_owner = compute_sheet_owner(p_options);
6262

63-
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindFolder, t_owner, p_title, p_prompt, nil, 1, p_initial);
63+
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindFolder, t_owner, p_title, p_prompt, p_initial, nil);
6464

6565
MCPlatformDialogResult t_result;
6666
MCAutoStringRef t_folder;
@@ -158,7 +158,7 @@ int MCA_file(MCStringRef p_title, MCStringRef p_prompt, MCStringRef p_filter, MC
158158
else
159159
t_kind = kMCPlatformFileDialogKindOpen;
160160

161-
MCPlatformBeginFolderOrFileDialog(t_kind, t_owner, p_title, p_prompt, *t_types, t_types . Count(), p_initial);
161+
MCPlatformBeginFolderOrFileDialog(t_kind, t_owner, p_title, p_prompt, p_initial, *t_types, t_types . Count());
162162

163163
MCPlatformDialogResult t_result;
164164
MCAutoStringRef t_file, t_type;
@@ -191,7 +191,7 @@ int MCA_file_with_types(MCStringRef p_title, MCStringRef p_prompt, MCStringRef *
191191
else
192192
t_kind = kMCPlatformFileDialogKindOpen;
193193

194-
MCPlatformBeginFolderOrFileDialog(t_kind, t_owner, p_title, p_prompt, p_types, p_type_count, p_initial);
194+
MCPlatformBeginFolderOrFileDialog(t_kind, t_owner, p_title, p_prompt, p_initial, p_types, p_type_count);
195195

196196
MCPlatformDialogResult t_result;
197197
MCAutoStringRef t_file, t_type;
@@ -227,7 +227,7 @@ int MCA_ask_file(MCStringRef p_title, MCStringRef p_prompt, MCStringRef p_filter
227227
MCPlatformWindowRef t_owner;
228228
t_owner = compute_sheet_owner(p_options);
229229

230-
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindSave, t_owner, p_title, p_prompt, *t_types, t_types . Count(), p_initial);
230+
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindSave, t_owner, p_title, p_prompt, p_initial, *t_types, t_types . Count());
231231

232232
MCPlatformDialogResult t_result;
233233
MCAutoStringRef t_file, t_type;
@@ -254,7 +254,7 @@ int MCA_ask_file_with_types(MCStringRef p_title, MCStringRef p_prompt, MCStringR
254254
MCPlatformWindowRef t_owner;
255255
t_owner = compute_sheet_owner(p_options);
256256

257-
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindSave, t_owner, p_title, p_prompt, p_types, p_type_count, p_initial);
257+
MCPlatformBeginFolderOrFileDialog(kMCPlatformFileDialogKindSave, t_owner, p_title, p_prompt, p_initial, p_types, p_type_count);
258258

259259
MCPlatformDialogResult t_result;
260260
MCAutoStringRef t_file, t_type;

engine/src/mac-dialog.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
563563

564564
////////////////////////////////////////////////////////////////////////////////
565565

566-
void MCPlatformBeginFolderOrFileDialog(MCPlatformFileDialogKind p_kind, MCPlatformWindowRef p_owner, MCStringRef p_title, MCStringRef p_prompt, MCStringRef *p_types, uint4 p_type_count, MCStringRef p_initial)
566+
void MCPlatformBeginFolderOrFileDialog(MCPlatformFileDialogKind p_kind, MCPlatformWindowRef p_owner, MCStringRef p_title, MCStringRef p_prompt, MCStringRef p_initial, MCStringRef *p_types, uint4 p_type_count)
567567
{
568568
MCAutoStringRef t_initial_folder;
569569
if (p_initial != nil)

engine/src/platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ enum MCPlatformFileDialogKind
942942
kMCPlatformFileDialogKindFolder,
943943
};
944944

945-
void MCPlatformBeginFolderOrFileDialog(MCPlatformFileDialogKind p_kind, MCPlatformWindowRef p_owner, MCStringRef p_title, MCStringRef p_prompt, MCStringRef *p_types, uint4 p_type_count, MCStringRef p_initial);
945+
void MCPlatformBeginFolderOrFileDialog(MCPlatformFileDialogKind p_kind, MCPlatformWindowRef p_owner, MCStringRef p_title, MCStringRef p_prompt, MCStringRef p_initial, MCStringRef *p_types, uint4 p_type_count = 0);
946946
MCPlatformDialogResult MCPlatformEndFolderDialog(MCStringRef & r_selected_folder);
947947

948948

0 commit comments

Comments
 (0)