## **Overview**
**Related Modules:**
[Graphic](Graphic.md)
**Description:**
Represents a slider.
Users can drag or click the knob to adjust the progress of an event.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Structures
Represents the listener for a slider change. |
## Public Member Functions
UISlider () | A constructor used to create a UISlider instance. |
~UISlider () | A destructor used to delete the UISlider instance. |
GetViewType () const override | |
SetKnobWidth (int16_t width) | |
GetKnobWidth () | |
SetImage (const ImageInfo *backgroundImage, const ImageInfo *foregroundImage, const ImageInfo *knobImage) | Sets the images as pixel maps for this slider, including the background, foreground, and knob images. |
SetImage (const char *backgroundImage, const char *foregroundImage, const char *knobImage) | Sets the images for this slider, including the background, foreground, and knob images. |
SetSliderColor (const ColorType backgroundColor, const ColorType foregroundColor, const ColorType knobColor) | Sets the colors for this slider, including the background, foreground, and knob colors. |
SetSliderRadius (int16_t backgroundRadius, int16_t foregroundRadius, int16_t knobRadius) | Sets the corner radiuses for this slider, including the background, foreground, and knob corner radiuses. |
SetKnobStyle (const Style &style) | |
SetKnobStyle (uint8_t key, int64_t value) | |
GetKnobStyle () const | const Style & |
GetKnobStyle (uint8_t key) const | Obtains the value of a knob style. |
OnClickEvent (const ClickEvent &event) override | Called when the view is clicked. |
OnDragEvent (const DragEvent &event) override | Called when the view is being dragged. |
OnDragEndEvent (const DragEvent &event) override | Called when the view stops dragging. |
OnPreDraw (const Rect &invalidatedArea) override | Called before a view is drawn. This function is used to check whether the parent view of this view needs to be redrawn so as to optimize the drawing process. |
OnDraw (const Rect &invalidatedArea) override | |
SetSliderEventListener (UISliderEventListener *listener) | Sets the listener for a slider change. |
A constructor used to create a UIBoxProgress instance. | |
A destructor used to delete the UIBoxProgress instance. | |
SetWidth (int16_t width) override | Sets the width for the view holding this progress bar. |
SetHeight (int16_t height) override | Sets the height for this view. |
SetDirection (const Direction &direction) | Sets the direction for this progress bar. |
GetDirection () const | Obtains the direction of this progress bar. |
SetValidWidth (int16_t width) | Sets the actual width for this progress bar. |
GetValidWidth () const | Obtains the actual width of this progress bar. |
SetValidHeight (int16_t height) | Sets the actual height for this progress bar. |
GetValidHeight () const | Obtains the actual height of this progress bar. |
A constructor used to create a UIAbstractProgress instance. | |
A destructor used to delete the UIAbstractProgress instance. | |
EnableBackground (bool enable) | Sets whether the background of the progress bar is visible. |
SetValue (int16_t value) | Sets the current value for this progress bar. |
GetValue () const | Obtains the current value of this progress bar. |
SetRange (int16_t rangeMax, int16_t rangeMin) | Sets the range for this progress bar. |
GetRangeMin () const | Obtains the minimum value of this progress bar. |
GetRangeMax () const | Obtains the maximum value of this progress bar. |
SetImage (const char *foregroundImage, const char *backgroundImage=nullptr) | Sets the image for this progress bar. |
SetImage (const ImageInfo *foregroundImage, const ImageInfo *backgroundImage=nullptr) | Sets the image as a pixel map for this progress bar. |
SetStep (uint16_t step) | Sets the step for this progress bar. |
GetStep () const | Obtains the current step of this progress bar. |
SetBackgroundStyle (const Style &style) | Sets the background style for this progress bar. |
SetBackgroundStyle (uint8_t key, int64_t value) | Sets a background style for this progress bar. |
GetBackgroundStyle () const | const Style & Obtains the background style of this progress bar. |
GetBackgroundStyle (uint8_t key) const | Obtains the value of a background style of this progress bar. |
SetForegroundStyle (const Style &style) | Sets the foreground style for this progress bar. |
SetForegroundStyle (uint8_t key, int64_t value) | Sets a foreground style for this progress bar. |
GetForegroundStyle () const | const Style & Obtains the foreground style of this progress bar. |
GetForegroundStyle (uint8_t key) const | Obtains the value of a foreground style of this progress bar. |
SetCapType (CapType cap) | Sets the type of caps on the background and foreground of the progress bar. |
UIView () | A default constructor used to create an UIView instance. |
UIView (const char *id) | A constructor used to create an UIView instance. |
~UIView () | A destructor used to delete the UIView instance. |
OnPostDraw (const Rect &invalidatedArea) | |
ReMeasure () | |
Invalidate () | Refreshes the invalidated area of the view. |
InvalidateRect (const Rect &invalidatedArea) | Refreshes a view in a specified invalidated area. |
OnLongPressEvent (const LongPressEvent &event) | Called when the view is long pressed. |
OnDragStartEvent (const DragEvent &event) | Called when the view starts to drag. |
OnPressEvent (const PressEvent &event) | Called when the view is pressed. |
OnReleaseEvent (const ReleaseEvent &event) | Called when the view is released. |
OnCancelEvent (const CancelEvent &event) | Called when a click event on the view is canceled. |
SetOnDragListener (OnDragListener *onDragListener) | Sets a drag event listener for the view. |
Obtains the drag event listener for the view. | |
SetOnClickListener (OnClickListener *onClickListener) | Sets a click event listener for the view. |
Obtains the click event listener for the view. | |
SetOnLongPressListener (OnLongPressListener *onLongPressListener) | Sets a long-press event listener for the view. |
Obtains the long-press event listener for the view. | |
SetOnTouchListener (OnTouchListener *onTouchListener) | Sets a touch event listener for the view. |
Obtains the touch event listener for the view. | |
GetTargetView (const Point &point, UIView **last) | Obtains the top-level view based on specified coordinates. |
Sets the parent view for the view. | |
GetParent () const | UIView * Obtains the parent view of the view. |
SetNextSibling (UIView *sibling) | Sets the next sibling view for the view. |
GetNextSibling () const | UIView * Obtains the next sibling view of the view. |
SetVisible (bool visible) | Sets whether the view is visible. |
IsVisible () const | Checks whether the view is visible. |
SetTouchable (bool touch) | Sets whether the view is touchable. |
IsTouchable () const | Checks whether the view is touchable. |
SetDraggable (bool draggable) | Sets whether the view is draggable. |
IsDraggable () const | Checks whether the view is draggable. |
SetDragParentInstead (bool dragParentInstead) | Sets whether to transfer the drag event to the parent view for processing when the view is being dragged. |
IsDragParentInstead () const | Obtains whether the view transfers a drag event to the parent view for processing. |
GetRect () const | Obtains the absolute rectangle area of the view. When the view has deformation such as rotation, the rectangle area is the intersection set of the absolute rectangle area and deformation matrix. |
GetVisibleRect () const | Obtains the visible absolute rectangle area of the view. |
GetMaskedRect () const | Obtains the valid absolute rectangle area of the view. The valid area refers to the area where the view can be displayed. Generally, the valid area is the same as the visible view area, but they may be different in the grid layout. |
GetOrigRect () const | Obtains the absolute rectangle area of the view. |
virtual Rect Obtains the content of the absolute rectangle area of the view. This area excludes padding. | |
GetRelativeRect () const | Obtains the rectangular area of the view relative to the parent view, that is, the rectangular area relative to the coordinates of the parent view. |
ResizeVisibleArea (int16_t x, int16_t y, int16_t width, int16_t height) | Adjusts the size of the visible area. This operation may affect the final display size. |
GetWidth () | Obtains the width for the view. |
GetHeight () | Obtains the height for the view. |
Resize (int16_t width, int16_t height) | |
SetX (int16_t x) | Sets the x-coordinate for the view. |
GetX () const | Obtains the x-coordinate for the view. |
SetY (int16_t y) | Sets the y-coordinate for the view. |
GetY () const | Obtains the y-coordinate for the view. |
SetPosition (int16_t x, int16_t y) | Sets the position for the view. |
SetPosition (int16_t x, int16_t y, int16_t width, int16_t height) | Adjusts the position and size of the view. |
IsViewGroup () const | Checks whether the view is a container view. |
SetIntercept (bool isIntercept) | Sets whether to intercept the drag event. If intercepted, the view does not transfer the drag event to the parent view after local processing. |
SetTransformMap (const TransformMap &transMap) | Sets the affine transformation matrix. |
Obtains an affine transformation matrix. | |
GetChildById (const char *id) const | virtual UIView * Obtains the child view of a specified ID. |
SetViewId (const char *id) | |
GetViewId () const | |
SetViewIndex (int16_t index) | |
GetViewIndex () const | |
LayoutChildren (bool neeInvalidate=false) | Lays out all child views according to the preset arrangement mode. |
LayoutCenterOfParent (int16_t xOffSet=0, int16_t yOffset=0) | Lays out the view in the center of the parent view. |
LayoutLeftOfParent (int16_t offset=0) | Lays out the view on the left of the parent view. |
LayoutRightOfParent (int16_t offset=0) | Lays out the view on the right of the parent view. |
LayoutTopOfParent (int16_t offset=0) | Lays out the view on the top of the parent view. |
LayoutBottomOfParent (int16_t offset=0) | Lays out the view on the bottom of the parent view. |
AlignLeftToSibling (const char *id, int16_t offset=0) | Aligns the view with the left of a sibling view. |
AlignRightToSibling (const char *id, int16_t offset=0) | Aligns the view with the right of a sibling view. |
AlignTopToSibling (const char *id, int16_t offset=0) | Aligns the view with the top of a sibling view. |
AlignBottomToSibling (const char *id, int16_t offset=0) | Aligns the view with the bottom of a sibling view. |
AlignHorCenterToSibling (const char *id, int16_t offset=0) | Aligns the view with the center of a sibling view in the x-axis. |
AlignVerCenterToSibling (const char *id, int16_t offset=0) | Aligns the view with the center of a sibling view in the y-axis. |
LayoutLeftToSibling (const char *id, int16_t offset=0) | Lays out the view on the left of a sibling view. |
LayoutRightToSibling (const char *id, int16_t offset=0) | Lays out the view on the right of a sibling view. |
LayoutTopToSibling (const char *id, int16_t offset=0) | Lays out the view on the above of a sibling view. |
LayoutBottomToSibling (const char *id, int16_t offset=0) | Lays out the view on the below of a sibling view. |
SetStyle (uint8_t key, int64_t value) | |
GetStyle (uint8_t key) const | |
GetStyleConst () const | const Style & Obtains the view style. This function applies to scenarios where the style does not need to be modified, which saves memory. |
operator new (size_t size) | |
operator delete (void *p) | Overrides the delete function. |
## Additional Inherited Members
Additional Inherited Member Name | |
---|---|
Direction : uint8_t { Direction::DIR_LEFT_TO_RIGHT, Direction::DIR_RIGHT_TO_LEFT, Direction::DIR_TOP_TO_BOTTOM, Direction::DIR_BOTTOM_TO_TOP } | Enumerates the directions of the progress bar. |