add file picker thing

I guess this part is done
This commit is contained in:
StapleButter 2018-12-14 04:28:57 +01:00
parent 5efb162302
commit 8372edac0c
1 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,18 @@ int OnCloseWindow(uiWindow* window, void* blarg)
return 1; return 1;
} }
void OnMicWavBrowse(uiButton* btn, void* blarg)
{
char* file = uiOpenFile(win, "WAV file (*.wav)|*.wav|Any file|*.*", NULL);
if (!file)
{
return;
}
uiEntrySetText(txMicWavPath, file);
uiFreeText(file);
}
void OnCancel(uiButton* btn, void* blarg) void OnCancel(uiButton* btn, void* blarg)
{ {
uiControlDestroy(uiControl(win)); uiControlDestroy(uiControl(win));
@ -120,6 +132,7 @@ void Open()
uiBoxAppend(path_box, uiControl(txMicWavPath), 1); uiBoxAppend(path_box, uiControl(txMicWavPath), 1);
uiButton* path_browse = uiNewButton("..."); uiButton* path_browse = uiNewButton("...");
uiButtonOnClicked(path_browse, OnMicWavBrowse, NULL);
uiBoxAppend(path_box, uiControl(path_browse), 0); uiBoxAppend(path_box, uiControl(path_browse), 0);
} }