Skip to content

Commit

Permalink
Fixed popup menu Assign/Expire Option from stalling live data feed.
Browse files Browse the repository at this point in the history
Fixed diisabled vertical scrollbar not showing when ;long list of unmatched trades in Reconcile dialog.
  • Loading branch information
PaulSquires committed Feb 7, 2024
1 parent 28dd407 commit 348a965
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions TradeTracker/src/ActiveTrades/ActiveTrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<Transaction> trans;
std::shared_ptr<Leg> newleg;

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -1010,8 +1010,6 @@ void CActiveTrades::CalledAwayAssignment(
// ========================================================================================
void CActiveTrades::CreateAssignment(auto trade, auto leg) {

pause_live_updates = true;

std::shared_ptr<Transaction> trans;
std::shared_ptr<Leg> newleg;

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion TradeTracker/src/Config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions TradeTracker/src/TextBoxDialog/TextBoxDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}


Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 348a965

Please sign in to comment.