Beja Expert Licensed User Longtime User Jul 31, 2018 #1 Hello all, After searching for a post about a rotary knob that has steps (not continuous).. I finally gave up the switch jumps from one value to another like that of the washing machine. any help appreciated.
Hello all, After searching for a post about a rotary knob that has steps (not continuous).. I finally gave up the switch jumps from one value to another like that of the washing machine. any help appreciated.
derez Expert Licensed User Longtime User Jul 31, 2018 #2 I use these two subs in a clock application to rotate the clock's hands, it is the same as what you want with the change of starting angle and angle difference for each step: Code: Copy Sub setRotation(v As View, Angle As Float) Dim jo = v As JavaObject jo.RunMethod("setRotation", Array As Object(Angle)) End Sub Sub drawhand(lbl As Label, index As Double) Dim q As Double = 270 + 6 * index setRotation(lbl,q) End Sub Add a click event to make the knob rotate to the next step. Upvote 0
I use these two subs in a clock application to rotate the clock's hands, it is the same as what you want with the change of starting angle and angle difference for each step: Code: Copy Sub setRotation(v As View, Angle As Float) Dim jo = v As JavaObject jo.RunMethod("setRotation", Array As Object(Angle)) End Sub Sub drawhand(lbl As Label, index As Double) Dim q As Double = 270 + 6 * index setRotation(lbl,q) End Sub Add a click event to make the knob rotate to the next step.
Beja Expert Licensed User Longtime User Jul 31, 2018 #3 derez said: I use these two subs in a clock application to rotate the clock's hands, it is the same as what you want with the change of starting angle and angle difference for each step: Code: Copy Sub setRotation(v As View, Angle As Float) Dim jo = v As JavaObject jo.RunMethod("setRotation", Array As Object(Angle)) End Sub Sub drawhand(lbl As Label, index As Double) Dim q As Double = 270 + 6 * index setRotation(lbl,q) End Sub Add a click event to make the knob rotate to the next step. Click to expand... Thanks derez Some time ago I read a post with realistic graphical knob.. but now can't find it.. will try your solution. Upvote 0
derez said: I use these two subs in a clock application to rotate the clock's hands, it is the same as what you want with the change of starting angle and angle difference for each step: Code: Copy Sub setRotation(v As View, Angle As Float) Dim jo = v As JavaObject jo.RunMethod("setRotation", Array As Object(Angle)) End Sub Sub drawhand(lbl As Label, index As Double) Dim q As Double = 270 + 6 * index setRotation(lbl,q) End Sub Add a click event to make the knob rotate to the next step. Click to expand... Thanks derez Some time ago I read a post with realistic graphical knob.. but now can't find it.. will try your solution.
DonManfred Expert Licensed User Longtime User Jul 31, 2018 #4 https://www.b4x.com/android/forum/threads/rotaryknobview.65628/ Upvote 0
derez Expert Licensed User Longtime User Jul 31, 2018 #5 Beja said: Thanks derez Some time ago I read a post with realistic graphical knob.. Click to expand... How much realistic depends on the graphics of the image you put on the central view. Upvote 0
Beja said: Thanks derez Some time ago I read a post with realistic graphical knob.. Click to expand... How much realistic depends on the graphics of the image you put on the central view.
Star-Dust Expert Licensed User Longtime User Jul 31, 2018 #6 See this: https://www.b4x.com/android/forum/threads/sd-trimmer.92776/ Last edited: Jul 31, 2018 Upvote 0
Beja Expert Licensed User Longtime User Jul 31, 2018 #7 DonManfred said: https://www.b4x.com/android/forum/threads/rotaryknobview.65628/ Click to expand... Hi Don, Thanks and yes this is one of the posts I found and tested.. but as you see it is contentious instead of moving in steps. Best regards. B Upvote 0
DonManfred said: https://www.b4x.com/android/forum/threads/rotaryknobview.65628/ Click to expand... Hi Don, Thanks and yes this is one of the posts I found and tested.. but as you see it is contentious instead of moving in steps. Best regards. B
LucaMs Expert Licensed User Longtime User Jul 31, 2018 #8 Beja said: Some time ago I read a post with realistic graphical knob Click to expand... https://www.b4x.com/android/forum/threads/how-they-do-3.21137/#post-122000 Upvote 0
Beja said: Some time ago I read a post with realistic graphical knob Click to expand... https://www.b4x.com/android/forum/threads/how-they-do-3.21137/#post-122000
Beja Expert Licensed User Longtime User Jul 31, 2018 #9 LucaMs said: https://www.b4x.com/android/forum/threads/how-they-do-3.21137/#post-122000 Click to expand... The post I am trying to find is not about contentious values.. But incremental .. Knob devided in points so pointer jumps back and forth from point to point. That post still missing-in-action ! Thanks to all anyways. Upvote 0
LucaMs said: https://www.b4x.com/android/forum/threads/how-they-do-3.21137/#post-122000 Click to expand... The post I am trying to find is not about contentious values.. But incremental .. Knob devided in points so pointer jumps back and forth from point to point. That post still missing-in-action ! Thanks to all anyways.
klaus Expert Licensed User Longtime User Aug 1, 2018 #10 You may have a look at this project, I made it as a XUI challenge. It is a XUI B4X CustomView. It needs some improvements. At the moment it doesn't work yet with B4i, will be fixed. 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. EDIT: 2018.08.11 Removed the zip file. A new version is HERE. Last edited: Aug 11, 2018 Upvote 0
You may have a look at this project, I made it as a XUI challenge. It is a XUI B4X CustomView. It needs some improvements. At the moment it doesn't work yet with B4i, will be fixed. 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. EDIT: 2018.08.11 Removed the zip file. A new version is HERE.