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

DatePicker DayMetrics

 Post Reply Post Reply
Author
Message
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post Topic: DatePicker DayMetrics
    Posted: 19 June 2007 at 3:39pm
Is this event fired for all visible days every time the selection is changed?
 
jp
Back to Top
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2007 at 4:09pm
Let's assume that it does...  let's also assume that the process needed to determine the metrics is non-trivial.  Two questions:
 
1)  Is there a way to update the metrics once, then set AskDayMetrics = false until the months displayed change?  I guess another way of asking this would be:  Is there a way to determine when the control has finished updating...?
 
2)  Is the metrics object being destroyed after the event handler exits?  I've tried passing this object on to a non-blocking handler... but modifications to that object are not reflected in the control.
 
jp 
Back to Top
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2007 at 8:44pm

It's worse than I thought.  Several things seem to cause every single day to refire the DayMetrics event:

1) Change selected date
2) Change to another month
3) MouseEnter Today button
4) MouseLeave Today button
5) MouseEnter None button
6) MouseLeave None button
 
That pretty much renders this event completely unusable - thus eliminating the ability to modify DatePicker font style.
 
Please - someone chime in here and tell me I'm crazy.  Why would I want to refresh font metrics for something that's still visible on the screen?
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: 06 July 2007 at 5:45pm
Currently DayMetrics asked for each control's redraw for each visible day.
This operation assumed to be fast and lightweight.

And yes, metrics object is created and destroyed for each method call.

It could be still visible, but it's size, font or position could be already changed for a moment of redraw.

Certainly additional improvements could be added like some caching, but this is a target for future versions.

--
WBR,
Serge
Back to Top
LarryInCanada View Drop Down
Newbie
Newbie


Joined: 28 April 2009
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote LarryInCanada Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2012 at 12:39pm
This issue is driving me insane.  Confused
I want to be able to run the Day Metrics one single ime, and then set it so id does not re-run.  I know this post is 7 or 8 years old, so I am hoping to god that this has finally been addressed????
 
Someone, anyone, please help me out here......
 
 
Back to Top
Boris View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 June 2007
Location: United Kingdom
Status: Offline
Points: 179
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boris Quote  Post ReplyReply Direct Link To This Post Posted: 19 December 2012 at 3:06am
No it hasn't.
 
I only need to read my db once or when the user changes the month so I was doing this:
Private Sub DatePicker1_DayMetrics(ByVal Day As Date, ByVal Metrics As XtremeCalendarControl.IDatePickerDayMetrics)
Dim rst As ADODB.RecordSet
Set rst = New ADODB.RecordSet

' query db based on day.
If Not rst.EOF Then
    rst.MoveFirst
 
    Do
    Metrics.Font.Bold = True
   
    rst.MoveNext
    Loop Until rst.EOF
End If
 
rst.Close

If Day = Me.DatePicker1.LastVisibleDay Then Me.DatePicker1.AskDayMetrics = False
End Sub
 
now i would have thought that if day equals the last visible day I could turn off the metrics. Yes that works. until the control loses focus then all the dates disappear. Also you have to load the form with metrics on. Explicity turning back on the metrics does not refresh the dates and you have to manually select the control with the mouse and use a DatePicker1.AskDayMetrics = True in the .selectionchanged event. Not good! Perhaps Larry you could try modifying my code and share if you fix it. Cheers
Boris

Product: Xtreme SuitePro (ActiveX) version 16.4.0 16.3.1

Platform: Windows XP (32bit) - SP 3

Language: Visual Basic 6.0 SP6

VS 2005-2008-2010-2013
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.125 seconds.