|
From: Kevin A. <al...@se...> - 2001-11-29 19:35:36
|
Time for the morning ramble... I've been doing lots of cleanup in the framework and samples. I hadn't looked at the findFiles sample since I first slapped it together and it wouldn't even run. This is one of those samples that I found useful, but I stopped using it because I wanted it to do a lot more and got out of the habit of using it. Now it not only works (or should work), but it can open and save .grep files just like the PythonWin IDE. I also added a feature to load a file with the textEditor sample and jump to a particular line when you double-click on line in the result list. So, now the sample is at least useful again (okay, useful to me). It turns out that the following methods in the wxPython wxTextCtrl (the PythonCard versions of these methods are in parens: GetNumberOfLines (getNumberOfLines) GetLineLength (getLineLength) GetLineText (getLineText) PositionToXY (positionToXY) XYToPosition (xyToPosition) all count a wrapped line in their calculations under Windows, but not on Linux; the Linux wxTextCtrl does all its calculations based just on newlines. If you use the wxHSCROLL (horizontal scrollbar) style under Windows, then text won't wrap and the method results will always match Linux. The horizontal scrollbar does not show up under Windows unless the longest line in the control is wider than the control width; Linux (GTK) never shows a horizontal scrollbar. I think I'm going to add an attribute to TextArea called "hscroll" which can be 1 (true) or 0 (false). Under Linux, if this attribute is true it will have no effect. I haven't added it yet, because I would prefer to have a solution to toggle the horizontal scrollbar and wrapping and I don't know how to pull that off. Also, I think this is the first attribute that is Windows specific and we should probably have a clear naming convention for platform specific methods and attributes. For now, if you are using the textEditor sample under Windows and it goes to the wrong line on a Go To, it is most likely because of line wrapping. Vadim (wx-dev) confirmed that as of 2.3.2 there is no way to suppress style info when pasting styled text or doing a drag and drop into a wxTextCtrl, so we'll just have to live with that limitation in TextArea. ka |