From: Alex T. <al...@tw...> - 2005-08-09 18:04:10
|
> > >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? > > > This is my second try at answering this question .... my first try earlier was just plain wrong - please ignore it. This is controlled by one of the initialization constants to wxCalendarCtrl. The Pythoncard calendar component sets it ( calendar.CAL_SEQUENTIAL_MONTH_SELECTION ) which causes it to use the compact form rather than the drop-down form that you want. Easiest thing is to - create a directory called appcomponents within your application directory - create a file called __init__.py (that's underscore underscore i n i t underscore underscore . p y ) (can be empty) - copy in the calendar.py from PythonCard/components - change calendar.CalendarCtrl.__init__(self, aParent, widget.makeNewId( aResource.id ), wx.DateTime_Now(), aResource.position, aResource.size, style = wx.CLIP_SIBLINGS | wx.NO_FULL_REPAINT_ON_RESIZE | calendar.CAL_SHOW_HOLIDAYS | calendar.CAL_SHOW_SURROUNDING_WEEKS | calendar.CAL_SEQUENTIAL_MONTH_SELECTION, name = aResource.name ) to calendar.CalendarCtrl.__init__(self, aParent, widget.makeNewId( aResource.id ), wx.DateTime_Now(), aResource.position, aResource.size, style = wx.CLIP_SIBLINGS | wx.NO_FULL_REPAINT_ON_RESIZE | calendar.CAL_SHOW_HOLIDAYS | calendar.CAL_SHOW_SURROUNDING_WEEKS, ## calendar.CAL_SEQUENTIAL_MONTH_SELECTION, name = aResource.name ) and that should do it for you .... -- 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 |