B4J Library [B4X] [XUI] xRotaryKnob class

Discussion in 'B4J Libraries & Classes' started by klaus, Aug 11, 2018.

  1. klaus

    klaus Expert Licensed User

    After a request from HERE, I made it as a XUI challenge.
    You can turn the button, and it snaps onto the nearest value.
    A click in the middle selects the next value, a LonkClick in the middle selects the prevous value.
    There are three snap modes:
    AFTERMOVE snaps when the knob is released, upper left knob.
    ALLWAY snaps allways during moving, the lower green knob.
    NEVER doesn't snap at all, displays the current value, the upper right knob,

    The zip file contains three folders, one for each proguct (B4A, B4i and B4J).
    There is only one xRotaryKnob.bas file in the B4J folder.
    For the two other products, there is a relative link, in the IDE, to the file in the B4J folder.

    upload_2018-8-11_16-19-51.gif

    jxRotaryKnob
    • xRotaryKnob
      • Events:
        • ValueChanged (Value As Int)
        Functions:
        • AddToParent (Parent As B4XView, Left As Double, Top As Double, Width As Double, Height As Double) As String
        • Class_Globals As String
        • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
          Base type must be Object
        • Initialize (Callback As Object, EventName As String) As String
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        Properties:
        • BackgroundColor As Int
          gets or sets the BackgroundColor property
        • HighlightTextColor As Int
          gets or sets the HighlightTextColor property
        • KnobBorderColor As Int
          gets or sets the KnobBorderColor property
        • KnobColor As Int
          gets or sets the KnobColor property
        • Left As Double
          gets or sets the Left property
        • LineColor As Int
          gets or sets the LineColor property
        • OffsetAngle As Int
          gets or sets the OffsetAngle property
        • ScaleMaxValue As Int
          gets or sets the ScaleMaxValue property
        • ScaleMinValue As Int
          gets or sets the ScaleMinValue property
        • ScaleNbValues As Int
          gets or sets the ScaleNbValues property
        • SnapMode As String
          gets or sets the SnapMode property
          possible values:
          AFTERMOVE the knob snaps only when the knob is released, default value.
          ALLWAYS the knob snaps during moving.
          NEVER the knob doesn't snap at all, it displays the current position.
        • TextColor As Int
          gets or sets the TextColor property
        • Top As Double
          gets or sets the Top property
        • Width As Double
          gets or sets the Width property
          there is no Height property because the object is square
    • Author: Klaus CHRISTL (klaus)
    • Version: 1.0
     

    Attached Files:

    Last edited: Aug 11, 2018
    Roberto P., Erel, jahswani and 7 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice