Skip to content

Commit 6c70094

Browse files
committed
[FIX] : fix validations buttons
1 parent 34446cb commit 6c70094

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ SOFTWARE.
3232
#include <cfloat>
3333
#include <cstring> // stricmp / strcasecmp
3434
#include <cstdarg> // variadic
35-
#include <sstream>
3635
#include <iomanip>
3736
#include <ctime>
3837
#include <sys/stat.h>
@@ -45,7 +44,7 @@ SOFTWARE.
4544

4645
#ifdef __EMSCRIPTEN__
4746
#include <emscripten.h>
48-
#endif // EMSCRIPTEN
47+
#endif // __EMSCRIPTEN__
4948

5049
#if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) || \
5150
defined(__WIN64__) || defined(WIN64) || defined(_WIN64) || defined(_MSC_VER)
@@ -343,15 +342,6 @@ namespace IGFD
343342
}
344343
#endif
345344

346-
inline void imAlignForWidth(float width, float alignment = 0.5f)
347-
{
348-
ImGuiStyle& style = ImGui::GetStyle();
349-
float avail = ImGui::GetContentRegionAvail().x;
350-
float off = (avail - width) * alignment;
351-
if (off > 0.0f)
352-
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off);
353-
}
354-
355345
/////////////////////////////////////////////////////////////////////////////////////
356346
//// FILE EXTENTIONS INFOS //////////////////////////////////////////////////////////
357347
/////////////////////////////////////////////////////////////////////////////////////
@@ -443,7 +433,7 @@ namespace IGFD
443433
{
444434
ret.resize(sz);
445435
#ifndef _MSC_VER
446-
std::mbstowcs((wchar_t*)ret.data(), str.c_str(), sz);
436+
std::mbstowcs(ret.data(), str.c_str(), sz);
447437
#else // _MSC_VER
448438
mbstowcs_s(nullptr, ret.data(), sz, str.c_str(), sz);
449439
#endif // _MSC_VER
@@ -467,7 +457,7 @@ namespace IGFD
467457
{
468458
ret.resize(sz);
469459
#ifndef _MSC_VER
470-
std::wcstombs((wchar_t*)ret.data(), str.c_str(), sz);
460+
std::wcstombs(ret.data(), str.c_str(), sz);
471461
#else // _MSC_VER
472462
wcstombs_s(nullptr, ret.data(), sz, str.c_str(), sz);
473463
#endif // _MSC_VER
@@ -594,7 +584,7 @@ namespace IGFD
594584
{
595585
res = true;
596586
}
597-
#endif // __EMSCRIPTEN__
587+
#endif // _IGFD_WIN_
598588
if (!res) {
599589
std::cout << "Error creating directory " << name << std::endl;
600590
}
@@ -3909,13 +3899,13 @@ namespace IGFD
39093899

39103900
if (invertOkAndCancelButtons)
39113901
{
3912-
prDrawCancelButton();
3913-
prDrawOkButton();
3902+
res |= prDrawCancelButton();
3903+
res |= prDrawOkButton();
39143904
}
39153905
else
39163906
{
3917-
prDrawOkButton();
3918-
prDrawCancelButton();
3907+
res |= prDrawOkButton();
3908+
res |= prDrawCancelButton();
39193909
}
39203910

39213911
ImGui::EndGroup();

0 commit comments

Comments
 (0)