Skip to content

Commit

Permalink
Latest HexCtrl adaptation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jovibor committed Sep 11, 2023
1 parent fffb68a commit 677753f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Checks: '*,
-bugprone-narrowing-conversions,
-bugprone-use-after-move,
-llvm-header-guard,
-llvm-include-order,
-llvm-namespace-comment,
-llvm-qualified-auto,
-misc-non-private-member-variables-in-classes,
Expand Down
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ cpp_indent_preprocessor = one_left
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = true
cpp_new_line_before_open_brace_namespace = new_line
cpp_new_line_before_open_brace_type = ignore
cpp_new_line_before_open_brace_namespace = ignore
cpp_new_line_before_open_brace_type = same_line
cpp_new_line_before_open_brace_function = ignore
cpp_new_line_before_open_brace_block = same_line
cpp_new_line_before_open_brace_lambda = same_line
Expand Down
18 changes: 10 additions & 8 deletions Pepper/CViewRightTL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,24 +413,26 @@ void CViewRightTL::OnListSecHdrGetDispInfo(NMHDR* pNMHDR, LRESULT* /*pResult*/)
}
}

void CViewRightTL::OnListSecHdrGetToolTip(NMHDR* pNMHDR, LRESULT* /*pResult*/)
void CViewRightTL::OnListSecHdrGetToolTip(NMHDR* pNMHDR, LRESULT* pResult)
{
const auto pNMI = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
if (pNMI->iSubItem != 10)
const auto pLTI = reinterpret_cast<PLISTEXTTINFO>(pNMHDR);
if (pLTI->iSubItem != 10)
return;

const auto& pSecHeaders = m_pMainDoc->GetSecHeaders();
std::wstring wstrTipText;
static std::wstring wstrTipText;
wstrTipText.clear();
for (const auto& flags : MapSecHdrCharact) {
if (flags.first & pSecHeaders->at(pNMI->iItem).stSecHdr.Characteristics) {
if (flags.first & pSecHeaders->at(pLTI->iItem).stSecHdr.Characteristics) {
wstrTipText += flags.second;
wstrTipText += L"\n";
}
}
if (!wstrTipText.empty()) {
static LISTEXTOOLTIP stTT { { }, L"Section Flags:" };
stTT.wstrText = std::move(wstrTipText);
pNMI->lParam = reinterpret_cast<LPARAM>(&stTT); //Tooltip pointer.
static constexpr auto pwszCaption { L"Section Flags:" };
pLTI->stData.pwszCaption = pwszCaption;
pLTI->stData.pwszText = wstrTipText.data();
*pResult = TRUE;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Pepper/Utility.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export namespace Utility

//All HexCtrl dialogs' IDs for hiding/showing in Views, when tab is deactivated/activated.
inline const std::vector<HEXCTRL::EHexWnd> g_vecHexDlgs {
HEXCTRL::EHexWnd::DLG_BKMMANAGER, HEXCTRL::EHexWnd::DLG_DATAINTERP, HEXCTRL::EHexWnd::DLG_MODIFY,
HEXCTRL::EHexWnd::DLG_BKMMGR, HEXCTRL::EHexWnd::DLG_DATAINTERP, HEXCTRL::EHexWnd::DLG_MODIFY,
HEXCTRL::EHexWnd::DLG_SEARCH, HEXCTRL::EHexWnd::DLG_CODEPAGE,
HEXCTRL::EHexWnd::DLG_GOTO, HEXCTRL::EHexWnd::DLG_TEMPLMGR };

Expand Down
2 changes: 1 addition & 1 deletion Pepper/dep/HexCtrl
Submodule HexCtrl updated 37 files
+1 −0 .clang-tidy
+2 −2 .editorconfig
+38 −40 HexCtrl/HexCtrl.h
+566 −576 HexCtrl/dep/ListEx/CListEx.cpp
+72 −20 HexCtrl/dep/ListEx/ListEx.h
+1 −1 HexCtrl/dep/StrToNum
+45 −45 HexCtrl/res/HexCtrl.rc
+1 −1 HexCtrl/res/HexCtrlRes.h
+11 −14 HexCtrl/src/CHexCtrl.cpp
+2 −3 HexCtrl/src/CHexCtrl.h
+40 −40 HexCtrl/src/CHexSelection.cpp
+1 −2 HexCtrl/src/CHexSelection.h
+62 −48 HexCtrl/src/CScrollEx.cpp
+7 −5 HexCtrl/src/CScrollEx.h
+170 −132 HexCtrl/src/Dialogs/CHexDlgBkmMgr.cpp
+11 −9 HexCtrl/src/Dialogs/CHexDlgBkmMgr.h
+31 −33 HexCtrl/src/Dialogs/CHexDlgCallback.cpp
+5 −6 HexCtrl/src/Dialogs/CHexDlgCallback.h
+32 −25 HexCtrl/src/Dialogs/CHexDlgCodepage.cpp
+1 −2 HexCtrl/src/Dialogs/CHexDlgCodepage.h
+19 −27 HexCtrl/src/Dialogs/CHexDlgDataInterp.cpp
+7 −5 HexCtrl/src/Dialogs/CHexDlgDataInterp.h
+25 −25 HexCtrl/src/Dialogs/CHexDlgFillData.cpp
+4 −5 HexCtrl/src/Dialogs/CHexDlgFillData.h
+165 −231 HexCtrl/src/Dialogs/CHexDlgGoTo.cpp
+6 −10 HexCtrl/src/Dialogs/CHexDlgGoTo.h
+4 −0 HexCtrl/src/Dialogs/CHexDlgModify.cpp
+1 −2 HexCtrl/src/Dialogs/CHexDlgModify.h
+52 −52 HexCtrl/src/Dialogs/CHexDlgOpers.cpp
+1 −2 HexCtrl/src/Dialogs/CHexDlgOpers.h
+13 −11 HexCtrl/src/Dialogs/CHexDlgSearch.cpp
+1 −4 HexCtrl/src/Dialogs/CHexDlgSearch.h
+905 −858 HexCtrl/src/Dialogs/CHexDlgTemplMgr.cpp
+48 −55 HexCtrl/src/Dialogs/CHexDlgTemplMgr.h
+51 −41 README.md
+14 −12 VS Projects/Sample Project/HexSampleDlg.cpp
+3 −4 VS Projects/Sample Project/HexSampleDlg.h

0 comments on commit 677753f

Please sign in to comment.