Re: [lazarus] Cannot start Lazarus any more...
On Wed, 15 Mar 2006 10:57:04 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >Last week I removed 5 package sources of installed packages and the IDE did >work and only warned. There must be a special combination, why it didn't >work for you. Well, it works now but I will do my best to create another error situation,I know I am good at it %-) Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Cannot start Lazarus any more...
On Wed, 15 Mar 2006 10:10:40 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >Can you start it in gdb and send the backtrace? After two "make cleans" and one more "make all" almost did the trick. Now I get the message but "marked for installation" but the IDE starts finally. Well, after removing the package I can finally start the IDE without messages. Whew! Very, very strange! Thanks for helping me out, anyhow! (As for the backtrace I lost it in the remake process), the start is here: #12 $005946e7 in TPKGMANAGER__IDECOMPONENTPALETTEENDUPDATE (SENDER=$105d14, PALETTECHANGED=true, this=$14f4f4) at PkgManager.pas:519 #13 $005727ba in TBASECOMPONENTPALETTE__DOENDUPDATE (CHANGED=true, this=$105d14) at ComponentReg.pas:434 #14 $0056fe06 in TCOMPONENTPALETTE__DOENDUPDATE (CHANGED=true, this=$105d14) at ComponentPalette.pas:296 #15 $00572add in TBASECOMPONENTPALETTE__ENDUPDATE (this=$105d14) at ComponentReg.pas:516 #16 $0059d59a in TPKGMANAGER__LOADINSTALLEDPACKAGES (this=$14f4f4) at PkgManager.pas:2360 #17 $00419b95 in TMAINIDE__CREATE (THEOWNER=$cef24, vmt=$88eed8, this=$ff024) at Main.pp:1104 #18 $004010d7 in main () at lazarus.pp:88 Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Cannot start Lazarus any more...
On Tue, 14 Mar 2006 22:06:41 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >If you can start the IDE, uninstall the package. Cannot start the IDE so... >If not, build a clean IDE (make clean all). Tried now with the 'all' option with the same result. Nope. Very strange indeed. Well - a reinstall will probably do the trick but for the time being this looks like a showstopper. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Cannot start Lazarus any more...
The recent removal of the (non-working) mysql component was disastrous for me as the non-working component was on component palette. After rebuild Lazarus throws an exception because it cannot find the component icon bitmap or something. I will presumably need to remove something from somewhere but what and where? I remember doing something like this in the past but cannot do it any more :-\ Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] TMySQLDatabase and TMySQLDataset
On Thu, 09 Mar 2006 15:15:01 +0100, Joost van der Sluis <[EMAIL PROTECTED]> wrote: >These component's won't work. I think they never did, realle, and they >never will. They are obsolete. Whew... and I thought I was going nuts trying to use them a couple of times without much success :) Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Object pascal a "Modern Language"
On Sun, 5 Mar 2006 03:50:47 -0300, "Flávio Etrusco" <[EMAIL PROTECTED]> wrote: >I guess it's not so hugely useful or else someone would have >contributed it already. This is much more important in Java because >the String objects are constant/immutable and thus can't be This is very true I have never seen any performance problems with FPC. A StringTokenizer class could, however, be handy and it would not be very difficult to implement. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Object pascal a "Modern Language"
On Sat, 4 Mar 2006 08:41:53 -0800, Dale Welch <[EMAIL PROTECTED]> wrote: >But everyone always knew java was slow. It wasn't meant >to be able to be your primary language for large projects. This is where I have do disagree, having used Java. Example: I wrote a piece of linguistic software in Java. It needed an lot of HEAVY string handling. Using the wrong technique in concatenation (Strings instead of StringBuffer) I would have had problems. Using the language in a correct manner (Strings where necessary and StrinbBuffer in everywhere else) I got all the functionality I needed and the performance was excellent. Using just Strings is one of the common mistakes that causes low performance when lots of concatenations are done as every concatenation creates a new object. I want to point out that I also wrote a very exotic Replace function in plain Java that I thought would NEVER be fast enough, knowing that I am dealing with bytecode. To my surprise the code was faster than I could ever have dreamed and could be run just like any native .exe. Three years later I wrote the same routines in PHP and used every possible piece of optimization I could think of (and I know PHP very well). I ended up with junk that used 40x CPU compared with the Java one. And believe me, I did everything I could think of. Nope, the PHP can only be used if I write the critical parts (~50% of the application code in C as a PHP extension. So there is a difference between a bytecode/JIT-compiled and a sort-of-compiled language. After that I thought of rewriting the same app in FPC but have not yet had the time to start the project. What I noticed, however, was that a lot of work should be done to achieve the same functionality the Java String/Stringbuffer/Tokenizer classes have - we do not have them in plain FPC. What I really miss is in FPC the multitude of good classes, good functions that Java has. Tokenizer is a good example of a effort-saving utility class that is very well written in Java. Java is definitely NOT slow if written properly and used properly. At least Java basic things (String handling, hash maps, loops etc) perform very well compared with just about any language. With lots mathematics, matrixes and things like that I know less about things may be different though. As for large projects anybody can have a look at Eclipse. In my latest project it was chosen as the default environment and we never had any performance problems with it... not to mention big sites with JSPs and servlets and the J2EE abstraction level. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] graphical shapes library or component
On Sat, 04 Mar 2006 10:35:33 +0100, Marc Santhoff <[EMAIL PROTECTED]> wrote: >May I ask which version of the DXF spec you are using? As for the DXF version I have no idea whatsoever. The library is the same you mentioned (John Biddiscombe 1997, based on earlier work from 1995 by someone else). I only used this in a soldering control software project where the PCB drawing were exported as DXF and read to the application using the library. The DXF format was chosen because someone in the company had already started the work using it. It worked, though, and I suppose a revised version is in use in some places even today. All I did was correct some small memory leaks but all my changes are in the final product which is closed source. I have the original library here at home, still and if/when I have the time I will have a look at it (or somebody else, if interested). Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] graphical shapes library or component
On Fri, 03 Mar 2006 17:15:05 +0100, Danny Milosavljevic <[EMAIL PROTECTED]> wrote: >In gtk terminology that's a "drawing area". A dia canvas is the complex >thing that *stores* the shapes as objects and such... I have been really busy for the past few weeks but I have now tested the DXF library I used 6-7 years ago in Delphi. After the LCL corrections with arcs it seems to work now. It stores the DXF objects as structures of some sort so it might be of some use. For the time being it just reads a DXF file and is capable of displaying it... and I suppose it can also detect the mouse movement on the object (I never used this feature). If anyone is interested I will mail it gladly. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Pausing in DLL
On Fri, 03 Mar 2006 01:19:41 +1000, SteveG <[EMAIL PROTECTED]> wrote: >In this specific instance - >I need Program One to 'pause' the function that started Program Two >until the IPCServer is active, >but I still need Program One's Form / Messages to continue Why not use a server socket in Program One and wait for the IPCServer to connect, greet and say "hi, I am alive". I did something like this several years ago in Delphi and it was a very flexible solution. There must be more elegant solutions available, though. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Debugger causing problem in Windows
On Fri, 27 Jan 2006 22:43:11 -0800, George Lober <[EMAIL PROTECTED]> wrote: >Not sure what to make of the silence. It is somewhat difficult to comment on the problems of a 8-year old, not-any-more supported operating system which has several flaws in its internals. I understand that you do not want to jump to XP for various reasons and that is understandable. However, very few developers are using older Windows versions and that is why very few can actually help you. I am not a big fan of Microsoft but as for things that have an impact on my professional productivity I pay a few euros with pleasure. After jumping from the toy OS (Win95) to the professional branch (NT4, Win2K and finally XP) I have had very few if any problems. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Run Lazarus on Windows XP PRO
On Fri, 27 Jan 2006 13:51:23 -0700, "SIX-S" <[EMAIL PROTECTED]> wrote: >I am running XP PRO for windows, Lazarus version#9.10 beta. I am entering >the first program in the Lazarus Tutorial that put a button on the screen. Occasionally I have had weird problems with gdb - it just stays in the background, blocking the execution of a project. The way to get out of the situation is to kill gdb from the task manager. It seems unlikely, however, that this is the cause in your case but it is a good idea to check it, anyhow. If you close Lazarus and gdb.exe is still on the task list there is something wrong with the installation of the system. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Canvas handling obscurity
On Mon, 16 Jan 2006 18:49:26 +0100, Martin Smat <[EMAIL PROTECTED]> wrote: >And what about methods: TCanvas.RadialPie and TCanvas.Chord? Can anybody >verify what are the parameters in Delphi? In LCL they use Left, Top, >Width >and Height. procedure Chord(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer); Description Use Chord to create a shape that is defined by an arc and a line that joins the endpoints of the arc. The chord consists of a portion of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The ellipse is bisected by a line that runs between the points (X3,Y3) and (X4,Y4). The perimeter of the chord runs counter clockwise from (X3, Y3), counterclockwise along the ellipse to (X4,Y4), and straight back to (X3,Y3). If (X3,Y3) and (X4,Y4) are not on the surface of the ellipse, the corresponding corners on the chord are the closest points on the perimeter that intersect the line. The outline of the chord is drawn using the value of Pen, and the shape is filled using the value of Brush. There is no RadialPie in VCL (at least my version of Delphi) -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Who Discussed Linker Slowness?
On Sun, 15 Jan 2006 20:21:04 +0100, Peter Vreman <[EMAIL PROTECTED]> wrote: >So in short: The only way to get a major speedup in linking is to have an >internal linker so the .o is not needed anymore and can be stored in the Has anyone compared various alternatives for ld (if there are many of them)? There is at least one called Optlink by Digital Mars as a part of their free compiler packages. I have no idea whether this linker can replace gnu ld, though, having only quickly tested the compiler environment a long time ago. The site is at: http://www.digitalmars.com/ -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Canvas handling obscurity
On Thu, 12 Jan 2006 08:29:58 +0100, Martin Smat <[EMAIL PROTECTED]> wrote: >Shall I convert this method to >TCanvas.Arc(Left,Top,Right,Bottom,angle1,angle2 : Integer); It would possibly be easier to use these two if they shared the same parameters. One would not get confused the way one does in PHP and its way of using different order of parameters for functions that resemble each other. So I vote for your proposal. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Make error on last svn
On Wed, 11 Jan 2006 11:42:08 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >Fixed for fpc 2.0.0. Well, that was REALLY quick :) -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Make error on last svn
Result of make: Compiling allcodetoolunits.pp Compiling CodeToolManager.pas CodeToolManager.pas(564,15) Error: Identifier not found "ExceptFrameCount" CodeToolManager.pas(565,11) Error: Identifier not found "ExceptFrames" Platform: Win32 -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RoundRect patch
>method RoundRect was not overridden in the Win32 interface and the >default LCL method was used instead of the Win32 API call which did not Ahh... it was really that easy? I thought the idea was to change it in the LCL but what the heck - the result looks a lot brighter now. Nice. Thank you. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Canvas handling obscurity
On Sat, 7 Jan 2006 14:41:48 +0100, Mattias Gaertner >This should be changed. >Please report this as bug, so it won't be forgotten. Done. >a) Yes. In fact, all Handle objects are not the same as under Delphi. >b) No. There should be no function with exactly the same name and parameter >types and completely different meaning. All right, you gave a very clear answer :-) Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: Canvas handling obscurity
>In LCL the meaning are width and height. >So the correct form of your function should be: >Canvas.Arc(iMin,jMin, iMax-iMin,jMax-jMin, x1, y1, x2,y2); Any idea why this is different from Delphi? -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Canvas handling obscurity
> Canvas.Arc(iMin,jMin, iMax,jMax, x1, y1, x2,y2); > Windows.Arc(Canvas.handle,iMin,jMin, iMax,jMax, x1, y1, x2,y2); Oh dear me! I finally noticed that the Lazarus Arc differs from the rest of the world. In Windows API and Delphi the coordinates are rectangle coordinates and in Lazarus it is TCanvas.Arc(Left,Top,AWidth,AHeight,sx,sy,ex,ey : Integer); in Delphi this is: procedure Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer); And Windows API: BOOL Arc( HDC hdc, // handle to device context int nLeftRect, // x-coord of rectangle's upper-left corner int nTopRect,// y-coord of rectangle's upper-left corner int nRightRect, // x-coord of rectangle's lower-right corner int nBottomRect, // y-coord of rectangle's lower-right corner int nXStartArc, // x-coord of first radial ending point int nYStartArc, // y-coord of first radial ending point int nXEndArc,// x-coord of second radial ending point int nYEndArc // y-coord of second radial ending point ); for some reason unknown to me. This explains the weird behaviour of a graphics application I tried to port from Delphi Is there any special reason for one of the primitives to have a different parameter list? Are there any other differences as big as this one? -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] My icon editor eats GDI handles
On Wed, 4 Jan 2006 22:22:10 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >The TLazIntfImage creates new bitmap handle objects everytime you call >CreateBitmap. Yes, that's what I figured out after getting stuck at 8000+ GDI handles :) >To copy from one TLazIntfImage to another you can do that directly >editImage.Assign(originalImage); >If you need speed, you can copy the content of PixelData, MaskData directly. Thanks, I'll test those. For the time/project being, though, I discovered that I can use global handles just as easily. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Speedbutton glyph loading crashes Lazarus
On Wed, 4 Jan 2006 12:06:54 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >Has this issue been fixed, or is it still there? Works just fine right now. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Look and feel of Lazarus
On Mon, 02 Jan 2006 19:37:05 +0100, dannym <[EMAIL PROTECTED]> wrote: >Yes, win32 (and KDE) uses that order for some reason. >"Everyone else" (Mac, Gnome) uses the other order, I would rather say "the rest" instead of "everyone else" :) >Of course this is entirely a matter of taste and the sun will die down >before anyone ever agrees on button order :) I believe there is a bunch of usability theory and practice behind the solution and at least an immense tradition if not anything else. Personally I do not mind as I have written my first GUI at the time when there were no mice, and the screen resolution was 160x72 so I suppose I can adapt to anything but I do know there are people who get really mad at things like button order. The idea about the "VFI" approace Graeme wrote about that would do the trick on a "per os" or "per widgetset" basis sounded really good. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Pascal and CGI-bin
On Mon, 02 Jan 2006 20:06:17 +0100, dannym <[EMAIL PROTECTED]> wrote: >No, the web is radically different. Retrofitting a gui app onto a web >page will suck. I've seen it, some people did it for a (huge) app in our Well, it depends. A couple of years ago I was faced with a web application that needed to be written in record time and that dealt with about a dozen of different tables with filtered/ordered views. One could easily see how it could have been written for the desktop. What I did was sit down in my rocking-chair for three days and think. I finally came up with acopy of the Clarion for Windows model about templates (browse-edit-save-report) and that is what I did using object oriented PHP. What followed was a huge success and so far around 200 applications written using the same basis, though of course evolving all the time. A skilled writer can produce a basic multi-user database browse/update/report web application in hours, the inofficial record of a coworker being 40 minutes for a small call center CRM app. Almost from scratch. Yes, we do have a code generator :) My point is that the original idea was really taken directly from a desktop approach. This is how I used to work with Clarion years back. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Designer SpeedButton showstopper
>Donwload lazarus-0.9.11-20051231-src.* >or update CVS. Micha's fix seemed to work, very, very nice!!! I always have the latest version, using SVN every day. Now there is one more glitch to look at and it is the ugly RoundRect. I hand-wrote a roundrect function using lines and arcs and the result was the same so there must be something wrong with the geometrical calculations or arcs. The smaller the arc the more visible the distortion is. A zoomed test image can be found at http://xdb.fi/lazarus/images/roundrects.gif -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Designer SpeedButton showstopper
Has anyone idea/time to have a look at the SpeedButton Glyph loading problem in Designer which is a real showstopper now. I am not yet familiar enough with the internal workings of the IDE, I can only provide a bactrace. This happens when you assign a glyph to a speedbutton (select image and press ok). I tried to investigate the cause but I have very little clue as to what to look for and where. Loading glyphs at runtime is an alternative, of course and I have used that. Anyhow, the backtrace is : #0 $baadf00d in ?? () #1 $004b21b5 in TBITMAPCANVAS__FREEDC (this=$22c42d4) at bitmapcanvas.inc:114 #2 $004b1faa in TBITMAPCANVAS__CREATEHANDLE (this=$22c4014) at bitmapcanvas.inc:49 #3 $004b8260 in TCANVAS__REQUIREDSTATE (REQSTATE=[CSHANDLEVALID..CSBRUSHVALID], this=$22c4014) at canvas.inc:1403 #4 $004b80fa in TCANVAS__GETHANDLE (this=$22c4014) at canvas.inc:1315 #5 $0048f4dc in TBUTTONGLYPH__DRAW (CANVAS=$e553c, CLIENT= {LEFT = 0, TOP = 0, RIGHT = 23, BOTTOM = 22, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 23, Y = 22}}, OFFSET={X = 0, Y = 0}, STATE=BSUP, TRANSPARENT=true, BIDIFLAGS=0, this=$1fddc9c, result= {LEFT = 0, TOP = 0, RIGHT = 23, BOTTOM = 22, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 23, Y = 22}}) at buttonglyph.inc:127 #6 $00490443 in TCUSTOMSPEEDBUTTON__PAINT (this=$22814f0) at speedbutton.inc:496 #7 $0048aff6 in TGRAPHICCONTROL__WMPAINT (MESSAGE={MSG = 1056, DC = 3724621780, PAINTSTRUCT = $0, RESULT = 0}, this=$22814f0) at graphiccontrol.inc:64 #8 $007bfd1b in SYSTEM_TOBJECT_$__DISPATCH$formal () #9 $00567082 in TDESIGNER__PAINTCONTROL (SENDER=$22814f0, THEMESSAGE= {MSG = 1056, DC = 3724621780, PAINTSTRUCT = $0, RESULT = 0}, this=$22c80ec) at Designer.pp:1028 #10 $00568b42 in TDESIGNER__ISDESIGNMSG (SENDER=$22814f0, THEMESSAGE= {MSG = 1056, WPARAM = -570345516, LPARAM = 0, RESULT = 0, WPARAMLO = 14292, WPARAMHI = 56833, LPARAMLO = 0, LPARAM HI = 0, RESULTLO = 0, RESULTHI = 0}, this=$22c80ec) at Designer.pp:1796 #11 $0048637d in TCONTROL__WNDPROC (THEMESSAGE= {MSG = 1056, WPARAM = -570345516, LPARAM = 0, RESULT = 0, WPARAMLO = 14292, WPARAMHI = 56833, LPARAMLO = 0, LPARAM HI = 0, RESULTLO = 0, RESULTHI = 0}, this=$22814f0) at control.inc:1445 #12 $004855e4 in TCONTROL__PERFORM (MSG=1056, WPARAM=-570345516, LPARAM=0, this=$22814f0) at control.inc:1006 #13 $0047d920 in TWINCONTROL__PAINTCONTROLS (DC=3724621780, FIRST=$0, this=$2280ca0) at wincontrol.inc:2680 #14 $0047d707 in TWINCONTROL__PAINTHANDLER (THEMESSAGE= {MSG = 1056, DC = 3724621780, PAINTSTRUCT = $6facc, RESULT = 457432}, this=$2280ca0) at wincontrol.inc:2619 #15 $00480607 in TWINCONTROL__WMPAINT (MSG={MSG = 1056, DC = 3724621780, PAINTSTRUCT = $6facc, RESULT = 457432}, this=$2280ca0) at wincontrol.inc:4318 #16 $0048b302 in TCUSTOMCONTROL__WMPAINT (MESSAGE= {MSG = 1056, DC = 3724621780, PAINTSTRUCT = $6facc, RESULT = 457432}, this=$2280ca0) at customcontrol.inc:100 #17 $007bfd1b in SYSTEM_TOBJECT_$__DISPATCH$formal () #18 $00567082 in TDESIGNER__PAINTCONTROL (SENDER=$2280ca0, THEMESSAGE= {MSG = 1056, DC = 3724621780, PAINTSTRUCT = $6facc, RESULT = 457432}, this=$22c80ec) at Designer.pp:1028 #19 $00568b42 in TDESIGNER__ISDESIGNMSG (SENDER=$2280ca0, THEMESSAGE= {MSG = 1056, WPARAM = -570345516, LPARAM = 457420, RESULT = 457432, WPARAMLO = 14292, WPARAMHI = 56833, LPARAMLO = 64204, LPARAMHI = 6, RESULTLO = 64216, RESULTHI = 6}, this=$22c80ec) at Designer.pp:1796 #20 $0048637d in TCONTROL__WNDPROC (THEMESSAGE= {MSG = 1056, WPARAM = -570345516, LPARAM = 457420, RESULT = 457432, WPARAMLO = 14292, WPARAMHI = 56833, LPARAMLO = 64204, LPARAMHI = 6, RESULTLO = 64216, RESULTHI = 6}, this=$2280ca0) at control.inc:1445 #21 $0047e425 in TWINCONTROL__WNDPROC (MESSAGE= {MSG = 1056, WPARAM = -570345516, LPARAM = 457420, RESULT = 457432, WPARAMLO = 14292, WPARAMHI = 56833, LPARAMLO = 64204, LPARAMHI = 6, RESULTLO = 64216, RESULTHI = 6}, this=$2280ca0) at wincontrol.inc:3046 #22 $004de7a7 in DELIVERMESSAGE (TARGET=$2280ca0, MESSAGE=void) at Win32Proc.pp:541 #23 $00457ce1 in SENDPAINTMESSAGE (parentfp=$6fccc) at win32callback.inc:435 -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Look and feel of Lazarus
On Fri, 30 Dec 2005 14:12:35 +0100 (CET), [EMAIL PROTECTED] (Marco van de Voort) wrote: >- First, the "positive" button should always be right, IOW cancel should be >left from the positive one. Note that there is inconsistency in the But the current order in the majority of applications is something like == [ OK ] [CANCEL] [APPLY] = I checked more than half a dozen of my applications (MS Office, OpenOffice, Photoshop, a couple of editors and so forth) and all of them had OK on the LEFT. Am I missing something? I remember reading a GUI design guide as early as 1987 where this order was recommended. Or have I become totally senile? Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RoundRect calculation error
Here is an example how a filled roundrect 'leaks'. It is drawn on a red background with green fill colour and white pen colour: http://xdb.fi/lazarus/images/leaking_roundrect.gif -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RoundRect calculation error
>Maybe it is better to look, why EccentricAngle is equal to zero. Has a similar You are absolutely correct. I just changed that to get a bit further with the application and the real cause should be tracked down. Well, there is something funny going on with the RoundRect, anyhow. The smaller the rounded rectangle is the worse it looks and at 100x100 there is still an visible distortion. To prove my suspicions I created the following routine: procedure TForm1.Button1Click(Sender: TObject); var centerx,centery,x,y: Integer; begin centerx := Screen.Width div 2; centery := Screen.Height div 2; x := 10; canvas.Brush.Style :=bsClear; repeat Canvas.RoundRect(centerx -(x div 2), centery-x div 3, centerx+ (x div 2), centery+x div 3, x div 2, x div 3); x := x + 10; until x > 200; end; which should be proper and valid code. The resulting image reveals the severe problems with smaller rounded rectangles, here is a 300% magnified result: http://xdb.fi/lazarus/images/roundrects.gif The smaller the rectangle is the worse the distortion, so somebody with better math skills should have a look at it. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] RoundRect calculation error
On Wed, 28 Dec 2005 11:53:51 +0100, Vincent Snijders <[EMAIL PROTECTED]> wrote: >+ a := (Rect.Right - Rect.Left) / 2; >+ b := (Rect.Bottom - Rect.Top) / 2; Being a linguist I must confess that my graph math skills are probably worse than anybody else's but I do know that division by zero is not good practise in any mathematics :) I applied the same patch but STILL the test app crashed, though not as often. I tried this one: if EccentricAngle=0 then EccentricAngle := 1; which must be inncorrect as the precision in calculation is somewhat lost (1/5760, I suppose) but that corrected the situation at least as far as the test app is concerned. It has been up and running for several minutes now. The full function is as follows but I do not know whether a change like this one is acceptable if one looks at the big picture: Function EllipseRadialLength(Rect : TRect; EccentricAngle : Extended) : Longint; var a, b, R : Extended; begin a := (Rect.Right - Rect.Left) / 2; // vincent b := (Rect.Bottom - Rect.Top) / 2; // vincent R := Sqr(a)*Sqr(b); if EccentricAngle=0 then // markku EccentricAngle := 1 // markku R := Sqrt(R / ((Sqr(b)*Sqr(Cos(DegToRad(EccentricAngle/16 + (Sqr(a)*Sqr(Sin(DegToRad(EccentricAngle/16)); Result := TruncToInt(R); end; Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] RoundRect calculation error
I found The RoundRect creation very problematic and just to test whether it is me or the math functions I ran the Delphi help file example application and it resulted in "External SIGFPE" just like my own application. If anybody happens to find a decent routine for calculating the roundrect, please come forward. The test application is below, it should SIGFPE if you run it. The error seems to occur with a very small width or height. var X, Y, DX, DY: Integer; procedure TForm1.FormActivate(Sender: TObject); begin WindowState := wsMaximized; Timer1.Interval := 50; Randomize; end; procedure TForm1.Timer1Timer(Sender: TObject); begin X := Random(Screen.Width - 10); Y := Random(Screen.Height - 10); Canvas.Pen.Color := Random(65535); Canvas.Pen.Width := Random(7); DX := Random(400); DY := Random(400); Canvas.RoundRect(X, Y, X + DX, Y + DY, DX div 2, DY div 2); end; Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Small correction to intfgraphics.pas
I noticed a small error in intfgraphics.pas: The TLazReaderPartIcon.InternalCheck function should be something like this: function TLazReaderPartIcon.InternalCheck(Stream: TStream): boolean; var bfh: Array[0..21] of byte; begin Stream.Read(bfh,22); // dummy read of ico file header Result:=True; { Assumes stream in the correct place } end; At its present state it does not read the file header at all and reading the icon is broken. or possibly a copy of the TLazReaderIcon.InternalCheck function function TLazReaderIcon.InternalCheck(Stream: TStream): boolean; var IconHeader: TIconHeader; begin FnStartPos := Stream.Position; Stream.Read(IconHeader,SizeOf(IconHeader)); With IconHeader do Result := (idReserved=0) and (LEtoN(idType)=1); FnIcons := LEtoN(IconHeader.idCount); end; -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] My icon editor eats GDI handles
I am still fighting my way through the graphics jungle. So far the only problem has been the consumption of GDI handles which happens in this code fragment which is part of mouseMove rectangle/ellipse drawing routine where during a mouse move I first 1) Save the original image (editImage bitmap) 2) draw the ellipse to editImage 3) Project the image to magnified area (grid) 4) Restore the saved image to editImage Only after keyup I finally update the editImage bitmap I have narrowed down the leak to these two functions; if I exit from them immediately the memory leak disappears... Other than this problem the icon editor is already usable, it reads xpm and ico files and writes them as well. And it is beautiful :) ... editImage : TLazIntfImage; ... var originalImage : TlazIntFImage; // this is where I save it originalBitmap: TBitmap; BmpHnd,MaskHnd: HBitmap; procedure saveBitmap(); begin // create the original image and load a bitmap to it originalImage := originalBitmap.CreateIntfImage; originalImage.LoadFromBitmap(BmpHnd,MaskHnd); end; procedure restoreBitmap(); var BmpHnd,MaskHnd: HBitmap; begin // load editImage from the original bitmap originalImage.CreateBitmap(BmpHnd,MaskHnd,false); editImage.LoadFromBitmap(BmpHnd,MaskHnd); originalImage.Free; // should'nt this free the resources? // or should I also free something else? end; ... case Tool of Ellipse: begin saveBitmap; // save the original // irrelevant from here just drawing the stuff to tmpBitmap tmpBitMap.Canvas.Brush.Style := bsSolid; tmpBitMap.Canvas.Pen.Color := FPColorToTcolor(currentFG); tmpBitMap.Canvas.Brush.Color := FPColorToTcolor(currentBG); tmpBitmap.Canvas.Ellipse(rectStartX,rectStarty,RectEndX,rectEndY); editImage.loadFromBitmap(BmpHnd,MaskHnd); drawGrid; // draw the editor grid + image // ...up to this point restoreBitmap; //restore the original end; Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] XPM reader and transparency
On Mon, 26 Dec 2005 12:54:22 +0100, Mattias Gaertner <[EMAIL PROTECTED]> wrote: >BTW, instead of pixarray you can use the TLazIntfImage directly. This way >you do not only save conversion time, but you will also get fast platform You were correct and it seems to be a wise decision. Now I need to do very few conversions (if any after I have finally learned the FPC graphics system). -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] XPM reader and transparency
> if IntfImg1.Colors[x,y].alpha<>colTransparent then I think that should say if IntfImg1.Colors[x,y]<>colTransparent then without the 'alpha' right ? >BTW, instead of pixarray you can use the TLazIntfImage directly. This way That is an option, of course. However, speed is not the main problem here as I am dealing with very small bitmaps. I will look into the internal representation before doing any undo/redo/save implementation. Here is a screenshot of what I have done so far: http://xdb.fi/lazarus/images/IconEditor.jpg Pen, ColorPicker, Eraser, Selection, and Rectangle tools are working already. I will possibly not have the time or skill to create everything I have included in the tool palette (spray, for instance, may be too much for me), but we'll see... This is great fun after working several years with other languages. Thanks for helping me out of the trap :) Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] XPM reader and transparency
I have been writing some routines for my XPM icon editor but got lost in the area I have never been very good at: transparency. Instead of writing my own XPM Reader I have used the one in "intfgraphics.pas". I cannot, however, find a way to detech transparent pixels using the reader. What I have done is use the example skeleton in intfgraphics.pas: // from example skeleton transcount := 0; IntfImg1:=TLazIntfImage.Create(0,0); IntfImg1.GetDescriptionFromDevice(0); Reader:=TLazReaderXPM.Create; IntfImg1.LoadFromFile(filename,Reader); IntfImg1.CreateBitmap(BmpHnd,MaskHnd,true); //added true here Bitmap1.Handle:=BmpHnd; Bitmap1.MaskHandle:=MaskHnd; Reader.Free; IntfImg1.Free; // ... up to here, my own code after this TransparentColor := Bitmap1.TransparentColor; // just to test what the value of the transparent color is: showmessage('Transparent color: '+inttohex(Transparentcolor,8)); // and it shows normally value "2000" // get dimensions pixX := Bitmap1.Height; pixY := Bitmap1.Width; // now transfer the color values to XPM icon editor two-dim pixarray: for x := 0 to pixX-1 do for y := 0 to pixY-1 do begin if BitMap1.Canvas.Pixels[x,y] <> TransparentColor then pixarray[x+1,y+1] := Bitmap1.Canvas.Pixels[x,y] else pixarray[x+1,y+1] := -1; // my own transparent flag end; What I get, however, is a black color instead of a transparent one as the internal bitmap does not seem to have any transparent values. Any roadsign out of here would be appreciated! The mini XPM editor is very close to usable as soon as I get the XPM reading working. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Speedbutton glyph loading crashes Lazarus
On Fri, 23 Dec 2005 13:48:11 +0100, barko <[EMAIL PROTECTED]> wrote: >Same thing on linux (latest lazarus from svn, fpc 2.0.1), here is output from Loading the glyph using LoadFromXPMFile() works just fine so it must be just a small bug in the designer. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Speedbutton glyph loading crashes Lazarus
System: === Windows XP, latest CVS Symptom: === When placing a speebutton onto a form and loading a glyph (bmp,xpm tested) using Glyph->[...] ->Load picture -> (choose bitmap)->return --> OK An access violation occurs, crashing Lazarus every time. Ist it just my system or is anybody else suffering from the same behaviour? Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Component writing problems
>Maybe you can take a look at >http://wiki.lazarus.freepascal.org/index.php/RingChart_and_AnalogWatch >to see how to create a analogue clock. ;-) Huh? Well, yes... I know there are lots of clocks available :) What I had in mind, really was to convert a simple Delphi freeware component to see what needs to be done. Now I should have at least a vague idea of it so I'll write down what I have done. After that, the next chapter is a bit more demanding: I will try to convert a DXF reader/display class to Lazarus. It is a freeware component and worked well in my commercial Delphi application I wrote in 1997. As for the icon I did, again, run into a trouble. I used an icon editor called "IconXP" that should export XPM. However, when linking the resource, Lazarus fails to start, stating that the bitmap resource is invalid. A look at the XPM file revealed that the icon editor produces: static const unsigned char * tclock_xpm[] = { instead of static char * tclock_xpm[] = { After fixing that everything was ok. Any idea about a decent xpm icon editor that would make valid Lazarus XPM? Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Component writing problems
>Don't call paint in Resize. This will be done automatically. Thanks, Mattias and Marc. Now the "real thing" is working as well. It is a resizable, color-configurable analogue clock and it seems to work perfectly. One thing is missing, though, the icon Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Component writing problems
Hello, I have been trying to create a simple new component just for the sake of experience and I MUST be real stupid as I get the following backtrace when I try to insert the new component (which has been compiled ok) to the form. The component comes from Delphi and works just fine there. It seems to me as if the TWincontrol needed a parent but as it cannot find one simply raises an exception. Before getting into the real thing I created the simplest component I can image, it extends class TCustomPanel and onPaint it should draw a very short line and is totally useless. The Canvas operation Moveto() seems to start the chain. Any help would be appreciated. I do not mind being called an idiot, either :) When I get the first real component done I will document the process and publish it as a starter's tutorial. - gdb backtrace (running lazarus, dropping component) --- Program received signal SIGFPE, Arithmetic exception. $0040dc98 in RAISEGDBEXCEPTION (MSG=$1f95e4c) at LCLProc.pas:594 (gdb) bt #0 $0040dc98 in RAISEGDBEXCEPTION (MSG=$1f95e4c) at LCLProc.pas:594 #1 $00480f45 in TWINCONTROL__CREATEWND (this=$2216928) at wincontrol.inc:4781 #2 $00480c53 in TWINCONTROL__CREATEHANDLE (this=$2216928) at wincontrol.inc:4723 #3 $004818ac in TWINCONTROL__HANDLENEEDED (this=$2216928) at wincontrol.inc:5031 #4 $0047ff73 in TWINCONTROL__GETHANDLE (this=$2216928) at wincontrol.inc:4073 #5 $00482aa5 in TWINCONTROL__GETDEVICECONTEXT (WINDOWHANDLE=0, this=$2216928) at wincontrol.inc:5502 #6 $004788f0 in TCONTROLCANVAS__CREATEHANDLE (this=$2199934) at controlcanvas.inc:90 #7 $004b8180 in TCANVAS__REQUIREDSTATE (REQSTATE=[CSHANDLEVALID], this=$2199934) at canvas.inc:1403 #8 $004b7a30 in TCANVAS__MOVETO (X1=2, Y1=2, this=$2199934) at canvas.inc:1075 #9 $007c12b1 in TSIMPLELINE__PAINT (this=$2216928) at SimpleLine.pas:49 #10 $007c127d in TSIMPLELINE__RESIZE (this=$2216928) at SimpleLine.pas:44 /backtrace- -- unit/component unit SimpleLine; {$mode objfpc}{$H+} interface uses Windows, Messages, SysUtils, Classes, GraphType,Graphics, Controls, Forms, Dialogs, ExtCtrls, LResources; type TSimpleLine = class(TCustomPanel) private { Private declarations } protected { Protected declarations } public { Public declarations } constructor Create(AOwner: TComponent); override; procedure Paint; override; procedure Resize; override; published property OnResize; { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('Misc',[TSimpleLine]); end; constructor TSimpleLine.Create(AOwner: TComponent); begin inherited; end; procedure TSimpleLine.Resize; begin inherited; paint(); end; // - this is where it all starts --- procedure TSimpleLine.paint() ; begin Canvas.Moveto(2,2); Canvas.Lineto(4,4); end; end. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Writing and installing components
>http://wiki.lazarus.freepascal.org/index.php/Lazarus_Packages >http://wiki.lazarus.freepascal.org/index.php/Install_Packages Thanks, for some reason unknown to me I did not find those ones. I'll possibly create a very simple component (like an analogue clock) and document the process. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Writing and installing components
Is there a tutorial/example/section available about the creation and installation of a component? A hasty search did not reveal the existence of any such document? If not, I just might try to create one (after I find out how to do it, of course). The DXF reader class I have been converting from Delphi3 to Lazarus has already shown the first simple image. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] GetSystemMetrics sigsegv
On Mon, 12 Dec 2005 13:56:51 +0200, Markku Niskanen <[EMAIL PROTECTED]> wrote: > scrollpanel_lr.height := GetSystemMetrics(SM_CYHSCROLL)*2; Got it (thanks to Darius). The object is not initialized yet and it is the assignment that causes the problem. Back to school, shame on me :( Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] GetSystemMetrics sigsegv
> scrollpanel_lr.height := GetSystemMetrics(SM_CYHSCROLL)*2; > scrollpanel_ud.width := GetSystemMetrics(SM_CXVSCROLL); Of course I forgot to mention the OS which is Windows XP, latest Lazarus from svn. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] GetSystemMetrics sigsegv
Hello, I have been converting an old delphi dxf reader/writer class to Lazarus but stumbled onto this: procedure Zoom_panel.Resize; begin inherited; scrollpanel_lr.height := GetSystemMetrics(SM_CYHSCROLL)*2; scrollpanel_ud.width := GetSystemMetrics(SM_CXVSCROLL); //... etc end; The GetSystemMetrics() call produces an "external sigsegv" exception. Any idea about the cause and/or a hint how to continue? Anyhow, I was amazed to see the class compile with so little modification. Markku -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Eclipse
On Sat, 06 Aug 2005 21:58:47 -0300, Luiz Americo <[EMAIL PROTECTED]> wrote: >"When I opened Fedora's native Eclipse I noticed my laptop became slow >and unresponsive, and the CPU usage skyrocketed to 100%. Eclipse took a Funny, my group of eight PHP programmers have been using EclipsePHP for a few weeks and we have found very little of any problems. We have normal hyperthreading Pentium 4 CPUs with WinXP and 512 MB. I have to admit we were somewhat sceptical when we started our test but everybody has been happy with the result - with PHP. No performance problems. Knowing Eclipse I, however, cannot understand how it could help Lazarus without a VERY big amount of work if even after the work. -- [EMAIL PROTECTED] _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives