1
0
mirror of synced 2024-11-28 17:40:51 +01:00

Bring strings view and pattern data view in line with each other

This commit is contained in:
WerWolv 2020-11-20 00:16:50 +01:00
parent 763d1f0e2d
commit f36014194d
3 changed files with 6 additions and 6 deletions

View File

@ -73,7 +73,7 @@ namespace hex::lang {
else
return left->getName() < right->getName();
}
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("position")) {
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("offset")) {
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
return left->getOffset() > right->getOffset();
else

View File

@ -21,7 +21,7 @@ namespace hex {
if (ImGui::BeginTable("##patterndatatable", 6, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) {
ImGui::TableSetupColumn("Color", 0, -1, ImGui::GetID("color"));
ImGui::TableSetupColumn("Name", 0, -1, ImGui::GetID("name"));
ImGui::TableSetupColumn("Position", 0, -1, ImGui::GetID("position"));
ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset"));
ImGui::TableSetupColumn("Size", 0, -1, ImGui::GetID("size"));
ImGui::TableSetupColumn("Type", 0, -1, ImGui::GetID("type"));
ImGui::TableSetupColumn("Value", 0, -1, ImGui::GetID("value"));

View File

@ -73,7 +73,7 @@ namespace hex {
if (ImGui::BeginTable("##strings", 3,
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable |
ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) {
ImGui::TableSetupColumn("Position", 0, -1, ImGui::GetID("position"));
ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset"));
ImGui::TableSetupColumn("Size", 0, -1, ImGui::GetID("size"));
ImGui::TableSetupColumn("String", 0, -1, ImGui::GetID("string"));
@ -82,7 +82,7 @@ namespace hex {
if (sortSpecs->SpecsDirty) {
std::sort(this->m_foundStrings.begin(), this->m_foundStrings.end(),
[&sortSpecs](FoundString &left, FoundString &right) -> bool {
if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("position")) {
if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("offset")) {
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
return left.offset > right.offset;
else
@ -120,9 +120,9 @@ namespace hex {
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
ImGui::TableNextColumn();
ImGui::Text("0x%08lx:0x%08lx", foundString.offset, foundString.offset + foundString.size);
ImGui::Text("0x%08lx : 0x%08lx", foundString.offset, foundString.offset + foundString.size);
ImGui::TableNextColumn();
ImGui::Text("%08lx", foundString.size);
ImGui::Text("0x%04lx", foundString.size);
ImGui::TableNextColumn();
ImGui::Text("%s", foundString.string.c_str());
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,