Re: [Lazarus] Ideas for improving lazarus.dci code templates
I can only agree with all Graeme's remarks, except the last, which I think is a bit overkill. Michael. On Wed, 13 May 2009, Graeme Geldenhuys wrote: Hi, Over the years I have noticed some shortcomings in the lazarus.dci handling. Here are some of my ideas. Please comment on them before I create official feature requests in Mantis. * Lazarus should have seperate .dci files. One for custom user settings and one which contains the default .dci settings. That way if new default settings get applied to the lazarus.dci file, all users get it without the next Lazarus update. The lazarus.dci should live in the Lazarus install directory. Then we should have a user.dci in the profile directory. * If the user customizes an existing (default) code templates, they should be added to the user.dci file and override the default one. * This design which be extended even further to have language specific .dci files. Instead of lazarus.dci, rather have the following: - objectpascal.dci - java.dci - html.dci - javascript.dci etc... So as the IDE opens a file, lets say for example a index.html file, then the default code template for that file will be html.dci The synedit editor available on sourceforge already includes a lot of language specific dci files. I post those to mantis if needed. * Why doesn't the default lazarus.dci contain a repeat...until' code template. I always add it myself though. * Maybe project specific code templates could also be an option. I'm not sure is this is really relevant, but it might be handy. For example, I develop many tiOPF (Object Persistent Framework) applications. I have a lot of code templates for such projects. But if I work on a quick console application, those code templates are not needed. Some maybe Lazarus Packages or Project Options could contain an entry for project or packages specific code templates. Project Options is probably the better option. Your thought? Any new suggestions? Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Ubuntu 9.04 (Lazarus too slow)
On Wed, 6 May 2009, Graeme Geldenhuys wrote: On Wed, May 6, 2009 at 3:26 PM, Leonardo M. Ramé l.r...@griensu.com wrote: Does anyone faced the same problem? I don't have slowness, but I do have other graphics problems with fpGUI Toolkit and MSEgui and applications run under WINE. Ubuntu 9.04 has had some serious graphics bugs since the beta release and has not been fixed for the final release. I have reported it to Ubuntu while I tested the beta - the report was confirmed, but has not been fixed yet. I've updated my system will all available fixes and still the problem persists. I am considering downgrading to 7.10 or 8.04.2 LTS where everything still worked nicely. So in short - to anybody else out there... DO NOT UPGRADE TO Ubuntu 9.04 Or install KUbuntu 9.04, which works lightning fast, and so far without visible bugs. I updated a PC and a Laptop, and all went smoothly... Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Ubuntu 9.04 (Lazarus too slow)
On Wed, 6 May 2009, Graeme Geldenhuys wrote: 2009/5/6 Michael Van Canneyt mich...@freepascal.org: Or install KUbuntu 9.04, which works lightning fast, and so far without visible bugs. I updated a PC and a Laptop, and all went smoothly... Sorry Michael, but it has the same problem here. Run a fpGUI based application or Windows application under WINE. Look at any button, edit box, combobox, popup menu's bottom right corner. Use xmag to make it easier to see. Pixels missing due to drawing bug in XLib I believe. Ubuntu and Kubuntu has the same XLib version. I used XDrawLine directly to draw a rectangle corner to corner (left, top, right then bottom). The last line is shifted by 1 pixel. At least in Ubuntu 9.04 final they fixed the LCD font anti-aliasing bug. Hm. I will not dispute this, I don't use wine, and up till now I used only QT/GTK based apps, which don't seem to have the problem you mention. Qt uses it's own routines to draw, if I'm correct, probably this is why they haven't noticed/fixed this before the release... Other than that, I've used Kubuntu 9.04 to finally convince some people to switch to Linux, and I'm now definitely dropping OpenSUSE in favour of Kubuntu, so you won't hear me complain about it (yet) :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Latest RTL, FCL and LCL online docs
On Tue, 28 Apr 2009, Graeme Geldenhuys wrote: On Tue, Apr 28, 2009 at 12:54 PM, Vincent Snijders vincent.snijd...@gmail.com wrote: I tried to do it for the off line docs, but the --footer-date parameter is overridden by the --footer parameter which adds a link to the on-line documentation. So for now, also no date stamp in the off line documentation. As expected, but local help is not really an issue, seeing that it must be generated by the user itself. BTW: The process of generating local HTML help for LCL is pretty easy under Linux. Well done. Easier than RTL and FCL. ;-) What is so hard about typing make html ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Latest RTL, FCL and LCL online docs
On Tue, 28 Apr 2009, Graeme Geldenhuys wrote: On Tue, Apr 28, 2009 at 1:17 PM, Michael Van Canneyt mich...@freepascal.org wrote: What is so hard about typing make html ? /opt/fpcdocs_svn $ make html make -C ../compiler/utils msg2inc make: *** ../compiler/utils: No such file or directory. Stop. make: *** [../compiler/utils/msg2inc] Error 2 OK, so clearly 'fpcdocs_svn' must be in a different directory layout. The README.DOCS doesn't mention a required directory structure. Also the documentation repository (located at http://svn.freepascal.org/svn/fpcdocs/trunk) doesn't give any indication that it must be a sub-directory of FPC somewhere. The readme file also says that to create html help, it uses latex2html, but what if I am only interested in the class documentation for RTL and FCL? Onl HTML output, not the pretty PDF manuals that I always download. What make parameter do I pass in then - that doesn't require latex2html? Something that only uses fpdoc for html output? The following should do it: make rtl.chk make fcl.chk And you don't need latex2html, but tex4ht for the other things. I changed the README file so it's more correct. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Latest RTL, FCL and LCL online docs
On Tue, 28 Apr 2009, Graeme Geldenhuys wrote: On Tue, Apr 28, 2009 at 2:15 PM, Michael Van Canneyt mich...@freepascal.org wrote: The following should do it: make rtl.chk make fcl.chk And you don't need latex2html, but tex4ht for the other things. I changed the README file so it's more correct. Thanks, the description is now much better (clearer). I still have problems though. Can I use a symlink'ed docs directory? The layout is still as I shown in my previous email, but I get the following output. You can't use a symlinked docs directory, the link points in the wrong direction. You could try symlinked rtl/compiler/packages directories from the point of view of the docs. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Latest RTL, FCL and LCL online docs
On Tue, 28 Apr 2009, Graeme Geldenhuys wrote: On Tue, Apr 28, 2009 at 3:13 PM, Vincent Snijders vincent.snijd...@gmail.com wrote: I just do: FPCSRCDIR=/path/to/fpc/sources make rtl.chk FPCSRCDIR=$FPCSRCDIR That's even better. :-) Michael, could you add this to the readme file as well? Done. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Import Form from previous project
On Wed, 22 Apr 2009, German C. Basisty wrote: My fellow colegs: Im trying to import to my current project some form developed for an earlier project. So I copyed the .pas and .lfm from the older project folder to the current project folder, then I opened them via lazarus IDE and in the Project menú, choose the option to add the opened file to the current Project. Ok well, the form appears to be correct, and the IDE shows it OK as it was developed, but when I want to open it from my program (via ShowModal) it presents an Acces Violation error and the program fails. Any idea?? Did you add it to the list of forms to be auto-created (in project options) ? Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] revision numbers of each SVN tag?
On Tue, 14 Apr 2009, Graeme Geldenhuys wrote: On Tue, Apr 14, 2009 at 4:29 PM, Michael Van Canneyt mich...@freepascal.org wrote: Even in CVS - the mother of all revision systems - a tag could be moved, so there also it could be that you had to do a cvs up on a tag. Software evolves (hopefully) and we should not repeat prior mistakes. ;-) See my previous post. You miss the point, namely that a 'tag' is just a convention between people. Nowhere it says that a tag should be set in concrete to last unaltered for eternity. Every versioning software available provides a means to set a 'tag', and leaves it up to the users how to interpret 'tag'. I for one would never use software that makes a tag irrevocable: Errare humanum est... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Delphi wxWidget plugin for Lazarus
On Tue, 31 Mar 2009, svaa wrote: Hello: By the way, Watching the demo I can see that Lazarus compiles (or complies and links) very slow compared to codegear. And it is just hello world program. I have always felt the Lazarus was a little slow, but this demo has shown it clearly. In codegear, the click run pops a progress message for an instant and displays the application running, in Lazarus he has to wait several seconds to see the form running. Do you have any clue of such a difference of performance? This is a FAQ since day 1, I think :-) Delphi works with the compiler in-memory, as a DLL. Lazarus has an external compiler, and often the compiler even calls an external linker. This is a price you pay for a cross-platform solution. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Controlling DPI
On Sat, 28 Mar 2009, ik wrote: I would like to allow users to set their own DPI as they think it best for them. A zoom factor or the actual DPI ? The former is possible, the latter I have no idea how to do this. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Clipboard.HasFormat issue
Hi, Is there a reason why ClipBoard.HasFormat() is so slow ? Putting a call to ClipBoard.HasFormat() in an OnUpdate handler of an action coupled to a toolbutton, seriously slows down an application, to the point of being unusable. If I comment out the call, the application responds normally. This is on Linux (GTK1). I looked at the clipboard calls, but on the first look of things I see no reason why it should be so slow, except maybe the ClipboardGetFormats() call. The strange thing is that if something suitable is on the clipboard, the application responds normally. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Clipboard.HasFormat issue
On Sat, 28 Mar 2009, Hans-Peter Diettrich wrote: Michael Van Canneyt schrieb: Is there a reason why ClipBoard.HasFormat() is so slow ? Putting a call to ClipBoard.HasFormat() in an OnUpdate handler of an action coupled to a toolbutton, seriously slows down an application, to the point of being unusable. If I comment out the call, the application responds normally. The request may go to the clipboard owner, which is responsible for providing the clipboard contents in the various formats. The system also may search for conversion tools, capable to render the desired format from one of the supplied formats. This is on Linux (GTK1). I looked at the clipboard calls, but on the first look of things I see no reason why it should be so slow, except maybe the ClipboardGetFormats() call. I only know about the Windows clipboard, not on other systems. The graphics system should not be involved on any platform. The strange thing is that if something suitable is on the clipboard, the application responds normally. Isn't there a method EnumClipboardFormats, which should return only the currently available formats? The HasFormat() function calls EnumClipboardFormats, among other things. I'll investigate how it behaves if I call EnumClipboardFormats directly. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Easiest way to case strings
On Sat, 21 Mar 2009, Reenen Laurie wrote: Hi, I'm sure most of you have had this... is there an easy way to have a case statement that's based on strings rather than ordinal types. Is there somewhere a shortcut? The only solution I can think of is defining constants with strings and ordinal types... What I'd like to do is: case fruit of: 'apple' : 'pear' : 'banana': 'grape': else end; So the only solution I can think of is const fruitlist = (apple,pear,banana,grape); fruitstrings = ('apple','pear','banana','grape'); and then... for i := apple to grape do if fruit {string} = fruitstrings[i] then fruitvar := i; case fruitvar of apple : pear : banana : grape : else end; Any easier solutions to trying to run a case on a string? Well, you could try this: Program doit; uses sysutils; Function WordCase(Const S : String; Const Options : Array of string) : Integer; begin Result:=High(Options); While (Result=0) and (COmpareText(S,Options[Result])0) do Dec(Result); end; begin Case WordCase(Paramstr(1),['zero','one','two','three']) of 0 : Writeln('zero found'); 1 : Writeln('One found'); 2 : Writeln('Two found'); 3 : Writeln('Three found'); else Writeln('Unknown case : ',paramstr(1)); end; end. It works for me :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Exception dialog
On Mon, 16 Mar 2009, Hans-Peter Diettrich wrote: Michael Van Canneyt schrieb: Is there a reason why the default exception dialog has a cancel button to kill the application ? An unhandled exception IMO is due to some software bug, which the user cannot cure in any way. That's a very restrictive definition of exception. An exception is a way to stop the normal logic and flow of the program. In a GUI application, you rely on the program's event loop to catch the exception (so it is definitely handled) and to show it to the user. If you don't want it to be shown, use the Abort exception. Borland explains this use in detail in chapter 14 of the Delphi 7 manual. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Exception dialog
Hello, Is there a reason why the default exception dialog has a cancel button to kill the application ? We often use an exception to signal wrong entry of data or so, because it stops all further processing. If the user then uses the cancel button, the program is simply ended, which is not what we (or better: the users) want. And I imagine many others use this technique. I have overridden the OnException handler of TApplication, so it's no longer a problem, but I was curious as to why this is done like this by default ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Stringgrid woes...
On Fri, 13 Mar 2009, Jesus Reyes wrote: In Delphi, Setting EditorMode:=False; Saves the data (setedittext is called again). In Lazarus, it is not called. I'm taking notes. Great :-) I think it would also be a good idea to have an event which helps to validate the data. Something like Procedure TForm1.ValidateEntry(Sender : TObject; ACol,ARow : Integer; Var Value : String); begin // Do some things, possibly modify Value or raise exception. end; Which is called only once, when the data is saved finally. Currently, it's hard to do proper validation in a grid. Well, in my opinion of course... I thought the same and that's why I introduced grid.modified which has served me very well. But I agree that an event to do validation would be best, I will try to do something about it. I'll be glad to test, if you want. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Stringgrid woes...
On Sat, 14 Mar 2009, Sergei Gorelkin wrote: Michael Van Canneyt wrote: Not in delphi 7, I tested ? However, it is called when you set EditorMode explicitly to false. But never by itself. Yep, I was wrong, details tend to become forgotten with time :( But only partially. It is called when you finish editing by pressing Enter, or by moving current cell with the keyboard, or by activating another control. It is not called when you finish editing by mouse click elsewhere in the grid. .. or click directly on the 'OK' button which is supposed to save all data in the grid, which is what most of our clients seem to do... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)
On Sat, 14 Mar 2009, Paul Ishenin wrote: Bart wrote: Shouldn't we then strive to make SysUtils use locale settings on all platforms? As it is now, it's rather inconsistent. Maybe I should ask on the pfc mailinglist? As I know the core of the fpc rtl (and sysutils is there) does not want to depend on the libc but clocale unit is using it. Thus developers must decide themself whether to include it or not. But we can simple use it in some basic LCL unit as we do with cwstring so the problem will be solved. I dont know what other lazarus developers think about this. Since you use Libc anyway, I think this is the best way for the time being. Unless of course Graeme Geldenhuys works through his meanwhile astronomic TODO list and implements the Locale checking himself in 100% Object Pascal :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Stringgrid woes...
Hello, The stringgrid editor does the following: procedure TStringCellEditor.Change; begin inherited Change; if FGridnil then begin FGrid.SetEditText(FCol, FRow, Text); end; end; procedure TStringCellEditor.EditingDone; begin inherited EditingDone; if FGridnil then FGrid.EditingDone; end; This makes it completely impossible to do any checking of the entered values, because the SetEditText() event has no way of knowing when the editing ends. In my opinion, the SetEditText() should only be called when the editing is done, i.e. it should be like this: procedure TStringCellEditor.Change; begin inherited Change; end; procedure TStringCellEditor.EditingDone; begin inherited EditingDone; if FGridnil then begin FGrid.SetEditText(FCol, FRow, Text); FGrid.EditingDone; end; end; Imagine a stringgrid where you want to allow only real numbers in a cell. In that case you normally do 2 things: - Only allow numerals and decimal points in the OnKeyPress event - Only save the edit text when a valid number is entered, and give an error message if it is not valid. With the current situation, this is simply impossible, because of the following: 1. User types 1 - Settext receives 1 - all is well. 2. User types . - settext received 1. - error, because 1. is not a valid number. In other words, there is no way of knowing when you have received the final text that the user has entered. Is there a reason for the current behaviour, and can it be changed ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Stringgrid woes...
On Fri, 13 Mar 2009, Sergei Gorelkin wrote: Michael Van Canneyt wrote: ... Is there a reason for the current behaviour, and can it be changed ? With Delphi, I used to check the grid.EditorMode property in OnSetEditText handler, and skip all validations when EditorMode=true. Didn't check this with LCL, but there's a good chance it works. It doesn't, because Editormode is alwaus true in the OnSetEditText handler. I tested that. Also, during testing I discovered that setting EditorMode:=False; doesn't save the value, while IMHO it should. Apart from any workarounds around supposed bugs, calling SetText on each keystroke is IMHO also simply very inefficient (not to mention unnecessary) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Stringgrid woes...
On Fri, 13 Mar 2009, Jesus Reyes wrote: This makes it completely impossible to do any checking of the entered values, because the SetEditText() event has no way of knowing when the editing ends. In my opinion, the SetEditText() should only be called when the editing is done, i.e. it should be like this: procedure TStringCellEditor.Change; begin inherited Change; end; procedure TStringCellEditor.EditingDone; begin inherited EditingDone; if FGridnil then begin FGrid.SetEditText(FCol, FRow, Text); FGrid.EditingDone; end; end; This suggest that there should not be distinction between grid's OnSetEditText and OnEditingDone so why do we need both?. Imagine a stringgrid where you want to allow only real numbers in a cell. In that case you normally do 2 things: - Only allow numerals and decimal points in the OnKeyPress event - Only save the edit text when a valid number is entered, and give an error message if it is not valid. With the current situation, this is simply impossible, because of the following: 1. User types 1 - Settext receives 1 - all is well. 2. User types . - settext received 1. - error, because 1. is not a valid number. In other words, there is no way of knowing when you have received the final text that the user has entered. Is there a reason for the current behaviour, and can it be changed ? The grid behaves that way for the same reason there is a TEdit.OnChange event, I'm afraid there is no way to know that final text has been entered using this event. Is this different on Delphi? I would like to improve compatibility if it's not. If OnSetEditText is enough in Delphi to know when editing is finished then I think we should do it also. Hm. Did some checking in delphi. It behaves the same. So better leave it as it is. Bad :( Oh well, now I know again why I don't want to use grids for editing. But customers disagree, unfortunately :( Currently the assumed way to know when the final text is entered is using OnEditingDone no OnSetEditText, maybe this is not working but I was aware that OnEditingDone was triggered for several causes not necesarily only when user ended editing, for this reason I usually do following on OnEditingDone of grid cells that need validation. if grid.Modified then begin [Do validation on col,row cell. Revert changes if not validated, etc] grid.Modified := false; end; The problem is that the actual data is not in the grid cells, so reverting it would not be that easy. Is there a way to force the grid to save the data ? That would help, actually... In Delphi, Setting EditorMode:=False; Saves the data (setedittext is called again). In Lazarus, it is not called. I think it would also be a good idea to have an event which helps to validate the data. Something like Procedure TForm1.ValidateEntry(Sender : TObject; ACol,ARow : Integer; Var Value : String); begin // Do some things, possibly modify Value or raise exception. end; Which is called only once, when the data is saved finally. Currently, it's hard to do proper validation in a grid. Well, in my opinion of course... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Stringgrid woes...
On Fri, 13 Mar 2009, Sergei Gorelkin wrote: Jesus Reyes wrote: Is this different on Delphi? I would like to improve compatibility if it's not. If OnSetEditText is enough in Delphi to know when editing is finished then I think we should do it also. It appears to be different then. In Delphi, OnSetEditText is called multiple times during editing (with grid.EditorMode=True), and when the editing is complete, it is called once with grid.EditorMode=False. Not in delphi 7, I tested ? However, it is called when you set EditorMode explicitly to false. But never by itself. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Code Folding mess and Code Divider feature
On Fri, 13 Mar 2009, Martin Friebe wrote: Graeme Geldenhuys wrote: Hi, This relates to the new bug report: http://bugs.freepascal.org/view.php?id=13322 Code Folding seems to have gone way overboard! It simply makes the editor look like a mess at the moment (Lazarus svn trunk revision). What is the end goal of code folding? Maybe is in the middle of the overall goal and I am simply acting to quickly. Either way, I will voice my concerns... There is a general plan/idea to add some configuration (have to see how much) to define what you want to have foldable and what not. It wasn't seen as urgent yet (at least not by me...) Most (if not all) of the places that allow folding now, do so in Delphi as well. this is part of why they have been added, to make it easier for (ex-) Delphi users. IMHO most of the new ones are reasonable? - Except maybe for: Program / Unit and Implementation / interface; but they don't occur very often in a normal unit. - Maybe discussable are var Canost type blocks? Think is they can be very useful for bigger var sections (but I agree they can be irritating with just on line in it) - Folding at class / private / public = IMHO should be ok? - Folding at procedure in addition to the begin = arguable, if it should be instead of the begin? Will be interested to see, if other people will voice opinions, which of the new foldings they like, which not As long as it can be switched off, you won't hear me complaining :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MySQL Database Component and Parameter Binding
On Mon, 2 Mar 2009, Andrew Brunner wrote: Can anyone tell me if the MySQL Database component in Lazarus does Parameter Binding for Insert and Update? Yes. I'm needing a Component to implement binding parameters for Insert and Update methods. I also need a component that enumerates tables and fields and allows me to manage them if they don't exist (both Tables/Fields) etc. This component exists in the data dictionary components, I use it actively. (for firebird, but it should work in MySQL as well). The database desktop (delivered with Lazarus) uses it as well. Check it out, if you are missing some features let me know and we'll see what can be done. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GPL'ed projects and closed-sourced tools
On Tue, 3 Mar 2009, Graeme Geldenhuys wrote: Hi, I got told in the CodeGear newsgroups that if you create a GPL'ed project, the tools used to create that project must also be GPL'ed otherwise somebody might require a commercial compiler to compile the GPL'ed project. I have never heard anything like this before. As far as I understand, if a project is GPL'ed, it relates only to that project or projects based on the original project. It has nothing to do with what tools (compiler, editor, IDE, OS, etc) you used to create that source code. Is my assumption correct? Your assumption is correct. There are many GPL projects that can be compiled with MSVCC or Borland C++, and these can hardly be called open source tools. It is of course 'good practice' to use open source tools for an open source project for obvious reasons, but there is no requirement to do so. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PBear and Gecko SDK components in Lazarus..
On Fri, 27 Feb 2009, domini...@savagesoftware.com.au wrote: Hi all, From reading this thread... http://forum.lazarus.freepascal.org/index.php/topic,6158.15.html It seems that Phil had done some work in getting PBear working with Lazarus. Does anyone know who Phil is, and if this is now available from SVN? I am interested in both PBear and GeckoSDK working with Lazarus apps, particularly on Windows and Mac OS X. Currently I have an application which uses PBear with Delphi on Windows and it works really well. Having it work on Mac OS X with Lazarus/FreePascal would be the easiest porting route, but I'm willing to consider GeckoSDK as an alternative just to ensure cross-platform browser support. I tried GeckoSDK once, but I never got it to work. Compiling was not a problem, but it never worked correctly; The first call to initialize Gecko invariably crashed the application. You might be better off trying to fix PBear. I use it myself, and IMHO it should be easy to port. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Examples of IniPropStorage?
On Sat, 21 Feb 2009, David W Noon wrote: On Sat, 2009-02-21 at 19:06 +0100, Luca Olivetti wrote: En/na David W Noon ha escrit: [snip] If there are none, could somebody please give me a quick sample they have knocked up for their own use? Thanks in advance. Drop a TIniPropStorage on the form, let's call it FormStorage. Put all properties you want to preserve in the form SessionProperties (there's a nice dialog to add what you want). If you know beforehand the location of the .ini file, just set it in the TIniPropstorage at design time, otherwise assign it in FormCreate. Also in FormCreate call restore. When you want to save, just call save, e.g.: procedure TSettingsForm.FormCreate(Sender: TObject); begin FormStorage.IniFileName:=SettingsFilename; FormStorage.Restore; end; procedure TFormAjustes.SaveButtonClick(Sender: TObject); begin FormStorage.Save; end; Thanks for that, Luca. The code is putting me in the right direction. Now, how do I actually extract key/value pairs from it and store key/value pairs into it? The only property I have found that looks likely is the StoredValues collection, but this is too kludgey to be true, e.g.: Name_field.Text := Ini_props.StoredValues['Name'].Value; That seems to be the sequence required to get a string, and it seems to segfault if the .INI file is empty. Moreover, the ReadString() method also segfaults if I use that method instead of the property, e.g.: Name_field.Text := Ini_props.ReadString('Name', 'missing'); The second approach has much neater syntax, plus it allows me to specify a default value if the required section of the .INI file lacks a value for that key. But I get access violations when the .INI file is empty. Attached is a patch for propertystorage; Could you please test if you still get the access violation when the patch was applied ? Michael.Index: propertystorage.pas === --- propertystorage.pas (revision 17626) +++ propertystorage.pas (working copy) @@ -680,11 +680,13 @@ function TCustomPropertyStorage.ReadString(const Ident, DefaultValue: string): string; begin + StorageNeeded(True); Result := DoReadString(RootSection, Ident, DefaultValue); end; procedure TCustomPropertyStorage.WriteString(const Ident, Value: string); begin + StorageNeeded(False); DoWriteString(RootSection, Ident, Value); end; ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 0.9.26, 0.9.26.1, 0.9.26.2, 0.9.27 ou 0.9.28? (Silvio Cl écio)
On Mon, 16 Feb 2009, Felipe Monteiro de Carvalho wrote: 2009/2/16 Vincent Snijders vincent.snijd...@gmail.com: I have a feeling something got lost in the translation from Portuguese to English or from English to Dutch in the next paragraph, because I don't understand your point. Basically he said he was very disappointed by the Linux Lazarus 0.9.26 He probably installed the Gtk 1. Yes, gtk 1 does look like crap. But it's very near it's grave now. Well, To old-time linux/unix users such as myself, it does not look like crap. GTK 1 was revolutionary in its days. The GTK1 target is maybe not the most flashy one by current standards, but it does its job, requires WAY less resources than GTK 2 and is a hell of a lot faster. For this reason I still use it daily. Gtk 2 is already the standard, so 0.9.28 should have a much better default look. And the possibility of using Lazarus in Linux with LGPL-Qt 4.5 will give a huge jump in quality. Why is that ? Is Qt so much better than GTK ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to query Enabled/Disabled component state?
On Tue, 10 Feb 2009, Graeme Geldenhuys wrote: Hi, Something weird I just noticed. I have not tested this under Delphi 7, but I have tested it with Lazarus GTK1 and GTK2 widget set. See attached image to help explain If I do Panel1.Enabled = False, all components are disabled (visually). This is what I expected. But if I now query Edit1.Enabled, it returns True. Also if I query CheckBox2.Enabled it also returns True. Is this a bug? For some reason I expected all child components to be Enabled = False, because that's what they are. Once Panel1 is disabled, I cannot set focus or interact with any child components. They are even painted in disabled state. How do I pragmatically detect if a component is really enabled or disabled? Seems that the logical way of quering the component's Enabled property gives false information. No, it gives the correct information. You should use CanFocus for what you need. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking and Layout managers
On Mon, 9 Feb 2009, Mattias Gärtner wrote: Zitat von Hans-Peter Diettrich drdiettri...@aol.com: Mattias Gärtner schrieb: Maybe I misunderstood your proposal. What parts of TWinControl should be moved to TContainerControl? Do you want to move the ControlCount and Controls properties to TContainerControl? Yes, all the child control related stuff. I'd move that into the LayoutManager, and redirect all related methods and properties to that helper object. Then the LayoutManager is as exchangable as the DockManager. What about TControl.Parent? It will be of type TContainerControl, of course. I admit that the tests for TWinControl have to be revised accordingly, but there remains more to do. E.g. it's nonsense when TWinControl redirects docking and other messages to TControl, which then again delegates the job back to its own TWinControl parent. All that docking and child control handling stuff should be entirely removed from TControl, and also from TWinControl, and instead should be moved into the layout and docking helper objects. I'm just about to find all that stuff, and to implement a direct connection between e.g. TDragManager, TDockPerformer, and the DockManager. The legacy interface of all classes can survive that update, the revised methods only will redirect the tasks immediately to the final worker object. These are highly desireable changes, regardless of whether we introduce a new layout layer class or not. We might use conditional compilation, so that in case of trouble the old class tree remains intact, for debugging and as a last resort in case of trouble with legacy code. IMO we should cut some of the old trees, in order to see the wood for trees again. First of all: Yes, that would be better from object oriented point of view. But: At least 90% of TWinControl is about its child controls. The rest is mostly key, mouse and focus handling. I guestimate, TContainerControl will have about 1-3kloc code, 500loc will stay in TWinControl and the remaining 4-6kloc will go to the new docking/layout classes. There is no question, that such a big change is Delphi incompatible. The question is how much: - A lot of code (outside the LCL) relies on the fact, that AControl.Parent is a TWinControl and has a handle (exact: can have a handle). The compiler will not find all places that needs to be fixed. For example: procedure RecursiveCall(AWinControl: TWinControl); begin for i:=0 to ControlCount-1 do if Controls[i] is TWinControl then RecursiveCall(TWinControl(Controls[i])); end; This recursive call won't find all children anymore. So all users have to check every place manually, where TWinControl is used and maybe replace it with TContainerControl. I don't think this is a very good idea. Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] creating multiple non-modal form instances
On Tue, 3 Feb 2009, Graeme Geldenhuys wrote: Hi, I have a listing screen (grid based) that allows various views and filters - selected by the user. I want the user to be able to open multiple instances of that listing screen. Each with there own views and filters. How do I create such multiple instances? Do I keep calling something like the following: Application.CreateForm(TLearnerListForm, frmBrLearners); frmBrLearners being a global variable of TLearnerListForm. Though I hate global variable! Just do a With TLearnerListForm.Create(Application) do begin Initialize; Show; end; You can keep track of them with the Screen.Forms property: For I:=0 to Screen.FormCount-1 do If Screen.Forms[i] is TLearnerListForm then and that's it. Well, at least in Delphi, but I assume lazarus can do the same. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] creating multiple non-modal form instances
On Tue, 3 Feb 2009, Graeme Geldenhuys wrote: On Tue, Feb 3, 2009 at 11:20 AM, Michael Van Canneyt mich...@freepascal.org wrote: Just do a With TLearnerListForm.Create(Application) do begin Initialize; Show; end; Where is Initialize defined? I only found InitializeWnd, or did you mean Initialize is a custom method I wrote myself? The latter, yes :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ptInRect question
On Fri, 30 Jan 2009, Hans-Peter Diettrich wrote: Michael Van Canneyt schrieb: Is there a reason why the top/left sides are included (=), and the left/bottom sides are not included ? I would expect them to be included as well. There exist reasons, mostly the definition in the WinAPI. Thanks to you, and everyone else, for the answers. All I really needed to know is whether the cursor is at an edge of a rectangle (above a selected object, in fact). And in that case it turns out that ptinrect is definitely out Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TFileStream
On Thu, 29 Jan 2009, Dave Coventry wrote: = snip === case ftype of 43://'+' begin FS:=TFileStream.Create(fname, fmshareDenyWrite); Try FS.Seek(pos,soFromBeginning); FS.ReadBuffer(fldheader[0],4); increm:=LEtoN(PLongInt(fldheader)^)+1; for m:=0 to 3 do begin fldheader[m]:=increm and 255; increm:=increm shr 8; end; FS.Seek(pos,soFromBeginning); FS.WriteBuffer(fldheader[0],4); - Fails here Finally FreeAndNil(FS); end; end; end; = snip === Continuing on the same block: I am trying to read a block of 4 bytes, increment it by one and write it back again. However, if fails on the write. Probably because you failed to specify fmOpenReadWrite. fmshareDenyWrite does not automatically mean write access. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] ptInRect question
Hi, I have a question regarding the following function: function PtInRect(const Rect : TRect;const p : TPoint) : Boolean; begin PtInRect:=(p.y=Rect.Top) and (p.yRect.Bottom) and (p.x=Rect.Left) and (p.xRect.Right); end; Is there a reason why the top/left sides are included (=), and the left/bottom sides are not included ? I would expect them to be included as well. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ptInRect question
On Fri, 30 Jan 2009, dmitry boyarintsev wrote: AFAIK, Delphi compat.Here's the delphi code from Types unit. function PtInRect(const Rect: TRect; const P: TPoint): Boolean; begin Result := (P.X = Rect.Left) and (P.X Rect.Right) and (P.Y = Rect.Top) and (P.Y Rect.Bottom); end; I found this out already, but why, what is the rationale ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Canvas clipping ?
Hi, Is TCanvas clipping supported ? I set cliprect, but nothing happens... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TFileStream
On Mon, 26 Jan 2009, Dave Coventry wrote: Hi AJ. I was under the impression that this: FS:=TFileStream.Create(fname, fmshareDenyWrite); Try FS.ReadBuffer(hdbuffer[0],32); Finally FreeAndNil(FS);- end; would free the File Pointer to be used again. That is correct. Do you suggest that I use another variable when I do it the second time? That should absolutely not be necessary. Is it possible to specify that the program only uses one thread? This is so by default, unless you create threads yourself ? More likely is simply the fact that the file cannot be locked. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TFileStream
On Mon, 26 Jan 2009, Dave Coventry wrote: 2009/1/26 Andrew Brunner andrew.t.brun...@gmail.com: Actually, I'm thinking you're creating a memory problem with using fillchar and passing the pointer to the dynarray instead of the element. Try using FillChar with the zero element again... The reason why the construction maybe failing is b/c a potential memory leak created by not using the zero element of the dynarray you are using. So you're saying that if I miss out the Fillchar function, it will work a expected? Apart from the fact that my array won't be filled with spaces, of course. That is what he is saying, yes. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Not sure if the Laz Devs have seen this...
On Sat, 24 Jan 2009, Florian Klaempfl wrote: I used git and mercurial at work for small projects to test things a little bit and both are a real pain compared with svn and I saw no increased productivity for small projects and I cannot imagine how this should be different for fpc or lazarus. - line ending conversion is at the same poor level as cvs: you often end with full diffs by accident when working on different systems. Ok, I admit editing files on a unix system through a samba share with a windows editor is uncommon but I often do it and it breaks horrible with git and hg. - no blocking of revisions to merge: svnmerge has a nice feature which allows to block revisions to be merged to a branch. This is neither possible with git nor with hg as far as I can see and at least fpc uses it heavily. - I often forgot a hg up after an hg push/hg pull and ended with files full of conflicts due to this. Thanks for these remarks. The real reason I keep my eye on git is that Subversion is a real pain if you have a lot of branches. Tracking all revisions of a file accross branches (something we do a lot at work) is incredibly slow. The subversion graph takes meanwhile a full 5 minutes to build up. But my remark was not meant to indicate that we should switch to git as a main repository. I merely wanted to say that providing mirrors of SVN in other systems is something we can consider. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sat, 24 Jan 2009, Graeme Geldenhuys wrote: On Fri, Jan 23, 2009 at 7:16 PM, Hans-Peter Diettrich drdiettri...@aol.com wrote: I then downloaded the swingdemoapp.jar file and ran it via the command line. I got a swingdemoapp.jnlp, and a swtdemoappbase.jar. Here is a direct link to the .jar file. http://www.miglayout.com/swingdemoapp.jar I just tried this on a different machine. Downloaded the latest .jar file as show above and launched the demo using: java -jar swingdemoapp.jar I played around with this demo; Looked at the code. What's the big fuss all about ? The same things you see there can be easily done in Lazarus ? Whether I write - rather obscure - layouting code for the start as displayed there, or I write a 'OnResize' event handler and do some minor adjustments myself (the improved anchoring of lazarus gets you a long way), the fact remains that I must take care of the layouting by writing code manually ? If you had a nice property editor, maybe then it would be better. Even so, creating a usable property editor for such a complicated matter is not going to be easy, I think. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sun, 25 Jan 2009, Graeme Geldenhuys wrote: On Sat, Jan 24, 2009 at 1:40 PM, Michael Van Canneyt mich...@freepascal.org wrote: What's the big fuss all about ? * the layout manager can do complex layout without nesting panels or other layout managers. * Auto resize of components so translation text NEVER gets clipped. I have fixed things like this a 100 times in Lazarus, until the next person edits something in that form, or somebody changes something in the widgetset code. With LCL as used in Lazarus IDE, such things are always broken. * No over lapping components (a constant issue in Lazarus IDE) * Automatic button order based on the platform - built into the layout manager. No extra components required like the ButtonPanel in LCL. * Automatic border and spacing widths based on the platform - built into the layout manager. eg: Mac OS-X has bigger form borders that Windows, GTK etc.. * Totally screen resolution independent. Max / Min and Preferred components sizes are taken into account. * DPI independent. * Unit sizes can be specificed in %, inches, cm, pixels, mm, etc.. * The original Java MiG Layout is toolkit independent. It's very simple to add new toolkit support. I hope to make the port the same. * Built-in debug mode, to help with layout design and debugging. .the list goes on! ;-) I'm sure it does, but I simply doubt it will result in me less fidgeting. The syntax may look strange in the beginning, but it's quite easy to learn. Also you would probably only use a handy full of syntax commands to complete most layouts. The rest of the supported syntax is for more advanced designs and features, but not required to be able to use the layout manager. You confirm my doubts: the 'handy full' can probably be achieved with lazarus easily as well ;-) But hey, by all means, surprise me !! I'll be glad to be proven wrong. Anyway, we had this discussion once. It'll be interesting to see you come up with a non-text version in terms of properties, collections and whatnot. And then of course a nice intuitive property editor. With this I mean: a drawn representation of all components in the form, (maybe scaled) click on each control, and specify it's properties. Now wouldn't that be nice ? :-) If you make the properties, I'll make the editor :) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where to place definition of a record?
On Sun, 25 Jan 2009, Dave Coventry wrote: Hi, I'm following a suggestion for producing my own records so that I can define a custom TStringlist as detailed in this article: http://dn.codegear.com/article/33423 However, I am unsure of where to post this code and am wondering if someone would advise me. === snip === unit mvlists; {$mode objfpc}{$H+} interface uses Classes, SysUtils; type TNameValueRecord = record This should be class, not record. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Not sure if the Laz Devs have seen this...
On Thu, 22 Jan 2009, Dave Coventry wrote: Please don't shoot me: :) Why would we do this ? I just thought you might be interested in this: http://www.theregister.co.uk/2009/01/21/git_gaining_ground/ Git is certainly promising (I keep an eye on it since some time), but a bit hard on the beginning programmer. If there is an interest, then maybe we can set up a git mirror of the SVN repository; There seem to be tools for this. I believe we have already a mercurial mirror, so we're open-minded :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Fatal: Internal error 200208151
On Thu, 22 Jan 2009, User wrote: I get the error: Fatal: Internal error 200208151 This is an internal compiler error; We need more information about how you got this to be able to help. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Linux
On Wed, 21 Jan 2009, Bernd Mueller wrote: c...@freemail.hu wrote: Thanks for the answers and suggestions everyone! The speed issue I have is that simple things, like popup menues, clicking on tabs of a pagecontrol, changing tasks ...almost everything is handled too slowly. Compared to what I am used to, the delay is quite disturbing. The other kind of slowness is that when the screen is refreshed it is slow enough to see the different areas refreshing one by one. All together it feeling is similar to working in a web browser. The PC is an older one: Celeron 1700 CPU, 512MB RAM, 200GB HDD (10 GB for Ubuntu), Integrated Video, but I think it should be decent enough for running Linux. There was enough free RAM so the slowness could not have been caused by disk swaping either. So, one thing is already clear, I will need a proper driver for the video card for sure. But realy would not want to be offtopic any longer, I better go to the Ubuntu forums to seek for more specific help. I am running Ubuntu 6x, 7x, 8x and Windows XP/2000 in VMs on the same machine and have the same impression as you: For me, Windows feels snappier than Ubuntu Linux. I run Windows 2000 under a VMWare in linux, and it is dog slow. I think we are more measuring the speed of VMWare and their drivers than the actual guest OS. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Sqlite usage
On Fri, 16 Jan 2009, SteveG wrote: Is it possible to have the sqlite3.dll library (WinXP) dynamically loaded rather than static linked into my Laz program ? The sqlite dll is not in the Windows path (by choice), and I would like to be able to point my prog to it at run time. At the moment, I just have the sqlitedb unit in the 'uses' of my app. The SQLDB sqlite connection loads the library dynamically. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] real user name
On Wed, 14 Jan 2009, Reenen Laurie wrote: Ok, so if I want code in which I want to get the username, which is crossplatform... how should it look? {$ifdef windows} username := GetEnvironmentVariable('USERNAME'); {$endif} I'm not sure if this is correct; There is a windows call to get the current user name. {$ifdef linux} GetUserData(FpGetuid, Data); username := Data.pw_uid; {$endif} How about MacOS? For MacOS the linux construct should work ? Also, as a matter of interest... what types are FpGetuid and Data? Integer (or word) and pw_nam, I think ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FYI: qt is going to be LGPL
On Wed, 14 Jan 2009, Felipe Monteiro de Carvalho wrote: This is just fantastic. It really adds a lot of value to the lazarus-qt interface. And even more, it becomes a viable substitute for the gtk2 interface in UNIXes. The only problem being that Qt 4.5 would be required, which means that at the moment no distribution supports it out of the box. Why such strict requirement for the version ? This says to me that as soon as a system updates to Qt 4.6 all is possibly broken ? That seems like a very bad situation, which IMHO should be solved rather quickly, because it severely limits the usefullness of the Qt interface. The GTK interface works on a relatively wide range of GTK 2 versions, which is a good thing. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] real user name
On Wed, 14 Jan 2009, Reenen Laurie wrote: Sorry for digging up an old thread... I just want to know... Is this code crossplatfrom? GetUserData(FpGetuid, Data); Result.Name:= Data.pw_name; Result.Real_name:= Data.pw_gecos; Result.User_id:= Data.pw_uid; Result.Group_id:= Data.pw_gid; Result.home_dir:= Data.pw_dir; Result.shell:= Data.pw_shell; It definitely won't work on Windows, but all unix-like platforms should be fine. Michael. If not, is some of it? Specifically the Data.pw_name Regards, -Reenen On Thu, Dec 4, 2008 at 11:23 AM, Andrea Mauri andrea.mauri...@gmail.comwrote: Marco van de Voort ha scritto: In our previous episode, Andrea Mauri said: I solved using GetUserData procedure from users unit. GetUserData(FpGetuid, Data); Result.Name:= Data.pw_name; Result.Real_name:= Data.pw_gecos; Result.User_id:= Data.pw_uid; Result.Group_id:= Data.pw_gid; Result.home_dir:= Data.pw_dir; Result.shell:= Data.pw_shell; Note that that avoids _unit_ libc but not _library_ libc. That said, the above example code will probably work well on FreeBSD and OS X too (contrary to _unit_ libc) That's what I want. a. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus -- Dr. Andrea Mauri, PhD Milano Chemometrics and QSAR Research Group Department of Environmental Sciences University of Milano-Bicocca P.zza della Scienza, 1 20126 Milano - Italy Tel: ++39 02 64482801 mailto:andrea.mauri...@gmail.com http://michem.disat.unimib.it/chm/ ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus -- o__ ,_./ _ (_)_\(_)___ ...speed is good ___ I believe five out of four people have a problem with fractions. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Randomize
On Tue, 30 Dec 2008, Lv wrote: Randomize seems to be 1 second dependent on the system clock. I cannot remember if this used to be the same in Borland Delphi/Pascal The example below shows a 1 second tick sensitivity to random number creation. Am I missing something? uses unix,crt; VAR dummystring,filename : String; randomnumber : Int64; hellfreezesover : Boolean; BEGIN hellfreezesover:=False; Repeat Randomize; randomnumber:=Random(999); writeln('randomnumber=',randomnumber); Until (hellfreezesover or keypressed); END. This is normal behaviour. Randomize initializes the random seed with a value it retrieves from the clock. You must call Randomize exactly once in your program, never in a loop, something like this: Randomize; Repeat randomnumber:=Random(999); writeln('randomnumber=',randomnumber); Until (hellfreezesover or keypressed); Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FpGUI Interface - basic TLabel
On Wed, 24 Dec 2008, Andreas Maier wrote: Hello, last days i've played with implementig (basic) TLabel-support for the fpGUI-Interface. I have now a few basics running. (under Win32, but i will test it under linux x86_64 too). Does it make sence to implement more things for the fpGUI-Interface at the current state of fpgui? fpGUI is up to it, so this should not be a problem, I think. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] about gif images
On Sun, 21 Dec 2008, C Western wrote: Mattias Gaertner wrote: Do you have a fpimage reader for gif? Mattias I put together a GIF reader based on fpimage a little while ago. I hadn't offered it for lazarus as it was based rather heavily on a unit in the RXLibrary, and I wasn't sure of the copyright. I note though that the relevant RXGif unit is in turn based on a freeware C library. Can anyone advise? I suspect that the fpimage reading code is sufficiently different ? Maybe you can put it under modified LGPL, but say that it is based on ideas/code found in the RXGif unit ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] flickering on statusbar panel
On Fri, 19 Dec 2008, Mattias Gaertner wrote: On Fri, 19 Dec 2008 11:52:18 +0100 Andrea Mauri andrea.mauri...@gmail.com wrote: The code I wrote in the e-mail is just a sample! Anyway, create a new project, drop a label, a statusbar and a button on the form. Create a panel on the statusbar. On buttonclick drop the following code: procedure TForm1.Button1Click(Sender: TObject); var i: integer; begin i:= 0; while i 1 do begin // Application.ProcessMessages; label1.Caption:= Format('Number: %d', [i]); statusbar1.Panels[0].Text:= Format('Number: %d', [i]); Inc(i); end; Clicking on the button the text in the statusbar panel start to be updated, and it flickers. The text in the caption is updated only at the end of the while do cycle. Great. There you have the bug. The statusbar should not update, just like the label. As far as I know, in Delphi the statusbar updates immediatly, contrary to a label. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] csvexporter
On Tue, 16 Dec 2008, Andrea Mauri wrote: I am developing a cross platform application. Yesterday I dropped a csvexporter on a form (and I was under win). The lazdbexport unit have been added by the IDE. Then today, working on my Ubuntu pc at home I tried to recompile the same project and I got an error (lazdbexport unit not found), so I opened an empty project and I dropped csvexporter on the form. The IDE added the fpccsvexport unit, so I introduced the IFDEFs. I supposed that the IFDEF were in the package. There are none ? There is no OS-dependent code in the exporters. Anyway I used the csvexporter just a bit and it seems to work fine both on win and linux :). This is strange, because the unit is called fpcsvexport.pp ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] What is current status of fpGUI?
On Tue, 9 Dec 2008, Aleksa Todorovic wrote: Hi, all! In the team I am part of, we are evaulating several GUI frameworks for our next project. One of the options (and I hope one we will choose, since other member of the team are more into some C++ solution) is to use Lazarus with fpGUI. We need fpGUI, because we need our GUI to be skinnable. Now, here are questions I have: 1) Does fpGUI in current version supports creation of skinnable applications? 2) I've followed instructions on http://wiki.lazarus.freepascal.org/fpGUI_Interface, but I got this error when I try to compile Lazarus with fpGUI: I would at this point not recommend to use fpGUI with the LCL. You can however use fpGUI standalone, and that works fine and stable. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Examples of lazDaemon
On Fri, 5 Dec 2008, User wrote: I have installed the lazDaemon package but I do not know how to create a Daemon application. I need some examples. Check the examples/cleandirs directory for an example. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Curved text
On Tue, 2 Dec 2008, Mattias Gärtner wrote: Zitat von Michael Van Canneyt [EMAIL PROTECTED]: Hi, Does anyone by any chance have a routine to draw curved text ? aggpas has. I didn't use it yet with fpimage. Aha. Thanks for the hint, I'll have a look. Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Curved text
Hi, Does anyone by any chance have a routine to draw curved text ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SQLConnector
On Mon, 1 Dec 2008, Joost van der Sluis wrote: Op maandag 01-12-2008 om 16:48 uur [tijdzone +0100], schreef Andrea Mauri: where I can find information about how to use the SQLConnector component? Is it a general object that can be used to connect to different database types (SQLlite, Firebird, MySQL...)? That's the idea. I saw the property ConnectorType (string), how can I set it? Is TSQLConnector already usable? You could try, but if I'm correct there are some fundamental flaws in it's design. Just one, actually: the object counts are 'wrong' as you pointed out once... I still didn't find a workable solution for that. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] The db-aware controls allow editing a readonly-dataset
On Thu, 27 Nov 2008, Joost van der Sluis wrote: Hi all, When a dataset is read-only, the db-aware controls allow editing. The changes aren't send to the dataset, though. Which is very confusing for the user. I don't know how to fix it. I can change TDatalink.ReadOnly so that is checks if the dataset is ReadOnly. But, for exmple, TDBEdit.Readonly directly passes the result of TDatalink.Readonly. And I checked with Delphi and there TDBEdit.Readonly is false, even if the TDataset is readonly. That is because the readonly is the TCustomEdit.ReadOnly, no ? You can set a edit read-only, even if the field is read-write, so this is normal in my eyes. But if the TDataset is readonly then the edit should of course also give readonly=True. Alternative is to check in TDBEdit.IsReadOnly and relatives... ? Please explain ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus with Oracle database
On Thu, 27 Nov 2008, Graeme Geldenhuys wrote: On Wed, Nov 26, 2008 at 5:15 PM, Michael Van Canneyt [EMAIL PROTECTED] wrote: Based on the amount of things you want to try and do, I estimate that there must be at least 11 clones of you in South Africa. Or else you live in a time-warped part of the time/space continuum. hehehe... And my body is feeling the strain!!! 2 weeks before I have a well deserved 3 week holiday which includes a 8 day motorcycle tour with my very pregnant wife. :-) I can't wait! I wish I could go with you. My motorcycle is built for such trips :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus with Oracle database
On Wed, 26 Nov 2008, Graeme Geldenhuys wrote: Hi, Has anybody user Lazarus, SqlDB and Oracle? Is there any major issues, or is it smooth sailing. I want to try out the free Oracle Database 10g Express Edition under Linux. http://www.oracle.com/technology/products/database/xe/index.html Based on the amount of things you want to try and do, I estimate that there must be at least 11 clones of you in South Africa. Or else you live in a time-warped part of the time/space continuum. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Turbopower's OnGuard or some licensing package
On Fri, 14 Nov 2008, Graeme Geldenhuys wrote: Is there a port of Turbopower's OnGuard component to Lazarus or Free Pascal? The original one is very Win32 specific. I also found a Kylix CLX version at: http://tponguardclx.sourceforge.net/ So if nobody ported OnGaurd to Free Pascal yet, maybe the latter link my help. I'm looking for a licensing package. Something that can limit the number of connections to a DB backend (optional - not a critical feature), system being unlocked to a single system only (copy the application to another system, or do to much hardware changes and the application is blocked again) etc... Anybody know of such components that work cross-platform (yes there are many for Windows only, but ours need to work under Linux and Windows). Onguard works fine for this, I've used it myself ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Performance of GTK 2 and CE
On Fri, 14 Nov 2008, Graeme Geldenhuys wrote: On Fri, Nov 14, 2008 at 1:47 PM, Mark Morgan Lloyd Apropos cross-compiling and noting that I was using a big-endian processor, I did notice that the uidesigner icons were blank but didn't want to mention it until I'd got x86 and SPARC working in parallel so knew what was expected. Images support in fpGUI is very basic. In only supports limited format BMP files. Does 'fpimage' included in Free Pascal and used by Lazarus LCL I believe work? If so, then the fpGUI image issues should be resolved when I start implementing fpcanvas and fpimage support into fpGUI early next year. Lazarus uses fpimage for quite a few formats. If that works, then it should work for fpGUI too... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forums on www.lazarus.freepascal.org is virtually unusable
On Thu, 13 Nov 2008, Florian Klaempfl wrote: Maybe Michael H. can find out why it's slow and then we can look for solutions how to improve it for example by moving part of the site to another machine. And while you're at it, update the look of the lazarus site, so it is more in sync with the freepascal/wiki one. The contrast is rather big... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Bug 0012616
Hi, Someone entered bug ID 0012616. I confirm this bug, it's really annoying because you can't edit a single imagelist any more :( I did a SVN update today, and got this error, so it must have been a recent change that caused this. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SVN integration into Lazarus IDE (suggestions)
On Fri, 7 Nov 2008, Paul Ishenin wrote: Michael Van Canneyt wrote: I second this. Borland has (had) a special API in the IDE for this. Specifically, this would mean that lazarus provides an interface in ideintf, which is then implemented for various version control systems... Dont complicate already complicated task at the begining. Let's Darius implement svn plugin at first and then you will push him to make it more generic. Of course! I'm happy to see that there is a plugin at all :-) Since I use Subversion, the SVN plugin is a perfect start for me :-) But not everyone uses SVN, so... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SVN integration into Lazarus IDE (suggestions)
On Fri, 7 Nov 2008, dmitry boyarintsev wrote: Imho, it's better to make Generic Version Control integration plugin, rather than SVN plugin. So actually ANY version control tool can be used with the same GUI (CVS, SVN, Git .. and others). All control tool provides common features, like: file comparing, commite/update/revert, add/remove files with version controlled project. I second this. Borland has (had) a special API in the IDE for this. Specifically, this would mean that lazarus provides an interface in ideintf, which is then implemented for various version control systems... Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus repository in Git (summary)
On Thu, 6 Nov 2008, Graeme Geldenhuys wrote: Hi, As promised, here is the final details of comparing SubVersion and Git using the *full* Lazarus history. So there is no doubt that Git is extremely optimized for size and it's very impressive how much information it can store in such a little space. Plus it will save considerable download time. All this is very correct, but largely irrelevant. I considered Git for use in my company, (subversion is quite bad for handling lots of banches) and frankly: I decided against it because people here couldn't understand it. They have a hard time understanding Subversion (or CVS or any of it), and git is even 2 notches harder to understand. That and the fact that there is no decent GUI clinched the matter. Sometimes one must weigh the technical features against practical usage. I can have the best technical system of the world, but if I'm the only one understanding it - in my company - it is simply ruled out. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Grid question
Hi, How can I force the grid to invalidate (or draw if visible) a single cell ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Grid question
On Tue, 4 Nov 2008, Graeme Geldenhuys wrote: On 11/4/08, Jesus Reyes [EMAIL PROTECTED] wrote: How can I force the grid to invalidate (or draw if visible) a single cell ? grid.InvalidateCell(ColIndx,RowIndex); That is what I also expected... Jesus Reyes A. Just curiousbut why would you need that? Isn't the grid painting double buffered? Well, I have a special grid mediator that must redraw a TCustomDrawGrid cell, but I don't want it to do this unless it is absolutely necessary. So I tell the grid to invalidate the cell and have it figure out whether the repaint is needed or not. (and in doing so, it calculates all needed parameters such as the cell rectangle and so on) For a stringgrid, setting the cell text will do whatever is needed, but that doesn't work in a TCustomDrawGrid. But somehow the InvalidateCell doesn't show up in the code completion. I just get Invalidate, which I found strange, and so I asked the question. I'll investigate this. Thanks to everyone for the answers. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Fix for bug in TTabcontrol/TPageControl/TNotebook
Hi, The TNBPages(TStrings) class does not implement the GetObect and PutObject calls of TStrings correctly. That is, If I do a MyNoteBook.Pages.AddObject('SomeString',SomeObject); the SomeObject is simply lost. (logical, PutObject is not implemented) Instead, the MyNoteBook.Pages.Objects returns a reference to the TCustomPage used by the notebook. This is of course horribly wrong :( It's easy enough to fix this by correctly implementing TNBPages.PutObject and fixing TNBPages.GetObject. I can do this, but before I do this, I would like to know if there is LCL code that relies on the fact that Pages.Objects return references to the actual TCustomPage instances ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE idea
On Sun, 2 Nov 2008, Mac Programmer wrote: I've been working recently with QGIS (www.qgis.org), a slick, cross- platform, Qt-based GIS. QGIS has a feature that is so cool, you almost have to see it to appreciate it. But here's a brief description anyway: QGIS supports plugins written in Python. If you've developed a nifty plugin, all you have to do is zip up your files, post the .zip on your Web site, then supply your users with the URL of a simple .xml file (called a plugin repository). For example: plugins pyqgis_plugin name=MyPlug version=0.0.1 descriptionDescription goes here./description homepage/ file_namemyplug.zip/file_name author_nameMy Name/author_name download_urlhttp://my.web.site/myplug.zip/download_url /pyqgis_plugin /plugins When your user enters this URL in QGIS's Plugin Installer, it downloads the .zip file, unzips it in the .qgis folder in your home folder (~ or C:\Documents and Settings\username), and adds it to the list of available plugins that can be activated in QGIS. But wait, there's more. If you select a plugin in the list that is not installed, the button says Install Plugin. If it's already installed, the button says Reinstall Plugin (useful if you suspect that you've corrupted or deleted some of the plugin's files). And if a _newer_ version is available, the button says Upgrade Plugin. You can manually have it scan all the repositories you've entered or optionally let it scan all repositories automatically when QGIS starts up. If it finds a plugin that you have installed and there's a newer version available, this is listed at the top of the available plugins list and highlighted in bold. It seems as though something like this might be useful in the Lazarus IDE for listing, downloading, installing and updating available packages. For example, perhaps the Installed Packages dialog could be extended to include this kind of feature. Selecting a package from a list of available packages in a repository XML would download and unzip the package source files under ~/.lazarus, then proceed with compiling the .lpk file and re-compiling Lazarus to install the package. This would also be useful for keeping up to date automatically with the latest version of a package that you use. As it is now, the way in which packages are made available can be different for each package and keeping up with the latest package version requires manually checking each package site. This might also help package authors and porters to keep their package up to date. At any given point in time it seems as though half the packages for Lazarus are broken (won't compile). Maybe this would be a way of automatically testing which packages, say on CCR, are broken and alerting the authors. We are working on such a system, it's called fpmake and fppkg. FPC itself will be converted to this, Lazarus too. And, it's written in 100% Object Pascal. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Commercial components for Lazarus
On Wed, 29 Oct 2008, [EMAIL PROTECTED] wrote: Hello List, I have written a post to the database section of the Lazarus forum about a commercial database engine recently ported for Lazarus, which made me think about the whole Commercial components for Lazarus issue. This is a part of that post: (It can be found here http://www.lazarus.freepascal.org/index.php?name=PNphpBB2file=viewtopicp=27411#27411) Lazarus is a free software, which is good, but I would pay for it just to get the chance to develop crossplatform in a Delphi like style. I believe it is important for the future of Lazarus to attract the developers of quality commercial components to port their work for Lazarus. And it is already happening. The big question is if the Lazarus community is willing to realize how valuable it is to have the wealth of quality commercial components for Lazarus we already have for Delphi. Are they willing to pay for it? I certainly hope they see that it is for the benifit of everyone. It could open the way to port a lot of Widows only Delphi projects for different platforms. Many times a suitable 3rd party component can save lots of time and money, so it is more efficient to spend the money on buying a good 3rd party product. What everyone thinks about this? What is the question exactly ? I understand it as: Would the lazarus community pay commercial developers to port their components ? Am I correct ? Michael ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Commercial components for Lazarus
On Wed, 29 Oct 2008, [EMAIL PROTECTED] wrote: Would the lazarus community pay commercial developers to port their components ? Am I correct ? Oh no. :) Simply: What is the attitude of the developers, who are using Lazarus as their development tool? Would they buy commercial 3rd party components to improve thier applications? Is the Lazarus community a financially viable target for the developers of such components? I would buy such components, no problem. As long as they come with source included. This is a prerequisite, even when I buy delphi components. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Commercial components for Lazarus
On Wed, 29 Oct 2008, Graeme Geldenhuys wrote: On Wed, Oct 29, 2008 at 2:42 PM, [EMAIL PROTECTED] wrote: Oh no. :) Simply: What is the attitude of the developers, who are using Lazarus as their development tool? Would they buy commercial 3rd party components to improve thier applications? Is the Lazarus community a financially viable target for the developers of such components? If it saves me a lot of time, I would be more than happy to pay for something. That goes for any tools I use - commercial or free. The best tool for the job wins! Just the other day I bought Nero for Linux simply because it worked better that the hordes of open-source cd writing software out there. Hm. And here I am, hoping that K3B will finally be included in the next windows... :) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] TListview issues
Hi, We're trying to implement dragdrop from/to a TListView. There are several issues: 1. The selected listitem is not yet set when the drag is initialized. This prevents knowing which item in the list is being dragged, and this is the initial problem. Trying to work around this, we hit 2 other problems: 2. When a drag is started (OnStartDrag event), the X,Y positions are unknown, so they cannot be initialized in a TDragObject object which we would create. We can work around this by saving the X,Y in the onmousedown object and create a TDragObject in the OnStartDrag event where we store the saved X,Y. Using GetItemAt should then enable us to determine which item is being dragged. But then we hit the third problem: 3. TListView.GetItemAt(X,Y) retuns the wrong item when ShowColumnHeaders=True. As far as we can see, it returns the next object in the list, and Nil on the last item. In short, we're stuck... This is tested both under GTK1 and GTK2. Has someone succesfully used drag drop using GTK (or windows, for that matter) ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Rotating a bitmap
Hi, How can I rotate a bitmap 90° counterclockwise ? Alternatively, how can I read/write the pixels in the bitmap ? I found ReadChannels/WriteChannels from RawImage, but they use a strange kind of position object which I don't understand :( (an alternate answer is to implement rotated fonts in GTK1 ;)) Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotating a bitmap
On Mon, 27 Oct 2008, Graeme Geldenhuys wrote: 2008/10/27 Michael Van Canneyt [EMAIL PROTECTED]: Hi, How can I rotate a bitmap 90° counterclockwise ? To save you the trouble... :-) http://www.efg2.com/Lab/ImageProcessing/RotateScanline.htm http://www.delphi-central.com/tutorials/RotateBitmapBitBlt.aspx http://delphi.about.com/cs/adptips2001/a/bltip1201_4.htm Thank you, but I already saw those prior to asking my questions. None of the techniques described there work in Lazarus. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotating a bitmap
On Mon, 27 Oct 2008, Vincent Snijders wrote: 2008/10/27 Michael Van Canneyt [EMAIL PROTECTED]: Hi, How can I rotate a bitmap 90° counterclockwise ? Alternatively, how can I read/write the pixels in the bitmap ? I found ReadChannels/WriteChannels from RawImage, but they use a strange kind of position object which I don't understand :( Maybe the lazintf example (http://svn.freepascal.org/svn/lazarus/trunk/examples/lazintfimage/) can help. It rotates an image. Exactly what I needed. TLazIntfImage is the missing link :-) Thanks to everyone for the links ! Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotating a bitmap
On Mon, 27 Oct 2008, Reenen Laurie wrote: I had a similar problem... Eventually I moved on to GLscene... Though obviously it's probably not at all what you want to do, but it's pretty easy to rotate things there. :-) obj.rollangle := obj.rollangle + 90; You can use an orthogonal camera if you don't want / need the perspective. You can even let it slowly rotate using a cadencer, but let's not jump the gun here. All I need is to display a text at a 90° angle. Since GTK 1 doesn't support rotated text (hint hint), I draw the text on a bitmap, rotate that 90 degrees and display the bitmap, when I detect GTK1 as a widget set :-) Requiring OpenGL for this would be slightly over the top, I'm sure you'll agree :-) Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotating a bitmap
On Mon, 27 Oct 2008, Luiz Americo Pereira Camara wrote: Michael Van Canneyt escreveu: All I need is to display a text at a 90° angle. Since GTK 1 doesn't support rotated text (hint hint), I draw the text on a bitmap, rotate that 90 degrees and display the bitmap, when I detect GTK1 as a widget set :-) Take a look at the unit i pointed. It has a class that does specifically this. Indeed it does. Thanks for the hint. I'll use my implementation since it uses the built-in rotated font if available. (and it was ready anyway :-) ) Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotated text ?
On Fri, 24 Oct 2008, Paul Ishenin wrote: Michael Van Canneyt wrote: Hi, Is it possible to draw text at a 90° angle ? Yes. Gtk1 does not support it but win32, qt and gtk2 supports. I use GTK 1 :( You can find an example in the TDockHeader.Draw method (ldocktree.pas). OK, thank you. I'll have a look. How can one detect the used widget set in a binary ? Thanks to everyone for the answers ! Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Rotated text ?
On Fri, 24 Oct 2008, Felipe Monteiro de Carvalho wrote: 2008/10/24 Michael Van Canneyt [EMAIL PROTECTED]: How can one detect the used widget set in a binary ? That one is easy: ldd myexecutable If it links to gtk1, it must be using the gtk1 widgetset =) This one I could have found myself :-) But what I meant: There is no property in the LCL that can be checked ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Rotated text ?
Hi, Is it possible to draw text at a 90° angle ? Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Mantis statistics
On Wed, 22 Oct 2008, Graeme Geldenhuys wrote: Hi, Does Mantis have a statistics page we can view? Things like new reports per month or week. Resolved reports per week or month. Bug reports per release etc, etc... I'm just curious - are the bug reports becoming more or less for every release? Yes I know statistics can be skewed depending on how you read the data, but I simply want to see a general overview of what's happening behind the scenes. There is such a page, but I don't think it is available for 'normal' users. Only devels/mantis managers can view this page. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WebService API for Mantis?
On Wed, 22 Oct 2008, Marc Weustink wrote: Graeme Geldenhuys wrote: Hi, Is there some external or webservice API for Mantis? For example: Can I write a Lazarus GUI program to view and submit bug reports, without using a Web Browser? Similar to what CodeGear has with there bug reporting system. If there is a WebService API, I guess a GUI bug reporting program will make for a very nice WebServices demo for FPC and Lazarus. :-) See http://www.futureware.biz/mantisconnect/ Don't know how this will affect the load on the server. Pieces of Mantis like user prefs/permissions aren't coded in the most efficient way. This should not make any difference. Since it's coded as a SOAP webservice, it should be a piece of cake to connect with WST and create a GUI layer. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Mantis statistics
On Wed, 22 Oct 2008, Florian Klaempfl wrote: Graeme Geldenhuys schrieb: On Wed, Oct 22, 2008 at 9:55 AM, Michael Van Canneyt [EMAIL PROTECTED] wrote: There is such a page, but I don't think it is available for 'normal' users. Only devels/mantis managers can view this page. Why? There is no secret information about a graph showing project summary information? The reason is probably load. Generating the graphs takes several seconds for e.g. FPC. Indeed. But I'm sure Graeme can make a small app which calls and caches this page, so we can run it once per day and store it's result as a static page :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpmake build system in latest FPC
On Fri, 17 Oct 2008, Henry Vermaak wrote: On 17/10/2008, Vincent Snijders [EMAIL PROTECTED] wrote: Mattias Gärtner schreef: Zitat von Graeme Geldenhuys [EMAIL PROTECTED]: Is Lazarus going to switch to the fpmake build system? Henry Vermaak created an example for use with fpGUI - I could never get it working before. It seems quite impressive and is very customizable and all done in something I know - Object Pascal. I hope, yes. Michael VC tried to create a fpmake for the LCL. I don't know the state. Maybe we should let the fpc team switch first, so the system gets better tested. yes, i wonder if an fpc dev can tell us what the status of this is. fpmake is a great tool, and so much more flexible than make. Peter Vreman got everything working locally. However, he is very busy professionally, and therefore it is more or less sleeping now. What needs to be done now is mostly organisational: - Set up a central repository - Start testing the FPC release with it. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where is form instance being NIL'ed
On Tue, 14 Oct 2008, Graeme Geldenhuys wrote: Hi, When a new form is created using Application.CreateForm(), the form's global instance variable is passed in as well. Now if that form's CloseAction = caFree, where is that instance variable assigned nil after it was freed? It is not, unless you set it to nil in the BeforeDestroy event. Using that variable is a very bad idea anyway. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] infinite loop due no OnChange event firing
On Mon, 13 Oct 2008, Graeme Geldenhuys wrote: Hi, In tiOPF with LCL widgetset we hit a little snag. We react to the OnChange event of a TEdit. In GTK1 we have no issues. In GTK2 we get a core dump as soon as the text has changed (first key being pressed). Here is a discussion about the issue between Michael and myself. Michael thinks it's normal, I think it's a bug in LCL. Small correction: I don't think it is 'normal', but I do think one never should rely on this behaviour :-) At the very least, all widget sets should react in the same manner: if the TEdit.OnChange event is not fired in GTK 1, it should not fire in Windows or GTK 2 or Mac either. And the latter is demonstratably not the case now; So this should definitely be fixed. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] infinite loop due no OnChange event firing
On Mon, 13 Oct 2008, Graeme Geldenhuys wrote: On Mon, Oct 13, 2008 at 11:05 AM, Michael Van Canneyt [EMAIL PROTECTED] wrote: Small correction: I don't think it is 'normal', but I do think one never should rely on this behaviour :-) My apologies... :-) At the very least, all widget sets should react in the same manner: if the TEdit.OnChange event is not fired in GTK 1, it should not fire in Windows or GTK 2 or Mac either. And the latter is demonstratably not the case now; So this should definitely be fixed. Agreed! What is weird is that for the same of being complete, I created three test applications. One TEdit and one TButton. The edit has the text 'Hello' set at design time. The Button's OnClick will assign the value 'Hello' to TEdit. Edit1.OnChange simply does a writeln to the console to show it has fired. Button1.OnClick does a writeln() before and after the call to Edit1. This application was created for fpGUI, LCL-GTK1 and LCL-GTK2. I can't reproduce the error we experienced in tiOPF+LCL applications. Edit1.OnChange doesn't seem to fire now... :-( But it does in tiOPF+LCL apps. :-/ IMHO because you should change the exit.text in the edit.onchange event, only then the effect will occur. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus questions (auto complete, searching, docking, edit height)
On Fri, 10 Oct 2008, John Stoneham wrote: 2008/10/10 Michael Van Canneyt [EMAIL PROTECTED] On Fri, 10 Oct 2008, John Stoneham wrote: On Fri, Oct 10, 2008 at 5:34 AM, Mattias Gärtner [EMAIL PROTECTED]wrote: Zitat von Marius [EMAIL PROTECTED]: -Would it be a problem to have a seperate IDE window for the structure view instead of a fixed one in the object inspector. IMO the current structure view is to small and it is also limiting the size of the object explorer. At the moment you can only use the splitter between to change the size. I too would like to have an option to separate the Object Inspector into two windows. My current project has over 700 objects on the main form, and having the tree-view of the objects share space with their Properties/Events is a real pain. Why not use the object drop-down instead of the treeview ? I never use the treevies ? Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus The dropdown list is even worse than the treeview when you have close to 1,000 objects on a form. Could be, I never had SO many objects :-) Maybe you should split the form up in frames, then ? Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Frames
On Tue, 7 Oct 2008, Mattias Gärtner wrote: The IDE now supports TFrame. See here for already working features: http://wiki.lazarus.freepascal.org/IDE_Development#Frames Awesome !! =-) Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GTK2 is now the default widgetset
On Tue, 7 Oct 2008, Mattias Gärtner wrote: The default widgetset was changed from gtk1 to gtk2 on Linux, BSD, Sparc. Well, that will be an exciting update from SVN... Frames. GTK2 (still use GTK 1)... Does this mean that GTK 1 will not be maintained anymore ? Probably in practice: yes ? Michael.___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Xml
On Tue, 7 Oct 2008, [EMAIL PROTECTED] wrote: i have a light problem with xml. here my code: {.create the document} CFWxmlFile:=TXMLDocument.Create; {.create the root node of the configuration file} CFWxmlRoot:=CFWxmlFile.CreateElement('configfile'); CFWxmlFile.AppendChild(CFWxmlRoot); {.create the config item locale} CFWxmlRoot:=CFWxmlFile.DocumentElement; CFWxmlCfgItm:=CFWxmlFile.CreateElement('locale'); TDOMElement(CFWxmlCfgItm).SetAttribute('lang',NSJLang); CFWxmlRoot.AppendChild(CFWxmlCfgItm); {.write the file and free the memory} WriteXMLFile(CFWxmlFile,NSJPathCfg); CFWxmlFile.Free; the result is ok except for formatting: ?xml version=1.0? configfilelocale lang=EN//configfile What i missed for have: ?xml version=1.0? configfile locale lang=EN/ /configfile You cannot control the formatting. This is part of the XML specs, and is normal. Whitespace is irrelevant in XML, except for some special cases. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Xml
On Tue, 7 Oct 2008, Graeme Geldenhuys wrote: On Tue, Oct 7, 2008 at 9:28 PM, Michael Van Canneyt [EMAIL PROTECTED] wrote: You cannot control the formatting. This is part of the XML specs, and is normal. Whitespace is irrelevant in XML, except for some special cases. I know whitespace is irrelevant in XML, but I always thought there was a pretty format option somewhere. FPCUnit's xml output is formatted pretty. So is Lazarus's .xml config files. What do they use then? No idea, but most likely not the FPC DOM implementation :-) Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] A solution to online AND offline IDE help
On Fri, 3 Oct 2008, Graeme Geldenhuys wrote: Hi, After some replies in other thread about TiddlyWiki, I realized something. That could be a perfect solution to Lazarus IDE help! What's your thoughts on this... Download any one of the listed wikis, or even the 200Kb empty wiki and play around to get an idea of how cool this concept really is! :-) Ehm. The FPC help alone is about 32000 HTML pages. How will your browser react if you cram all that in 1 page and load it in the browser ? I can't even imagine what would happen if you add the LCL help... Such small tools are OK for small (as in tiny, tiddly) projects, but not for serious projects. Michael. ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus