FIX 4.0 Demo 1.0
Loading...
Searching...
No Matches
order_panel.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <ftxui/component/component.hpp>
9#include "../styles.hpp"
10#include "../../client_state.hpp"
11#include "../../client_app.hpp"
12#include <memory>
13#include <string>
14
15namespace fix40::client::tui {
16
22 std::string selectedClOrdID;
23 size_t lastOrderCount = 0;
24
26 bool showCancelDialog = false;
29};
30
34ftxui::Component OrderListComponent(
35 std::shared_ptr<OrderListState> listState,
36 std::shared_ptr<ClientApp> app,
37 const std::shared_ptr<ClientState>& state);
38
43 std::string symbol;
44 std::string price;
45 std::string quantity;
46 int sideIndex = 0; // 0=买, 1=卖
47 int orderTypeIndex = 0; // 0=限价, 1=市价
48
49 // Toggle 选项(必须持久化,因为 Toggle 持有指针引用)
50 std::vector<std::string> sideOptions = {"买入", "卖出"};
51 std::vector<std::string> typeOptions = {"限价", "市价"};
52};
53
57ftxui::Component OrderPanelComponent(
58 std::shared_ptr<OrderPanelState> panelState,
59 std::shared_ptr<ClientApp> app,
60 std::shared_ptr<ClientState> state);
61
62} // namespace fix40::client::tui
Definition app.cpp:15
Component OrderListComponent(std::shared_ptr< OrderListState > listState, std::shared_ptr< ClientApp > app, const std::shared_ptr< ClientState > &state)
创建订单列表组件
Definition order_panel.cpp:19
Component OrderPanelComponent(std::shared_ptr< OrderPanelState > panelState, std::shared_ptr< ClientApp > app, std::shared_ptr< ClientState > state)
创建下单面板组件
Definition order_panel.cpp:366
订单列表状态
Definition order_panel.hpp:20
std::string cancelDialogClOrdID
弹窗对应的订单 clOrdID(打开弹窗时冻结,避免选中变化导致错撤)。
Definition order_panel.hpp:28
int selectedIndex
Definition order_panel.hpp:21
bool showCancelDialog
是否显示“撤单确认”弹窗(订单列表内 Modal)。
Definition order_panel.hpp:26
std::string selectedClOrdID
Definition order_panel.hpp:22
size_t lastOrderCount
Definition order_panel.hpp:23
下单面板状态
Definition order_panel.hpp:42
std::vector< std::string > sideOptions
Definition order_panel.hpp:50
std::string symbol
Definition order_panel.hpp:43
std::vector< std::string > typeOptions
Definition order_panel.hpp:51
int sideIndex
Definition order_panel.hpp:46
std::string quantity
Definition order_panel.hpp:45
std::string price
Definition order_panel.hpp:44
int orderTypeIndex
Definition order_panel.hpp:47