Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RCSCalendar Class
Message
 
To
10/06/2009 14:57:52
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01283517
Message ID:
01405031
Views:
96
>>>I like your classes. Thanks for sharing.
>>>
>>
>>Thanks for the feedback, I'm glad it was useful.
>>
>>BTW - one thing that I think gets overlooked is that the +/- and D keys are overloaded so you can bump the date forward or backward (or set it back to the current date) using them.
>
>
>When my host form is close to the edge of the main VFP window, the calendard will be chopped off.
>
>See attached image.
>
>Can you suggest the area of the class I should look at to address this?
>
>Perhaps it needs a check like this somewhere:
>

Yeah, that will work. Add the code below (I'm including some code which is already their to give you an idea of where to put the new code) in DisplayCalendar():
* Position the calendar

lnTop = OBJTOCLIENT(This, 1) + ThisForm.Top + This.Height + 6
lnLeft = OBJTOCLIENT(This, 2) + ThisForm.Left + 4

IF lnTop + This.Height + This.oCalendar.Height < _screen.Height
   * Below
   This.oCalendar.Left = ThisForm.Left + OBJTOCLIENT(This, 2) - This.oCalendar.Width + This.Width
   This.oCalendar.Top = ThisForm.Top + OBJTOCLIENT(This, 1) + This.Height + SYSMETRIC(9) + 2
ELSE
   * Above
   This.oCalendar.Left = ThisForm.Left + OBJTOCLIENT(This, 2) - This.oCalendar.Width + This.Width
   This.oCalendar.Top = ThisForm.Top + OBJTOCLIENT(This, 1) + SYSMETRIC(9) + 2 - This.oCalendar.Height
ENDIF   

* Keep the calendar on the form
IF This.oCalendar.Left < 0
   This.oCalendar.Left = 0    
ENDIF
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform