B4A Library [Class]ClsWheel Input wheels

tcgoh

Active Member
Licensed User
Longtime User
Hi,

Thanks for the very nice clswheel class, but I have some problem with date time now.

When I set clswheel.show(lbltext, ""), I will get the today's date on first time the clswheel was shown, but when I click the cancel button follow by the back button to get out of the App, the next time the clswheel will show a date on the 1st day of the month and not today's date.

Anyone has this problem?

Thanks for any help.
 

tcgoh

Active Member
Licensed User
Longtime User
Hi Klaus,

Thank you for the quick update to version 1.9, but I have problem opening the ClsWheelsV1_9.b4a with the this error,(I'm using B4a version 3.0)
 
Last edited:

tcgoh

Active Member
Licensed User
Longtime User
Hi Klaus,

Thanks for coming up with a version for B4a Ver 3.0 But the attached version still has the same error about "given key was not present in dictionary"

Regards
 

tcgoh

Active Member
Licensed User
Longtime User
Many Thanks again Klaus, now its working on b4a ver 3.0. BTW main.bal and numbers.bal are missing in the attachment, but I managed to copy from the earlier attachment.

Thanks again great work.
Regards
 

LucaMs

Expert
Licensed User
Longtime User
Hi, Fully great Klaus ,

I get an error at compilation time:

scvWheel(i).ScrollToNow(ScrollPos(i))

scvWheel(i) does not have the ScrollToNow member (it is a ScrollView)


[EDIT: I found this bad info:

ScrollToNow (Scroll As Int)

Immediately scrolls the ScrollView (with no animations).


Evidently this member was added after my B4A version (3.0).

Could you specify the difference compared to "scrollPosition"?]


Many thanks, Klaus
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Whereever you see scvWheel(x).ScrollToNow(y)
replace it by objWheel(x).RunMethod3("scrollTo", 0, "java.lang.int", y, "java.lang.int")
You must replace x and y by the correct values.
ScrollPosition = X is equal to smoothScrollTo, smooth scroll
ScrollToNow(X) is equal to scrollTo, fast scroll
 

LucaMs

Expert
Licensed User
Longtime User

Many thanks, Klaus, I'll try.

The documentation is very brief; I have tried to use scrollPosition instead of ScrollToNow and a strange thing happens, I do not know if it is due to this.

If I select a day> 9 and then I select a month, day changes (it seems to me that it will become the number of the month).


Thanks again.
 

Attachments

  • lm ClsWheelsV1_9 Test.zip
    20.3 KB · Views: 211

klaus

Expert
Licensed User
Longtime User
The problem you encounter is not related to the scroll change.
It happens also in older versions.
I had never encountered it because I set first the year then the month and at last the day.
The problem is that the day list changes when you change the month because of the different numbers of days depending on the month.
That was the reason why the wheel layout is year - month - day.
 

LucaMs

Expert
Licensed User
Longtime User
I looked at the code.
If the reason is not the scroll but the calculation of the days, the problem should occur with any version of B4A.
(among other things, the order should be flexible, because the year / month / day is not usual).

I will try to go crazy modifying it

Thanks, Klaus
 

LucaMs

Expert
Licensed User
Longtime User
Damn, it was a mini-micro-little bug

I have different number lines, so I can't write the right one.

After:
B4X:
    Else If (WheelType = DATE OR WheelType = DATE_TIME) AND S = scvWheel(2) Then


there is:
B4X:
        CurrentDayIndex = Floor(scvWheel(1).ScrollPosition / lblHeight + 0.5) - WheelContentNb(1)


but the wheel of day has index 2.
B4X:
        CurrentDayIndex = Floor(scvWheel(2).ScrollPosition / lblHeight + 0.5) - WheelContentNb(2)



(I have not done a lot of tests, but it seems logical)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…