Results 1 to 21 of 21

Thread: ucCalendar (Events calendar)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    ucCalendar (Events calendar)

    Calendar to which we can add events, this can be used for many things such as showing staff vacations, collection events, shifts, time activities or graphically showing date intervals.

    The control has support for drag & drop of events, such as being able to modify its date range with the mouse, if we press the Ctrl key and do drag & drop it duplicates this event.

    Then the data entry part is in charge of the programmer, in the examples added sample unass form, what I did not do was create a series of events, but it is possible if you have a little patience, any doubt about the latter I can give a guide on how to do it.

    Inside the examples in the “Advance” folder you will find an example linking the calendar to a SQLite database, in the forum version I will use the RC6 engine and in my website J3cnn.dll

    The calendar events are not handled by index but by keys, internally they are sorted by date and in this way the index is lost (I didn't like how I approached it at first).

    The control does not have any dependencies, even the icons are painted with lines.

    The scrollbar wheel works correctly when it is compiled, I did it this way since I did not use Safe subclass, to avoid headaches when programming I leave it like this, compiled the same thing works correctly for the MouseLeave event (since mouseleave is not active some tooltips can are activated). If someone needs it to work in the ide they can remove the "If App.LogMode Then".

    To close I know that there are many things that are pending, I would like you to comment if something should be implemented or corrected, also if you see any errors; So it's easier for me that way. In the first days of uploading, I will surely be updating it frequently as they inform me or find details.



    Name:  ucCalendar_Month.jpg
Views: 1373
Size:  19.4 KB

    Name:  ucCalendar_Week.jpg
Views: 1328
Size:  19.0 KB





    Download:
    ucControlCalendar-RC6.zip
    thanks @SearchingDataOnly for the conversion

    Go to web page:
    http://leandroascierto.com/blog/ucca...io-de-eventos/

    Here is a quick detail of its functions and properties:
    AddEvents : Main function to add events to the calendar, parameters required; subject
    (descriptive title), start date and time, end date and time and color of the event, the rest of
    the parameters are optional, return value an event key.
    CenterCalenarInNow : Moves the scroll to the current time.
    Clear : Remove all events.
    DateValue : Assigns or returns the current date of the calendar.
    DayHaveEvents : Returns True/False if there are events on a specific day.
    DropDownColor : When there are many events in a day and in the Month view mode there
    are more than can be shown, a dropdown bar is shown which we can change the color with
    this property.
    EventsCount : Number of events added.
    EventsRoundCorner : Boolean property to show or not show rounded corners in events
    and buttons.
    FirstDayOfWeek : Here we can assign which day we want to be displayed as the first day
    of the week, by default it uses the system day.
    GetAllEvents : Gets a collection of the keys of the added events.
    GetEventData : Obtains the data of an event, its first parameter is the key of the event
    which we can obtain with GetAllEvents or by some event, the rest of the parameters are
    return values.
    GetEventsFromDay : Returns a collection of keys of the events of a specific day,
    GetSelectionRangeDate: Function to obtain the selected date range.
    HeaderColor : Color of the header and part of the theme.
    HideEvent : Hides the event, useful for filtering.
    LinesColor : Color of the lines.
    Redraw : Enables or disables calendar repainting, this serves to speed up the loading of
    events.
    RemoveEvent : Removes an event.
    Refresh : Refreshes the calendar redraw.
    SelectedEvent : Returns the selected event.
    SelectionColor : Color of the selection.
    SetStrLanguage : Here we can pass the translation of the words used.
    ShowToolTipEvents: If you want to show or not the tooltip window, it can be replaced by a
    custom one with more detailed information. See the EventMouseEnter and
    EventMouseLeave events.
    Update : It is more complete than refresh, it reorders the events by date and alphabetically,
    recalculates the position and finally repaints everything.
    UpdateEventData : Function to update the data of an event. The key of the event that we
    want to modify must be passed.
    UserCanChangeDate : Enable or disable the user to be able to change the current
    calendar page.
    UserCanChangeEvents : Enables or disables whether the user can change events (by
    stretching or dragging).
    UserCanChangeViewMode: Hide all the buttons at the top of the right side. In this way the
    user cannot change the view mode or the programmer takes control of which view he
    wants to show.
    UserCanScrollMonth : In month view mode, you can scroll infinitely if you need to change
    pages, only if this option is enabled.
    ViewMode : Change by code in the view mode (Day, Week, Month, Year)

    Events:

    DateBackColor : When this event is triggered, we can choose the background color of the
    cell based on the date or time, as well as its HatchStyle.
    DateChange : When the user changes the calendar page this event is fired.
    DragNewEvent : When the user has the Control key pressed and drags & drops, the event
    is duplicated, that is, a new event is added by the user, with this event we are informed and
    thus we can save it in the database or as it is be driving.
    DropDownViewMore: Event when the view more button is pressed, this button is in the
    "Months" view, it appears when there are many events in a day and they do not enter the
    cell, pressing this will change to view mode = "Day", We can cancel this and show a
    custom window with the events of the day, we can retrieve the events of the day with
    GetEventsFromDay.
    EventChangeDate : This event fires when the user drags & drops or resizes the event with
    the mouse. it is useful for storing the new dates in the database.
    EventMouseEnter : When the mouse enters an event.
    EventMouseLeave : When the mouse leaves over the event.
    EventClick : Click on an event.
    PreDateChange: Before the user pages to another date, here we can cancel it.
    PreEventChangeDate : Before the user changes the data of an event with the drag & drop
    or the mouse, this event is very useful to prevent dragging events on certain dates or times
    in which we do not want an event to be added
    Last edited by LeandroA; May 16th, 2022 at 10:17 AM.
    leandroascierto.com Visual Basic 6 projects

  2. #2
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    539

    Re: ucCalendar (Events calendar)

    good job

  3. #3
    New Member
    Join Date
    Feb 2014
    Posts
    5

    Re: ucCalendar (Events calendar)

    Excellent!!! thanks for sharing.

  4. #4
    Lively Member
    Join Date
    Sep 2016
    Posts
    94

    Re: ucCalendar (Events calendar)

    As usual great !

  5. #5
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    I can't access your website via PC or mobile. It's an issue for a long time. Don't know the reason.
    Attached Images Attached Images  
    Last edited by DaveDavis; May 15th, 2022 at 06:45 PM.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    how strange!, is the first time I hear that it fails, maybe because it is not ssl?, try this other address
    http://recursosvisualbasic.com.ar/blog/
    leandroascierto.com Visual Basic 6 projects

  7. #7
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by LeandroA View Post
    how strange!, is the first time I hear that it fails, maybe because it is not ssl?, try this other address
    http://recursosvisualbasic.com.ar/blog/
    If I search "recursosvisualbasic.com.ar: ucCalendar", then I can view the website being translated by google (as below screenshot showing, it is 2nd link), but I still can't download. I guess the build-in translator got problem or your ISP issue?
    Attached Images Attached Images  

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    http://recursosvisualbasic.com.ar/bl...io-de-eventos/
    http://recursosvisualbasic.com.ar/bl...olCalendar.zip

    do not search for it in google since it is not indexing recursosvisualbasic
    leandroascierto.com Visual Basic 6 projects

  9. #9
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by LeandroA View Post
    http://recursosvisualbasic.com.ar/bl...io-de-eventos/
    http://recursosvisualbasic.com.ar/bl...olCalendar.zip

    do not search for it in google since it is not indexing recursosvisualbasic
    both are can't being accessed. I have difficulties to visit your website for a long time. But it is strange that some time I can access though most of time I can't.
    Last edited by DaveDavis; May 15th, 2022 at 08:05 PM.

  10. #10
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    I manage to download using 3rd website service to download this zip.
    1. When I am firstly running "ucControlCalendar\Advance\Proyecto1.vbp", it reports missing mscomctl.ocx, then I use Notepad to open Proyecto1.vbp and change to : Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0; MSCOMCTL.OCX. (from #2.2#0 to #2.1#0)
    2. There're many weird characters in program. I guess they are Spain. So I change my Region to Spain (Argentina), then I see the beautiful characters.
    e.g. .SetStrLanguage "Año", "Mes", "Semana", "Día", "Hoy", "Comienza", "Finaliza", "Todo el día"
    3. I register some dlls.
    4. There're a Run-error '13' Type mismatch at:
    Code:
    lKey = ucCalendar1.AddEvents(.Value("Subject"), .Value("StartTime"), .Value("EndTime"), .Value("Category"), .Value("AllDay"), .Value("Comment"), , .Value("IsSerie"), .Value("Notify"), .Value("Private"), .Value("ShowTimeAs"))

  11. #11
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by DaveDavis View Post
    4. There're a Run-error '13' Type mismatch at:
    Code:
    lKey = ucCalendar1.AddEvents(.Value("Subject"), .Value("StartTime"), .Value("EndTime"), .Value("Category"), .Value("AllDay"), .Value("Comment"), , .Value("IsSerie"), .Value("Notify"), .Value("Private"), .Value("ShowTimeAs"))
    should convert to DateTime and Boolean???

    .Value(AllDay)=0
    .Value(AllDay)=Verdadero
    What is the Data Type for AllDay, IsSerie,Notify and Private?

    Edited:
    Code:
                    Dim bAllDayEvent As Boolean
                    Debug.Print " .Value(AllDay)="; .Value("AllDay")
                    If (CStr(.Value("AllDay")) = "Verdadero") Then
                        bAllDayEvent = True
                    ElseIf CStr(.Value("AllDay")) = "Falso" Then
                        bAllDayEvent = False
                    End If
                    
                    Dim bIsSerie As Boolean
                    If (CStr(.Value("IsSerie")) = "Verdadero") Then
                        bIsSerie = True
                    ElseIf CStr(.Value("IsSerie")) = "Falso" Then
                        bIsSerie = False
                    End If
                    
                    Dim bNotify As Boolean
                    If (CStr(.Value("Notify")) = "Verdadero") Then
                        bNotify = True
                    ElseIf CStr(.Value("Notify")) = "Falso" Then
                        bNotify = False
                    End If
                    
                    Dim bPrivate As Boolean
                    If (CStr(.Value("Private")) = "Verdadero") Then
                        bPrivate = True
                    ElseIf CStr(.Value("Private")) = "Falso" Then
                        bPrivate = False
                    End If
                    
                    lKey = ucCalendar1.AddEvents(.Value("Subject"), .Value("StartTime"), .Value("EndTime"), .Value("Category"), bAllDayEvent, .Value("Comment"), , bIsSerie, bNotify, bPrivate, .Value("ShowTimeAs"))
    SQLLite datatype should convert to VB6 known Data Types and VB6 Data Type should convert to SQLLite datatype?
    There're DateTime issues due to different date and time formats in db and the PC system.
    Last edited by DaveDavis; May 16th, 2022 at 02:35 AM.

  12. #12
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    There's a tip always showing underneath the main window.

    Edited: after compile, there're no more extra tip window and the mouse wheel is working.
    Attached Images Attached Images  
    Last edited by DaveDavis; May 16th, 2022 at 02:27 AM.

  13. #13
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,521

    Re: ucCalendar (Events calendar)

    Hi LeandroA,
    Your ucCalender is excellent, thanks for sharing.

    Since I'm an RC5/RC6 lover, it took me 3 minutes to replace SQLiteConnection (Sqlite3.dll) with RC6.SqliteDB. Maybe you could also add a ucCalender example for RC6 to your website.

    I strongly recommend that VB6ers who use SqliteDB boldly use RC6, which provides extremely convenient tools for operating Sqlite-DB. Don't worry that RC6 is closed source. Because it only took me 3 minutes to replace SQLiteConnection (Sqlite3.dll) with RC6.SqliteDB, you can also replace RC6.SqliteDB with SQLiteConnection (Sqlite3.dll) within 3 minutes

    Below is my modified code. (Note: There are some garbled characters in my code, maybe some unicode characters cannot be displayed in the Chinese VB6-IDE)
    Attached Files Attached Files

  14. #14
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    Suggest Field "Subject" to text type and "Comment" to blob type, or both are text type.
    Read/write blob will save as ANSI and cause Unicode lost.
    Last edited by DaveDavis; May 16th, 2022 at 04:11 AM.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by SearchingDataOnly View Post
    Hi LeandroA,
    Your ucCalender is excellent, thanks for sharing.

    Since I'm an RC5/RC6 lover, it took me 3 minutes to replace SQLiteConnection (Sqlite3.dll) with RC6.SqliteDB. Maybe you could also add a ucCalender example for RC6 to your website.

    I strongly recommend that VB6ers who use SqliteDB boldly use RC6, which provides extremely convenient tools for operating Sqlite-DB. Don't worry that RC6 is closed source. Because it only took me 3 minutes to replace SQLiteConnection (Sqlite3.dll) with RC6.SqliteDB, you can also replace RC6.SqliteDB with SQLiteConnection (Sqlite3.dll) within 3 minutes

    Below is my modified code. (Note: There are some garbled characters in my code, maybe some unicode characters cannot be displayed in the Chinese VB6-IDE)
    Thank you very much, I have updated the first post and put the version with RC6, but before I made some changes in the database, I don't know why it had some badly renamed fields, so the reading was not correct, the strange thing is that with J3cnn.dll I could view them well. I also changed the way of storing the booleans, as @DaveDavis mentioned, it gave him an error and that's because on my PC (Spanish) they are stored in Spanish (Verdadero, Falso) and it recognizes them correctly, but when I pick it up in English it has conflicts, so now I keep 1 and 0 in it. which should be a bool.
    leandroascierto.com Visual Basic 6 projects

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by DaveDavis View Post
    There's a tip always showing underneath the main window.

    Edited: after compile, there're no more extra tip window and the mouse wheel is working.
    Hello, I don't know if I mentioned it here but it is because the sublcass only enabled it compiled, when it is not compiled this should not happen.
    leandroascierto.com Visual Basic 6 projects

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by DaveDavis View Post
    should convert to DateTime and Boolean???


    What is the Data Type for AllDay, IsSerie,Notify and Private?

    Edited:
    Code:
                    Dim bAllDayEvent As Boolean
                    Debug.Print " .Value(AllDay)="; .Value("AllDay")
                    If (CStr(.Value("AllDay")) = "Verdadero") Then
                        bAllDayEvent = True
                    ElseIf CStr(.Value("AllDay")) = "Falso" Then
                        bAllDayEvent = False
                    End If
                    
                    Dim bIsSerie As Boolean
                    If (CStr(.Value("IsSerie")) = "Verdadero") Then
                        bIsSerie = True
                    ElseIf CStr(.Value("IsSerie")) = "Falso" Then
                        bIsSerie = False
                    End If
                    
                    Dim bNotify As Boolean
                    If (CStr(.Value("Notify")) = "Verdadero") Then
                        bNotify = True
                    ElseIf CStr(.Value("Notify")) = "Falso" Then
                        bNotify = False
                    End If
                    
                    Dim bPrivate As Boolean
                    If (CStr(.Value("Private")) = "Verdadero") Then
                        bPrivate = True
                    ElseIf CStr(.Value("Private")) = "Falso" Then
                        bPrivate = False
                    End If
                    
                    lKey = ucCalendar1.AddEvents(.Value("Subject"), .Value("StartTime"), .Value("EndTime"), .Value("Category"), bAllDayEvent, .Value("Comment"), , bIsSerie, bNotify, bPrivate, .Value("ShowTimeAs"))
    SQLLite datatype should convert to VB6 known Data Types and VB6 Data Type should convert to SQLLite datatype?
    There're DateTime issues due to different date and time formats in db and the PC system.

    thank you very much for notifying me of this, I have made the corrections and I make sure to save 1 and 0, this is because in my pc (Spanish) when saving as boolean they are stored in Spanish (Verdadero, Falso), and when lifting it in your pc they do not recognizes them as True or False
    leandroascierto.com Visual Basic 6 projects

  18. #18
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    There're few errors during running the updated demo.
    1. It's either data in db for "StartTime" and "EndTime" or Date and Time Formats issue between your PC and my PC region settings.
    Code:
    If StartTime > EndTime Then
            'Err.Raise 100, , "Start time cannot be greater than end time"
            Exit Function
    End If
    My vb6 is interpreting "9/5/2022 12:30:00 Am" and "5/15/2022 4:00:00 Am" but in db they are "9/5/2022 00:30:00" and "15/5/2022 04:00:00".

    Name:  db issue vb6.png
Views: 901
Size:  9.6 KB

    Name:  db issue.png
Views: 969
Size:  25.0 KB
    2. add Form1 Form_Load:
    Code:
    If lKey <> 0 Then ColEvents.Add cEvent, CStr(lKey)
    then I can run the demo with two modifications.
    Last edited by DaveDavis; May 16th, 2022 at 08:50 AM.

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by DaveDavis View Post
    There're few errors during running the updated demo.
    1. It's either data in db for "StartTime" and "EndTime" or Date and Time Formats issue between your PC and my PC region settings.
    Code:
    If StartTime > EndTime Then
            'Err.Raise 100, , "Start time cannot be greater than end time"
            Exit Function
    End If
    confirmed: data in db has fault.
    Attachment 184863

    2. add Form1 Form_Load:
    Code:
    If lKey <> 0 Then ColEvents.Add cEvent, CStr(lKey)
    then I can run the demo with two modifications.
    mmm if I had not taken this into account, ok I can solve it, I am going to convert the date to unixtime, that was going to do that from the beginning but I did not want to complicate the example, storing the date as unixtime is better since you can select dates with sql ex: select * where date > xxxx
    Thanks again!
    leandroascierto.com Visual Basic 6 projects

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    440

    Re: ucCalendar (Events calendar)

    @DaveDavis Well, I think that with this update there shouldn't be any more regional configuration problems, the example should run fine in any country.
    leandroascierto.com Visual Basic 6 projects

  21. #21
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: ucCalendar (Events calendar)

    Quote Originally Posted by LeandroA View Post
    @DaveDavis Well, I think that with this update there shouldn't be any more regional configuration problems, the example should run fine in any country.
    I can run without fault. Thank you!
    The demo I download on your website, When I update the text of Subject or Location or Body, my Unicode lost. But RC6 version is OK.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width