On 1/29/07, Kris Leech <[EMAIL PROTECTED]> wrote:
What where you main issues keeping Delphi compatibility? Did you develop in Laz, then try compiling in Delphi, fixing any errors (mainly syntax errors?)?
Using mode delphi, I don´t think I had any sintax differences to be solved. The problems I remember were: * I use TTrayIcon component, and that comes with lazarus source. So I just did a local copy of this component on the magnifier CVS, so other people won´t have trouble compiling in Delphi. * I use a custom message on windows, so lcl needs to be recompiled with: PassWin32MessagesToLCL (p.s. I still think we should merge this switch =) ) I can develop on either .. and open the result with the other. Not many problems there when you don´t have visually designed forms. So, basically I found very little incompatibility between lazarus on windows and delphi. The really big problem were the incompatibilities between win32 and Gtk 2, and later with Qt There are some irreconciliable differences between them, that require a lot of thinking to work around. Some examples: * To magnify the screen I use the winapi StretchDraw. Gtk will simply refuse to accept working if you don´t set SrcX = SrcY = 0. =/ So basically I had to include another image on Gtk, to make the stretching on 2 steps. First copy the part I want to magnify to a new image, and then enlarge that. On Qt I found another bizarre behavior. Suppose I magnify an area with negative coordinates, like (x: -50, y: -50, w: 100, h: 100). Windows will understand that as (x: 0, y: 0, w: 50, h: 50) always, on all versions. But not Qt. Qt will understand that as (x: 0, y: 0, w: 100, h: 100) =/ This was horrible to work around .... many ugly ifdefs. What happens is that simply the result for this special situation isn´t defined. Also, how to hide the cursor? On Windows just do a: Windows.ShowCursor(boolNewState); Now, for Gtk I tryed a lot, for weeks, but didn´t have much success. Even found code on the web ... but just doesn´t work on my PC. In the end, WinAPI can be terrible, but it´s very widely documented, with lot´s of people use it, so it´s easy to find how to do something. I found Gtk very hard to work with, horribly documented, and because so few people actually know it, it´s very hard to solve doubts. I took 2 hours to create the Windows implementation of TTrayIcon. I took 1 week to do the Gtk 1 implementation. And then another week to do the Gtk 2 implementation =/ This just kills any time frames you have. For more details, you can just download the source code here: http://sourceforge.net/projects/magnifier -- Felipe Monteiro de Carvalho _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
