Print Page | Close Window

SOLVED: CalendarThemeImageList Add

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=18051
Printed Date: 20 May 2024 at 11:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: CalendarThemeImageList Add
Posted By: McKloony
Subject: SOLVED: CalendarThemeImageList Add
Date Posted: 14 March 2011 at 4:30am
How can I add a image from the ImageManager to the CalendarThemeImageList?

CalendarThemeImageList.AddBitmap ImageManager.Icons.GetImage(ID, 16)

does not work



-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6



Replies:
Posted By: SuperMario
Date Posted: 15 March 2011 at 3:06pm
what are you trying to accomplish?


Posted By: McKloony
Date Posted: 16 March 2011 at 1:51am
First I want to replace the default Icons for the CalendarEvens. I tried with:
 
CalendarControl.Theme.CustomIcons.AddIcons ImageManager.Icons
 
But it takes no effekt. Second I want ro add some Icons for the Day.Header
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 16 March 2011 at 8:59am
For custom icons you do this:


    Dim objThemeOfice2007 As CalendarThemeOffice2007
    Set objThemeOfice2007 = CalendarControl.Theme
   
    If objThemeOfice2007 Is Nothing Then Exit Sub
   
       
        ' add custom icons with special IDs to use them instead of standard
        ' see also PrePopulate event handler
       
        objThemeOfice2007.CustomIcons.LoadBitmap App.Path & "\Icons\Reminder.bmp", xtpCalendarEventIconIDReminder, xtpImageNormal
        objThemeOfice2007.CustomIcons.LoadBitmap App.Path & "\Icons\Occ.bmp", xtpCalendarEventIconIDOccurrence, xtpImageNormal
        objThemeOfice2007.CustomIcons.LoadBitmap App.Path & "\Icons\Exc.bmp", xtpCalendarEventIconIDException, xtpImageNormal
        objThemeOfice2007.CustomIcons.LoadBitmap App.Path & "\Icons\Private.bmp", xtpCalendarEventIconIDPrivate, xtpImageNormal
       
        'objThemeOfice2007.CustomIcons.AddIcon ImageListCustomIcons.ListImages.Item(1).ExtractIcon.Handle, xtpCalendarEventIconIDReminder, xtpImageNormal
        'objThemeOfice2007.CustomIcons.AddIcon ImageListCustomIcons.ListImages.Item(2).ExtractIcon.Handle , xtpCalendarEventIconIDOccurrence, xtpImageNormal
        'objThemeOfice2007.CustomIcons.AddIcon ImageListCustomIcons.ListImages.Item(3).ExtractIcon.Handle, xtpCalendarEventIconIDException, xtpImageNormal
        'objThemeOfice2007.CustomIcons.AddIcon ImageListCustomIcons.ListImages.Item(4).ExtractIcon.Handle, xtpCalendarEventIconIDPrivate, xtpImageNormal
                       
        '' increase event height for 4 pixels to have enough space to draw custom icons.
        'objThemeOfice2007.MonthView.Event.HeightFormula.Constant = 5
        'objThemeOfice2007.WeekView.Event.HeightFormula.Constant = 5
        'objThemeOfice2007.RefreshMetrics
       
        ' custom icons
       
        'objThemeOfice2007.SetCustomIcons ImageListCustomIcons
       
        Dim arCustIconsIDs(5) As Long
        arCustIconsIDs(0) = 1 ' unread mail
        arCustIconsIDs(1) = 2 ' read mail
        arCustIconsIDs(2) = 3 ' replyed mail
        arCustIconsIDs(3) = 4 ' attachment
        arCustIconsIDs(4) = 5 ' Low priority
        arCustIconsIDs(5) = 6 ' HIGH priority
       
        objThemeOfice2007.CustomIcons.LoadBitmap App.Path & "\Icons\EventCustomIcons.bmp", arCustIconsIDs, xtpImageNormal

   
    CalendarControl.Populate

Private Sub CalendarControl_PrePopulate(ByVal ViewGroup As XtremeCalendarControl.CalendarViewGroup, ByVal Events As XtremeCalendarControl.CalendarEvents)
   
    Dim pEvent As CalendarEvent
    Dim strData As String
   
    For Each pEvent In Events       
        pEvent.CustomIcons.RemoveAll
                           
            ' customize standard icons
            If pEvent.PrivateFlag Then
                pEvent.CustomIcons.Add xtpCalendarEventIconIDPrivate
            End If
           
            If pEvent.Reminder Then
                pEvent.CustomIcons.Add xtpCalendarEventIconIDReminder
            End If
           
            If pEvent.RecurrenceState = xtpCalendarRecurrenceOccurrence Then
                pEvent.CustomIcons.Add xtpCalendarEventIconIDOccurrence
            End If
           
            If pEvent.RecurrenceState = xtpCalendarRecurrenceException Then
                pEvent.CustomIcons.Add xtpCalendarEventIconIDException
            End If
    Next
   
        If Events.Count = 1 Then
            Events(0).CustomIcons.Add 1
            Events(0).CustomIcons.Add 4
            Events(0).CustomIcons.Add 5
                   
        ElseIf Events.Count >= 3 Then
            Events(0).CustomIcons.Add 3
           
            Events(1).CustomIcons.Add 2
            Events(1).CustomIcons.Add 6

            Events(2).CustomIcons.Add 6
            Events(2).CustomIcons.Add 6
       
        ElseIf Events.Count >= 2 Then
            Events(0).CustomIcons.Add 2
            Events(0).CustomIcons.Add 5
           
            Events(1).CustomIcons.Add 4
            Events(1).CustomIcons.Add 6
        End If
   
End Sub


Posted By: SuperMario
Date Posted: 16 March 2011 at 9:10am
Icons for day headers I don't think is possible, at least in COM version.  CalendarThemeImageList is used for "parts" of the day headers.  I guess it might be possible if you could fit something in the "left" or "right" parts as I don't think they get repeated.


Posted By: McKloony
Date Posted: 16 March 2011 at 10:35am
Is it also possible to add CustomIcons from the ImageManager?

-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 16 March 2011 at 10:59am
You can just do this assuming you have an ImageManager on your form called CalendarImageManager:

Set objThemeOfice2007.CustomIcons = CalendarImageManager.Icons


Posted By: Roland
Date Posted: 07 June 2011 at 2:28pm
i think you use access 2010 
 i cant use
CalendarControl_PrePopulate &
 PrePopulateDay event handler
maybe in reference sometime missing or something else
 please help me



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net