metaforce/specter/include/specter/PathButtons.hpp

41 lines
1020 B
C++
Raw Normal View History

2018-10-07 03:39:49 +00:00
#pragma once
#include <cstddef>
#include <memory>
#include <vector>
#include "specter/ScrollView.hpp"
#include <hecl/SystemChar.hpp>
2018-12-08 05:24:02 +00:00
namespace specter {
class ViewResources;
2018-12-08 05:24:02 +00:00
struct IPathButtonsBinding {
virtual void pathButtonActivated(size_t idx) = 0;
};
2018-12-08 05:24:02 +00:00
class PathButtons : public ScrollView {
struct ContentView;
struct PathButton;
friend struct PathButton;
2018-12-08 05:24:02 +00:00
ViewChild<std::unique_ptr<ContentView>> m_contentView;
int m_pathButtonPending = -1;
IPathButtonsBinding& m_binding;
bool m_fillContainer;
std::vector<PathButton> m_pathButtons;
public:
2018-12-08 05:24:02 +00:00
PathButtons(ViewResources& res, View& parentView, IPathButtonsBinding& binding, bool fillContainer = false);
~PathButtons() override;
2018-12-08 05:24:02 +00:00
void setButtons(const std::vector<hecl::SystemString>& comps);
void setMultiplyColor(const zeus::CColor& color) override;
2018-12-08 05:24:02 +00:00
/* Fill all available space in container when requested */
void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
};
2018-12-08 05:24:02 +00:00
} // namespace specter