mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
ab8f16961e
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
56 lines
1.0 KiB
C++
56 lines
1.0 KiB
C++
/*
|
|
GWEN
|
|
Copyright (c) 2010 Facepunch Studios
|
|
See license in Gwen.h
|
|
*/
|
|
|
|
#include "Gwen/Controls/ScrollBar.h"
|
|
#include "Gwen/Controls/ScrollBarBar.h"
|
|
|
|
using namespace Gwen;
|
|
using namespace Gwen::Controls;
|
|
using namespace Gwen::ControlsInternal;
|
|
|
|
//Actual bar representing height of parent
|
|
|
|
GWEN_CONTROL_CONSTRUCTOR(ScrollBarBar)
|
|
{
|
|
RestrictToParent(true);
|
|
SetTarget(this);
|
|
}
|
|
|
|
void ScrollBarBar::Render(Skin::Base* skin)
|
|
{
|
|
skin->DrawScrollBarBar(this, m_bDepressed, IsHovered(), m_bHorizontal);
|
|
BaseClass::Render(skin);
|
|
}
|
|
|
|
void ScrollBarBar::OnMouseMoved(int x, int y, int deltaX, int deltaY)
|
|
{
|
|
BaseClass::OnMouseMoved(x, y, deltaX, deltaY);
|
|
|
|
if (!m_bDepressed)
|
|
return;
|
|
|
|
InvalidateParent();
|
|
}
|
|
|
|
void ScrollBarBar::OnMouseClickLeft(int x, int y, bool bDown)
|
|
{
|
|
BaseClass::OnMouseClickLeft(x, y, bDown);
|
|
InvalidateParent();
|
|
}
|
|
|
|
void ScrollBarBar::Layout(Skin::Base* /*skin*/)
|
|
{
|
|
if (!GetParent())
|
|
return;
|
|
|
|
//Move to our current position to force clamping - is this a hack?
|
|
MoveTo(X(), Y());
|
|
}
|
|
|
|
void ScrollBarBar::MoveTo(int x, int y)
|
|
{
|
|
BaseClass::MoveTo(x, y);
|
|
} |