iWheel Library

karlchick

Member
Licensed User
iWheel is a user interface element used select an item from a list. The list is displayed on the surface of a wheel that the user can spin like an odometer up and down. The centre of the wheel has an overlaid transparent readout bar.

iWheel is intended to help creating user interface for touch screens and is designed for finger-based operation.

Moving the wheel is done by dragging the finger (or a stylus) over the screen. The faster dragged the faster the wheel moves. On lifting the finger the wheel continues to move but will start to reduce speed until it finally 'clicks' into the position of one of the items displayed on its surface. Touching the wheel when it is spinning will stop the wheel.

When the user's finger touches down or lifts up from the wheel a FingerDown or FingerUp event is generated and the programmer can handle it in code, if required.

When the wheel finally stops at a rest position a ValueChanged event is generated and the programmer can handle it in code, if required.

Wheels can be of different types:

· Textual - each text item must be added using AddText method.

· Numeric - the wheel displays a range of integers

· DateTime - the wheel displays a range of dates and/or times

The library works for desktop and device and has been tested on WVGA (HD2) with autoscale compilation.

The attached images show the library used in a Geocaching app I'm developing and the two demo programs supplied.

The ZIP file contains the demo programs with windows exe's, help file and library dll.

NB: If the downloaded help file reports "Navigation to the webpage was canceled" then you need to unblock the help file (right click help file, properties, click unblock).

The library has been developed in VB using Sharpdevelop, consequently the dll contains the usual VB extra 'helper' objects. Please ignore these and only use the 'wheel' object.

Enjoy :)
Karl.


iWheel v1.1 [Update 6-MAR-2012]

Two new properties:

BarHeight - gets or sets the read bar's height in pixels.
LineSpacing - gets or sets the line spacing of text displayed on the wheel.

also added ClockDemo to show how these can be used.


iWheel v1.2 [Update 7-MAR-2012]

Minor bug fix: BarHeight now limited to Wheel.Height, wasn't checked before but would lead to an exception.
Help file: Visible property was missing from help file, now added.
 

Attachments

  • AppScreenshot.jpg
    AppScreenshot.jpg
    19.2 KB · Views: 106
  • DatePicker.jpg
    DatePicker.jpg
    17.1 KB · Views: 89
  • ColourDemo.jpg
    ColourDemo.jpg
    17.5 KB · Views: 93
  • ClockDemo.jpg
    ClockDemo.jpg
    8.3 KB · Views: 49
Last edited:

giannimaione

Well-Known Member
Licensed User
Longtime User
:sign0098: wow
shocking :icon_clap:
 

karlchick

Member
Licensed User
I've updated the iWheel library and added two new properties:
BarHeight - gets or sets the read bar's height in pixels.
LineSpacing - gets or sets the line spacing of text displayed on the wheel.

NB: You can remove the read bar by setting its height to 0 (before create).

Attached is v1.1 of the library including a new demo program (clock) using the two new properties.

Updated ZIP and screenshot in post #1.

Have fun :)
Karl.
 
Last edited:

mjcoon

Well-Known Member
Licensed User
Attached is v1.1 of the library including a new demo program (clock) using the two new properties.

This is a splendid effort.

It will be easier for a user to be sure that they have the latest version if you edit your initial post to the latest version. That way they do not have to scan all the other posts. You could include a reference to your latest post so that they can find out what the changes are for without downloading and looking at a history file. Any of AGraham's DLL threads will display this pattern.

Similarly CableGuy updates his initial post of additional DLL versions to show the full repertoire that is available (with brief descriptions). But only if you let him know of a change.

Mike.
 

giannimaione

Well-Known Member
Licensed User
Longtime User
:sign0142:
and now.... can you convert DLL B4PPC to DLL B4A ?
:sign0098:
 

karlchick

Member
Licensed User
:sign0142:
and now.... can you convert DLL B4PPC to DLL B4A ?
:sign0098:

I'm sorry to say that I am sticking with Windows Mobile until TomTom is available for Android, hence I don't have B4A, only B4PPC.

I generally develop apps for my own use and hence to run on WM on my HD2.

My latest App (GPX2MM, a geocaching interface between Geocaching.com GPX pocket queries and Memory Map, handling field notes, trackables, MMO overlay generation and larger MM icons -- all performed direct on the HD2 without needing a laptop) is finger friendly using BList a lot, but I needed a way of entering dates/times -- hence iWheel idea was born, I wrote it in B4PPC originally, but soon wanted to turn it into a general control, hence I made the library.

Is conversion of a B4PPC dll to B4A dll straightforward?

The iWheel library uses System.Drawing.Bitmap.Lockbits/UnLock and System.Runtime.InteropServices.Marshal.Copy to implement its own BitBlt operation to overlay the wheel and read bar images over the text and all this is in VB too (wish I used C# now). Perhaps B4A has some cool built in image manipulation or alpha layer support?

Or perhaps someone else would like to convert iWheel to B4A?

Karl.
 

pdabasic

Active Member
Licensed User
Looks Great!
Thank you for sharing!

What is the other three Class in your dll?

MyProject
MyWebServices
TheardedSafeObjectProvider'1
 

karlchick

Member
Licensed User
The library has been developed in VB using Sharpdevelop, consequently the dll contains the usual VB extra 'helper' objects. Please ignore these and only use the 'wheel' object.

I think they are VB helper classes put in by the VB compiler automatically and I can't find anyway of stopping them.

If I'd used C# then they wouldn't be there - I suppose I could convert it all to C# and then provide the C# to allow the dll to be mergeable. But it is not a quick task (SharpDevelop can convert to C#) as the low level graphical manipulation stuff would need rewritting a bit... and alas I don't have the time at the moment. :(

So for now, please just ignore those objects.

One thing I'd like to know (if people are using the control) is if the control is fast enough on their devices -- the larger the control the more processing is involved. There is some scope for optimisation in the library...

Karl.
 

pdabasic

Active Member
Licensed User
Karl, please add an ControlRef property to the wheel!

I would like to use it with door FromControl()
 

karlchick

Member
Licensed User
Karl, please add an ControlRef property to the wheel!

I would like to use it with door FromControl()

I'm not quite sure how to do this as the library is not a wrapper for an underlying control. The main control used by the library is a picturebox.

What is it that you hope to achieve with a ControlRef property?

Karl.
 

pdabasic

Active Member
Licensed User
I'm not quite sure how to do this as the library is not a wrapper for an underlying control. The main control used by the library is a picturebox.

What is it that you hope to achieve with a ControlRef property?

Karl.

I use some other dll for example fgGradientbuttons, webbrowser...
And I change the width or heigh or visible and some other property dinamicaly with door library, like this:

B4X:
Object("doorObj").FromControl(Fggradientbuttons("fgbtn1").ControlRef)
Object("doorObj").SetProperty("Visible",False)

I need propety what set as a Control
 

agraham

Expert
Licensed User
Longtime User
I don't see why you need to use the Door library when the properties you mention, Height, Width and Visible, are already provided. If you do need to use the Door library you are doing it inefficiently. FromControl is intended for use with the "built-in" Basic4ppc controls, for a library you can assign a ControlRef directly.

B4X:
doorObj.Value = fgbtn1.ControlRef
doorObj.SetProperty("Visible",False)
or if you need to indirectly specify the button
B4X:
b = "fgbtn1"
doorObj.value = FgGradientbuttons(b).ControlRef
doorObj.SetProperty("Visible",False)
 

karlchick

Member
Licensed User
I should point out that the following properties are read only:

Wheel.Height
Wheel.Width
Wheel.Count
Wheel.Spinning
Wheel.Text

and the following properties are ignored after the call to Wheel.Create:

Wheel.ForeColor
Wheel.BarBackColor
Wheel.BarForeColor
Wheel.BarHeight
Wheel.BevelWidth
Wheel.EdgeLeft
Wheel.EdgeRight

although Wheel.BarHeight can be changed to 0 after Create to stop the read bar being displayed. Setting it any other value will cause it to be displayed again but the height will remain unchanged.

These properties that can only be changed/set before Create are like this because the wheel control creates iamges for the wheel and read bar as part of the Create method. These images are not re-created on the fly, just overlayed onto the text that does change.

Karl.
 

pdabasic

Active Member
Licensed User
Hello Karl!

Wich framework needed to use your Wheel control?
On the desktop works fine but when I add your library or try to run your exe on my device, always get an error message.

Thx
 
Top