From: Schollnick, B. <Ben...@xe...> - 2005-07-18 19:27:48
|
1) How do I find out what Row the user has highlighted? I know GetSelectedString will return the text, but I'm interested in finding out row #666 is selected. a) How do I set the active row back to 667 or after I reload the list? 2) I have buttons on the custom dialog / MultiColumnList... But I would like to activate the edit function if they double click on a row. I thought it would be either on_Activate or on_ActivatedEvent but neither of those seemed to work when I created a event handler. =20 3)=20 > -----Original Message----- > From: pyt...@li...=20 > [mailto:pyt...@li...] On=20 > Behalf Of kim...@ya... > Sent: Monday, July 18, 2005 2:04 PM > To: pyt...@li... > Subject: Re: [Pythoncard-users] Calendar Widget, setting the=20 > date shown to a specific date. >=20 >=20 > It's obvious (***NOT***): >=20 > import datetime date >=20 > ... >=20 > def on_initialize(self, event): > =09 > self.components.caCalendar.date=3Ddatetime.date(2005,8,1) > ... >=20 > -- > John >=20 >=20 > Schollnick, Benjamin wrote: > > Folks, > >=20 > > I'm using a calendar widget.... But I have run > into a issue > > that I can't seem > > to resolve... > >=20 > > Is there a way to set the Calendar widget to a > specific date? I > > see the > > SetDate function, but I am unable to find the > syntax/format for > > that function... > >=20 > > I need to set the calendar to match the data it is=20 > representing.... > >=20 > > I briefly checked the samples, but I did not see > any that used > > the calendar, and > > set the date to anything but the default of Now... > (The calendar > > widget appears > > to default to NOW().) > >=20 > > Any hints? > >=20 > > - Benjamin > >=20 > >=20 > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux > Migration Strategies > > from IBM. Find simple to follow Roadmaps, > straightforward articles, > > informative Webcasts and more! Get everything you > need to get up to > > speed, fast. > http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dclick > > _______________________________________________ > > Pythoncard-users mailing list Pyt...@li... > > > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > >=20 > >=20 >=20 >=20 > --=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration=20 > Strategies from IBM. Find simple to follow Roadmaps,=20 > straightforward articles, informative Webcasts and more! Get=20 > everything you need to get up to speed, fast.=20 > http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick > _______________________________________________ > Pythoncard-users mailing list Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users >=20 |
From: Alex T. <al...@tw...> - 2005-07-18 21:49:09
|
Schollnick, Benjamin wrote: >1) How do I find out what Row the user has highlighted? I know >GetSelectedString will return the text, but I'm interested in finding >out row #666 is selected. > > There's no PythonCard method to do this directly. You can use the wxPython methods (I stole / adopted this code from the components/multicolumn.py). I took the multicolumnexample in the samples directory, added a button called "which" and added the code below. It prints out the list of selected item row numbers - and then makes the row following the first selected one be (also) selected. > def on_which_mouseClick(self, event): > print self.components.theList.getStringSelection() > numitems = self.components.theList.GetSelectedItemCount() > itemidx = -1 > items = [] > for i in xrange(numitems) : > itemidx = self.components.theList.GetNextItem(itemidx, > wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED) > if itemidx == -1: > #Odd, selection changed? > break > items.append(itemidx) > print items > > itemidx = items[0] + 1 > self.components.theList.SetSelection(itemidx) > a) How do I set the active row back to 667 or after I reload the >list? > > > You'd need to (assuming you want to) first de-select the current selection, then select 667 as you want - something like for i in items: self.components.theList.SetSelection(i, 0) # second param 0 to deselect self.components.theList.SetSelection(667) >2) I have buttons on the custom dialog / MultiColumnList... But I would >like to activate the edit function if they double click on a row. I >thought it would be either on_Activate or on_ActivatedEvent but neither >of those seemed to work when I created a event handler. > > > What did the MessageWatcher say the event was ? It's itemActivated :-) >3) > > > Yes. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.9.0/50 - Release Date: 16/07/2005 |