[Lazarus] Printing a formatted page

2008-06-22 Thread Dave Coventry
Is there any way of setting up a page in RTF, say, and reformatting so
that it can be drawn on TPrinter.Canvas?

Currently I'm measuring the positions of lines and text in millimetres
and scaling them up so that I can use Printer1.Canvas.Moveto(470,625)
and Printer1.Canvas.LineTo(880,625).
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Marco van de Voort
On Sun, Jun 22, 2008 at 03:10:19AM -0700, Boian Mitov wrote:
 Thank you! I have also found another work around in my properties, but this 
 will help. What are the reasons for so many differences in the Design time 
 interfaces from Delphi ? Are those legal or technical issues? I also notice 
 that there is practically no usage of Interfaces. 

Interfaces came later. Both in Delphi (D4) and FPC (2.0)

 Is this  because of the strange way FPC works with interfaces (what they
 call optimization), or some other reason?

Interfaces work fine. Even horrible interface abusing stuff like DECAL has
worked for ages. 

However your problems touch one of the cores of Delphi
compability, if somebody abuses something in _one_ delphi version, and it
works, does that mean that FPC has to carry that Delphi bug indefinitely,
and let performance suffer? I think not.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Boian Mitov
 Hi Mattias,

Thank you! A bit closer IDE integration will surely help us maintain 
components both for Delphi and Lazarus ;-) . We do support D5-2007 and we 
are aware of the changes overtime.

Unfortunately the optimization, I have renders the Interfaces virtually 
useless in Lazarus :-( . The lifespan of the interfaces is now unpredictable 
and left for the optimization to decide, and that allows for only limited 
types of objects to be maintained trough Interfaces. Anything that relies on 
resources other than memory practically will be dangerous to be used trough 
interfaces similar to the issues in the GC environments :-( . Sad, 
considering the enormous power interfaces offer in Delphi.

  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com



- Original Message - 
From: Mattias Gaertner [EMAIL PROTECTED]
To: lazarus@lazarus.freepascal.org
Sent: Sunday, June 22, 2008 4:51 AM
Subject: Re: [Lazarus] Obtaining TIDesigner


 About FPC optimization:
 I'm happy that the FPC team does not do Delphi compatibility at any
 cost.


 Mattias
 ___
 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] Obtaining TIDesigner

2008-06-22 Thread Marco van de Voort
On Sun, Jun 22, 2008 at 05:11:12AM -0700, Boian Mitov wrote:
 Thank you! A bit closer IDE integration will surely help us maintain 
 components both for Delphi and Lazarus ;-) . We do support D5-2007 and we 
 are aware of the changes overtime.
 
 Unfortunately the optimization, I have renders the Interfaces virtually 
 useless in Lazarus :-( . 

Since there is a simple workaround (move the relevant block to a
local procedure that declares the interface reference), I think this is a
_little_ bit exaggerated.

The lifespan of the interfaces is now unpredictable 

implementation defined is the word you are looking for.

 Sad, considering the enormous power interfaces offer in Delphi.

Hmm, I never was that happy with the ref counted interfaces. An interface
and pseudo garbage collection are two different things IMHO.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Florian Klaempfl
Boian Mitov schrieb:
   I still stand by my statement that this so called optimization is a 
 design bug in FPC. Of course this is just my opinion, and you guys can 
 disagree. That is no problem, as long as there are work around etc ;-) . 
 Only the time will tell who is right. My prediction is that the so called 
 optimization will lead to so many problems overtime that at some point it 
 will be removed, and the interfaces will start working as they in all other 
 languages I have used, 

What did you use so far? DOS batch files? Maybe listen to things people 
tell you.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Boian Mitov
  Something to cheer you up guys ;-) . Here is a snapshot of our current 
progress. You can see that all the runtime libraries are already ported and 
recompiled, and the OpenWire design time basic functionality is mostly 
operational:

http://www.mitov.com/LazarusProgress.jpg

The PlotLab and SignalLab are fully 100% functional ;-) . AudioLab and 
VideoLab are ~80% ready too, missing only the platform specific capture and 
recording/playback components. We are looking at GStreamer for the Linux 
side, but we will see...

  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com
 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Florian Klaempfl
Boian Mitov schrieb:
   Outdated, but shows some of the history.

Everybody is free to post any page on the web.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Obtaining TIDesigner

2008-06-22 Thread Boian Mitov
Sorry, this is the full list:
  a.. Visual C# 2005
  b.. Visual Basic 2005
  c.. Visual C++/CLI 2005
  d.. Visual J# 2005
  e.. Delphi 5 
  f.. Delphi 6 
  g.. Delphi 7 
  h.. Delphi 2005 
  i.. C++ Builder 5 
  j.. C++ Builder 6 
  k.. BDS 2006 / Delphi 2006 / C++ Builder 2006 
  l.. Turbo Delphi 2006
  m.. Turbo C++ 2006
  n.. Delphi 2007
  o.. C++ Builder 2007
  p.. RAD Studio 2007 
  q.. Visual C++ 6.0 (MFC)/Win32
  r.. Visual C++ 2003 (MFC)/Win32
  s.. Visual C++ 2005 (MFC)/Win32

  t.. Lazarus is comming (Win32/Win64/Linux)
  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com



- Original Message - 
From: Florian Klaempfl [EMAIL PROTECTED]
To: General mailing list lazarus@lazarus.freepascal.org
Sent: Sunday, June 22, 2008 5:50 AM
Subject: Re: [Lazarus] Obtaining TIDesigner


 What did you use so far? DOS batch files? Maybe listen to things people 
 tell you.
 ___
 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] Obtaining TIDesigner

2008-06-22 Thread Boian Mitov
  Outdated, but shows some of the history. Sorry, haven't updated it in the 
last few years ;-) .

http://www.mitov.com/My_Resume/my_resume.html

  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com



- Original Message - 
From: Florian Klaempfl [EMAIL PROTECTED]
To: General mailing list lazarus@lazarus.freepascal.org
Sent: Sunday, June 22, 2008 5:50 AM
Subject: Re: [Lazarus] Obtaining TIDesigner



 What did you use so far? DOS batch files? Maybe listen to things people
 tell you.
 ___
 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] Obtaining TIDesigner

2008-06-22 Thread Boian Mitov
I guess, you don't believe it ;-) . Everybody is free to believe or not. Our 
products however are real and available for download, and are free for non 
commercial purposes. If you have any doubt, you can always check, and see 
that they do exist. And they use interfaces to both work with the Delphi 
OTA, and to control DirectShow graphs, and other Windows API interfaces. We 
also have a library for OPC, but it is not officially released. OPC is also 
COM based. The libraries also employ interfaces heavily to deliver buffers, 
and perform thread synchronization.

  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com



- Original Message - 
From: Florian Klaempfl [EMAIL PROTECTED]
To: General mailing list lazarus@lazarus.freepascal.org
Sent: Sunday, June 22, 2008 6:10 AM
Subject: Re: [Lazarus] Obtaining TIDesigner


 Everybody is free to post any page on the web.
 ___
 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] Need some help with UpdateSQL in TSQLQuery and TMySQL50Connection

2008-06-22 Thread Joost van der Sluis
Op zaterdag 21-06-2008 om 14:04 uur [tijdzone -0500], schreef Howard Lee
Harkness:
 On Thu, Jun 19, 2008 at 8:22 AM, Joost van der Sluis [EMAIL PROTECTED]
 wrote:
 Op zaterdag 14-06-2008 om 16:06 uur [tijdzone -0500], schreef
 Howard Lee
 Harkness:
 
  However, it doesn't seem to matter what I put in for
 nbDelete. I
  always get the error There are no fields found to generate
 the
  where-clause if I do ApplyUpdates for nbDelete. If I put
 nothing in
  there, the field appears to be deleted, but it is still in
 the table,
  and comes back to the grid when I press refresh.
 

 Yes, and yes. See the code that I posted at the beginning of the
 thread -- if you see a problem with the code , please tell me what I'm
 doing wrong, or not doing right. There is definitely something wrong
 with it, because it doesn't work. If I left something out, tell me and
 I can just zip up the whole project and email it to you.

Sorry, but with the code you've sent, it's truely impossible to get the
error-message you claim that you got. There even is no 'ApplyUpdates' in
your code. That code is completely irrelevent - it's the code of an empy
program.

Please, don't send puzzles to us, we can't help you if you do.

For an example look at the fpc-code: packages/fcl-db/sqldb/examples

Joost.


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread Joost van der Sluis
Op zaterdag 21-06-2008 om 17:05 uur [tijdzone -0500], schreef Howard Lee
Harkness:
 
 Seems to me that I should have been able to get a program as trivial
 as the one I am trying to write running with stuff that was available
 two years ago. Kinda makes me wonder if I'm just trying to use the
 wrong tools. 

Yes, you are. You are using MySQL for a non-web-based application. ;)

Joost.

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Need some help with UpdateSQL in TSQLQuery and TMySQL50Connection

2008-06-22 Thread Joost van der Sluis
You can disregard this mail, in the mean time most issues are cleared
out. ;)

Joost.

Op zondag 22-06-2008 om 15:48 uur [tijdzone +0200], schreef Joost van
der Sluis:
 Op zaterdag 21-06-2008 om 14:04 uur [tijdzone -0500], schreef Howard Lee
 Harkness:
  On Thu, Jun 19, 2008 at 8:22 AM, Joost van der Sluis [EMAIL PROTECTED]
  wrote:
  Op zaterdag 14-06-2008 om 16:06 uur [tijdzone -0500], schreef
  Howard Lee
  Harkness:
  
   However, it doesn't seem to matter what I put in for
  nbDelete. I
   always get the error There are no fields found to generate
  the
   where-clause if I do ApplyUpdates for nbDelete. If I put
  nothing in
   there, the field appears to be deleted, but it is still in
  the table,
   and comes back to the grid when I press refresh.
  
 
  Yes, and yes. See the code that I posted at the beginning of the
  thread -- if you see a problem with the code , please tell me what I'm
  doing wrong, or not doing right. There is definitely something wrong
  with it, because it doesn't work. If I left something out, tell me and
  I can just zip up the whole project and email it to you.
 
 Sorry, but with the code you've sent, it's truely impossible to get the
 error-message you claim that you got. There even is no 'ApplyUpdates' in
 your code. That code is completely irrelevent - it's the code of an empy
 program.
 
 Please, don't send puzzles to us, we can't help you if you do.
 
 For an example look at the fpc-code: packages/fcl-db/sqldb/examples
 
 Joost.
 
 
 ___
 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] Printing a formatted page

2008-06-22 Thread Felipe Monteiro de Carvalho
What do you mean by RTF? Could you explain better what you are trying to do?

-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing a formatted page

2008-06-22 Thread Zaher Dirkey
You need like as MetaFile in Delphi, did you try TPostScriptCanvas in
pscanvas unit, i am not test it in fact.

On Sun, Jun 22, 2008 at 6:58 PM, Dave Coventry [EMAIL PROTECTED] wrote:
 On Sun, Jun 22, 2008 at 5:30 PM, Felipe Monteiro de Carvalho
 [EMAIL PROTECTED] wrote:
 What do you mean by RTF?

 RTF = Rich Text Format

 Could you explain better what you are trying to do?

 I want my app to generate printed forms and letters.

 Currently I have to measure the page I want to print and use the
 Canvas draw commands to draw the page. If anything changes I have to
 measure the page again and input the data in terms of lineto, moveto
 and textout methods.

 What I'm hoping to do is to format the page using OpenOffice and then
 convert this to moveto, lineto, textout, etc.

 PCL uses similar methods, penup, pendown, etc; maybe I could format
 the page and output it to PCL and then convert the PCL to
 TPrinter.Canvas functions? Maybe even Postscript? I used to have the
 old Adobe Postscript Cookbook. If I could just find it again...
 ___
 Lazarus mailing list
 Lazarus@lazarus.freepascal.org
 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
Zaher Dirkey
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing a formatted page

2008-06-22 Thread Felipe Monteiro de Carvalho
On Sun, Jun 22, 2008 at 12:58 PM, Dave Coventry [EMAIL PROTECTED] wrote:
 Currently I have to measure the page I want to print and use the
 Canvas draw commands to draw the page. If anything changes I have to
 measure the page again and input the data in terms of lineto, moveto
 and textout methods.

What do you need? Just the size of the paper?

If you are using normal paper, you can let LCL calculate the size by
simply giving the paper name to it:

uses Printers;

Printer.papersize.papername := 'A4';

PaperWorkRect := Printer.PaperSize.PaperRect.WorkRect; // This holds
the printable area of the paper

Printer.PaperSize.PaperRect.PhysicalRect holds the entire paper,
including areas that the printer won't be able to print to.

Example of printing using this:

Printer.BeginDoc;
Printer.Canvas.TextOut(PaperWorkRect.Left, PaperWorkRect.Top, 'TextOut');
Printer.EndDoc;

You can use TPrinterDialog to let the user choose the paper.
Printer.papersize.papername will be automatically updated.

I am writing about this in the Lazarus book.

 What I'm hoping to do is to format the page using OpenOffice and then
 convert this to moveto, lineto, textout, etc.

You will have a lot of difficulty to communicate with OpenOffice.

 PCL uses similar methods, penup, pendown, etc; maybe I could format
 the page and output it to PCL and then convert the PCL to
 TPrinter.Canvas functions?

What is PCL?

 Maybe even Postscript? I used to have the
 old Adobe Postscript Cookbook. If I could just find it again...

I am building a CNC Machine, and I also need to read data from an
external software. I analised Postscript and I arrived to the
conclusion that it is too complex to build a Postscript interpreter
(Postscript is a full programming language!).

We have decided now to build a PDF reading library for Free Pascal. We
should start working on it in a few months.

-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] SQLite - WinCe

2008-06-22 Thread cc_
I am testing SQLite under WinCE. A few notes:

- When the db file is in a shared folder linked to the Emulator, it cannot be 
opened. Needs to becopied to an internal folder. This may have nothing to do 
with Lazarus, but might be a useful peace of information anyway.
- SQLite3Connection does not  raise an exception when it cannot connect. 
Connected becomes  true no matter what.
- Opening a SQLQuery raises Bus error or misaligned data.
- Sqlite3Dataset:  Loading a less then 2MByte dataset takes around 15 seconds 
in the emulator on a  Centrino  Dothan 1.6 CPU.  Is this the speed to expect, 
or Sqlite3Dataset needs to be checked?


 - Leslie -
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing a formatted page

2008-06-22 Thread Dave Coventry
On Sun, Jun 22, 2008 at 7:24 PM, Felipe Monteiro de Carvalho
 What do you need? Just the size of the paper?
The whole lot.
I want to write a letter to someone who's name is in a database.
So It's got to say:
Dear $Title $Firstname $Surname, Re yours of the inst. $Date etc, ect.
(I'm just using Perl variables to show the structure of the letter -
obviously in Pascal you don't preface variables with $)

Also to print out Invioces and Reciepts.

It's actually for Student registration, letters of acceptance, Courses
taken, price of each course, etc...

 If you are using normal paper, you can let LCL calculate the size by 
 simply giving the paper name to it:
Mostly just A4 pages.


 You will have a lot of difficulty to communicate with OpenOffice.
Yes, I realise that. I've had a look at the format of OpenOffice
documents and I think it would not be trivial to convert such a
document into a format that I could use to print a page with
TPrinter.Canvas. That's why I was thinking of Postscript and PCL.

 What is PCL?
PCL = Printer Control Language (IIRC)
It used to be the language to control old style plottters (with up to
eight pens!), and I think it was an IBM standard.

 I am building a CNC Machine, and I also need to read data from
 an external software. I analised Postscript and I arrived to the
 conclusion that it is too complex to build a Postscript interpreter
 (Postscript is a full programming language!).
Yeah, I know! I did a lot of work in Postscript some years ago, but I
don't remember enough about it to confidently try and convert a PS
file. The problem is that it uses a lot of recursion and popping and
pushing functions onto a stack so that it becomes quite complicated to
read.

However, a lot of people have done a lot of stuff with PS, so I was
hoping there was something out there I could use...

 We have decided now to build a PDF reading library for Free
 Pascal. We should start working on it in a few months.
Good luck!
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Mac OS X : Cross compiling from i386 - PowerPC

2008-06-22 Thread Dominique Louis
Hi Felipe,
   I could not find the specific packages so I did a make all using the 
ppcppc compiler and when I do that I get the following compilation error
Fatal: Can't find unit MacOSAll used by CarbonInt

Am I not supposed to be able to do a
make all LCL_PLATFORM=carbon
and target the ppcppc compiler?

Dominique.

Felipe Monteiro de Carvalho wrote:
 On Sat, Jun 21, 2008 at 9:51 PM, Dominique Louis
 [EMAIL PROTECTED] wrote:
 Hi gurus,
   I'm trying to compile a Carbon application for PowerPC from an i386
 Mac OS X box. The i386 code compiles fine, but when I try and target
 PowerPC I get an Can't find unit Printer4Lazarus used by MyApp error.

 Any ideas?
 
 Open the Printer4Lazarus package. Go to Compiler Options. Set target
 processor and build.
 
 The same for LCL


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Graphics changes (r15472)

2008-06-22 Thread Marc Weustink
Marc Weustink wrote:
 Kostas Michalopoulos wrote:
 Yeah, this pretty much destroyed the material thumbnails in my 3D design
 app. Any workaround or this will come back soon? :-)
 Revert to r15471

 Marc
 That, or make a patch :-P.

 I've attached my fix. Seems that TCustomBitmap.SetSize was doing nothing 
 except filling some values in a TDIBSection which weren't used. I kept 
 them there (because i didn't tracked where they're actually used), but 
 also wrote code that updates the width/height info in FImage.Description 
 and allocates data for the pixels. I use RawimageNeeded too to obtain a 
 valid description (i just put the new width and height there).

 This makes both the autocompletion and changing TBitmap size code to work.
 
 autocompletion ??
 
 anyway, I need to think about this. Setting the width/height might be an 
 issue of TRasterImage too. Allocation of data is not needed (yet)
 
 About the DIBsection, that code will be removed and gets replaced by the 
 rawimage.

Should be fixed now in r15510

Marc

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Anyone using LCLIntf critical section routines?

2008-06-22 Thread Felipe Monteiro de Carvalho
Hello,

We are considering removing the critical section routines in LCLIntf,
because there is already a TCriticalSection in the RTL in the SyncObjs
unit.

If noone objects, and proves that those routines are useful for
something in 1 week, we will remove them.

thanks,
-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Mac OS X : Cross compiling from i386 - PowerPC

2008-06-22 Thread Vincent Snijders
Dominique Louis schreef:
 Hi Felipe,
I could not find the specific packages so I did a make all using the 
 ppcppc compiler and when I do that I get the following compilation error
 Fatal: Can't find unit MacOSAll used by CarbonInt
 
 Am I not supposed to be able to do a
 make all LCL_PLATFORM=carbon
 and target the ppcppc compiler?
 

You are supposed to use the latest release version of the fpc compiler 
or the SVN head of a development version.

Vincent
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Graphics changes (r15472)

2008-06-22 Thread Kostas Michalopoulos
 Yes, you cannot change the size of an Icon, since an icon contains on or
 more images of different sizes/depths

 Use Icon.Add() to add a new image with given size and depth, then use
 TIcon.Current to select the wanted image.

 Marc

Cannot this be done transparently so it won't break the code? Even with a 
boolean property to enable/disable this, it would be nice. Or if not, make 
width and size read-only. IMHO it is a bad surprise for the user to get this 
exception when the object allows the assignment of width and height fields.

Of course this isn't a high priority thing or anything, but it looks more 
polished i think :-)

Kostas

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread Howard Lee Harkness
Oh, and I *don't* want to applyupdates on the AfterScroll event unless that
is the only choice.

On Sun, Jun 22, 2008 at 2:22 PM, Howard Lee Harkness 
[EMAIL PROTECTED] wrote:

 On Sun, Jun 22, 2008 at 9:03 AM, Joost van der Sluis [EMAIL PROTECTED]
 wrote:

 My question is why you did DBNavigator1Click at all? On nbPost, it
 should call - first of all - SQLQuery1.Post. You forgot that. (I guess
 that that's your edit-problem) Normally, if you don't implement
 DBNavigator1Click it will do that automatically.

 Well, without some place to put the ApplyUpdates call, nothing gets
 changed in the database. When I tried not implementing the
 DBNavigator1Click, the program appeared to be working, but the database
 never actually changed.

 I also tried putting the ApplyUpdates in the FormClose event, and that
 didn't do anything, either.

 You are the one that mentioned that I needed to call ApplyUpdates (and
 later, disable and enable controls). Could you please take a look at the
 code I posted and SHOW ME what I need to do to make this work?
 --
 Howard Lee Harkness




-- 
Howard Lee Harkness
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Mac OS X : Cross compiling from i386 - PowerPC

2008-06-22 Thread Vincent Snijders
Dominique Louis schreef:
 Vincent Snijders wrote:
 You are supposed to use the latest release version of the fpc compiler 
 or the SVN head of a development version.
 
 Hi Vincent,
All the code is from the SVN or does SVN head of a development 
 version mean something else?

svn head means the current revision.

So if you are using a svn version of fpc, and you run into a lazarus 
problem, first update your fpc svn version and try that.

Vincent
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] SQLite - WinCe

2008-06-22 Thread cc_


 You could document some of your findings here:

 http://wiki.lazarus.freepascal.org/WinCE_Programming_Tips


I will, but first I am going to send them to the mailing list to find out 
their worth (I would not want to reinvent the wheel) and if they can be 
corrected.


 The only thing that I know about sqlite and lazarus is that there are
 some problems with it in fpc 2.2.0, so I would try 2.2.2 if I were
 you.

I forgot to mention my cfg: Lazarus Snapshot 2008.06.18 with Fpc 2.2.2RC1  + 
the Arm-Wince snapshot from the same date.


  - Leslie -

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread Howard Lee Harkness
Ok I added the Post call (for some reason, I thought the DbNavigator did
that automatically, but apparently not if you implement the click handler.
So now I have:

procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
TDBNavButtonType);
begin
  case Button of
  nbEdit: begin
  SQLQuery1.Edit;
  end;
  nbPost: begin
  SQLQuery1.Post;
  SQLQuery1.DisableControls;
  SQLQuery1.ApplyUpdates;
  SQLQuery1.EnableControls;
  end;
  nbRefresh: begin
 SQLQuery1.Close;
 SQLQuery1.Open;
 end;
  end;
end;

Inch by incredible inch. I can now insert and delete, but edit still does
nothing, even though it appears to until I stop and restart the program.

On Sun, Jun 22, 2008 at 1:22 PM, Howard Lee Harkness 
[EMAIL PROTECTED] wrote:

 On Sun, Jun 22, 2008 at 9:03 AM, Joost van der Sluis [EMAIL PROTECTED]
 wrote:

 My question is why you did DBNavigator1Click at all? On nbPost, it
 should call - first of all - SQLQuery1.Post. You forgot that. (I guess
 that that's your edit-problem) Normally, if you don't implement
 DBNavigator1Click it will do that automatically.

 Well, without some place to put the ApplyUpdates call, nothing gets
 changed in the database. When I tried not implementing the
 DBNavigator1Click, the program appeared to be working, but the database
 never actually changed.

 I also tried putting the ApplyUpdates in the FormClose event, and that
 didn't do anything, either.

 You are the one that mentioned that I needed to call ApplyUpdates (and
 later, disable and enable controls). Could you please take a look at the
 code I posted and SHOW ME what I need to do to make this work?
 --
 Howard Lee Harkness




-- 
Howard Lee Harkness
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] WinCE - Printing - PCL

2008-06-22 Thread cc_
I need to print from a WinCE app to a HP PCL compatible printer. Any suggestion?


 - Leslie -___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread John
Howard Lee Harkness wrote:
 Hmmm... looks like TDBF doesn't have any way to load my tables without 
 writing yet another program. And dBase tables? I think I will check 
 out SQLite first. I picked on MySQL by recommendation from some folks 
 telling me how it was a mature db with all of the features I was used 
 to from working with Oracle. It was certainly easier to set up than 
 FireBird -- and better documented.

 I suppose also that I could write all of the insert/delete/edit code, 
 but I didn't have to do that in Delphi 10 years ago. The DbNavigator 
 just worked with no additional code at all.

If you come from an Oracle background, consider Postgresql.  I had an 
Oracle background too, and felt immediately at home with PG.  On the 
other hand, dBase tables work fine for simple, single user tables, with 
less fuss than  SQL.  It depends on what you are trying to do.

I admit I always use an external tool to build the tables.  In 
postresql, pgadmin; for dbase tables an old copy of DBase it self (yes, 
I have one!) or DBD from Dephi.
 
Also, since I am writing, in looking through your last example or two, 
there doesn't seem to be any transaction.commit ?  This is needed in PG, 
I presume in MySQL as well.

My basic test database program had a PQConnection, SQLTranaction, 
SQLQuery (select * from ...), and the usual set of data-aware controls - 
grid, navigator, edit fields, etc - connected to the query, all set up 
at design time as you would in Delphi.  The only code was in a 'commit' 
button:

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  SQLQuery1.ApplyUpdates;
  SQLTransaction1.CommitRetaining;
end;

cheers,
John Sunderland
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread Howard Lee Harkness
Interesting... I tried your approach with MySQL, and I still could not get
edit to work. It appears to work in the grid, but stopping and re-starting
the program showed that nothing actually got edited.

Looks like I need to take your advice and try Postgresql. However, I won't
have any significant time to work on this project until next Sunday. Bummer.
I still have the vague suspicion that the problem is not with MySQL, but
with the TNavigator component. But if MySQL simply won't work with Lazarus,
it just won't work, and I don't need to spend the rest of the year running
into the same brick wall.

This is not the only project I have in mind, of course. It's just the first
step in a much larger project, for which I would like to make some money. So
the real solution may still be to actually buy some commercial development
tools. I really wanted to make a go of using all open-source stuff, but
first I need to find something that is ready for prime time.

Until I can write a trivial program that displays, inserts, deletes, and
edits records in a simple database table, I have no hope whatever of getting
any farther. So far, I have not seen any evidence that this is even possible
using Lazarus and MySQL (without writing 1000 lines of code to do all of the
SQL manipulation), so the next step is to evaluate another set of tools.

What I REALLY wanted was to be able to drop some components on a form
(connection, query, datasource, dbgrid, and dbnavigator), and link them
together with some properties, and have it work without writing a lick of
code -- just like I once did with Delphi 3 over a decade ago. So far,
Lazarus has not caught up with D3, much less D6.

Hmm... I need to spend some time looking for my old copy of D3 and see if it
will even run on XP.

On Sun, Jun 22, 2008 at 6:52 PM, John [EMAIL PROTECTED] wrote:

 Howard Lee Harkness wrote:
  Hmmm... looks like TDBF doesn't have any way to load my tables without
  writing yet another program. And dBase tables? I think I will check
  out SQLite first. I picked on MySQL by recommendation from some folks
  telling me how it was a mature db with all of the features I was used
  to from working with Oracle. It was certainly easier to set up than
  FireBird -- and better documented.
 
  I suppose also that I could write all of the insert/delete/edit code,
  but I didn't have to do that in Delphi 10 years ago. The DbNavigator
  just worked with no additional code at all.
 
 If you come from an Oracle background, consider Postgresql.  I had an
 Oracle background too, and felt immediately at home with PG.  On the
 other hand, dBase tables work fine for simple, single user tables, with
 less fuss than  SQL.  It depends on what you are trying to do.

 I admit I always use an external tool to build the tables.  In
 postresql, pgadmin; for dbase tables an old copy of DBase it self (yes,
 I have one!) or DBD from Dephi.

 Also, since I am writing, in looking through your last example or two,
 there doesn't seem to be any transaction.commit ?  This is needed in PG,
 I presume in MySQL as well.

 My basic test database program had a PQConnection, SQLTranaction,
 SQLQuery (select * from ...), and the usual set of data-aware controls -
 grid, navigator, edit fields, etc - connected to the query, all set up
 at design time as you would in Delphi.  The only code was in a 'commit'
 button:

 procedure TForm1.BitBtn1Click(Sender: TObject);
 begin
  SQLQuery1.ApplyUpdates;
  SQLTransaction1.CommitRetaining;
 end;

 cheers,
 John Sunderland
 ___
 Lazarus mailing list
 Lazarus@lazarus.freepascal.org
 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
Howard Lee Harkness
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Anyone using LCLIntf critical section routines?

2008-06-22 Thread Felipe Monteiro de Carvalho
The problem of keeping them is that we have to maintain them
(duplicating work with the fpc team) and make sure they are working,
which is not at all guaranteed today.

About your problem, well, you could send an e-mail to the fpc mailling
list asking the fpc team to change those routines to cdecl under
windows.

-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Advice about creating database-aware application with Lazarus

2008-06-22 Thread John
Howard Lee Harkness wrote:
 Interesting... I tried your approach with MySQL, and I still could not 
 get edit to work. It appears to work in the grid, but stopping and 
 re-starting the program showed that nothing actually got edited.

 Looks like I need to take your advice and try Postgresql. However, I 
 won't have any significant time to work on this project until next 
 Sunday. Bummer. I still have the vague suspicion that the problem is 
 not with MySQL, but with the TNavigator component. But if MySQL simply 
 won't work with Lazarus, it just won't work, and I don't need to spend 
 the rest of the year running into the same brick wall.
I am not saying that MySQL won't work, rather that Postgres has a 
similar 'feel' to using Oracle.  All the concepts are similar.  On the 
other hand, while I have never tried MySql, just from perusing this 
list, it does seem to have more problems with library versions, etc.

 This is not the only project I have in mind, of course. It's just the 
 first step in a much larger project, for which I would like to make 
 some money. So the real solution may still be to actually buy some 
 commercial development tools. I really wanted to make a go of using 
 all open-source stuff, but first I need to find something that is 
 ready for prime time.

 Until I can write a trivial program that displays, inserts, deletes, 
 and edits records in a simple database table, I have no hope whatever 
 of getting any farther. So far, I have not seen any evidence that this 
 is even possible using Lazarus and MySQL (without writing 1000 lines 
 of code to do all of the SQL manipulation), so the next step is to 
 evaluate another set of tools.
It probably really is worth satisfying yourself that you can do this 
with a dbase (or other local) table first - it does work.

 What I REALLY wanted was to be able to drop some components on a form 
 (connection, query, datasource, dbgrid, and dbnavigator), and link 
 them together with some properties, and have it work without writing a 
 lick of code -- just like I once did with Delphi 3 over a decade ago. 
 So far, Lazarus has not caught up with D3, much less D6.
To be fair, while you could do what you are saying with simple stuff 
into local (dbase/paradox) tables, I can't ever remember being able to 
do that in 'Real World' applications using Delphi 4 C/S into Oracle, of 
which I did quite a bit.

 Hmm... I need to spend some time looking for my old copy of D3 and see 
 if it will even run on XP.
It will - I even have Delphi 1 running on XP (don't ask why !) as well 
as using D4 extensively on it, due to some applications that use paradox 
dbs.

 (snip)

Cheers,
John Sunderland
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Anyone using LCLIntf critical section routines?

2008-06-22 Thread Boian Mitov
  Thank you!
I will remove any usage of them. I understand your point.
If I confirm that Lazarus has the same problem as Delphi with the pascal 
calling convention in CriticalSection, I will make sure the issue is 
reported.

  With best regards,
Boian Mitov


Mitov Software
http://www.mitov.com



- Original Message - 
From: Felipe Monteiro de Carvalho [EMAIL PROTECTED]
To: General mailing list lazarus@lazarus.freepascal.org
Sent: Sunday, June 22, 2008 6:56 PM
Subject: Re: [Lazarus] Anyone using LCLIntf critical section routines?


 The problem of keeping them is that we have to maintain them
 (duplicating work with the fpc team) and make sure they are working,
 which is not at all guaranteed today.

 About your problem, well, you could send an e-mail to the fpc mailling
 list asking the fpc team to change those routines to cdecl under
 windows.

 -- 
 Felipe Monteiro de Carvalho
 ___
 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