Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -13,75 +13,71 @@
|
||||
#include "Gwen/Controls/ScrollBarButton.h"
|
||||
#include "Gwen/Gwen.h"
|
||||
|
||||
|
||||
#define SCROLL_BUTTON_UP 0
|
||||
#define SCROLL_BUTTON_LEFT 0
|
||||
#define SCROLL_BUTTON_DOWN 1
|
||||
#define SCROLL_BUTTON_RIGHT 1
|
||||
#define NUDGE_DIST 10
|
||||
|
||||
namespace Gwen
|
||||
namespace Gwen
|
||||
{
|
||||
namespace Controls
|
||||
namespace Controls
|
||||
{
|
||||
class GWEN_EXPORT BaseScrollBar : public Base
|
||||
{
|
||||
public:
|
||||
GWEN_CONTROL(BaseScrollBar, Base);
|
||||
|
||||
virtual void Render(Skin::Base* skin);
|
||||
|
||||
virtual void SetBarSize(int size) = 0;
|
||||
virtual int GetBarSize() = 0;
|
||||
virtual int GetBarPos() = 0;
|
||||
|
||||
virtual void OnBarMoved(Controls::Base* control);
|
||||
virtual void OnMouseClickLeft(int /*x*/, int /*y*/, bool /*bDown*/) {}
|
||||
|
||||
virtual void ScrollToLeft() {}
|
||||
virtual void ScrollToRight() {}
|
||||
virtual void ScrollToTop() {}
|
||||
virtual void ScrollToBottom() {}
|
||||
|
||||
virtual float GetNudgeAmount() { return m_fNudgeAmount / m_fContentSize; }
|
||||
virtual void SetNudgeAmount(float nudge) { m_fNudgeAmount = nudge; }
|
||||
|
||||
virtual void BarMovedNotification();
|
||||
|
||||
virtual float CalculateScrolledAmount() { return 0; }
|
||||
virtual int CalculateBarSize() { return 0; }
|
||||
virtual bool SetScrolledAmount(float amount, bool forceUpdate);
|
||||
|
||||
virtual void SetContentSize(float size);
|
||||
virtual void SetViewableContentSize(float size);
|
||||
|
||||
virtual int GetButtonSize() { return 0; }
|
||||
virtual float GetScrolledAmount() { return m_fScrolledAmount; }
|
||||
|
||||
Gwen::Event::Caller onBarMoved;
|
||||
|
||||
float getContentSize()
|
||||
{
|
||||
class GWEN_EXPORT BaseScrollBar : public Base
|
||||
{
|
||||
public:
|
||||
|
||||
GWEN_CONTROL( BaseScrollBar, Base );
|
||||
|
||||
virtual void Render( Skin::Base* skin );
|
||||
|
||||
virtual void SetBarSize(int size) = 0;
|
||||
virtual int GetBarSize() = 0;
|
||||
virtual int GetBarPos() = 0;
|
||||
|
||||
virtual void OnBarMoved( Controls::Base* control);
|
||||
virtual void OnMouseClickLeft( int /*x*/, int /*y*/, bool /*bDown*/ ){}
|
||||
|
||||
virtual void ScrollToLeft(){}
|
||||
virtual void ScrollToRight(){}
|
||||
virtual void ScrollToTop(){}
|
||||
virtual void ScrollToBottom(){}
|
||||
|
||||
virtual float GetNudgeAmount() { return m_fNudgeAmount / m_fContentSize; }
|
||||
virtual void SetNudgeAmount( float nudge ) { m_fNudgeAmount = nudge; }
|
||||
|
||||
virtual void BarMovedNotification();
|
||||
|
||||
virtual float CalculateScrolledAmount() { return 0; }
|
||||
virtual int CalculateBarSize() { return 0; }
|
||||
virtual bool SetScrolledAmount(float amount, bool forceUpdate);
|
||||
|
||||
virtual void SetContentSize(float size);
|
||||
virtual void SetViewableContentSize(float size);
|
||||
|
||||
virtual int GetButtonSize() { return 0; }
|
||||
virtual float GetScrolledAmount() { return m_fScrolledAmount; }
|
||||
|
||||
Gwen::Event::Caller onBarMoved;
|
||||
|
||||
float getContentSize()
|
||||
{
|
||||
return m_fContentSize;
|
||||
}
|
||||
float getViewableContentSize() const
|
||||
{
|
||||
|
||||
return m_fViewableContentSize;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
ControlsInternal::ScrollBarButton* m_ScrollButton[2];
|
||||
ControlsInternal::ScrollBarBar * m_Bar;
|
||||
|
||||
bool m_bDepressed;
|
||||
float m_fScrolledAmount;
|
||||
float m_fContentSize;
|
||||
float m_fViewableContentSize;
|
||||
float m_fNudgeAmount;
|
||||
};
|
||||
return m_fContentSize;
|
||||
}
|
||||
}
|
||||
float getViewableContentSize() const
|
||||
{
|
||||
return m_fViewableContentSize;
|
||||
}
|
||||
|
||||
protected:
|
||||
ControlsInternal::ScrollBarButton* m_ScrollButton[2];
|
||||
ControlsInternal::ScrollBarBar* m_Bar;
|
||||
|
||||
bool m_bDepressed;
|
||||
float m_fScrolledAmount;
|
||||
float m_fContentSize;
|
||||
float m_fViewableContentSize;
|
||||
float m_fNudgeAmount;
|
||||
};
|
||||
} // namespace Controls
|
||||
} // namespace Gwen
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user