mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-17 20:45:23 +00:00
Add TextField drawing
This commit is contained in:
@@ -21,11 +21,8 @@ private:
|
||||
Zeus::CColor m_textColor;
|
||||
std::string m_textStr;
|
||||
std::unique_ptr<TextView> m_text;
|
||||
|
||||
SolidShaderVert m_verts[28];
|
||||
|
||||
ViewBlock m_bBlock;
|
||||
boo::IGraphicsBufferD* m_bBlockBuf = nullptr;
|
||||
|
||||
boo::IGraphicsBufferD* m_bVertsBuf = nullptr;
|
||||
boo::IVertexFormat* m_bVtxFmt = nullptr; /* OpenGL only */
|
||||
boo::IShaderDataBinding* m_bShaderBinding = nullptr;
|
||||
@@ -71,8 +68,8 @@ public:
|
||||
void setMultiplyColor(const Zeus::CColor& color)
|
||||
{
|
||||
View::setMultiplyColor(color);
|
||||
m_bBlock.m_color = color;
|
||||
m_bBlockBuf->load(&m_bBlock, sizeof(ViewBlock));
|
||||
m_viewVertBlock.m_color = color;
|
||||
m_viewVertBlockBuf->load(&m_viewVertBlock, sizeof(ViewBlock));
|
||||
m_text->setMultiplyColor(color);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
FileBrowser(ViewResources& res, View& parentView)
|
||||
: FileBrowser(res, parentView, HECL::GetcwdStr()) {}
|
||||
FileBrowser(ViewResources& res, View& parentView, const HECL::SystemString& initialPath);
|
||||
|
||||
void updateContentOpacity(float opacity);
|
||||
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
|
||||
@@ -2,14 +2,51 @@
|
||||
#define SPECTER_TEXTFIELD_HPP
|
||||
|
||||
#include "View.hpp"
|
||||
#include "TextView.hpp"
|
||||
|
||||
namespace Specter
|
||||
{
|
||||
|
||||
class TextField : public View
|
||||
{
|
||||
std::string m_textStr;
|
||||
std::unique_ptr<TextView> m_text;
|
||||
|
||||
SolidShaderVert m_verts[28];
|
||||
boo::IGraphicsBufferD* m_bVertsBuf = nullptr;
|
||||
boo::IVertexFormat* m_bVtxFmt = nullptr; /* OpenGL only */
|
||||
boo::IShaderDataBinding* m_bShaderBinding = nullptr;
|
||||
|
||||
int m_nomWidth = 0;
|
||||
int m_nomHeight = 0;
|
||||
|
||||
void setInactive();
|
||||
void setHover();
|
||||
void setDisabled();
|
||||
|
||||
public:
|
||||
TextField(ViewResources& res, View& parentView);
|
||||
|
||||
void setText(const std::string& str);
|
||||
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseMove(const boo::SWindowCoord&);
|
||||
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);
|
||||
|
||||
int nominalWidth() const {return m_nomWidth;}
|
||||
int nominalHeight() const {return m_nomHeight;}
|
||||
|
||||
void setMultiplyColor(const Zeus::CColor& color)
|
||||
{
|
||||
View::setMultiplyColor(color);
|
||||
m_viewVertBlock.m_color = color;
|
||||
m_viewVertBlockBuf->load(&m_viewVertBlock, sizeof(ViewBlock));
|
||||
m_text->setMultiplyColor(color);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,17 @@ namespace Specter
|
||||
{
|
||||
class ThemeData
|
||||
{
|
||||
Zeus::CColor m_uiText = Zeus::CColor::skWhite;
|
||||
Zeus::CColor m_fieldText = Zeus::CColor::skBlack;
|
||||
|
||||
Zeus::CColor m_vpBg = {0.2,0.2,0.2,1.0};
|
||||
Zeus::CColor m_tbBg = {0.4,0.4,0.4,1.0};
|
||||
Zeus::CColor m_uiText = Zeus::CColor::skWhite;
|
||||
Zeus::CColor m_tooltipBg = {0.0, 0.0, 0.0, 0.65};
|
||||
Zeus::CColor m_splashBg = {0.1, 0.1, 0.1, 0.65};
|
||||
|
||||
Zeus::CColor m_splash1 = {1.0, 1.0, 1.0, 1.0};
|
||||
Zeus::CColor m_splash2 = {0.3, 0.3, 0.3, 1.0};
|
||||
|
||||
Zeus::CColor m_button1Inactive = {0.2823, 0.2823, 0.2823, 1.0};
|
||||
Zeus::CColor m_button2Inactive = {0.1725, 0.1725, 0.1725, 1.0};
|
||||
Zeus::CColor m_button1Hover = {0.3523, 0.3523, 0.3523, 1.0};
|
||||
@@ -23,14 +31,26 @@ class ThemeData
|
||||
Zeus::CColor m_button2Press = {0.2823, 0.2823, 0.2823, 1.0};
|
||||
Zeus::CColor m_button1Disabled = {0.2823, 0.2823, 0.2823, 0.5};
|
||||
Zeus::CColor m_button2Disabled = {0.1725, 0.1725, 0.1725, 0.5};
|
||||
Zeus::CColor m_tooltipBg = {0.0, 0.0, 0.0, 0.65};
|
||||
Zeus::CColor m_splashBg = {0.1, 0.1, 0.1, 0.65};
|
||||
Zeus::CColor m_splash1 = {1.0, 1.0, 1.0, 1.0};
|
||||
Zeus::CColor m_splash2 = {0.3, 0.3, 0.3, 1.0};
|
||||
|
||||
Zeus::CColor m_textfield2Inactive = {0.7823, 0.7823, 0.7823, 1.0};
|
||||
Zeus::CColor m_textfield1Inactive = {0.4725, 0.4725, 0.4725, 1.0};
|
||||
Zeus::CColor m_textfield2Hover = {0.8523, 0.8523, 0.8523, 1.0};
|
||||
Zeus::CColor m_textfield1Hover = {0.5425, 0.5425, 0.5425, 1.0};
|
||||
Zeus::CColor m_textfield2Disabled = {0.7823, 0.7823, 0.7823, 0.5};
|
||||
Zeus::CColor m_textfield1Disabled = {0.4725, 0.4725, 0.4725, 0.5};
|
||||
|
||||
public:
|
||||
virtual const Zeus::CColor& uiText() const {return m_uiText;}
|
||||
virtual const Zeus::CColor& fieldText() const {return m_fieldText;}
|
||||
|
||||
virtual const Zeus::CColor& viewportBackground() const {return m_vpBg;}
|
||||
virtual const Zeus::CColor& toolbarBackground() const {return m_tbBg;}
|
||||
virtual const Zeus::CColor& uiText() const {return m_uiText;}
|
||||
virtual const Zeus::CColor& tooltipBackground() const {return m_tooltipBg;}
|
||||
virtual const Zeus::CColor& splashBackground() const {return m_splashBg;}
|
||||
|
||||
virtual const Zeus::CColor& splash1() const {return m_splash1;}
|
||||
virtual const Zeus::CColor& splash2() const {return m_splash2;}
|
||||
|
||||
virtual const Zeus::CColor& button1Inactive() const {return m_button1Inactive;}
|
||||
virtual const Zeus::CColor& button2Inactive() const {return m_button2Inactive;}
|
||||
virtual const Zeus::CColor& button1Hover() const {return m_button1Hover;}
|
||||
@@ -39,10 +59,13 @@ public:
|
||||
virtual const Zeus::CColor& button2Press() const {return m_button2Press;}
|
||||
virtual const Zeus::CColor& button1Disabled() const {return m_button1Disabled;}
|
||||
virtual const Zeus::CColor& button2Disabled() const {return m_button2Disabled;}
|
||||
virtual const Zeus::CColor& tooltipBackground() const {return m_tooltipBg;}
|
||||
virtual const Zeus::CColor& splashBackground() const {return m_splashBg;}
|
||||
virtual const Zeus::CColor& splash1() const {return m_splash1;}
|
||||
virtual const Zeus::CColor& splash2() const {return m_splash2;}
|
||||
|
||||
virtual const Zeus::CColor& textfield1Inactive() const {return m_textfield1Inactive;}
|
||||
virtual const Zeus::CColor& textfield2Inactive() const {return m_textfield2Inactive;}
|
||||
virtual const Zeus::CColor& textfield1Hover() const {return m_textfield1Hover;}
|
||||
virtual const Zeus::CColor& textfield2Hover() const {return m_textfield2Hover;}
|
||||
virtual const Zeus::CColor& textfield1Disabled() const {return m_textfield1Disabled;}
|
||||
virtual const Zeus::CColor& textfield2Disabled() const {return m_textfield2Disabled;}
|
||||
};
|
||||
|
||||
class ViewResources
|
||||
|
||||
Reference in New Issue
Block a user