From 8372edac0c535e610bf543e1fbbff944b4dc1365 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Fri, 14 Dec 2018 04:28:57 +0100 Subject: [PATCH] add file picker thing I guess this part is done --- src/libui_sdl/DlgAudioSettings.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libui_sdl/DlgAudioSettings.cpp b/src/libui_sdl/DlgAudioSettings.cpp index 7fbf1018..73096d5e 100644 --- a/src/libui_sdl/DlgAudioSettings.cpp +++ b/src/libui_sdl/DlgAudioSettings.cpp @@ -45,6 +45,18 @@ int OnCloseWindow(uiWindow* window, void* blarg) 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) { uiControlDestroy(uiControl(win)); @@ -120,6 +132,7 @@ void Open() uiBoxAppend(path_box, uiControl(txMicWavPath), 1); uiButton* path_browse = uiNewButton("..."); + uiButtonOnClicked(path_browse, OnMicWavBrowse, NULL); uiBoxAppend(path_box, uiControl(path_browse), 0); }