mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
C++ Shuffleboard fixes (#1595)
* Fix C++ ShuffleboardComponent template type * Fix `WithWidget(WidgetType&)`not being properly capitalized * Fix data members across dll boundaries by using enum for built in types
This commit is contained in:
committed by
Peter Johnson
parent
182758c05b
commit
e8b24717c7
@@ -18,6 +18,12 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
static constexpr const char* layoutStrings[] = {"List Layout", "Grid Layout"};
|
||||
|
||||
static constexpr const char* GetStringFromBuiltInLayout(BuiltInLayouts layout) {
|
||||
return layoutStrings[static_cast<int>(layout)];
|
||||
}
|
||||
|
||||
ShuffleboardContainer::ShuffleboardContainer(const wpi::Twine& title)
|
||||
: ShuffleboardValue(title) {}
|
||||
|
||||
@@ -26,6 +32,11 @@ ShuffleboardContainer::GetComponents() const {
|
||||
return m_components;
|
||||
}
|
||||
|
||||
ShuffleboardLayout& ShuffleboardContainer::GetLayout(const wpi::Twine& title,
|
||||
BuiltInLayouts type) {
|
||||
return GetLayout(title, GetStringFromBuiltInLayout(type));
|
||||
}
|
||||
|
||||
ShuffleboardLayout& ShuffleboardContainer::GetLayout(const wpi::Twine& title,
|
||||
const LayoutType& type) {
|
||||
return GetLayout(title, type.GetLayoutName());
|
||||
|
||||
Reference in New Issue
Block a user