Print Page | Close Window

CalendarTheme2007 and BeforeDrawDayViewCell

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=5170
Printed Date: 28 September 2024 at 5:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CalendarTheme2007 and BeforeDrawDayViewCell
Posted By: g.achrainer
Subject: CalendarTheme2007 and BeforeDrawDayViewCell
Date Posted: 29 September 2006 at 5:20am
Hi,

seems as if "BeforeDrawDayViewCell" only works when using the "old" 2003 theme, but not if I use the new 2007 theme.

I want to display individual working time for each day as well as a planned lunch time.

How would I do that using 10.3?

Thanks in advance,

Gerhard



Replies:
Posted By: sserge
Date Posted: 02 October 2006 at 4:30pm
Hi,

When customizing themes (2007 and others in future) you can use another notification BeforeDrawThemeObject. Below is the example:

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxCalendarControl1.SetTheme(New CalendarThemeOffice2007Class)

        If Not AxCalendarControl1.BeforeDrawThemeObjectFlags Is Nothing Then
            AxCalendarControl1.BeforeDrawThemeObjectFlags.SetFlag(CalendarBeforeDrawThemeObject.xtpCalendarBeforeDraw_DayViewDay)
        End If

        AxCalendarControl1.Populate()
    End Sub

    Private Sub AxCalendarControl1_BeforeDrawThemeObject(ByVal sender As Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_BeforeDrawThemeObjectEvent) Handles AxCalendarControl1.BeforeDrawThemeObject
        Dim pTheme2007 As CalendarThemeOffice2007
        pTheme2007 = AxCalendarControl1.Theme
        Dim pDay As CalendarViewDay

        If e.eObjType = CalendarBeforeDrawThemeObject.xtpCalendarBeforeDraw_DayViewDay Then
            pDay = e.drawParams

            If ... Then
                pTheme2007.DayView.Day.Group.Cell.WorkCell.BackgroundColor = RGB(..., ..., ...)
            End If
        End If
    End Sub


--
WBR,
Serge


Posted By: g.achrainer
Date Posted: 03 October 2006 at 9:22am
Hi,

thanks for the hint, it almost works now, but there is one issue left:
having a Variant as Parameter, which is an Interface or an object is not possible to implement in Gupta Teamdeveloper.
I worked around that declaring the Parameter as Interface which seems to be ok as long as I don't use "xtpCalendarBeforeDraw_DayViewTimeScale" etc.
Would be nice to have one parameter for the Interface, if any, and another for the numeric information.

Anyway, for now it works, thank you once again.

Regards,

Gerhard



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