B4A Library [Class]ClsWheel Input wheels

aarondc

Member
Licensed User
Longtime User
@klaus

I have seen a scroll wheel that changes its text attribute (or maybe it's the background image) while scrolling, and restores it once scrolling stops. I'd like to try and emulate that.

Is it possible to process a "start scroll" / "end scroll" event for this view?

I already asked this, and it was missed, is there a better way of asking questions?
 

klaus

Expert
Licensed User
Longtime User
... is there a better way of asking questions?
You asked a simple question and you got a simple answer .

I added the two events. The file has been updated in the first post.

To test it click on the 'With Event' button, when you scroll the activity title will show 'Scrolling'.

Best regards.
 

aarondc

Member
Licensed User
Longtime User
I am a simple B4Aer still!

Thank you, Klaus. I shall have a good look, much appreciated.
 

stefanoa

Active Member
Licensed User
Longtime User
NIce Class!!!
but why it displays only the years from 2000 onwards? need for a birthdate (ex 1940)..
thanks
 

stefanoa

Active Member
Licensed User
Longtime User
thanks very much..
but i think there is a problem in new properties.
i'm trying to do:
B4X:
Dim tmpYear As Int = DateTime.GetYear(DateTime.Now) - 1900
whlDate.FirstYear = 1900
whlDate.NumberOfYears =tmpYear  'until current year
but don't work (the wheel does not work properly).

If instead i modify the class in:
B4X:
    Private cFirstYear = 1900 As Int  
    Private cNbYears = (DateTime.GetYear(DateTime.Now) - cFirstYear + 1) As Int
it work!
 

Espinosa4

Active Member
Licensed User
Longtime User
Hello everybody,

Can I change the date format in my screen?
I need that the first be day-month-year.

is it possible?

Thank you very much.
Espinosa
 
Last edited:

klaus

Expert
Licensed User
Longtime User
is it possible?
No, not in the current version.
The reason why I put it as year / month / day is the month of february and the different number of days in a month !
Selecting first the year the program knows if february has 28 or 29 days and then selecting the month the program knows how many days the selected month has this to update the last wheel for the days.

But anyway, the selected date is returned in the format you set in the program.

Best regards.
 
Last edited:

Espinosa4

Active Member
Licensed User
Longtime User
Ahhhhh, I understand now.
Thank you very much klaus.

Yes, I know I know, finally the result is Ok. It was only for esthetic reasons.

Cheers
Espinosa
 

stefanoa

Active Member
Licensed User
Longtime User
hi, i've this problem (images as attachment)

i've for ex. a edittext.text="21/9/2013" as date and when i execute for first time the whldata.show (pressing a button) it show "1/9/2013".
Then if i press cancel or Ok and re-press button (and so re-execute whldata.show) it show correctly "21/9/2013".

B4X:
whlDate.Initialize(Me, Activity, trans.GetText("Enter Date"), 3, Null, 24, 0, True)
...

If modGeneral.p_dateformatDDMMYYYY = True Then
   DateTime.DateFormat ="dd-MM-yyyy"
Else
   DateTime.DateFormat ="MM-dd-yyyy"
End If

    dateEditText.Text="21-09-2013"     '-- example
   
    Dim tmpData As String = dateEditText.Text.trim

    whlDate.Show(dateEditText,  tmpData)

what could be the cause?
 

Attachments

  • wh1.png
    15.5 KB · Views: 256
  • wh2.png
    35.6 KB · Views: 268
  • wh3.png
    34.6 KB · Views: 247

stefanoa

Active Member
Licensed User
Longtime User
Yes, is initialized only one time in Activity_Create..
B4X:
whlDate.Initialize(Me, Activity, trans.GetText("Enter Date"), 3, Null, 24, 0, True)
whlTimeHM.Initialize(Me, Activity, trans.GetText("Enter Time"), 2, Null, 30, 1, True)

whlTimeHM, instead, work correctly...
 

klaus

Expert
Licensed User
Longtime User
Could you post your project as a zip file or at least a smaller one showing the problem.
I tested in the demo program your date and it works as expected.
But initializing whlDate each time I press the button I get the same as you do.

Best regards.
 

stefanoa

Active Member
Licensed User
Longtime User
The Bug is in 1.6 version!!!
Same program with 1.5 work correctly...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…