2015-12-03 03:26:50 +00:00
|
|
|
#ifndef SPECTER_TOOLBAR_HPP
|
|
|
|
#define SPECTER_TOOLBAR_HPP
|
|
|
|
|
|
|
|
#include "Specter/View.hpp"
|
|
|
|
|
|
|
|
namespace Specter
|
|
|
|
{
|
2016-01-12 00:44:54 +00:00
|
|
|
#define SPECTER_TOOLBAR_GAUGE 28
|
2015-12-03 03:26:50 +00:00
|
|
|
|
|
|
|
class Toolbar : public View
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
class Resources
|
|
|
|
{
|
|
|
|
friend class ViewResources;
|
|
|
|
friend class Toolbar;
|
|
|
|
boo::ITextureS* m_shadingTex;
|
|
|
|
|
2016-01-10 06:40:23 +00:00
|
|
|
void init(boo::IGraphicsDataFactory* factory, const IThemeData& theme);
|
2015-12-03 03:26:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class Position
|
|
|
|
{
|
2016-01-07 00:39:18 +00:00
|
|
|
None,
|
2015-12-03 03:26:50 +00:00
|
|
|
Bottom,
|
|
|
|
Top
|
|
|
|
};
|
|
|
|
private:
|
|
|
|
Position m_tbPos;
|
2016-01-27 00:41:44 +00:00
|
|
|
unsigned m_units;
|
|
|
|
std::vector<std::vector<ViewChild<View*>>> m_children;
|
2015-12-03 03:26:50 +00:00
|
|
|
|
2015-12-04 01:35:01 +00:00
|
|
|
ViewBlock m_tbBlock;
|
2015-12-03 03:26:50 +00:00
|
|
|
boo::IGraphicsBufferD* m_tbBlockBuf;
|
2015-12-05 00:42:46 +00:00
|
|
|
TexShaderVert m_tbVerts[10];
|
2016-01-27 00:41:44 +00:00
|
|
|
int m_nomGauge = 25;
|
2015-12-05 00:42:46 +00:00
|
|
|
int m_padding = 10;
|
2015-12-03 03:26:50 +00:00
|
|
|
|
2016-01-27 00:41:44 +00:00
|
|
|
void setHorizontalVerts(int width);
|
|
|
|
void setVerticalVerts(int height);
|
2015-12-03 03:26:50 +00:00
|
|
|
|
2016-01-08 00:06:21 +00:00
|
|
|
VertexBufferBinding m_vertsBinding;
|
2016-01-18 23:32:16 +00:00
|
|
|
|
2015-12-03 03:26:50 +00:00
|
|
|
public:
|
2016-01-27 00:41:44 +00:00
|
|
|
Toolbar(ViewResources& res, View& parentView, Position toolbarPos, unsigned units);
|
2015-12-03 03:26:50 +00:00
|
|
|
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseMove(const boo::SWindowCoord&);
|
2015-12-05 00:42:46 +00:00
|
|
|
void mouseEnter(const boo::SWindowCoord&);
|
|
|
|
void mouseLeave(const boo::SWindowCoord&coord);
|
|
|
|
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
|
2015-12-03 03:26:50 +00:00
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
2015-12-04 01:35:01 +00:00
|
|
|
|
2016-01-27 00:41:44 +00:00
|
|
|
int nominalHeight() const
|
|
|
|
{
|
|
|
|
return m_nomGauge;
|
|
|
|
}
|
2015-12-05 00:42:46 +00:00
|
|
|
|
2016-01-27 00:41:44 +00:00
|
|
|
void clear()
|
2015-12-20 21:59:23 +00:00
|
|
|
{
|
2016-01-27 00:41:44 +00:00
|
|
|
for (std::vector<ViewChild<View*>>& u : m_children)
|
|
|
|
u.clear();
|
2015-12-20 21:59:23 +00:00
|
|
|
}
|
2016-01-27 00:41:44 +00:00
|
|
|
void push_back(View* v, unsigned unit);
|
2016-01-18 23:32:16 +00:00
|
|
|
|
|
|
|
void setMultiplyColor(const Zeus::CColor& color)
|
|
|
|
{
|
|
|
|
View::setMultiplyColor(color);
|
2016-01-27 00:41:44 +00:00
|
|
|
for (std::vector<ViewChild<View*>>& u : m_children)
|
|
|
|
for (ViewChild<View*>& c : u)
|
|
|
|
if (c.m_view)
|
|
|
|
c.m_view->setMultiplyColor(color);
|
2016-01-18 23:32:16 +00:00
|
|
|
}
|
2015-12-03 03:26:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SPECTER_TOOLBAR_HPP
|