2018-10-07 03:39:49 +00:00
|
|
|
#pragma once
|
2016-01-07 00:39:18 +00:00
|
|
|
|
2019-08-30 09:55:46 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "specter/ScrollView.hpp"
|
|
|
|
|
|
|
|
#include <hecl/SystemChar.hpp>
|
2016-01-07 00:39:18 +00:00
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
namespace specter {
|
2019-08-30 09:55:46 +00:00
|
|
|
class ViewResources;
|
2016-01-07 00:39:18 +00:00
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
struct IPathButtonsBinding {
|
|
|
|
virtual void pathButtonActivated(size_t idx) = 0;
|
2016-01-07 00:39:18 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
class PathButtons : public ScrollView {
|
2019-08-30 09:55:46 +00:00
|
|
|
struct ContentView;
|
|
|
|
struct PathButton;
|
|
|
|
friend struct PathButton;
|
2016-01-07 00:39:18 +00:00
|
|
|
|
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;
|
2016-01-07 00:39:18 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:24:02 +00:00
|
|
|
PathButtons(ViewResources& res, View& parentView, IPathButtonsBinding& binding, bool fillContainer = false);
|
2019-08-30 09:55:46 +00:00
|
|
|
~PathButtons() override;
|
2016-01-07 00:39:18 +00:00
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
void setButtons(const std::vector<hecl::SystemString>& comps);
|
2019-08-10 10:24:33 +00:00
|
|
|
void setMultiplyColor(const zeus::CColor& color) override;
|
2016-01-27 00:41:44 +00:00
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
/* Fill all available space in container when requested */
|
2019-08-10 10:24:33 +00:00
|
|
|
void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
|
2016-01-07 00:39:18 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:24:02 +00:00
|
|
|
} // namespace specter
|