CaptionBar <-> doesn't honor datepicker range |
Post Reply |
Author | |
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
Posted: 27 August 2009 at 8:44am |
If I set the range of dates of the datepicker control and link this datepicker control to the calendar control all works perfect. But one minor problem is, that the user is able to ignore these settings by clicking the caption bars prev. / next buttons. Is there a property that I don't found or an other (simple) method to restrict the caption bars scrolling range?
Thanks for any idea
Using V13.1.0 unde VB6/SP6
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You can hide this navigation buttons from Caption Bar if you don't need it - may be there is some notification on this button click (please check) - if yes - you can fix user choice in your reaction on notification XTP_NC_CALENDAR_CAPTIONBARPART_BEFORE_CLICK
with nPartID =
xtpCalendarCaptionBar_ScrollPrevDate = 0x00000100, // Defines ScrollDateBar PrevDateButton.xtpCalendarCaptionBar_ScrollNextDate = 0x00000200, // Defines ScrollDateBar NextDateButton.
void CXTPCalendarCaptionBarTheme::OnPartClick(int nPartID)
{ BOOL bCancel = FALSE; if (m_pConnection) m_pConnection->SendEvent(XTP_NC_CALENDAR_CAPTIONBARPART_BEFORE_CLICK, (WPARAM)nPartID, (LPARAM)&bCancel); if (GetCalendarCtrl() && !bCancel) GetCalendarCtrl()->SendNotification(XTP_NC_CALENDAR_CAPTIONBARPART_BEFORE_CLICK, (WPARAM)nPartID, (LPARAM)&bCancel); if (bCancel) return; |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
I definitively need the previous/next buttons. They are very handy! But I use ActiveX under VB6 and I don't see how to restrict the working range of these buttons...
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I already explained you - there is Event and Notification - see my prev post. You can react on it - if bCancel = TRUE - action (change date range) will be canceled
Another idea - if you don't want to react on CaptionBar notification - react on Calendar or DatePicker dates range changed
e.g.
Private Sub CalendarControl_SelectionChanged(ByVal SelType As XtremeCalendarControl.CalendarSelectionChanged)
If SelType = xtpCalendarSelectionDays Then Debug.Print "SelectionChanged. Day(s)." If CalendarControl.ActiveView.Selection.IsValid Then Debug.Print CalendarControl.ActiveView.Selection.Begin Debug.Print CalendarControl.ActiveView.Selection.End End If End If If SelType = xtpCalendarSelectionEvents Then Debug.Print "SelectionChanged. Event(s)." End If End Sub Btw - you can make a post about new tooltip-related flag (show tooltip in non-active calendar app) - let's people know
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
OK - works partially but my solution is not very elegant because MonthView doesn't work:
Private Sub CalendarControl1_SelectionChanged(ByVal SelType As XtremeCalendarControl.CalendarSelectionChanged)
Static InProgress_OK As Boolean Dim d1 As Date Dim d2 As Date If SelType = xtpCalendarSelectionDays And CalendarControl1.ViewType <> xtpCalendarMonthView And Not InProgress_OK Then InProgress_OK = True d1 = DateSerial(Year(Now()), Month(Now()) - AppConfig.Value("Agenda.nMonateRet", 0), 1) d2 = DateSerial(Year(Now()), Month(Now()) + APPFORWARD + 1, 1) If CalendarControl1.ActiveView.Days(0).Date < d1 Then CalendarControl1.ViewType = xtpCalendarDayView CalendarControl1.ActiveView.ShowDay d1 End If If CalendarControl1.ActiveView.Days(CalendarControl1.ActiveView.DaysCount - 1).Date > d2 Then CalendarControl1.ViewType = xtpCalendarDayView CalendarControl1.ActiveView.ShowDay d2 End If InProgress_OK = False End If End Sub probably there is a better solution. Best if caption bar buttons would honore the useable range of the attached date picker!
I use the built in caption bar!
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Other people can use another logic... And improve your code to cover MonthView case
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |