GUI: implement instrument preview in file dialog
SADLY it's just for the built-in file dialog but i'll think of a solution for the external one
This commit is contained in:
parent
663e724111
commit
e8c9b645c5
38 changed files with 113 additions and 85 deletions
39
extern/igfd/ImGuiFileDialog.cpp
vendored
39
extern/igfd/ImGuiFileDialog.cpp
vendored
|
|
@ -3295,7 +3295,8 @@ namespace IGFD
|
|||
const std::string& vFileName,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3306,6 +3307,7 @@ namespace IGFD
|
|||
prFileDialogInternal.puDLGtitle = vTitle;
|
||||
prFileDialogInternal.puDLGuserDatas = vUserDatas;
|
||||
prFileDialogInternal.puDLGflags = vFlags;
|
||||
prFileDialogInternal.puDLGselFun = vSelectFun;
|
||||
prFileDialogInternal.puDLGoptionsPane = nullptr;
|
||||
prFileDialogInternal.puDLGoptionsPaneWidth = 0.0f;
|
||||
prFileDialogInternal.puDLGmodal = false;
|
||||
|
|
@ -3335,7 +3337,8 @@ namespace IGFD
|
|||
const std::string& vFilePathName,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3348,6 +3351,7 @@ namespace IGFD
|
|||
prFileDialogInternal.puDLGoptionsPaneWidth = 0.0f;
|
||||
prFileDialogInternal.puDLGuserDatas = vUserDatas;
|
||||
prFileDialogInternal.puDLGflags = vFlags;
|
||||
prFileDialogInternal.puDLGselFun = vSelectFun;
|
||||
prFileDialogInternal.puDLGmodal = false;
|
||||
|
||||
auto ps = IGFD::Utils::ParsePathFileName(vFilePathName);
|
||||
|
|
@ -3390,7 +3394,8 @@ namespace IGFD
|
|||
const float& vSidePaneWidth,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3401,6 +3406,7 @@ namespace IGFD
|
|||
prFileDialogInternal.puDLGtitle = vTitle;
|
||||
prFileDialogInternal.puDLGuserDatas = vUserDatas;
|
||||
prFileDialogInternal.puDLGflags = vFlags;
|
||||
prFileDialogInternal.puDLGselFun = vSelectFun;
|
||||
prFileDialogInternal.puDLGoptionsPane = vSidePane;
|
||||
prFileDialogInternal.puDLGoptionsPaneWidth = vSidePaneWidth;
|
||||
prFileDialogInternal.puDLGmodal = false;
|
||||
|
|
@ -3435,7 +3441,8 @@ namespace IGFD
|
|||
const float& vSidePaneWidth,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3448,6 +3455,7 @@ namespace IGFD
|
|||
prFileDialogInternal.puDLGoptionsPaneWidth = vSidePaneWidth;
|
||||
prFileDialogInternal.puDLGuserDatas = vUserDatas;
|
||||
prFileDialogInternal.puDLGflags = vFlags;
|
||||
prFileDialogInternal.puDLGselFun = vSelectFun;
|
||||
prFileDialogInternal.puDLGmodal = false;
|
||||
|
||||
auto ps = IGFD::Utils::ParsePathFileName(vFilePathName);
|
||||
|
|
@ -3489,7 +3497,8 @@ namespace IGFD
|
|||
const std::string& vFileName,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3497,7 +3506,7 @@ namespace IGFD
|
|||
OpenDialog(
|
||||
vKey, vTitle, vFilters,
|
||||
vPath, vFileName,
|
||||
vCountSelectionMax, vUserDatas, vFlags);
|
||||
vCountSelectionMax, vUserDatas, vFlags, vSelectFun);
|
||||
|
||||
prFileDialogInternal.puDLGmodal = true;
|
||||
}
|
||||
|
|
@ -3509,7 +3518,8 @@ namespace IGFD
|
|||
const std::string& vFilePathName,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3517,7 +3527,7 @@ namespace IGFD
|
|||
OpenDialog(
|
||||
vKey, vTitle, vFilters,
|
||||
vFilePathName,
|
||||
vCountSelectionMax, vUserDatas, vFlags);
|
||||
vCountSelectionMax, vUserDatas, vFlags, vSelectFun);
|
||||
|
||||
prFileDialogInternal.puDLGmodal = true;
|
||||
}
|
||||
|
|
@ -3534,7 +3544,8 @@ namespace IGFD
|
|||
const float& vSidePaneWidth,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3543,7 +3554,7 @@ namespace IGFD
|
|||
vKey, vTitle, vFilters,
|
||||
vPath, vFileName,
|
||||
vSidePane, vSidePaneWidth,
|
||||
vCountSelectionMax, vUserDatas, vFlags);
|
||||
vCountSelectionMax, vUserDatas, vFlags, vSelectFun);
|
||||
|
||||
prFileDialogInternal.puDLGmodal = true;
|
||||
}
|
||||
|
|
@ -3559,7 +3570,8 @@ namespace IGFD
|
|||
const float& vSidePaneWidth,
|
||||
const int& vCountSelectionMax,
|
||||
UserDatas vUserDatas,
|
||||
ImGuiFileDialogFlags vFlags)
|
||||
ImGuiFileDialogFlags vFlags,
|
||||
SelectFun vSelectFun)
|
||||
{
|
||||
if (prFileDialogInternal.puShowDialog) // if already opened, quit
|
||||
return;
|
||||
|
|
@ -3568,7 +3580,7 @@ namespace IGFD
|
|||
vKey, vTitle, vFilters,
|
||||
vFilePathName,
|
||||
vSidePane, vSidePaneWidth,
|
||||
vCountSelectionMax, vUserDatas, vFlags);
|
||||
vCountSelectionMax, vUserDatas, vFlags, vSelectFun);
|
||||
|
||||
prFileDialogInternal.puDLGmodal = true;
|
||||
}
|
||||
|
|
@ -3940,6 +3952,9 @@ namespace IGFD
|
|||
return 2;
|
||||
} else {
|
||||
fdi.SelectFileName(prFileDialogInternal, vInfos);
|
||||
if (prFileDialogInternal.puDLGselFun!=NULL) {
|
||||
prFileDialogInternal.puDLGselFun(GetFilePathName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue