From 348a965608c9b6660d53be32a04065c2613bd56d Mon Sep 17 00:00:00 2001 From: Paul Squires Date: Wed, 7 Feb 2024 13:03:14 -0330 Subject: [PATCH] Fixed popup menu Assign/Expire Option from stalling live data feed. Fixed diisabled vertical scrollbar not showing when ;long list of unmatched trades in Reconcile dialog. --- TradeTracker/src/ActiveTrades/ActiveTrades.cpp | 10 +++++----- TradeTracker/src/Config/Config.h | 2 +- TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/TradeTracker/src/ActiveTrades/ActiveTrades.cpp b/TradeTracker/src/ActiveTrades/ActiveTrades.cpp index 8bc6a03..4e7a0d2 100644 --- a/TradeTracker/src/ActiveTrades/ActiveTrades.cpp +++ b/TradeTracker/src/ActiveTrades/ActiveTrades.cpp @@ -402,6 +402,7 @@ void CActiveTrades::UpdateLegPortfolioLine(int index, ListBoxData* ld) { // This function is called from the TickerUpdateFunction() thread. // ======================================================================================== void CActiveTrades::UpdateTickerPrices() { + if (pause_live_updates) return; // Guard to prevent re-entry of update should the thread fire the update @@ -875,9 +876,6 @@ void CActiveTrades::ExpireSelectedLegs(auto trade) { void CActiveTrades::CalledAwayAssignment( auto trade, auto leg, int aggregate_shares, int aggregate_futures) { - - pause_live_updates = true; - std::shared_ptr trans; std::shared_ptr newleg; @@ -916,6 +914,8 @@ void CActiveTrades::CalledAwayAssignment( return; } + pause_live_updates = true; + // Retreive the Quantity amount that was set by the Assignment modal when OK was pressed. quantity_assigned = AfxValInteger(quantity_set_from_assignment_modal); @@ -1010,8 +1010,6 @@ void CActiveTrades::CalledAwayAssignment( // ======================================================================================== void CActiveTrades::CreateAssignment(auto trade, auto leg) { - pause_live_updates = true; - std::shared_ptr trans; std::shared_ptr newleg; @@ -1044,6 +1042,8 @@ void CActiveTrades::CreateAssignment(auto trade, auto leg) { return; } + pause_live_updates = true; + // Retreive the Quantity amount that was set by the Assignment modal when OK was pressed. quantity_assigned = AfxValInteger(quantity_set_from_assignment_modal); diff --git a/TradeTracker/src/Config/Config.h b/TradeTracker/src/Config/Config.h index 6c43dc8..7707820 100644 --- a/TradeTracker/src/Config/Config.h +++ b/TradeTracker/src/Config/Config.h @@ -30,7 +30,7 @@ SOFTWARE. #include "Utilities/AfxWin.h" -constexpr std::wstring version = L"4.0.0"; +constexpr std::wstring version = L"4.0.1"; enum class NumberFormatType { American, diff --git a/TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp b/TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp index ffd0ee6..ac1b678 100644 --- a/TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp +++ b/TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp @@ -47,12 +47,6 @@ void TextBoxDialog_OnSize(HWND hwnd, UINT state, int cx, int cy) { SetWindowPos( GetDlgItem(hwnd, IDC_TEXTBOXDIALOG_TEXTBOX), 0, 0, 0, cx, cy, SWP_NOZORDER | SWP_SHOWWINDOW); - - // Hide the vertical scrollbar if < 25 lines - if (Edit_GetLineCount(hTextBox) <= 25) { - ShowScrollBar(hTextBox, SB_VERT, false); - } - } @@ -114,7 +108,7 @@ bool TextBoxDialog_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) { TextBoxDialog.AddControl(Controls::MultilineTextBox, hwnd, IDC_TEXTBOXDIALOG_TEXTBOX, L"", 0, 0, 0, 0, - WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_LEFT | ES_AUTOHSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_WANTRETURN, + WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_LEFT | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_WANTRETURN, 0); return true; @@ -216,6 +210,12 @@ void TextBoxDialog_Show(HWND hParent, const std::wstring& caption, const std::ws // Do the reconciliation AfxSetWindowText(hTextBox, text); + // Hide the vertical scrollbar if < 24 lines + if (Edit_GetLineCount(hTextBox) <= 24) { + ShowScrollBar(hTextBox, SB_VERT, false); + } + + // Fix Windows 10 white flashing BOOL cloak = TRUE; DwmSetWindowAttribute(hwnd, DWMWA_CLOAK, &cloak, sizeof(cloak));