1
0
Fork 0
mirror of https://github.com/gwm17/Specter.git synced 2024-11-22 18:28:52 -05:00

Fixed some string concat cases in panels and EditorLayer

This commit is contained in:
Gordon McCann 2022-01-27 21:50:11 -05:00
parent 695c647d71
commit 3049ee7025
5 changed files with 18 additions and 15 deletions

View File

@ -163,23 +163,23 @@ namespace Navigator {
auto& params = gram.second->GetParameters();
if (ImGui::TreeNode(params.name.c_str()))
{
ImGui::BulletText("X Parameter: %s", params.x_par.c_str());
ImGui::BulletText(("X Parameter: "+params.x_par).c_str());
ImGui::BulletText("X Bins: %d X Min: %f X Max: %f", params.nbins_x, params.min_x, params.max_x);
if (params.y_par != "None")
{
ImGui::BulletText("Y Parameter: %s", params.y_par.c_str());
ImGui::BulletText(("Y Parameter: "+params.y_par).c_str());
ImGui::BulletText("Y Bins: %d Y Min: %f Y Max: %f", params.nbins_y, params.min_y, params.max_y);
}
if(params.cutsDrawnUpon.size() != 0 && ImGui::TreeNode("Cuts Drawn"))
{
for(auto& cut : params.cutsDrawnUpon)
ImGui::BulletText("%s", cut.c_str());
ImGui::BulletText(cut.c_str());
ImGui::TreePop();
}
if(params.cutsAppliedTo.size() != 0 && ImGui::TreeNode("Cuts Applied"))
{
for(auto& cut : params.cutsAppliedTo)
ImGui::BulletText("%s", cut.c_str());
ImGui::BulletText(cut.c_str());
ImGui::TreePop();
}
ImGui::TreePop();
@ -195,9 +195,9 @@ namespace Navigator {
auto& params = cut.second->GetCutParams();
if(ImGui::TreeNode(params.name.c_str()))
{
ImGui::BulletText("X Parameter: %s", params.x_par.c_str());
ImGui::BulletText(("X Parameter: "+params.x_par).c_str());
if(params.y_par != "None")
ImGui::BulletText("Y Parameter: %s", params.y_par.c_str());
ImGui::BulletText(("Y Parameter: "+params.y_par).c_str());
ImGui::TreePop();
}
}

View File

@ -36,9 +36,9 @@ namespace Navigator {
std::string text = "";
if (ImGui::BeginPopupModal(m_openFileName.c_str()))
{
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str());
ImGui::Text(("Current Directory: " + m_currentPath.lexically_normal().string()).c_str());
ImGui::SameLine();
ImGui::Text("Extension Filter: %s", ext.c_str());
ImGui::Text(("Extension Filter: "+ext).c_str());
ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok"))
{
@ -111,9 +111,9 @@ namespace Navigator {
std::string text = "";
if (ImGui::BeginPopupModal(m_saveFileName.c_str()))
{
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str());
ImGui::Text(("Current Directory: "+m_currentPath.lexically_normal().string()).c_str());
ImGui::SameLine();
ImGui::Text("Extension Filter: %s", ext.c_str());
ImGui::Text(("Extension Filter: "+ext).c_str());
ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok"))
{
@ -184,7 +184,7 @@ namespace Navigator {
std::string text = "";
if (ImGui::BeginPopupModal(m_openDirName.c_str()))
{
ImGui::Text("Current Directory: %s", m_currentPath.lexically_normal().string().c_str());
ImGui::Text(("Current Directory: "+m_currentPath.lexically_normal().string()).c_str());
ImGui::InputText("Selected", &m_selectedItem);
if (ImGui::Button("Ok"))
{

View File

@ -9,7 +9,7 @@
namespace Navigator {
SourceDialog::SourceDialog() :
m_openFlag(false), m_chosenWindow(2000000)
m_openFlag(false), m_chosenPort("51489"), m_chosenWindow(2000000)
{
}
@ -30,6 +30,7 @@ namespace Navigator {
m_openFlag = false;
m_chosenType = DataSource::SourceType::None;
m_chosenLocation = "";
m_chosenPort = "51489";
m_chosenWindow = 2000000;
ImGui::OpenPopup("Attach Source");
}
@ -50,6 +51,7 @@ namespace Navigator {
if (m_chosenType == DataSource::SourceType::CompassOnline)
{
ImGui::InputText("Hostname", &m_chosenLocation);
ImGui::InputText("Port", &m_chosenPort);
}
else if (m_chosenType == DataSource::SourceType::CompassOffline)
{
@ -67,7 +69,7 @@ namespace Navigator {
if (ImGui::Button("Ok"))
{
PhysicsStartEvent event(m_chosenLocation, m_chosenType, m_chosenWindow);
PhysicsStartEvent event(m_chosenLocation, m_chosenType, m_chosenWindow, m_chosenPort);
Application::Get().OnEvent(event);
ImGui::CloseCurrentPopup();
}

View File

@ -19,6 +19,7 @@ namespace Navigator {
bool m_openFlag;
DataSource::SourceType m_chosenType;
std::string m_chosenLocation;
std::string m_chosenPort;
FileDialog m_fileDialog;
int m_chosenWindow;
};

View File

@ -37,8 +37,8 @@ namespace Navigator {
m_newCutParams.x_par = zoomed_params.x_par;
m_newCutParams.y_par = zoomed_params.y_par;
ImGui::InputText("Cut Name", &m_newCutParams.name);
ImGui::BulletText("X Parameter: %s", m_newCutParams.x_par.c_str());
ImGui::BulletText("Y Parameter: %s", m_newCutParams.y_par.c_str());
ImGui::BulletText(("X Parameter: "+m_newCutParams.x_par).c_str());
ImGui::BulletText(("Y Parameter: "+m_newCutParams.y_par).c_str());
if(ImGui::Button("Accept & Draw"))
{
m_cutModeFlag = true;