From 90526a8bfd40481d250a5d48e0953d008ed30e02 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Tue, 21 May 2019 14:18:58 -0500 Subject: [PATCH 1/5] SPARK-2464 - ladder cursor provides visual feedback when middle clicking over bid ask cols --- .../Trading/Ladder/View/LadderTactileAdorner.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs index ef8d80395..390c9b3c6 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs @@ -149,11 +149,24 @@ namespace mbts.spark { } void _host_PreviewMouseDown(object sender, MouseButtonEventArgs e) { + // If we middle click over bid or ask columns then change the mouse + // cursor to illustrate sending an order is not applicable + var pos = e.GetPosition(_host); + if (e.MiddleButton == MouseButtonState.Pressed && + (_host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Bid || _host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Ask)) { + _host.Cursor = Cursors.No; + } + _is_mouse_down = true; InvalidateVisual(); } void _host_MouseUp(object sender, MouseButtonEventArgs e) { + // This will reset the cursor appropriately if the middle mouse button + // has been pressed while over the bid or ask columns + var point = e.GetPosition(_host); + _set_current_row_and_column(point); + _is_mouse_down = false; _is_mouse_dragging = false; InvalidateVisual(); From 7e75a71898df2c4e4370ef5c13cfe0476e4795a8 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Tue, 28 May 2019 10:47:11 -0500 Subject: [PATCH 2/5] check root algo's can_expand to see if we should draw Cursor.No --- .../Modules/Trading/Ladder/View/LadderTactileAdorner.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs index 390c9b3c6..4316b3c4f 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs @@ -150,10 +150,13 @@ namespace mbts.spark { void _host_PreviewMouseDown(object sender, MouseButtonEventArgs e) { // If we middle click over bid or ask columns then change the mouse - // cursor to illustrate sending an order is not applicable + // cursor to illustrate sending an order is not applicable when the + // selected algo in the left pane's algo root has no additional properties var pos = e.GetPosition(_host); if (e.MiddleButton == MouseButtonState.Pressed && - (_host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Bid || _host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Ask)) { + (_host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Bid || _host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Ask) && + !(_host._vm.order_properties_vm?.selected_algo_definition?.algo_root?.can_expand ?? true) + ) { _host.Cursor = Cursors.No; } From 31b2ba91656bd8a87b797b5c42394738ed6fcc80 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Tue, 28 May 2019 14:38:27 -0500 Subject: [PATCH 3/5] PR suggestion - if statement readability --- .../Modules/Trading/Ladder/View/LadderTactileAdorner.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs index 4316b3c4f..68014b14b 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs @@ -153,10 +153,11 @@ namespace mbts.spark { // cursor to illustrate sending an order is not applicable when the // selected algo in the left pane's algo root has no additional properties var pos = e.GetPosition(_host); + var column_type = _host._column_for_point(pos).column_type; + var selected_algo_can_expand = _host._vm.order_properties_vm?.selected_algo_definition?.algo_root?.can_expand ?? true; if (e.MiddleButton == MouseButtonState.Pressed && - (_host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Bid || _host._column_for_point(pos).column_type == LadderGridHost.ColumnType.Ask) && - !(_host._vm.order_properties_vm?.selected_algo_definition?.algo_root?.can_expand ?? true) - ) { + (column_type == LadderGridHost.ColumnType.Bid || column_type == LadderGridHost.ColumnType.Ask) && + !selected_algo_can_expand) { _host.Cursor = Cursors.No; } From e60f5678ec93dcd8948c3d895d3ab5947a56398a Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Tue, 4 Jun 2019 10:22:10 -0500 Subject: [PATCH 4/5] PR nits from chat --- .../Trading/Ladder/View/LadderTactileAdorner.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs index 68014b14b..f8cbef51c 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs @@ -149,16 +149,21 @@ namespace mbts.spark { } void _host_PreviewMouseDown(object sender, MouseButtonEventArgs e) { - // If we middle click over bid or ask columns then change the mouse - // cursor to illustrate sending an order is not applicable when the - // selected algo in the left pane's algo root has no additional properties + // When middle click over bid or ask columns: + // Non-parameterizalbe order: change cursor to No indicating sending an order is not possible + // Parameterizable order: if qty is null/0, flash and No cursor var pos = e.GetPosition(_host); var column_type = _host._column_for_point(pos).column_type; var selected_algo_can_expand = _host._vm.order_properties_vm?.selected_algo_definition?.algo_root?.can_expand ?? true; if (e.MiddleButton == MouseButtonState.Pressed && - (column_type == LadderGridHost.ColumnType.Bid || column_type == LadderGridHost.ColumnType.Ask) && - !selected_algo_can_expand) { - _host.Cursor = Cursors.No; + (column_type == LadderGridHost.ColumnType.Bid || column_type == LadderGridHost.ColumnType.Ask)) { + if (!selected_algo_can_expand) { + _host.Cursor = Cursors.No; + } + if (selected_algo_can_expand && (_host._vm.size_calculator.value ?? 0) == 0) { + _host._vm.size_calculator.flash_error(); + _host.Cursor = Cursors.No; + } } _is_mouse_down = true; From 0c17dbb55b6707f4f94172b8187a8b9d627ca451 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Wed, 5 Jun 2019 17:57:11 -0400 Subject: [PATCH 5/5] Updated release notes. --- doc/user/content/release_notes/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index 31cccd56a..58f2e5c93 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -9,6 +9,7 @@ insert_anchor_links = "right" - Made our orders easier to spot in MBO display - Changed middle-click on center column to recenter ladder and introduced Alt middle-click on center to bring up the MBO popup - Fixed Net/Absolute radio button in risk admin UI + - Added feedback to the ladder when the user attempts to middle click on bid/ask columns using an order that does not have parameters ## 2.1.4 ### User Visible Changes