From: Arthur E. <ar...@ia...> - 2004-09-11 21:02:23
|
Hi, some questions regarding the MultiColumnList. When I add items to the MultiColumnList, automatically I get a Heading. Is there a way to disable Headings all together? On OS X these headings take too much vertical space. Another space related question, is it possible to narrow vertical space, so rows become much smaller? I tried changing the font size, but the row size doesn't change accordingly? Thanks. Arthur |
From: <gre...@co...> - 2004-09-11 23:48:25
|
I am wondering if I have run into a bug. In the textarea and textfield components, if I create them during runtime, and set enabled to false, it does not get grayed out and I am still able to edit the component. Additionally, I tried setting editable to false and nothing seemed to change from that either, as I appeared to be able to still edit the text. By the way, what is the difference between editable and enabled? 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 Here's the part of my code where I am creating the textfield. (sorry if email bungles the tabs.) editable='False' tooltip='' widgetDefn={'type':'TextField', 'name':'txt'+ column[0], 'position':(xPosWidget, yPos), 'text':'', 'editable':editable, 'enabled':editable, 'toolTip':tooltip, 'size':(20,-1)} self.components[widgetDefn['name']]=widgetDefn |
From: <gre...@co...> - 2004-09-12 00:10:05
|
A combobox lets me write text in it instead of forcing me to select one of its listed choices, however this text does appear to do anything as it does not show up in .stringselection. This is even the case when I type in the exact same text as a listed choice in the combobox. This could be a bug depending on the desired behavior here. I believe the desired behavior should be to not allow text entry into a combobox, or giving an option to turn on text entry. But if the user is allowed to enter his own text, it should be picked up somewhere, right? Let me know, 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 |
From: Kevin A. <al...@se...> - 2004-09-12 03:07:57
|
On Sep 11, 2004, at 5:11 PM, Gregory Pi=F1ero wrote: > A combobox lets me write text in it instead of forcing me to select=20 > one of its listed choices, however this text does appear to do=20 > anything as it does not show up in .stringselection. This is even the=20= > case when I type in the exact same text as a listed choice in the=20 > combobox. > > This could be a bug depending on the desired behavior here. I believe=20= > the desired behavior should be to not allow text entry into a=20 > combobox, or giving an option to turn on text entry. But if the user=20= > is allowed to enter his own text, it should be picked up somewhere,=20 > right? > I don't believe the underlying wxPython ComboBox does anything with the=20= text the user types in the field, but rather leaves it up to you to=20 decide whether you want to do some processing. PythonCard does not bind=20= the EVT_TEXT_ENTER event, but you can handle the keyPress event, and do=20= some processing if event.keyCode =3D=3D 13, otherwise just call=20 event.skip(). That way if the user presses Return you can add the text=20= to the ComboBox list. You can use the keyPress or textUpdate event if=20 you want to look at the current text and then change the=20 stringSelection based on what the user has typed. I believe that by=20 default the selection will be changed only when the user clicks on the=20= dropdown arrow. If PythonCard is not behaving the same as the ComboBox in the wxPython=20= demo then there could be a bug in the PythonCard component, but I'm=20 pretty sure it is working the same. ka= |
From: <gre...@co...> - 2004-09-12 15:36:57
|
Kevin, Your answer makes sense. I guess all I really want to do is disable text entry so the user must choose one of the list items. I'm wondering if I'm using the wrong GUI component? For example on a web form, a drop-down box type thing only presents the preset choices, so I just want a GUI version of that type of webform thing. I'll play with the resource editor a bit, see if there's something that already works like that. Otherwise I'll look up how to just disable text entry. -Greg Kevin Altis wrote: > On Sep 11, 2004, at 5:11 PM, Gregory Piñero wrote: > >> A combobox lets me write text in it instead of forcing me to select >> one of its listed choices, however this text does appear to do >> anything as it does not show up in .stringselection. This is even the >> case when I type in the exact same text as a listed choice in the >> combobox. >> >> This could be a bug depending on the desired behavior here. I believe >> the desired behavior should be to not allow text entry into a >> combobox, or giving an option to turn on text entry. But if the user >> is allowed to enter his own text, it should be picked up somewhere, >> right? >> > I don't believe the underlying wxPython ComboBox does anything with the > text the user types in the field, but rather leaves it up to you to > decide whether you want to do some processing. PythonCard does not bind > the EVT_TEXT_ENTER event, but you can handle the keyPress event, and do > some processing if event.keyCode == 13, otherwise just call > event.skip(). That way if the user presses Return you can add the text > to the ComboBox list. You can use the keyPress or textUpdate event if > you want to look at the current text and then change the stringSelection > based on what the user has typed. I believe that by default the > selection will be changed only when the user clicks on the dropdown arrow. > > If PythonCard is not behaving the same as the ComboBox in the wxPython > demo then there could be a bug in the PythonCard component, but I'm > pretty sure it is working the same. > > 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 16:16:59
|
On Sep 12, 2004, at 8:38 AM, Gregory Pi=F1ero wrote: > Kevin, > > Your answer makes sense. I guess all I really want to do is disable=20= > text entry so the user must choose one of the list items. I'm=20 > wondering if I'm using the wrong GUI component? For example on a web=20= > form, a drop-down box type thing only presents the preset choices, so=20= > I just want a GUI version of that type of webform thing. > > I'll play with the resource editor a bit, see if there's something=20 > that already works like that. Otherwise I'll look up how to just=20 > disable text entry. > You want the Choice component. Maybe we should rename that component=20 DropDown or PopupMenu? ka |
From: <gre...@co...> - 2004-09-12 16:23:48
|
I'd vote for dropdown, but I figured in the future you guys would have a 'toolbar' in the resource editor where each component is a button with a picture of itself. Kind of like Visual Basic? Seems most intuitive to me that way. ah well, that's probably patented though ;-) -Greg Kevin Altis wrote: > On Sep 12, 2004, at 8:38 AM, Gregory Piñero wrote: > >> Kevin, >> >> Your answer makes sense. I guess all I really want to do is disable >> text entry so the user must choose one of the list items. I'm >> wondering if I'm using the wrong GUI component? For example on a web >> form, a drop-down box type thing only presents the preset choices, so >> I just want a GUI version of that type of webform thing. >> >> I'll play with the resource editor a bit, see if there's something >> that already works like that. Otherwise I'll look up how to just >> disable text entry. >> > > You want the Choice component. Maybe we should rename that component > DropDown or PopupMenu? > > 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: Alex T. <al...@tw...> - 2004-09-12 16:24:27
|
At 11:38 12/09/2004 -0400, Gregory Pi=F1ero wrote: >Kevin, > >Your answer makes sense. I guess all I really want to do is disable text= =20 >entry so the user must choose one of the list items. I'm wondering if=20 >I'm using the wrong GUI component? For example on a web form, a drop-down= =20 >box type thing only presents the preset choices, so I just want a GUI=20 >version of that type of webform thing. > >I'll play with the resource editor a bit, see if there's something that=20 >already works like that. Otherwise I'll look up how to just disable text= =20 >entry. Sounds like you just need a simple List component - fill in the items and=20 they can only choose one of them ... btw - don't be misled by the "minimallist" sample - that's really a=20 minimalmulticolumnlist I don't think there is a simple sample of a basic list - though the 'list=20 of samples' in the "Sample Launcher" is one. -- Alex. |
From: Alex T. <al...@tw...> - 2004-09-12 16:33:21
|
At 17:33 12/09/2004 +0100, Alex Tweedly wrote: >Sounds like you just need a simple List component - fill in the items and >they can only choose one of them ... Oops - missed the fact that you wanted a drop-down :-( Choice is of course what you wanted ... -- Alex. |
From: Kevin A. <al...@se...> - 2004-09-12 02:56:20
|
On Sep 11, 2004, at 4:48 PM, Gregory Pi=F1ero wrote: > I am wondering if I have run into a bug. In the textarea and=20 > textfield components, if I create them during runtime, and set enabled=20= > to false, it does not get grayed out and I am still able to edit the=20= > component. Additionally, I tried setting editable to false and nothing=20= > seemed to change from that either, as I appeared to be able to still=20= > edit the text. > > By the way, what is the difference between editable and enabled? > > 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 > > Here's the part of my code where I am creating the textfield. (sorry=20= > if email bungles the tabs.) > > editable=3D'False' > tooltip=3D'' > widgetDefn=3D{'type':'TextField', > 'name':'txt'+ column[0], > 'position':(xPosWidget, yPos), > 'text':'', > 'editable':editable, > 'enabled':editable, > 'toolTip':tooltip, = =20 > 'size':(20,-1)} > self.components[widgetDefn['name']]=3DwidgetDefn > Um, you aren't setting them to False, you're setting them to a string=20 'False' and all strings except the empty string '' evaluate to True.=20 Change the line above to: editable =3D False Enabled applies to all controls and determines whether those controls=20 get mouse clicks, whether the user can type text in them, select items=20= in a list, etc. Editable only applies to fields and determines whether=20= you can type text into the field or not. You can still copy text from=20 the field. The widgets sample shows off both attributes. BTW, please don't respond to another message to post a new question.=20 The mail message headers that mail clients use to show message threads=20= are still there even though your mail client may not show them, and so=20= it screws up the display of those threads. ka |
From: <gre...@co...> - 2004-09-12 15:31:08
|
Ah yes, silly mistake with using the string 'false'. My syntax highlighting doesn't pick up True/False, so I figured they weren't keywords... I'm still confused about the general False vs 0 issue in python, are they interchangeable? ..but that's off topic for for this list. Sorry for the false alarm. Greg Kevin Altis wrote: > On Sep 11, 2004, at 4:48 PM, Gregory Piñero wrote: > >> I am wondering if I have run into a bug. In the textarea and >> textfield components, if I create them during runtime, and set enabled >> to false, it does not get grayed out and I am still able to edit the >> component. Additionally, I tried setting editable to false and nothing >> seemed to change from that either, as I appeared to be able to still >> edit the text. >> >> By the way, what is the difference between editable and enabled? >> >> 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 >> >> Here's the part of my code where I am creating the textfield. (sorry >> if email bungles the tabs.) >> >> editable='False' >> tooltip='' >> widgetDefn={'type':'TextField', >> 'name':'txt'+ column[0], >> 'position':(xPosWidget, yPos), >> 'text':'', >> 'editable':editable, >> 'enabled':editable, >> >> 'toolTip':tooltip, >> 'size':(20,-1)} >> self.components[widgetDefn['name']]=widgetDefn >> > > Um, you aren't setting them to False, you're setting them to a string > 'False' and all strings except the empty string '' evaluate to True. > Change the line above to: > > editable = False > > Enabled applies to all controls and determines whether those controls > get mouse clicks, whether the user can type text in them, select items > in a list, etc. Editable only applies to fields and determines whether > you can type text into the field or not. You can still copy text from > the field. The widgets sample shows off both attributes. > > BTW, please don't respond to another message to post a new question. The > mail message headers that mail clients use to show message threads are > still there even though your mail client may not show them, and so it > screws up the display of those threads. > > 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 03:09:56
|
On Sep 11, 2004, at 2:02 PM, Arthur Elsenaar wrote: > Hi, > > some questions regarding the MultiColumnList. When I add items to the > MultiColumnList, automatically I get a Heading. Is there a way to > disable Headings all together? On OS X these headings take too much > vertical space. > > Another space related question, is it possible to narrow vertical > space, so rows become much smaller? I tried changing the font size, > but the row size doesn't change accordingly? > > Hi Arthur, I'm sorry but I don't know the answer offhand. Maybe someone that has used the underlying wx.ListCtrl will know. This might be a good question for the wxPython-users mailing list. ka |
From: Brad A. <bra...@ma...> - 2004-09-12 04:56:56
|
More questions about MultiColumnList: Is there a way to specify the width of a given column? How about justification of text to right/left/center? Can I highlight a column header to show that a given column has been selected for sorting? I haven't found much documentation on how to use MultiColumnLists, so I resorted to looking at multicolumnlist.py. I didn't see answers to my questions there, so I'm guessing those features don't exist yet in PythonCard. Should I start look into using wxPython calls when I need to do this kind of stuff? Thanks! |
From: Kevin A. <al...@se...> - 2004-09-12 06:38:45
|
On Sep 11, 2004, at 9:57 PM, Brad Allen wrote: > More questions about MultiColumnList: > > Is there a way to specify the width of a given column? > How about justification of text to right/left/center? > Can I highlight a column header to show that a given column has been > selected for sorting? > > I haven't found much documentation on how to use MultiColumnLists, so > I resorted to looking at multicolumnlist.py. I didn't see answers to > my questions there, so I'm guessing those features don't exist yet in > PythonCard. Should I start look into using wxPython calls when I need > to do this kind of stuff? > MultiColumnList wraps wx.ListCtrl so just look at that control in the wxPython demo as well as the wxWidgets/wxPython documentation. Just use the wxPython method calls for whatever you need to do. ka |
From: Alex T. <al...@tw...> - 2004-09-12 11:26:49
|
At 23:38 11/09/2004 -0700, Kevin Altis wrote: >MultiColumnList wraps wx.ListCtrl so just look at that control in the >wxPython demo as well as the wxWidgets/wxPython documentation. Just use >the wxPython method calls for whatever you need to do. I looked into the first question (Can I have a multicolumn list with no headers ?) There is a parameter to pass into wxListCtrl, but there's no equivalent in PythonCard. We'd need to add a "heading" field to the resource, and then use it to control whether or not wx.LC_NO_HEADER was passed in to wx.ListCtrl.__init__ Note this is an initialization-time only setting, can't be changed once the list exists. [ Kevin - I tried adding this as an extra parameter and found there's still some things I don't know about resources :-) I'll email you off-list about it .... ] There's a cheap hack that I used to test how it might work - use the existence (or not) of columnheadings to determine whether or not the list should have headings. Not the right long term answer, but a quick easy way to get it if you need it soon .... in components/multicolumnlist.py, at line 95, add if aResource.columnHeadings == []: rules |= wx.LC_NO_HEADER so you will then have if aResource.rules: rules = wx.LC_HRULES | wx.LC_VRULES else: rules = 0 if aResource.columnHeadings == []: rules |= wx.LC_NO_HEADER self._rules = aResource.rules etc. -- Alex. |
From: Arthur E. <ar...@ia...> - 2004-09-12 16:52:42
|
On Sep 12, 2004, at 13:37, Alex Tweedly wrote: > I looked into the first question (Can I have a multicolumn list with > no headers ?) > > There is a parameter to pass into wxListCtrl, but there's no > equivalent in PythonCard. We'd need to add a "heading" field to the > resource, and then use it to control whether or not wx.LC_NO_HEADER > was passed in to wx.ListCtrl.__init__ ah, good it's in wxPython. > Note this is an initialization-time only setting, can't be changed > once the list exists. does this mean one cannot do this in a pythoncard script, only in the framework because of the initialization order? Thanks, I'll try your suggestion. Arthur > There's a cheap hack that I used to test how it might work - use the > existence (or not) of columnheadings to determine whether or not the > list should have headings. Not the right long term answer, but a quick > easy way to get it if you need it soon .... > in components/multicolumnlist.py, at line 95, add > > if aResource.columnHeadings == []: > rules |= wx.LC_NO_HEADER > > so you will then have > if aResource.rules: > rules = wx.LC_HRULES | wx.LC_VRULES > else: > rules = 0 > > if aResource.columnHeadings == []: > rules |= wx.LC_NO_HEADER > > self._rules = aResource.rules > etc. > > -- Alex. |
From: Kevin A. <al...@se...> - 2004-09-12 17:08:26
|
On Sep 12, 2004, at 9:52 AM, Arthur Elsenaar wrote: > > On Sep 12, 2004, at 13:37, Alex Tweedly wrote: > >> I looked into the first question (Can I have a multicolumn list with >> no headers ?) >> >> There is a parameter to pass into wxListCtrl, but there's no >> equivalent in PythonCard. We'd need to add a "heading" field to the >> resource, and then use it to control whether or not wx.LC_NO_HEADER >> was passed in to wx.ListCtrl.__init__ > > ah, good it's in wxPython. > >> Note this is an initialization-time only setting, can't be changed >> once the list exists. > > does this mean one cannot do this in a pythoncard script, only in the > framework because of the initialization order? > > Thanks, I'll try your suggestion. > > Arthur > In general, if the PythonCard component doesn't support one of the styles supported by the underlying wxPython control, you'll have to subclass the PythonCard component or just modify it to suit your purposes. PythonCard will look for components in a directory called appcomponents in your main application directory before it loads from the default component list, so that can be used to override which version of a component is used if you want something application-specific. If you decide to provide you're own about the only thing you need to provide in the subclass is a replacement __init__ method, so just copy that from the original and change the style. In the case of this style, it is something that PythonCard really should support, so I'll make appropriate modifications to the multicolumnlist component and post something here once that is done. ka |
From: Alex T. <al...@tw...> - 2004-09-12 17:37:28
|
At 10:08 12/09/2004 -0700, Kevin Altis wrote: >On Sep 12, 2004, at 9:52 AM, Arthur Elsenaar wrote: > >> >>ah, good it's in wxPython. >> >>>Note this is an initialization-time only setting, can't be changed once >>>the list exists. >> >>does this mean one cannot do this in a pythoncard script, only in the >>framework because of the initialization order? It's passed in to the init function in wxPython; so the limitations apply equally to wxPython direct as to PythonCard. The limitation is that you can't change the "heading-ness" of the list - whatever it is when the list is created, so it remains. So if Kevin changes Pythoncard to allow this to be specified, you'll need to specify it the way you want in the resource editor - it won't be possible to leave headings off in the resource editor, and later add them from within the script, or vice versa. (Of course, you'll be able to leave them *blank* in the resource editor, and have the script supply the values, but not to change their existence.) -- Alex. |
From: Arthur E. <ar...@ia...> - 2004-09-13 12:38:59
|
On Sep 12, 2004, at 19:08, Kevin Altis wrote: > In general, if the PythonCard component doesn't support one of the > styles supported by the underlying wxPython control, you'll have to > subclass the PythonCard component or just modify it to suit your > purposes. PythonCard will look for components in a directory called > appcomponents in your main application directory before it loads from > the default component list, so that can be used to override which > version of a component is used if you want something > application-specific. If you decide to provide you're own about the > only thing you need to provide in the subclass is a replacement > __init__ method, so just copy that from the original and change the > style. > > In the case of this style, it is something that PythonCard really > should support, so I'll make appropriate modifications to the > multicolumnlist component and post something here once that is done. ok, added a directory 'appcomponents' next to my script, copied a modified version of multicolumnlist.py in there. In the __init__ of multicolumnlist.py, in line 92 I have added | wx.LC_NO_HEADER to the rules. I still have headings, so I suspect the modified version is not loaded. Any ideas what goes wrong here? Thanks, Arthur. |
From: Kevin A. <al...@se...> - 2004-09-13 14:54:25
|
On Sep 13, 2004, at 5:38 AM, Arthur Elsenaar wrote: > > On Sep 12, 2004, at 19:08, Kevin Altis wrote: > >> In general, if the PythonCard component doesn't support one of the >> styles supported by the underlying wxPython control, you'll have to >> subclass the PythonCard component or just modify it to suit your >> purposes. PythonCard will look for components in a directory called >> appcomponents in your main application directory before it loads from >> the default component list, so that can be used to override which >> version of a component is used if you want something >> application-specific. If you decide to provide you're own about the >> only thing you need to provide in the subclass is a replacement >> __init__ method, so just copy that from the original and change the >> style. >> >> In the case of this style, it is something that PythonCard really >> should support, so I'll make appropriate modifications to the >> multicolumnlist component and post something here once that is done. > > ok, added a directory 'appcomponents' next to my script, copied a > modified version of multicolumnlist.py in there. In the __init__ of > multicolumnlist.py, in line 92 I have added | wx.LC_NO_HEADER to the > rules. > > I still have headings, so I suspect the modified version is not > loaded. Any ideas what goes wrong here? > > Thanks, Arthur. > Sorry, I forgot to tell you that you also need a file named __init__.py in the appcomponents directory in order for the appcomponents directory to act as a package; that's how Python works. Just make a new blank file or copy the one that is already in the components directory. There are logging messages in the PythonCard framework to show what components are loaded and from where, so if you run your application with the -l command-line option you'll get a pythoncard.log file or output to stdout with a line that looks something like: DEBUG: : Mon Sep 13 07:48:07 2004: imported appcomponent multicolumnlist PythonCard customization note: Whether the output goes to stdout (the default) or not is controlled by a line in your pythoncard_config.txt file in ~/pythoncard_config/pythoncard_config.txt on *nix systems, including Mac OS X or your My Documents/pythoncard_config/pythoncard_config.txt or similar user directory on Windows systems, which is roughly equivalent to the home directory on *nix. The relevant lines are: 'logfile':'pythoncard.log', 'logToStdout':True, ka |
From: Arthur E. <ar...@ia...> - 2004-09-13 17:17:15
|
On Sep 13, 2004, at 16:54, Kevin Altis wrote: > Sorry, I forgot to tell you that you also need a file named > __init__.py in the appcomponents directory in order for the > appcomponents directory to act as a package; that's how Python works. > Just make a new blank file or copy the one that is already in the > components directory. that worked fine, thanks. There's one observation, probably a wxPython issue. When the heading is disabled, suddenly the scollbar at the right of the control becomes fully visible. Before, the lower button was just partly visible. I suspect the length of the scrollbar is wrongly calculated, the vertical size of the heading, when the heading is enabled. (on OS X) Another visual anomaly, a StaticText control doesn't clip the length of text beyond it's horizontal size. So far, start to like PythonCard as a replacement for my RealBasic development. When over time more of wxPython is incorporated and the IDE will be improved, it will be a terrific replacement for Rb. No more suffering the realbasic language, python is far superior imo. Thanks for your efforts! Arthur |