From: Alex T. <al...@tw...> - 2005-08-09 18:57:33
|
Tiberiu Ichim wrote: > Hi! > I've upgraded one of my apps from pythoncard 0.7 to the latest 0.8 > Unfortunately, the calendar widget has been modified (it no longer has > drop-down boxes for month and year), and for my application it would > be better to have those back. I've tried fiddling with the window > style flags from wx, but I couldn't get it to work the way it used to. > Besides creating separate widgets and linking them to the calendar > with code, is there a possibility to get the old style back? > Sorry for the late reply - I've been hoping my old machine still had 0.7 on it, and finally got a chance to revive it - and found only a very incomplete portion of 0.7 still there. I don't think the new calendarctrl (in wxPython, not in Pythoncard) has any way to directly set the year (you can use the < and > arrows to change one month at a time, and that will wrap over year boundaries). You could probably use the old calendar (as import wx.lib.calendar) - but you'd need to use wx Events directly not get it through PythonCard. Possible, but not recommended. I'd suggest simply adding a a couple of widgets - the code to link them is simple .... > def on_monthChoice_select(self, event): > prev = self.components.Calendar1.date > self.components.Calendar1.date = > prev.replace(month=self.components.monthChoice.selection+1) (note the +1 to account for the selections being 0-11 while the months are 1-12). And the year should be very similar ... -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.2/65 - Release Date: 07/08/2005 |