Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Calendar, the TextBox and their Relationship
Message
From
12/01/2008 05:30:40
 
 
To
11/01/2008 18:47:45
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01281278
Message ID:
01281319
Views:
10
>Got a Calendar class (RCSCalendar.vcx) and a TextBox to hold the selected date. The class has 42 small labels and on the click event (inherited from their parent labels) they populate a property on the container. I want to update the TextBox whenever that click occurs. It doesn't seem correct to add code to all those parent label Click events to refresh the TextBox value as it is at the form-level, as is the container, but I'm not sure how to get the TextBox to refresh other than in those 42 Click events. It's much simpler than I made it sound, but I can't think of another way to say it.

AFAIR the rcsCalender is rather well designed. There is a baseclass for those 42 days were you could enhance the click() or you cuold add code to the method being called (ugliest way would be to ask via program((program(-1)-)) who called it and act accordingly.

But I'ld enhance the rcsCalendar and your textbox both so that you have a factory approach communicating with the datepicker via a tiny interface. That way you could call on a moments notice a totally other class or an enhanced class (for instance with marked holidays, school vacation or a time picker added for datetime fields.

Update: I'ld also recommend to make as many of the .captions used dependant on the runtime: with the vfp-functions alone you get a language independant calender up to about 90% - just add code to set weekdays and months accordingly. Less than 20 lines of code in my implementation<g>. Add one method function for those tags not handled and you have a poor man's multilanguage calendar.


my 0.02 EUR

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform