metaforce/specter/include/Specter/Toolbar.hpp

79 lines
1.9 KiB
C++
Raw Normal View History

#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
class Toolbar : public View
{
public:
class Resources
{
friend class ViewResources;
friend class Toolbar;
boo::ITextureS* m_shadingTex;
void init(boo::IGraphicsDataFactory* factory, const IThemeData& theme);
};
enum class Position
{
None,
Bottom,
Top
};
private:
Position m_tbPos;
unsigned m_units;
std::vector<std::vector<ViewChild<View*>>> m_children;
2015-12-04 01:35:01 +00:00
ViewBlock m_tbBlock;
boo::IGraphicsBufferD* m_tbBlockBuf;
2015-12-05 00:42:46 +00:00
TexShaderVert m_tbVerts[10];
int m_nomGauge = 25;
2015-12-05 00:42:46 +00:00
int m_padding = 10;
void setHorizontalVerts(int width);
void setVerticalVerts(int height);
VertexBufferBinding m_vertsBinding;
2016-01-18 23:32:16 +00:00
public:
Toolbar(ViewResources& res, View& parentView, Position toolbarPos, unsigned units);
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);
void draw(boo::IGraphicsCommandQueue* gfxQ);
2015-12-04 01:35:01 +00:00
int nominalHeight() const
{
return m_nomGauge;
}
2015-12-05 00:42:46 +00:00
void clear()
2015-12-20 21:59:23 +00:00
{
for (std::vector<ViewChild<View*>>& u : m_children)
u.clear();
2015-12-20 21:59:23 +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);
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
}
};
}
#endif // SPECTER_TOOLBAR_HPP