B4J Question Datepicker pop-up unwanted, need it permanently

BlueVision

Active Member
Licensed User
Longtime User
Sometimes it gets complicated because it's simple:
I need a date picker for my B4J programme.
The date picker available in designer would be ideal and fulfil the purpose exactly. However, in my particular case it has a huge disadvantage: It consists of a text field, a button and a pop-up. I need neither the text field nor the button. I just need the interactive view of the popup, permanently without textfield and button. In other words: I need a permanently calender view with picking functionality. Does anyone have an idea?
 
Last edited:

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
i am not aware that currently something that specific exists. But it also seems that you could do it either as a customview or a simple Class, i mean creating it from 0.

you can take a look at XUI Views (open it as if it were ZIP) look for B4XDateTemplate.bas and inside the files folder look for the DatePicker.bjl. this will help you on creating your own view directly into a panel.
 

Attachments

  • XUI Views.b4xlib
    80.8 KB · Views: 46
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Thanks for the answer Enrique,
Well, I just looked at the XUI Views example from Erel. Honestly, I'm still trying to understand the principle...

In the end, I guess I will have to create my own version of a "calendar view with picker functionality". This means reinventing and implementing all the controls, the label matrix for the days of the month and the logical date functions in the programme itself from scratch, piece by piece. A class for this does not seem to exist. What a pity.
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
In the end, I guess I will have to create my own version of a "calendar view with picker functionality". This means reinventing and implementing all the controls, the label matrix for the days of the month and the logical date functions in the programme itself from scratch, piece by piece. A class for this does not seem to exist. What a pity.
Mostly

B4XDateTemplate.bas
Has all that you just mentioned. You may want to base your work around it so the task look less insurmountable
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Un saluto al Veneto!
Grazie per la classe, a quale elemento di controllo serve questa classe? Puoi dirmi qualcosa di più o magari hai anche un progetto di esempio da propormi?

Greetings to Veneto!
Thank you for the class, which control element does this class serve? Can you tell me more about it or do you perhaps even have an example project for me? Looks to me, that it is very close to Erel's original code.
 
Last edited:
Upvote 0

PaulMeuris

Active Member
Licensed User
Last year in may i made a tutorial about a calendar made easy
In this tutorial i explain how you can make a calendar from scratch.
Later i used that B4A code in a B4J application.
You can find a source code example in the attachment.
In the calendar class the day sequence can be changed:
B4X:
    Private daysequence As Int = 1            ' 1 = monday-sunday    2 = sunday-saturday
The cal_dayclick subroutine in the B4XMainPage processes the click on a day in the calendar.
Maybe you can use this code in your project.
 

Attachments

  • calendar_notes.zip
    5 KB · Views: 45
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
I think I need to ask such stupid questions more often, then I'll save a lot of time...

Thanks to all of you for the code snippets you sent in! Paul's code will probably win the race I think. It is flexible in terms of graphical representation, clear in structure and very quickly adaptable to other countries. This does not mean that there is good and bad code. Every variant you have posted in this thread is interesting and has a slightly different approach. Paul's code just matches my requirements almost exactly. Thank you all for the time and work you have put in. I hadn't really expected so much feedback. It seems you have all been dealing with similar problems.
The good thing is that we now have a wonderful collection of solutions and other developers can also benefit from them.
Keep up the good work, thank you very much. It might sound a bit strange when I say that I'm damn proud of the community and enjoy being able to work with other people around the world in this way. It's just fun and helps us all move forward!

Stay healthy! See you again for the next problem!

Thank you!
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Also check this out:
 
Upvote 0
Top