This class is an implementation of the Built-in ScrollLite control. You may check ScrollBarLite control source code in the Standard package to see how it may be used in your controls.
"Active" state of control or its part is the state when user has down mouse button over it but hasn't release it yet.
You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.
class CBuiltInScrollLite :public virtual IBuiltInScroll, public CBuiltInControl
{
public:
enum class ElementType // Describes scroll elements
{
Scroller, // A part which could be used to drag and change position
None // None
};
enum class State // Describes possible states
{
Normal, // Normal
Hovered, // Control is hovered
Active, // Controls is active(user down mouse button over its active element and didn't release it yet)
Disabled // Control is disabled
};
public:
IBuiltInControlListener *getListener() override;
bool isHovered() override;
RectF getRenderRect() override;
bool isDown() override;
void setListener(IBuiltInControlListener *value) override;
bool setEnabled(const bool value) override;
bool setDPI(const Point &value) override;
void UpdateFromStyle(IStyle *style, const String &class_name) override;
void Render(const bool last_pass, const Mat4f &matrix, const Block *block) override;
void Update() override;
// State change notifications
void NotifyOnAttach() override;
void NotifyOnDeactivate() override;
void NotifyOnFreeResources() override;
// Mouse input notifications
bool NotifyOnMouseHover(const PointF &position) override;
bool NotifyOnMouseLeave() override;
bool NotifyOnMouseMove(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDown(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftUp(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseLeftDoubleClick(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDown(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleUp(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseMiddleDoubleClick(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDown(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightUp(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
bool NotifyOnMouseRightDoubleClick(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
void NotifyOnMouseDownCancel() override;
bool NotifyOnMouseVerticalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
bool NotifyOnMouseHorizontalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
// Keyboard input notifications
bool NotifyOnKeyDown(const Key key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnKeyUp(const Key key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
bool NotifyOnDeadChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
// Other input notifications
bool NotifyOnDropFiles(const PointF &position, const StringArray &filenames) override;
// Clipboard notifications
bool NotifyOnPasteString(const String &text) override;
float getMin() override;
float getMax() override;
float getScroll() override;
float getScrollerSize() override;
float getDeltaSmall() override;
float getDeltaMedium() override;
float getDeltaLarge() override;
bool isVertical() override;
bool isArrowsVisible() override;
bool setMin(const float value) override;
bool setMax(const float value) override;
bool setScroll(const float value) override;
bool setScrollerSize(const float value) override;
bool setDeltaSmall(const float value) override;
bool setDeltaMedium(const float value) override;
bool setDeltaLarge(const float value) override;
bool setVertical(const bool value) override;
bool setArrowsVisible(const bool value) override;
CBuiltInScrollLite(); // Constructor
virtual State getState(); // Return current control state
ElementType getHoveredElement() const; // Return hovered element
ElementType getActiveElement() const; // Return active element
float getScrollInterval() const; // Return scroll timer interval in seconds. Scroll happens when user click on scrolling arrows and hold mouse button
// Shadow
int getShadowRadius(const State state) const; // Return shadow blur radius depending on state
PointF getShadowShift(const State state) const; // Return shadow shift depending on state
Color getShadowColor(const State state) const; // Return shadow color depending on state
// Background
bool isBorderRound() const; // Return whether border has round borders
float getBorderWidth() const; // Return border width
Color getBorderColor(const State state) const; // Return border color depending on state
Color getBackgroundColor(const State state) const; // Return background color depending on state
Gradient *getBackgroundGradient(const State state); // Return background gradient depending on state
// Scroller
bool isScrollerRound() const; // Return whether scroller has round borders
float getScrollerBorderWidth() const; // Return scroller border width
Color getScrollerBorderColor(const State state) const; // Return scroller border color depending on state
Color getScrollerBackgroundColor(const State state) const; // Return scroller background color depending on state
Gradient *getScrollerBackgroundGradient(const State state); // Return scroller background gradient depending on state
bool setScrollInterval(const float value); // Set scroll interval(in seconds)
// Shadow
bool setShadowRadius(const State state, const int value); // Set shadow blur radius depending on state
bool setShadowShift(const State state, const PointF &value); // Set shadow shift depending on state
bool setShadowColor(const State state, const Color &value); // Set shadow color depending on state
// Background
bool setBorderRound(const bool value); // Set whether border has round borders
bool setBorderWidth(const float value); // Set borders width
bool setBorderColor(const State state, const Color &value); // Set borders color depending on state
bool setBackgroundColor(const State state, const Color &value); // Set background color depending on state
// Scroller
bool setScrollerRound(const bool value); // Set whether scroller has round borders
bool setScrollerBorderWidth(const float value); // Set scroller borders width
bool setScrollerBorderColor(const State state, const Color &value); // Set scroller borders color depending on state
bool setScrollerBackgroundColor(const State state, const Color &value); // Set scroller background color depending on state
bool setShadowRadius(const int value); // Set shadow blur radius for all states
bool setShadowShift(const PointF &value); // Set shadow shift for all states
bool setShadowColor(const Color &value); // Set shadow color for all states
bool setBorderColor(const Color &value); // Set borders color for all states
bool setBackgroundColor(const Color &value); // Set background color for all states
bool setScrollerBorderColor(const Color &value); // Set scroller borders color for all states
bool setScrollerBackgroundColor(const Color &value); // Set scroller background color for all states
void SwitchDirection(const bool size); // Vertical become horizontal and wise versa
};
Namespace: | nitisa |
Include: | Nitisa/BuiltInControls/ScrollLite/BuiltInScrollLite.h |