Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Calendar, the TextBox and their Relationship
Message
De
12/01/2008 05:30:40
 
 
À
11/01/2008 18:47:45
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01281278
Message ID:
01281319
Vues:
11
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform