mirror of https://github.com/WerWolv/ImHex.git
Fixed about and cheat sheet window
This commit is contained in:
parent
c8304eb497
commit
e61dfa0927
|
@ -11,7 +11,6 @@ namespace hex {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewHelp::drawAboutPopup() {
|
void ViewHelp::drawAboutPopup() {
|
||||||
ImGui::OpenPopup("About");
|
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(450, 300));
|
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(450, 300));
|
||||||
if (ImGui::BeginPopupModal("About", &this->m_aboutWindowOpen, ImGuiWindowFlags_NoResize)) {
|
if (ImGui::BeginPopupModal("About", &this->m_aboutWindowOpen, ImGuiWindowFlags_NoResize)) {
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ namespace hex {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewHelp::drawPatternHelpPopup() {
|
void ViewHelp::drawPatternHelpPopup() {
|
||||||
ImGui::OpenPopup("PatternLanguage");
|
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(450, 300));
|
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(450, 300));
|
||||||
|
|
||||||
constexpr static auto DrawTitle = [](const std::string &title) {
|
constexpr static auto DrawTitle = [](const std::string &title) {
|
||||||
|
@ -64,11 +62,21 @@ namespace hex {
|
||||||
};
|
};
|
||||||
|
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(2000, 1000));
|
ImGui::SetNextWindowSizeConstraints(ImVec2(450, 300), ImVec2(2000, 1000));
|
||||||
if (ImGui::BeginPopupModal("Pattern Language Cheat Sheet", &this->m_patternHelpWindowOpen)) {
|
if (ImGui::BeginPopupModal("Cheat Sheet", &this->m_patternHelpWindowOpen)) {
|
||||||
ImGui::Text("ImHex Pattern Language Cheat Sheet");
|
ImGui::Text("ImHex Pattern Language Cheat Sheet");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
|
|
||||||
|
DrawTitle("Preprocessor directives");
|
||||||
|
ImGui::TextWrapped(
|
||||||
|
"Preprocessor directives can be used to alter the code before it's being parsed. Supported are "
|
||||||
|
"#define to replace one string with another and #include to include a separate file");
|
||||||
|
DrawCodeSegment("preprocessor", 40,
|
||||||
|
"#define HEADER_OFFSET 0x100\n"
|
||||||
|
"#include <cstdint.hexpat>\n"
|
||||||
|
"#include \"mypattern.hexpat\""
|
||||||
|
);
|
||||||
|
|
||||||
DrawTitle("Built-in types");
|
DrawTitle("Built-in types");
|
||||||
ImGui::TextWrapped(
|
ImGui::TextWrapped(
|
||||||
"The following built-in types are available for use");
|
"The following built-in types are available for use");
|
||||||
|
@ -144,20 +152,23 @@ namespace hex {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewHelp::createView() {
|
void ViewHelp::createView() {
|
||||||
if (this->m_aboutWindowOpen)
|
this->drawAboutPopup();
|
||||||
drawAboutPopup();
|
this->drawPatternHelpPopup();
|
||||||
|
|
||||||
if (this->m_patternHelpWindowOpen)
|
|
||||||
drawPatternHelpPopup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewHelp::createMenu() {
|
void ViewHelp::createMenu() {
|
||||||
if (ImGui::BeginMenu("Help")) {
|
if (ImGui::BeginMenu("Help")) {
|
||||||
if (ImGui::MenuItem("About", ""))
|
if (ImGui::MenuItem("About", ""))
|
||||||
this->m_aboutWindowOpen = true;
|
View::doLater([this]{
|
||||||
|
ImGui::OpenPopup("About");
|
||||||
|
this->m_aboutWindowOpen = true;
|
||||||
|
});
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (ImGui::MenuItem("Cheat Sheet", ""))
|
if (ImGui::MenuItem("Cheat Sheet", ""))
|
||||||
this->m_patternHelpWindowOpen = true;
|
View::doLater([this]{
|
||||||
|
ImGui::OpenPopup("Cheat Sheet");
|
||||||
|
this->m_patternHelpWindowOpen = true;
|
||||||
|
});
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue