B4A Library Custom Calendar Class

Hi,
This is my first contribution to B4A.
It's a very simple calendar clickable.

Instructions are :

Initialize(Callback, EventName, Width (same declare as addview), Height (idem), date (DateTimeFormat) )

ShowCalendar(Boolean)
LengthMonth(Year, Month) As Int
SetTableColor(Color) : color of the grid
SetBackGroundColor(Color) : color of the Background
SetActiveButtonColor(Color) : color of calendar's buttons
SetInactiveButtonColor(Color) : color of day's buttons
SetFunctionButtonColor(Color) : color of PrevMonth, NextMonth, Years Buttons
SetTextSize(value) : relative Size for Texts

NmFullday(0..6) : name each days
Nmday(0..6) : name (on 3 letters) for days
NmFullMonth(0..12) :name each months
NmMonth(0..11) : name (on 3 letters) for months
(theses tables are in French actually)
 

Attachments

  • CustomCalendarExemple.zip
    CustomCalendarExemple.zip
    4.6 KB · Views: 1,415
  • customcal.jpg
    customcal.jpg
    24 KB · Views: 2,110
Last edited:
Could this class be extended to show also a week view with columns of weekdays (each row being half-hour interval) and day view? (something like an outlook calendar, maybe...)
 
Does someone worked on this Calendar class in order to add events (appointement, day off, metting...) in it, when you click on a event, you'll get the event information??
Thank
 
Does someone worked on this Calendar class in order to add events (appointement, day off, metting...) in it, when you click on a event, you'll get the event information??
Thank
I made some changes in this class to display days of a list in different color.
The changes were marked with this text: "* * * NEW 02/08/2015".
 

Attachments

I made some changes in this class to display days of a list in different color.
The changes were marked with this text: "* * * NEW 02/08/2015".

I to see two errors in you code, the first is in Main program add this at Activity_create

Code:
Local.Initialize

and the other fail is in Custom_Calendar class, add this

Code:
Public Sub Initialize(vCallback As Object, vEventName As String, Ww As Int, Hh As Int, BeginDate As Long, ld As List)    '* * * NEW 02/08/2015

the variable 'Wv' is not declared, and some variable more not declared in class
 

Attachments

Last edited:
I to see two errors in you code, the first is in Main program add this at Activity_create

Code:
Local.Initialize

and the other fail is in Custom_Calendar class, add this

Code:
Public Sub Initialize(vCallback As Object, vEventName As String, Ww As Int, Hh As Int, BeginDate As Long, ld As List)    '* * * NEW 02/08/2015

the variable 'Wv' is not declared, and some variable more not declared in class

Cool. Thanks.
 
I have modified this example, but have serious layout issues.
I am using two devices:
7" Tablet
4" ZTE Phone
The 7" tablet layout is great, but the 4" phone layout does not show the Months nor the Days.
I have attached the two screenshots and also the code.
Could anyone please assist.
 

Attachments

  • Tablet-7inch.png
    Tablet-7inch.png
    19.5 KB · Views: 706
  • ZTE-4inch.png
    ZTE-4inch.png
    28 KB · Views: 720
  • Calendar_Test.zip
    Calendar_Test.zip
    13.8 KB · Views: 569
Back
Top