From: <gre...@co...> - 2004-09-12 16:35:17
|
Minor bug? Maybe this was already fixed in the latest version? Below is the code generated by the resource editor. You can use it to replicate the bug, but any example should work. -Greg Version Info: PythonCard version: 0.8 wxPython version: 2.5.2.7 Python version: 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] Platform: win32 {'application':{'type':'Application', 'name':'Template', 'backgrounds': [ {'type':'Background', 'name':'bgTemplate', 'title':'Standard Template with no menus', 'position':(198, 198), 'size':(490, 582), 'components': [ {'type':'Choice', 'name':'Choice1', 'position':(118, 78), 'size':(130, -1), 'backgroundColor':(255, 128, 255), 'foregroundColor':(0, 0, 255), 'items':['1', '2', '3', '4', '5', '6'], }, ] # end components } # end background ] # end backgrounds } } |
From: <gre...@co...> - 2004-09-12 16:39:20
|
Actually, it seems to only happen with numbers as items. Also I typed them as [1,2,3] in the resource editor field. Maybe it's required to do, ['1','2','3'] ? -Greg Gregory Piñero wrote: > Minor bug? Maybe this was already fixed in the latest version? Below > is the code generated by the resource editor. You can use it to > replicate the bug, but any example should work. > > -Greg > > > Version Info: > PythonCard version: 0.8 > wxPython version: 2.5.2.7 > Python version: 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit > (Intel)] > Platform: win32 > > > {'application':{'type':'Application', > 'name':'Template', > 'backgrounds': [ > {'type':'Background', > 'name':'bgTemplate', > 'title':'Standard Template with no menus', > 'position':(198, 198), > 'size':(490, 582), > > 'components': [ > > {'type':'Choice', > 'name':'Choice1', > 'position':(118, 78), > 'size':(130, -1), > 'backgroundColor':(255, 128, 255), > 'foregroundColor':(0, 0, 255), > 'items':['1', '2', '3', '4', '5', '6'], > }, > > ] # end components > } # end background > ] # end backgrounds > } } > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > |
From: Kevin A. <al...@se...> - 2004-09-12 16:54:29
|
On Sep 12, 2004, at 9:40 AM, Gregory Pi=F1ero wrote: > Actually, it seems to only happen with numbers as items. Also I typed=20= > them as [1,2,3] in the resource editor field. Maybe it's required to=20= > do, ['1','2','3'] ? > > -Greg > > > Gregory Pi=F1ero wrote: > >> Minor bug? Maybe this was already fixed in the latest version? =20 >> Below is the code generated by the resource editor. You can use it=20= >> to replicate the bug, but any example should work. >> -Greg >> Version Info: >> PythonCard version: 0.8 >> wxPython version: 2.5.2.7 >> Python version: 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit=20= >> (Intel)] >> Platform: win32 >> {'application':{'type':'Application', >> 'name':'Template', >> 'backgrounds': [ >> {'type':'Background', >> 'name':'bgTemplate', >> 'title':'Standard Template with no menus', >> 'position':(198, 198), >> 'size':(490, 582), >> 'components': [ >> {'type':'Choice', >> 'name':'Choice1', >> 'position':(118, 78), >> 'size':(130, -1), >> 'backgroundColor':(255, 128, 255), >> 'foregroundColor':(0, 0, 255), >> 'items':['1', '2', '3', '4', '5', '6'], >> }, >> ] # end components >> } # end background >> ] # end backgrounds >> } } >> You didn't say what the bug was before, but I assume you mean that the=20= items in the list are strings? If so, yes, the items in the list must=20 be strings for all the components that have an items list attribute.=20 Use str() and int() to convert back and forth in your code if you need=20= to work with integers internally, but display them as strings in the=20 components. If you wanted to use stringSelection to select the item '3' in the list=20= then you would do something like: self.components.Choice1.stringSelection =3D '3' but if you wanted to select the item by its numeric position in the=20 list, remember to use an integer as well as that the list is=20 zero-based, like most things in Python. self.components.Choice1.selection =3D 2 ka= |
From: <gre...@co...> - 2004-09-12 17:03:56
|
Sorry, I forgot to describe the bug. This is a specific problem only with the resource editor. Basically what happens is I open resource editor, select 'Choice' (or 'Combobox'), then I go to the properties window, select items, type in [1,2,3] (or ['1','2','3'] either causes it), click update, then I go to stringselection, press the drop down button and see 1,2,3. I choose 1, and nothing seems to happen, then I hit update, and still nothing happens. Finally I hit save and code is generated without a stringselection specified. Does that explain it better? -Greg Kevin Altis wrote: > On Sep 12, 2004, at 9:40 AM, Gregory Piñero wrote: > >> Actually, it seems to only happen with numbers as items. Also I typed >> them as [1,2,3] in the resource editor field. Maybe it's required to >> do, ['1','2','3'] ? >> >> -Greg >> >> >> Gregory Piñero wrote: >> >>> Minor bug? Maybe this was already fixed in the latest version? >>> Below is the code generated by the resource editor. You can use it >>> to replicate the bug, but any example should work. >>> -Greg >>> Version Info: >>> PythonCard version: 0.8 >>> wxPython version: 2.5.2.7 >>> Python version: 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit >>> (Intel)] >>> Platform: win32 >>> {'application':{'type':'Application', >>> 'name':'Template', >>> 'backgrounds': [ >>> {'type':'Background', >>> 'name':'bgTemplate', >>> 'title':'Standard Template with no menus', >>> 'position':(198, 198), >>> 'size':(490, 582), >>> 'components': [ >>> {'type':'Choice', >>> 'name':'Choice1', >>> 'position':(118, 78), >>> 'size':(130, -1), >>> 'backgroundColor':(255, 128, 255), >>> 'foregroundColor':(0, 0, 255), >>> 'items':['1', '2', '3', '4', '5', '6'], >>> }, >>> ] # end components >>> } # end background >>> ] # end backgrounds >>> } } >>> > > You didn't say what the bug was before, but I assume you mean that the > items in the list are strings? If so, yes, the items in the list must be > strings for all the components that have an items list attribute. Use > str() and int() to convert back and forth in your code if you need to > work with integers internally, but display them as strings in the > components. > > If you wanted to use stringSelection to select the item '3' in the list > then you would do something like: > > self.components.Choice1.stringSelection = '3' > > but if you wanted to select the item by its numeric position in the > list, remember to use an integer as well as that the list is zero-based, > like most things in Python. > > self.components.Choice1.selection = 2 > > ka > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > |
From: Kevin A. <al...@se...> - 2004-09-12 17:26:28
|
On Sep 12, 2004, at 10:05 AM, Gregory Pi=F1ero wrote: > Sorry, I forgot to describe the bug. This is a specific problem only=20= > with the resource editor. > > Basically what happens is I open resource editor, select 'Choice' (or=20= > 'Combobox'), then I go to the properties window, select items, type in=20= > [1,2,3] (or ['1','2','3'] either causes it), click update, then I go=20= > to stringselection, press the drop down button and see 1,2,3. I=20 > choose 1, and nothing seems to happen, then I hit update, and still=20 > nothing happens. Finally I hit save and code is generated without a=20= > stringselection specified. > > Does that explain it better? > > -Greg > Yep, that's a real bug. Line 205 of=20 resourceEditor/modules/propertyEditor.py should be: if propName not in ['label', 'stringSelection', 'text',=20 'toolTip']: and line 364 should be: if propName in ['label', 'stringSelection', 'text', 'toolTip']=20= or propName in checkItems: ka= |