Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Calendar header
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Calendar header

 Post Reply Post Reply
Author
Message
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Topic: Calendar header
    Posted: 06 January 2007 at 4:50pm
I have several resources in my calendar.
 
The banner/header (not sure if this is the 'official' name) at the top of the day's schedule only reads the day of the week and not day/date etc.
 
How can I change this?
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2007 at 1:43pm
Hi,

It depends on the width of the window. If there is enough space to display long day header, it displays it. Otherwise, it tries to work with Middle day header format, then Short, and the Shortest at last.

In any case you can set custom format strings for day header date formats.
 
See CalendarDayView properties
    DayHeaderFormatLong
    DayHeaderFormatMiddle
    DayHeaderFormatShort
    DayHeaderFormatShortest 
 
As I understand you use office 2003 theme ?
 

Example:

    CalendarControl.DayView.DayHeaderFormatLong = "'(1)' ddd, dd MMMM yyyy"
    CalendarControl.DayView.DayHeaderFormatMiddle = "'(2)' ddd, dd MMM yy"
    CalendarControl.DayView.DayHeaderFormatShort = "'(3)' dd MMM "
    CalendarControl.DayView.DayHeaderFormatShortest = "'(4)' d.MM"
    CalendarControl.Populate
 


--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2007 at 9:13pm
I am acutally using 2007 theme and I can't seem to get above code to work.
 
I am viewing as a dayView (one single day) so I don't think space is an issue. I have a screen shot available. ....
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2007 at 4:37am
Ok, you can try another way:
 
See GetItemText notification.
 
Set :
    CalendarControl.AskItemTextFlags = xtpCalendarItemText_DayViewDayHeader
 
See enum XTPCalendarGetItemText


--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2007 at 8:51pm
not having much success.... can you provide a bit more info..
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2007 at 8:09am
Take a look at our VB sample, frmMain: CalendarControl_GetItemText event handler.
 
Also uncomment string
    CalendarControl.AskItemTextFlags = -1
in Form_Load method.
 
Then you'll see.

--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2007 at 5:42pm
It appears to not be working in 2007 Theme.... I am still just getting the Day of the week.
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 10:24am
Show me the code you're using in CalendarControl_GetItemText event handler.

--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 1:29pm
Straight from your sample:
 
Private Sub CalendarControl_GetItemText(ByVal Params As XtremeCalendarControl.CalendarGetItemTextParams)
    If Params.Item = xtpCalendarItemText_EventSubject Then
        Params.Text = "*Custom subject* " & Params.Text
   
    ElseIf Params.Item = xtpCalendarItemText_EventLocation Then
        Params.Text = "ScheduleID = " & Params.ViewEvent.Event.ScheduleID
       
    ElseIf Params.Item = xtpCalendarItemText_EventBody Then
        Params.Text = "custom BODY text."
       
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeader Or _
           Params.Item = xtpCalendarItemText_WeekViewDayHeader Or _
           Params.Item = xtpCalendarItemText_MonthViewDayHeader _
        Then
        Params.Text = "Date:" & Params.ViewDay.Date
   
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderLeft Or _
            Params.Item = xtpCalendarItemText_WeekViewDayHeaderLeft Or _
            Params.Item = xtpCalendarItemText_MonthViewDayHeaderLeft _
        Then
        'Params.Text = Day(Params.ViewDay.Date)
        Params.Text = Day(Params.ViewDay.Date)
   
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderCenter Or _
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderCenter Or _
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderCenter _
        Then
        Params.Text = WeekdayName(Weekday(Params.ViewDay.Date), , vbSunday)
   
    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderRight Or _
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderRight Or _
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderRight _
        Then
        Params.Text = Year(Params.ViewDay.Date)
       
    ElseIf Params.Item = xtpCalendarItemText_MonthViewWeekDayHeader Then
        Params.Text = Params.Text & " - " & Params.Weekday
       
    ElseIf Params.Item = xtpCalendarItemText_EventToolTipText Then
        Params.Text = "(" & Params.ViewEvent.Event.Location & ") " & _
                      Params.ViewEvent.Event.Subject & _
                      " [" & Params.ViewEvent.Event.Id & "]"
   
       
    End If
   
End Sub
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 2:32pm
So, it works as designed

If you want to see another header, customize this code as you wish.

--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 3:36pm
I actually didn't alter that code at all, it came straight 'out of the box'
 
 
Can you tell me then, does this feature work on the 2007 theme?
 
If so, then I am missing something and don't need to create custom code...
 
the header I am talking about is here: at the top of the calendarcontrol:
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 5:15pm
Yes, thIs feature works fine for Office 2007 theme.
 
Will try to help you...
 
You have to understand the code in GetItemText handler. Please read it once more and remove lines which you don't need.
 
Look at these lines:

    ElseIf Params.Item = xtpCalendarItemText_DayViewDayHeaderCenter Or _
           Params.Item = xtpCalendarItemText_WeekViewDayHeaderCenter Or _
           Params.Item = xtpCalendarItemText_MonthViewDayHeaderCenter _
        Then
        Params.Text = WeekdayName(Weekday(Params.ViewDay.Date), , vbSunday)

 
You receive Week day name because WeekdayName() returns it

Params.Text = WeekdayName(Weekday(Params.ViewDay.Date), , vbSunday)


Just set

Params.Text = "Bla-Bla-Bla..."

 
Well, instead this of course write what you need
 
ps:
Use following flags for Office 2007 theme:
 
    xtpCalendarItemText_DayViewDayHeaderLeft
    xtpCalendarItemText_DayViewDayHeaderCenter
    xtpCalendarItemText_DayViewDayHeaderRight
       
When your code start working, set only flags which are actually used to AskItemTextFlags for optimization (instead of -1, which is useful for debug).
 
Example:
 

    CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_DayViewDayHeaderLeft
       CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_DayViewDayHeaderCenter




--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 8:59am
Serge,
 
Got it! Thanks for your patience!!
 
 
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 9:01am
Actually one last quick question....
 
is there a way to change the font/font size of this header?
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 3:59pm
Originally posted by scbdpm scbdpm wrote:

Actually one last quick question....
 
is there a way to change the font/font size of this header?


For Office2007 theme look at the similar event handler BeforeDrawThemeObject and the message xtpCalendarBeforeDraw_DayViewDay.

Take a look at our regular sample for more details.

--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2007 at 7:01pm
would it be a line like this:
 
        pTheme2007.DayView.Day.Header.TextCenter.Normal.Font.Bold = True
        pTheme2007.DayView.Day.Header.TextCenter.Normal.Font.SIZE = 12
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 2:52pm
yes, you're correct.

--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 3:45pm
I am referencing the screen shot I pasted above.
 
So those lines of code do not seem to change the font/font size of the day of the week (Sunday which is currently showing) but rather is changing the size/font of the schedule headers (i.e. ARI, MEH, etc) that are at the bottom of that screen shot fragment......
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 4:29pm
For this caption you should reference the following piece of code in the sample:

    ElseIf eObjType = xtpCalendarBeforeDraw_DayViewDay Then
        pTheme2007.DayView.Day.Header.BaseColor = 20000 + 100 * Weekday(Params.Date)
        pTheme2007.DayView.Day.Header.TodayBaseColor = RGB(0, 0, 0)


--
WBR,
Serge
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 4:43pm

that's not helpful at all, that is just the code from your sample and doesn't change font or font size, just the color of the header...

please re-read my post!!!
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 6:03pm
Note that it's different for Normal days, Selected days, etc, and it should be set separately. The following piece of code works just fine:

pTheme2007.DayView.Day.Header.TextCenter.Normal.Font.Bold = True
pTheme2007.DayView.Day.Header.TextCenter.Normal.Font.SIZE = 12
       
pTheme2007.DayView.Day.Header.TextCenter.Selected.Font.Bold = True
pTheme2007.DayView.Day.Header.TextCenter.Selected.Font.SIZE = 12
       
pTheme2007.DayView.Day.Header.TextCenter.Today.Font.Bold = True
pTheme2007.DayView.Day.Header.TextCenter.Today.Font.SIZE = 12
       
pTheme2007.DayView.Day.Header.TextCenter.TodaySelected.Font.Bold = True
pTheme2007.DayView.Day.Header.TextCenter.TodaySelected.Font.SIZE = 12


Also to adjust header height somewhere after you set theme Office 2007 change height like

objThemeOfice2007.DayView.Day.Header.HeightFormula.Constant = objThemeOfice2007.DayView.Day.Header.HeightFormula.Constant + 7

do not set this in BeforeDrawThemeObject because this setting applyed on Populate call.

Also if you do not need dynamically chahge your font by some condition use static customization, like for height:

objThemeOfice2007.DayView.Day.Header.TextCenter.Normal.Font.SIZE = 12
......
objThemeOfice2007.RefreshMetrics



Also to understand theme customization look our VB Sample,
    menu Calendar ->
        Customize office 2007 Theme
 
--
WBR,
Serge        
Back to Top
scbdpm View Drop Down
Groupie
Groupie


Joined: 05 January 2007
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scbdpm Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2007 at 6:15pm
this is perfect! thank you!
 
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.