This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
magicka/deps/cdk-5.0-20161210/select_file.c
2017-03-20 21:40:32 +10:00

43 lines
935 B
C

#include <cdk_int.h>
/*
* $Author: tom $
* $Date: 2012/03/22 00:38:13 $
* $Revision: 1.2 $
*/
/*
* This allows a person to select a file.
*/
char *selectFile (CDKSCREEN *screen, const char *title)
{
/* *INDENT-EQLS* */
CDKFSELECT *fselect = 0;
char *filename = 0;
char *holder = 0;
/* Create the file selector. */
fselect = newCDKFselect (screen, CENTER, CENTER, -4, -20,
title, "File: ",
A_NORMAL, '_', A_REVERSE,
"</5>", "</48>", "</N>", "</N>",
TRUE, FALSE);
/* Let the user play. */
holder = activateCDKFselect (fselect, 0);
/* Check the way the user exited the selector. */
if (fselect->exitType != vNORMAL)
{
destroyCDKFselect (fselect);
refreshCDKScreen (screen);
return (0);
}
/* Otherwise... */
filename = copyChar (holder);
destroyCDKFselect (fselect);
refreshCDKScreen (screen);
return (filename);
}