28 |
28 |
29 #pragma once |
29 #pragma once |
30 |
30 |
31 #include "../ui/tree.h" |
31 #include "../ui/tree.h" |
32 #include "toolkit.h" |
32 #include "toolkit.h" |
|
33 #include "dnd.h" |
33 |
34 |
34 #include "../ui/container.h" |
35 #include "../ui/container.h" |
35 |
36 |
36 |
37 |
37 typedef struct UiTableColumn { |
38 typedef struct UiTableColumn { |
38 winrt::Microsoft::UI::Xaml::Controls::Button header; |
39 winrt::Microsoft::UI::Xaml::Controls::Button header; |
39 |
40 |
40 } UiTableColumn; |
41 } UiTableColumn; |
41 |
|
42 struct UiWinuiTableDnd { |
|
43 UiTableDndEvent evtobj; |
|
44 int evttype = 0; |
|
45 winrt::Microsoft::UI::Xaml::DragStartingEventArgs dndstartargs = { nullptr }; |
|
46 winrt::Microsoft::UI::Xaml::DropCompletedEventArgs dndcompletedargs = { nullptr }; |
|
47 winrt::Microsoft::UI::Xaml::DragEventArgs drageventargs = { nullptr }; |
|
48 }; |
|
49 |
42 |
50 typedef struct UiTable { |
43 typedef struct UiTable { |
51 winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollw; |
44 winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollw; |
52 winrt::Microsoft::UI::Xaml::Controls::Grid grid; |
45 winrt::Microsoft::UI::Xaml::Controls::Grid grid; |
53 winrt::Microsoft::UI::Xaml::Media::SolidColorBrush defaultBrush; |
46 winrt::Microsoft::UI::Xaml::Media::SolidColorBrush defaultBrush; |
70 ui_getvaluefunc getvalue = nullptr; |
63 ui_getvaluefunc getvalue = nullptr; |
71 int maxrows = 0; |
64 int maxrows = 0; |
72 int lastSelection = 0; |
65 int lastSelection = 0; |
73 ULONG64 lastPointerPress = 0; |
66 ULONG64 lastPointerPress = 0; |
74 std::vector<int> selection; |
67 std::vector<int> selection; |
75 bool enabledrag = false; // TODO: remove |
|
76 bool enabledrop = false; // TODO: remove |
|
77 |
68 |
78 UiTable(UiObject *obj, winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollW, winrt::Microsoft::UI::Xaml::Controls::Grid grid); |
69 UiTable(UiObject *obj, winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollW, winrt::Microsoft::UI::Xaml::Controls::Grid grid); |
79 |
70 |
80 ~UiTable(); |
71 ~UiTable(); |
81 |
72 |