From: Luis M. G. <lu...@gm...> - 2006-07-17 12:12:08
|
Dear Carl, Thank you very much for your reply! Note that I had tried that already, but I'm affraid something is = wrong... In the wxPython demo, which has three columns, I saw three lines as = follows: self.list.SetColumnWidth(0, wxLIST_AUTOSIZE) self.list.SetColumnWidth(1, wxLIST_AUTOSIZE) self.list.SetColumnWidth(2, 100) Since my multicolumnlist is named MultiComlumnList1, I tried this: for i in range(len(columns)): self.components.MultiColumnList2.SetColumnWidth(i, = wxLIST_AUTOSIZE) but it didn't work. My question is: Since I have to resort to pure wxPython, what else should I do? I added these lines at the top: from wxPython.wx import * from wxPython.lib.mixins.listctrl import wxColumnSorterMixin Are they necessary? Since I'm referring to a wx.listCtrl instead of a MultiColumnList one, = how should I espress the "SetColumnWidth" method? Sorry for these very basic questions... Thanks again and best regards, Luis ----- Original Message -----=20 From: Carl Wenrich=20 To: Luis M. Gonzalez=20 Sent: Monday, July 17, 2006 4:36 AM Subject: Re: [Pythoncard-users] MultiColumnList: How to set columns = width? wx.listCtrl.SetColumnWidth(col, width) "Luis M. Gonzalez" <lu...@gm...> wrote: Hi there, I have looked into the MultiColumnsList demo,=20 but I still can't figure out how to set columns widths so I can = display the full text of each one. Ideally, I'd like each column width to be as long as the longest = item contained in it. How can I do it? Any hint would be highly appreciated... Luis = -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your = job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Luis M. G. <lu...@gm...> - 2006-07-18 01:51:40
|
Hmmm... does it mean that I have to create "MultiColumnList1" as a = wx.ListCtrl from scratch? I tried that, but I get a "cannot import wxlistctrl" error message, = which I guess has something to do with the resource file... Anyway, how does the Multicolumn list sample work? It is a pure PythonCard app, with no wxPython tricks, and it works just = the way I want... ----- Original Message -----=20 From: Carl Wenrich=20 To: Luis M. Gonzalez=20 Sent: Monday, July 17, 2006 10:22 PM Subject: Re: [Pythoncard-users] MultiColumnList: How to set columns = width? I think you're trying to use a feature that PythonCard doesn't = support, which is why I suggested going directly to wx. I don't think = you can use the Pythoncard reference (self.component.<whatever>), you = have to use the wx.<component name>.SetColumnWidth(col, width). Of = course you must have the "import wx" line at the top of the file. "Luis M. Gonzalez" <lu...@gm...> wrote: Dear Carl, Thank you very much for your reply! Note that I had tried that already, but I'm affraid something is = wrong... In the wxPython demo, which has three columns, I saw three lines as = follows: self.list.SetColumnWidth(0, wxLIST_AUTOSIZE) self.list.SetColumnWidth(1, wxLIST_AUTOSIZE) self.list.SetColumnWidth(2, 100) Since my multicolumnlist is named MultiComlumnList1, I tried this: for i in range(len(columns)): self.components.MultiColumnList2.SetColumnWidth(i, = wxLIST_AUTOSIZE) but it didn't work. My question is: Since I have to resort to pure wxPython, what else should I do? I added these lines at the top: from wxPython.wx import * from wxPython.lib.mixins.listctrl import wxColumnSorterMixin Are they necessary? Since I'm referring to a wx.listCtrl instead of a MultiColumnList = one, how should I espress the "SetColumnWidth" method? Sorry for these very basic questions... Thanks again and best regards, Luis ----- Original Message -----=20 From: Carl Wenrich=20 To: Luis M. Gonzalez=20 Sent: Monday, July 17, 2006 4:36 AM Subject: Re: [Pythoncard-users] MultiColumnList: How to set = columns width? wx.listCtrl.SetColumnWidth(col, width) "Luis M. Gonzalez" <lu...@gm...> wrote:=20 Hi there, I have looked into the MultiColumnsList demo,=20 but I still can't figure out how to set columns widths so I can = display the full text of each one. Ideally, I'd like each column width to be as long as the longest = item contained in it. How can I do it? Any hint would be highly appreciated... Luis = -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make = your job easier Download IBM WebSphere Application Server v.1.0.1 based on = Apache Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Alex T. <al...@tw...> - 2006-07-18 12:41:37
|
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 17/07/2006 |
From: Luis M. G. <lu...@gm...> - 2006-07-18 03:18:26
|
For some strange reason, it doesn't work that well with me... If I don't set column headers, it shows all the items in the columns = complete (no matter what width value I indicate). But if I set column headers, it gets messed up again. In any case, it doesn't matter if I set the width as 100 or 3000. The = columns always show the same width, with some strange behaviour too (it = takes more time to display data). Well, I'm too tired now... I'll try again tomorrow. Thank you! Luis ----- Original Message -----=20 From: Carl Wenrich=20 To: Luis M. Gonzalez=20 Sent: Monday, July 17, 2006 11:15 PM Subject: Re: [Pythoncard-users] MultiColumnList: How to set columns = width? i just tried self.components.ml.SetColumnWidth(0, 100) and it worked = just fine (ml is the name of a multicolumnlist component). |
From: Luis M. G. <lu...@gm...> - 2006-07-18 13:52:36
|
Thank you Alex! I tried all what you said, with different results: >>The default for a PythonCard MulticolumnList is that all columns will = be wx.LIST_AUTOSIZE (and the last one will be expanded to fill remaining = space). =20 >> That's why the MultiColumn example works :-) I have two nulticolumnlists, one is created and filled on_initialize, = and the other is filled when I select a record on the first one = (invoices - invoice details). The first one shows records as you said (like wx.LIST_AUTOSIZE), but = the second one cuts the headers and items text with a narrower width. >> PythonCard doesn't support calling SetColumnWidth, though you might = be able to call wx directly.=20 Actually, it works. But only if I use it after adding data to the multicolumnlist (not = before). And it only accepts integers as width parameter, (not wx.LIST_AUTOSIZE = and not even a variable containing an int). >> What PythonCard does support is setting the column width as part of = setting the column headings=20 >> (see the documentation in the comments of multicolumnExample.py, or = look at components/multicolumnlist.py to see what it does, in = particular _setColumnHeadings() ).=20 The demo code documentation talks about "SetColumnHeadings", which as = far as I know is not implemented. If I use "columnHeadings" for assigning a list of lists as you said, = this is what I get: sc.MultiColumnList2.columnHeadings =3D [ ['DESCRIPCION', = wx.LIST_AUTOSIZE], ... AttributeError: 'module' object has no attribute 'LIST_AUTOSIZE' (Same result if I use "setColumnHeadings"). However, it works if I only add the headers text with = "columnHeadings". My source could wouldn't be of much help, because it uses a mysql = database to display data, but I can send it to you if you want... Anyway, I'll experiment a litle more to see what I'm doing wrong... Thanks! LUIS ----- Original Message -----=20 From: Alex Tweedly=20 To: Luis M. Gonzalez=20 Cc: Carl Wenrich ; pyt...@li...=20 Sent: Tuesday, July 18, 2006 9:41 AM Subject: Re: [Pythoncard-users] MultiColumnList: How to set columns = width? Luis M. Gonzalez wrote:=20 Hmmm... does it mean that I have to create "MultiColumnList1" as a = wx.ListCtrl from scratch? I tried that, but I get a "cannot import wxlistctrl" error message, = which I guess has something to do with the resource file... Anyway, how does the Multicolumn list sample work? It is a pure PythonCard app, with no wxPython tricks, and it works = just the way I want... The default for a PythonCard MulticolumnList is that all columns will = be wx.LIST_AUTOSIZE (and the last one will be expanded to fill remaining = space). That's why the MultiColumn example works :-) PythonCard doesn't support calling SetColumnWidth, though you might be = able to call wx directly. What PythonCard does support is setting the = column width as part of setting the column headings (see the = documentation in the comments of multicolumnExample.py, or look at = components/multicolumnlist.py to see what it does, in particular = _setColumnHeadings() ).=20 You set the columnHeadings by simply assigning to 'columnHeadings', = with either 1. a list of strings or 2. a list of lists - containing a string, and a width (# pixels or = wx.LIST_AUTOSIZE or 3. a list of lists - containing a string, a width (as above) and a = format (e.g. wx.LIST_FORMAT_LEFT) Note that if you look at the column headings (e.g.=20 print self.theList.columnHeadings you will see only the string (titles). You can also do print self.theList.GetColumnHeadingInfo() to see the complete (i.e. string, width, format) column heading data. So you can do things like the following (typed carefully, but not = tested) .... self.theList =3D self.components.myMultiColumnList # these can generally be either Tuples or Lists ... Lists used = here for ease of typing=20 # a simple list of strings self.theList.columnHeadings =3D ['name', 'address', 'age'] or # a list of lists - each contains the string the for heading text, = and an integer for the width self.theList.columnHeadings =3D [ ['name', wx.LIST_AUTOSIZE], ['address', = wx.LIST_AUTOSIZE], ['age', = wx.LIST_AUTOSIZE] ] etc. =20 If this doesn't help - could you send a sample code/rsrc file to = explain isn't working ... btw - If I'm reading the code properly, it doesn't fully support a mix = of auto-sized and fixed-size columns - but that isn't explicitly stated, = so you may need to experiment if you need to do that (it does support it = - but once you have set some cols to be fixed-width, the ability default = to AUTOSIZE is lost, and thereafter you need to always use the explicit = method to specify wx.LIST_AUTOSIZE). --=20 Alex Tweedly http://www.tweedly.net -------------------------------------------------------------------------= ----- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: = 17/07/2006 |
From: Luis M. G. <lu...@gm...> - 2006-07-18 18:34:19
|
Please forget my previous email. All my confussion is because I've been trying many things at once... Summing up: 1) setColumnHeadings() doesn't work for me.=20 2) Asigning a list of lists to columnHeadings works, but I cannot use = "wx.LIST_AUTOSIZE" as width parameter. If so, I get this error: sc.MultiColumnList2.columnHeadings =3D [ ['DESCRIPCION', = wx.LIST_AUTOSIZE], AttributeError: 'module' object has no attribute 'LIST_AUTOSIZE' ( Although it works if I specify a integer instead ). 3) SetColumnWidth() works (but with the same caveat I described above). Also, I noted that I get different behaviours depending on when I add = data to the multicolumnlist: For example, if I use the "SetColumnwith" method, I have to add the data = first. On the other hand, if I use an assignment to "columnHeadings", I must = add the data later. In any case, the width must be specified with integers. So the only problem I have now is that I cannot use "wx.LIST_AUTOSIZE" = nor "wx.LIST_FORMAT_LEFT" for aligning items, for example. Luis |
From: Alex T. <al...@tw...> - 2006-07-18 20:58:10
|
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 17/07/2006 |
From: Alex T. <al...@tw...> - 2006-07-18 22:39:25
|
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 17/07/2006 |