Re: [Lazarus] fpspreadsheet - automatic column width

2016-03-23 Thread Roberto P.
TOP !!

Thanks,

  Roberto

2016-03-22 17:24 GMT+01:00 Werner Pamler :

>
> Am 22.03.2016 um 16:16 schrieb Roberto P.:
>
>> To make it work well enough, I am still missing one point: is there a way
>> to detect which is the last used row in a column or the last used column in
>> a row?
>> A single cell is "not enough".
>>
> TsWorksheet.GetLastOcccupiedRowIndex, GetLastOccupiedColIndex determine
> the indexes of the last cell of the worksheet.
>
> There's also a  TsWorksheet.GetLastRowIndex, GetLastColIndex which
> consider also Row and Column records (needed for predefined row heights and
> column widths) beyond the last occupied cell. Both have an optional
> parameter "ForceCalculation" which you should set to true in your first
> call in order to initialize the cached value.
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpspreadsheet - automatic column width

2016-03-22 Thread Roberto P.
I understand...
At the moment I am manually setting the width of a column by looping on the
contents of all rows and then setting it to the maximum of the string
length (given the unit of measure "width of character '0' ").
To make it work well enough, I am still missing one point: is there a way
to detect which is the last used row in a column or the last used column in
a row?
A single cell is "not enough".

Thanksgreat library !!

Roberto

2016-03-22 14:28 GMT+01:00 Werner Pamler :

> Am 22.03.2016 um 11:12 schrieb Roberto P.:
>
>> Dear List,
>>
>> in (the great) fpspreadsheet library, is there a method to calculate the
>> minimum / optimum column width to fit its contents?
>> Or, can anyone suggest me how to write such method?
>>
>> I have found the CalcAutoRowHeight , but that's different: it compares
>> the font height with the cell height. I don't know how to calculate a
>> string visual length from its font...
>>
> FPSpreadsheet consists of two parts: one is the basic FPSpreadsheet itself
> which provides the basic worksheet and workbook classes and the interface
> to the file formats; the other one is the collection of visual components -
> I assume your question is about the basic FPSpreadsheet. The main design
> goal here is to keep it free from any visual stuff, i.e. avoid the LCL
> completely (no unit "graphics"). Therefore, I cannot calculate the pixels
> needed for the length of a string from TCanvas.TextWidth. Ok - I could try
> FPCanvas... But I would prefer to just add a flag to the column record
> telling the reading application "this column has an auto-sized width -
> calculate it after reading", simply because I don't know how the office
> applications perform their calculations. But while there is such a flag for
> the row heights, there is none for the column widths. But even the autocalc
> row height flag does not work as I'd wish because the main office apps
> additionally want the precise row height.
>
> In the visual package, on the other hand, there's the grid which is
> allowed to use TCanvas, of course, and there is even an AutoAdjustColumn
> method. It is called when a double click is performed at the dividing line
> between two column headers (like in Excel). I did not check, though, how
> the saved column width fits with what the office application requires.
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] fpspreadsheet - automatic column width

2016-03-22 Thread Roberto P.
Dear List,

in (the great) fpspreadsheet library, is there a method to calculate the
minimum / optimum column width to fit its contents?
Or, can anyone suggest me how to write such method?

I have found the CalcAutoRowHeight , but that's different: it compares the
font height with the cell height. I don't know how to calculate a string
visual length from its font...

Thanks a lot,

  Roberto
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator

2016-03-05 Thread Roberto P.
Great!
Are metadata included ?

Thanks,

 R.

2016-03-05 18:27 GMT+01:00 Michael Van Canneyt :

> Hi,
>
> I have committed a PDF generator to FPC Subversion: fcl-pdf.
>
> Why a new pascal PDF generator ? Mainly because the existing ones written
> in Object Pascal suffer from
> several disadvantages: - Font support usually incomplete or downright
> buggy.
> - Dependency on a GUI (LCL, VCL, Windows).
> The latter is important because the PDFs must be generated on a headless
> (no
> display) webserver.
>
> So, the fcl-pdf package contains a PDF generating unit fppdf that does not
> depend
> on any external libraries or GUI system.
>
> The PDF generator has the following features:
> - Support for basic shapes.
> - Support for basic line styles.
> - Dictionary support.
> - Multi-page PDF.
> - Image support.
> - TTF Font support.
> - Font embedding.
> - Unicode font support.
> - Stream Compression.
> - Image embedding.
> - Several paper types.
> - Portrait/Landscape.
> - Support for multiple measurement units.
> - Rotation matrix system.
> - PDF creator information.
> - The generated PDF passes several PDF validators.
>
> The library is based on a library that came with FPGUI, with a feature set
> which came closest to what I desired. It was completed for the company I
> work for by Graeme Geldenhuys, and is heavily unit tested.
>
> It is not yet feature-complete, but the above should be ample for most
> applications.
>
> In the near future, I expect to commit a reporting engine which, likewise,
> does not need a GUI (but can use one) and uses the PDF generator as one
> possible backend.
>
> Todo:
> - Implement TFPCustomCanvas descendent (TPDFCanvas) that draws on a PDF.
>   (should allow easy integration in LCL) - Partial embedding of (unicode)
> fonts (only used glyphs) for smaller PDFs.
> - On windows (possibly mac), allow to use native font mechanisms for
> extracting info from TTF files.
> - Reduce memory usage by streaming finished pages to file.
>
> Optionally:
> - PDF Forms ?
> - Archive format ?
> - Signatures ?
>
> Enjoy,
>
> I would welcome additional tests/demos, suggestions, bugreports,
> improvements or patches.
>
> Michael.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Do we really need a PaintSwastika procedure?

2016-01-07 Thread Roberto P.
My 2 cents:

1) a program routine is just a program routine, like pencils or a
paintbrush; neither of them is symbol.
If you are not comfortable with that symbol (any symbol that can be
offensive to anyone), you just have not to paint it and not to call the
routine.
Think about the difference!
(Example to help: I know at least a way to commit a homicide, but I don't
call that routine of mine, therefore I am not guitly of homicide)

2) please, revert the change, just to remember to anyone what the project
is, what the free software is.

R#

2016-01-08 0:59 GMT+01:00 Žilvinas Ledas :

> On 2016-01-08 01:14, Anthony Walter wrote:
>
>>
>> http://www.fallen.io/ww2/
>>
>> In short, WW2 resulted in more deaths than any event in human history
>> including the Black Death, the Napoleonic wars, the great Flu Pandemic of
>> 1918, and Pol Pot anti intellectualism cleansing or chairman Mao's program
>> of cultural cleansing. I have five uncles, on both my mother's and father's
>> side, who fought and died in WW2. When I've visited their graves in France
>> and Hawaii everyone I met seemed to a good understanding of the war's cost
>> in human life on both sides, and also the new connotations symbols like the
>> Swastika had taken, for better or worse.
>>
>> I don't like to be nitpicking, but this is not entirely true. According
> to other sources (eg.
> http://waitbutwhy.com/2013/08/the-death-toll-comparison-breakdown.html)
> eg. Mongol Conquests and Mao Era was comparable to WW2 and The Black Death
> was undoubtedly much worse.
>
>
> Regards,
> Žilvinas
>
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] very small addition to multilog package

2015-02-21 Thread Roberto P.
I don't mind, but I have never done it;I'll write you in private about that.

R#

2015-02-21 17:07 GMT+01:00 luiz americo pereira camara :

> Mind you creating  patch (
> http://wiki.lazarus.freepascal.org/Creating_A_Patch) against
> https://code.google.com/p/luipack/ repository?
>
> Luiz
>
> 2015-02-20 15:03 GMT-03:00 Roberto P. :
>
>> I've been using for long the great multilog package to do selective
>> logging to file and an IPC listener.Recently I needed to setup a little
>> more complicate IPC based system, for which I took advantage of all of that
>> good work.
>> In order to have a multiple agent bi-directional communication was to be
>> able to give a different name to each server.
>>
>> So, if anyone is interested in it or you want to include it in the
>> "standard" multilog package, I am attaching ipcnamedchannel.pas
>> It is nothing more than a copy of the standard ipcchannel.pas with a
>> change in the constructor a little else.
>>
>> This possibility could be very well integrated in the standard
>> TIPCChannel class with a second constructor, but I simply preferred not to
>> touch the original file.
>>
>> Bye,
>>
>>  R#
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] very small addition to multilog package

2015-02-20 Thread Roberto P.
I've been using for long the great multilog package to do selective logging
to file and an IPC listener.Recently I needed to setup a little more
complicate IPC based system, for which I took advantage of all of that good
work.
In order to have a multiple agent bi-directional communication was to be
able to give a different name to each server.

So, if anyone is interested in it or you want to include it in the
"standard" multilog package, I am attaching ipcnamedchannel.pas
It is nothing more than a copy of the standard ipcchannel.pas with a change
in the constructor a little else.

This possibility could be very well integrated in the standard TIPCChannel
class with a second constructor, but I simply preferred not to touch the
original file.

Bye,

 R#


ipcnamedchannel.pas
Description: Binary data
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TAChart with transparent background

2014-09-15 Thread Roberto P.
The image is a 30KB png, not much.
It is smaller than the area, so it gets actually stretched.
Can I use Draw instead of StretchDraw if I make the image exactly the size
I need?
I can force the form size.

I think that tens of milliseconds can be actually relevant, because I am
plotting data received (and processed) every 50ms from a serial port.

R#

2014-09-16 0:07 GMT+02:00 Werner Pamler :

> I added some simple time measuring code (using GetTickCount) to the
> background image tutorial to see the speed loss that you mention: Without
> the backgrounds (Lazarus logo and gradient) the GetTickCount reports 0 ms
> between the OnBeforeDrawBackground and OnAfterPaint events, while with the
> backgrounds it reports 16 ms, sometimes 0 ms. Replacing the StretchDraw by
> a simple Draw in the painting of the logo,  brings down the time also to 0.
> Therefore I'd guess that the background painting is not perceivable unless
> you squeeze a 20 mega-pixel photo into the chart area or load the image
> during the painting event.
>
> What exactly are you doing?
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TAChart with transparent background

2014-09-15 Thread Roberto P.
Though really late, I can confirm that the solution is working fine.
I still have to add some profiling code to measure it, though with added
background it seems perceivably slower even on a recent PC (core i5 vpro).
Are BGRA or other backends known to be faster?

thanks anyway for the help!

R#

2014-09-04 1:08 GMT+02:00 Roberto P. :

> Thank  you very much.
> I need a background image, therefore as soon as I am back at the office
> I'll try your code.
> Thank you again!
>
> R#
>
>
> 2014-09-02 18:18 GMT+02:00 Werner Pamler :
>
>> It is not fully clear to me what you mean by "a chart with transparent
>> background". Do you want to see the form underneath the chart? I fear this
>> is not easily possible. Or do you want to have a background image in the
>> chart? For the latter case this code is working fine with me:
>>
>> type
>>   TForm1 = class(TForm)
>> Chart1: TChart;
>> procedure Chart1BeforeDrawBackground(ASender: TChart; ACanvas:
>> TCanvas;
>>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
>> procedure Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
>>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
>> procedure FormCreate(Sender: TObject);
>> procedure FormDestroy(Sender: TObject);
>>   private
>> { private declarations }
>> FBackImage: TPicture;
>>   public
>> { public declarations }
>>   end;
>> 
>> procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas:
>> TCanvas;
>>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
>> begin
>>   ADoDefaultDrawing := false;
>>   ACanvas.StretchDraw(ARect, FBackImage.Graphic);
>> end;
>>
>> procedure TForm1.Chart1BeforeDrawBackground(ASender: TChart; ACanvas:
>> TCanvas;
>>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
>> begin
>>   ACanvas.GradientFill(ARect, clSkyBlue, clWhite, gdVertical);
>>   ADoDefaultDrawing := false;
>> end;
>>
>> procedure TForm1.FormCreate(Sender: TObject);
>> begin
>>   FBackImage := TPicture.Create;
>>   FBackImage.LoadFromFile('C:\lazarus-svn\images\splash_logo.png');
>>   // please adapt this path to your lazarus installation
>> end;
>>
>> procedure TForm1.FormDestroy(Sender: TObject);
>> begin
>>   FBackImage.Free;
>> end;
>>
>> The basic idea is to assign a handler to the chart events
>> OnBeforeDrawBackWall or OnBeforeDrawBackground and disable the default
>> background painting by setting ADoDefaultDrawing to false. The first event
>> replaces painting of the area enclosed by the chart's frame ("Back wall"),
>> the other one replaces painting of the entire chart background. Above
>> example paints the Lazarus splash-logo as BackWall and a gradient as
>> background.
>>
>> Maybe I'll once write a tutorial on this topic...
>>
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TAChart with transparent background

2014-09-03 Thread Roberto P.
Thank  you very much.
I need a background image, therefore as soon as I am back at the office
I'll try your code.
Thank you again!

R#


2014-09-02 18:18 GMT+02:00 Werner Pamler :

> It is not fully clear to me what you mean by "a chart with transparent
> background". Do you want to see the form underneath the chart? I fear this
> is not easily possible. Or do you want to have a background image in the
> chart? For the latter case this code is working fine with me:
>
> type
>   TForm1 = class(TForm)
> Chart1: TChart;
> procedure Chart1BeforeDrawBackground(ASender: TChart; ACanvas:
> TCanvas;
>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
> procedure Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
> procedure FormCreate(Sender: TObject);
> procedure FormDestroy(Sender: TObject);
>   private
> { private declarations }
> FBackImage: TPicture;
>   public
> { public declarations }
>   end;
> 
> procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas:
> TCanvas;
>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
> begin
>   ADoDefaultDrawing := false;
>   ACanvas.StretchDraw(ARect, FBackImage.Graphic);
> end;
>
> procedure TForm1.Chart1BeforeDrawBackground(ASender: TChart; ACanvas:
> TCanvas;
>   const ARect: TRect; var ADoDefaultDrawing: Boolean);
> begin
>   ACanvas.GradientFill(ARect, clSkyBlue, clWhite, gdVertical);
>   ADoDefaultDrawing := false;
> end;
>
> procedure TForm1.FormCreate(Sender: TObject);
> begin
>   FBackImage := TPicture.Create;
>   FBackImage.LoadFromFile('C:\lazarus-svn\images\splash_logo.png');
>   // please adapt this path to your lazarus installation
> end;
>
> procedure TForm1.FormDestroy(Sender: TObject);
> begin
>   FBackImage.Free;
> end;
>
> The basic idea is to assign a handler to the chart events
> OnBeforeDrawBackWall or OnBeforeDrawBackground and disable the default
> background painting by setting ADoDefaultDrawing to false. The first event
> replaces painting of the area enclosed by the chart's frame ("Back wall"),
> the other one replaces painting of the entire chart background. Above
> example paints the Lazarus splash-logo as BackWall and a gradient as
> background.
>
> Maybe I'll once write a tutorial on this topic...
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TAChart with transparent background

2014-09-02 Thread Roberto P.
Dear List,

is it possible to have a chart with transparent background, so that a
picture behind the plot is visible?

>From the wiki I understand that TAChart does not support BackImage property
as in Delphi, which would fit the purpouse.
However I read thay using BGRAbitmap as a back-end it is possible to use
transparency. I managed to install the required packages and activate the
back-end, but I did not understand from the tutorial (
http://wiki.freepascal.org/BGRABitmap_tutorial_TAChart) how to go on.

Does anyone has an example?

Thanks a lot,

  R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [LAZARUS] Any Free/Cheap Async Serial Port Component

2014-04-03 Thread Roberto P.
I don't know AsyncPro, but a quick overview of CPortLaz code reveals the
usage of a TThread and WaitForMultipleObjects which is very Windows-centric.

R#û


2014-04-03 11:14 GMT+02:00 Michael Schnell :

> On 04/02/2014 10:53 PM, Roberto P. wrote:
>
>> I'd like to point out that CPortLaz is multithreaded
>>
>
> Does it work similar to AsyncPro ?
>
> In fact, IMHO, it would be desirable to have a component that _internally_
> uses TThread to handle blocking ports (either using just a byte-FIDO - this
> is what AsyncPro does - and/or allowing the user to implement a protocol
> within the Thread's "Execute" ), and when some information from the port is
> received (at least one byte or when the protocol handler issues a "ready"),
> does an Event (aka queued callback) to the main thread.
>
> The main thread call of course needs to be "scheduled" using means such as
> TThread.Queue or Application.QueueAsyncCall. (As at the time when AsyncPro
> was released, Delphi did not provide either, AsyncPro uses Windows Messages
> by directly accessing the Windows API, which happily is not necessary with
> Lazarus).
>
> Unfortunately Thread -> Mainthread signaling is only easily provided in
> Lazarus in the GUI based Widget Types. (NoGUI still needs an appropriate
> enhancement.) But of course the user (or even a ComPort Unit) could provide
> a usable Main Loop implementation.
>
> -Michael
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [LAZARUS] Any Free/Cheap Async Serial Port Component

2014-04-03 Thread Roberto P.
Unfortunately I've never tried it on anything other than Win2000-XP-7; I
could support you only on these platforms with some examples.

If you discover anything interesting on Win CE, please share it!

R#


2014-04-03 0:23 GMT+02:00 Martin Gomez :

>
> On 02/04/2014 05:53 p.m., Roberto P. wrote:
>
>> I'd like to point out that CPortLaz is multithreaded and that it has both
>> a COM port object and a Packet object.
>> The first one is used to setup, open and close the port; the second one
>> connects to the first one and makes packet handling as simple as:
>>
>> - define what is a packet:
>>
>> Packet.Startstring := ':';
>> Packet.Stopstring := #13;   or Packet.Size := 8;
>>
>> - implement the OnPacket(Sender: TObject; Str : string); event handler
>>
>
> AWESOME, that's just what i need for a project i'm migrating from .NET
>
> Does it work in Windows CE?
>
>
> Regards,
> Martín
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [LAZARUS] Any Free/Cheap Async Serial Port Component

2014-04-02 Thread Roberto P.
I'd like to point out that CPortLaz is multithreaded and that it has both a
COM port object and a Packet object.
The first one is used to setup, open and close the port; the second one
connects to the first one and makes packet handling as simple as:

- define what is a packet:

Packet.Startstring := ':';
Packet.Stopstring := #13;   or Packet.Size := 8;

- implement the OnPacket(Sender: TObject; Str : string); event handler

It also has some visual components but I never used them.

R#



2014-04-02 16:04 GMT+02:00 Paulo Costa :

> On 02/04/2014 07:32, Bob Axtell wrote:
>
>> This newbie is familiar with COMPORT from WINSOFT from my olden Delphi
>> days, but I can no longer afford it for one program.
>>
>> Does anybody know of a free/cheap component? any how does it install?
>>
>
> You can try:
>
> http://sourceforge.net/projects/sdpo-cl/
>
> It is has a component wrapping the synaser library.
> Works with Windows and Linux.
>
> Paulo Costa
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [LAZARUS] Any Free/Cheap Async Serial Port Component

2014-04-02 Thread Roberto P.
we currently use this one:

http://sourceforge.net/projects/cportlaz/files/cportlaz/

R#


2014-04-02 8:32 GMT+02:00 Bob Axtell :

> This newbie is familiar with COMPORT from WINSOFT from my olden Delphi
> days, but I can no longer afford it for one program.
>
> Does anybody know of a free/cheap component? any how does it install?
>
> --Bob A
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] First use of Lazarus and lpr file

2014-03-09 Thread Roberto P.
It is automatically created.
Save the project and the unit containing the form, then look for a file
project_name.lpr in the project folder.
So, you don't need to add it...but you can open it and have a look at the
surprisingly short content.

R#


2014-03-09 21:24 GMT+01:00 Didier BRETIN :

> Hello,
>
> I'm trying to code with Lazarus under windows.
>
> I created a project "Application" and I created my Form.
>
> I would like to add a .lpr file for the "main" program, but, silly I am, I
> can't find how to add it.
>
> Can you help me ?
>
> Regards.
> --
> Didier Bretin
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] potential Dec2Numb bug

2013-06-14 Thread Roberto P.
oops, reposted.


2013/6/14 Reinier Olislagers 

> On 14-6-2013 12:39, Roberto P. wrote:
> > Dear List,
> >
> > I recently had some crashes in a program of mine, whose cause I was able
> > to identify in a potential bug of the Dec2Numb functionor at least,
> > in an undocumented feature.
>
> You're posting on the Lazarus list while dec2numb seems to be an FPC
> function in strutils... Perhaps posting this on the FPC list is a better
> idea. Looking at the help for dec2numb though it doesn't mention
> negative numbers are not allowed, so I'd just raise a bug report for FPC
> (specifying FPC, OS version, preferably a sample program attached to the
> report etc)
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] potential Dec2Numb bug

2013-06-14 Thread Roberto P.
Dear List,

I recently had some crashes in a program of mine, whose cause I was able to
identify in a potential bug of the Dec2Numb functionor at least, in an
undocumented feature.

Specifically, if Dec2Numb is passed a negative number, it returns an empty
string.

It sounds somehow illogical to me, is there an explanation for this
behaviour?


bye,

  R.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TForm BorderIcons

2012-09-07 Thread Roberto P.
2012/9/7 Vincent Snijders 

> Confirmed in the msdn:
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx
> WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or
> WS_MINIMIZEBOX styles.
>
> Vincent
>
>
...I should have save my email as a  draft, then updated the inbox, before
sending!

R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TForm BorderIcons

2012-09-06 Thread Roberto P.
2012/9/6 Mattias Gaertner 

> On Thu, 6 Sep 2012 16:15:03 +0200
> "Roberto P."  wrote:
>
> > Hi,
> >
> > I can see the option biHelp among the other TForm.BorderIcons properties.
> > What shall I do to have the form display the "?" button? It seems that
> > setting the property to true is not enough.
> > Anyone has an example on how to handle it ?
>
> AFAIK only MS Windows supports that.
>
> Mattias
>
>
Well, I am working on Win XP.
Fresh install of Lazarus 1.0 prepackaged installer + some extra components
from the CCR.

Before going to call for a bug, is there anyone who can try it on a blank
Form ?

R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TForm BorderIcons

2012-09-06 Thread Roberto P.
Hi,

I can see the option biHelp among the other TForm.BorderIcons properties.
What shall I do to have the form display the "?" button? It seems that
setting the property to true is not enough.
Anyone has an example on how to handle it ?

Thanks,

  R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Charset in TSdfDataSet

2012-09-06 Thread Roberto P.
2012/9/6 GLBX 

> **
> Right !
>
> with Textout, I get accents correctly
>
> but... when I post the changes, now, I get the problem
>
> Originally DAMMANS
>
> Changed to DéMMANS
>
> Display after editing
> DéMMANS (coorect)
>
> Saved in the CSV file as !
> DéMMANS
> and...
>
> when I display after new loading :
> DéMMANS   (?!?!?!)
>
> Oups !!
>

when working on that project of mine, I was in a hurry and I couldn't go
deeper in understanding things (like the double conversion through UTF16,
thanks Mattias).
At that time I was also UNABLE to save back to csv through the sdf dataset,
even with readonly = false, putting the db in edit/append and posting the
changes it looked somehow a reader-only dataset.

A quick (and maybe unefficient or dirty) trick to get around it has been to
use:
- a TSDFDataset to read the CSV file (my separtor was non-standard)
- copying it to a TMemDataset which can be manipulated really fast
- place a TCSVExporter component on the form (install in the palette from
the dbexport package) connected to the TMemDataset
When you're done with editing and posting, you can simply call
TCSVExporter.Execute to save it to CSV.

An alternative (that I couldn't explore due to the limited amount of time I
had) might be this one:  http://wiki.freepascal.org/CsvDocument
which supposedly reads and writes, either randomly (in memory) or
sequentially, a CSV file.

R#


>
> GLBX
>
> - Original Message -
> *From:* Mattias Gaertner 
> *To:* Lazarus mailing list 
> *Sent:* Thursday, September 06, 2012 12:04 PM
> *Subject:* Re: [Lazarus] Charset in TSdfDataSet
>
>
> GLBX  hat am 6. September 2012 um 11:36 geschrieben:
> > Hi,
> >
> > I checked the encodings and got :
> >
> > - GuessEncoding(dataset .fields[1].asString) and got UTF8
>  Keep in mind that it is impossible to reliably get the codepage of a
> text, unless the text begins with a BOM. GuessEncoding simply checks if the
> string validates some UTF-8 rules. If it is valid it returns UTF-8
> otherwise the system code page.
>
> > - [application]defaultTextEncoding = cp1252
> >
> > Now in DBGrid I wrote in DrawColumnCell :
> > ...
> > ExtTextOut( 
> UTF8ToISO_8859_1(dataCSV.Fields[datacol].AsString..)
> > and.
> > Now accents are correctly displayed...
>  It seems you are calling the windows API function ExtTextOut directly
> instead of the x-platform LCL one. The LCL one expects UTF-8, so you don't
> need the conversion.
>
> > But I will get the problem back when validating changes in fields !!!
> > (I Tried with OnSetText : but inefficient !)
>  Mattias
>
> --
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Charset in TSdfDataSet

2012-09-06 Thread Roberto P.
Hi,

I have recently dealt with a CSV file and accents.
I concluded that the TSdfDataSet had no problem with reading the file; I
was using a TMemo to show the strings and to see them correctly I had to
write something like this:

   Memo.Lines.Text := UTF8Encode(SdfDataSet.Fields[0].AsString)

I'm no expert at all, especially about string encoding, so maybe someone
else could better explain what we should with the string format in the
DataSet and in the LCL components, but that should make you work in the
meantime.

  R#


2012/9/6 GLBX 

> **
> Hi !
>
> First time I am here. Hope I do well with posting my question here.
>
> Working with a CSV file encoded with accents in French (é, è, ô, etc...),
> how can I change the charset for the TSdfDataSet in order to see those
> accents and not the ? replacing char?
>
> Thanks for your answer !
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Looking for a general text editor

2012-02-14 Thread Roberto P.
Hi Graeme,

I'll go straight to the point without any shame: may I have your calculator
and, eventually, the installer program?
Unfortunately I've little to share, because I'm an hw engineer and my sw
has very little or no "public" utility.
The only one vaguely useful (http://sourceforge.net/projects/ardp/) has
been downloaded 3 or 4 times in total.

Thanks anyway, especially for the efforts in fpGUI !!!

R#

Il giorno 14 febbraio 2012 12:48, Graeme Geldenhuys  ha scritto:

> On 14 February 2012 13:37, Graeme Geldenhuys  wrote:
> >
> > I've got a few apps that could be contenders in the FP Application
> > Suite list - or can only LCL based apps play there?
>
> To clarify the list I haveall obviously implemented in FPC + fpGUI.
>
>  * A file manager (yet another Total Commander clone)
>  * Globe (a toy style app where you can spin and zoom the earth)
>  * Bug Tracker (uses tiOPF and any database backend tiOPF supports)
>  * Address Book (uses tiOPF and any database backend tiOPF supports)
>  * Calculator (simple, advance and programmer interfaces). RPN should
> be supported soon.
>  * Installer program - for use with FPC based applications. This is a
> reimplementation of the
> Loki Installer which was originally written in C for games like
> SimCity and products like Borland Kylix.
>  * Image Viewer with thumbnail extraction support
>  * Since a few minutes ago, a Notepad style editor, with tab
> interface and syntax highlighting for pascal.
>  * ...probably a few more tools and utilities lying around somewhere
> on my hard drive.
>
>
> --
> Regards,
>   - Graeme -
>
>
> ___
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://fpgui.sourceforge.net
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] moving a project and its files

2012-01-25 Thread Roberto P.
2012/1/25 Hans-Peter Diettrich 

> Roberto P. schrieb:
>
>
>  What are the files that have to be added to our versioning system to be
>> able to chekout a copy somewhere else? Or, which files are automatically
>> generated by lazarus?
>>
>
> I don't remember where exporting projects is described :-(
>
> Recommended are certain project settings, which force evitable (editing,
> session specific...) information into distinct files. Also the resource
> type (lrs/fpc) should be set to . The help on Project Options may
> shed some light on it, in detail on Session and Miscellaneous options, but
> I found it not really helpful :-(
>
> Some default files (program icon...) can be omitted from the distribution,
> they can be generated by the IDE on demand. E.g. "Save .lrs files in the
> output directory" suggests that these files can be omitted from a
> distribution.
>
>
I usually use the output directory, as I wrote in my first email, but in
the main folder there are .rc and .res file that seems to be generated
automatically. Shall they be versioned?


> If somebody remembers where exporting/distributing projects is described
> in the wiki, please supply the according link.
>
> DoDi
>
>
>
> --
> __**_
> Lazarus mailing list
> Lazarus@lists.lazarus.**freepascal.org
> http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] moving a project and its files

2012-01-25 Thread Roberto P.
2012/1/25 Mattias Gaertner 

> On Wed, 25 Jan 2012 12:20:50 +0100
> "Roberto P."  wrote:
>
> > 2012/1/25 Mattias Gaertner 
> >
> > > On Wed, 25 Jan 2012 09:14:00 +0100
> > > "Roberto P."  wrote:
> > >
> > > > Hi List,
>
> Set a unit output directory in the compiler options and then compile.
> These files don't need to be stored in the versioning system.
> The project target file (.exe or .app) is also auto created if missing.
>
> And see here:
>
> http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_meaning_of_the_various_file_extensions_used_by_Lazarus.3F
>
>
Thanks! I haven't found that wiki page before.

R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] moving a project and its files

2012-01-25 Thread Roberto P.
2012/1/25 Mattias Gaertner 

> On Wed, 25 Jan 2012 09:14:00 +0100
> "Roberto P."  wrote:
>
> > Hi List,
> >
> > I need to move a project from a folder to another one;
>
> Use your favorite file browser and copy/move the folder.
>
>
Ok, I wasn't clearwith "moving" I also meant that I have to rename it
while reconstructing it at the other place.
Meanwhile I discovered that somehow (maybe with the save project as?) the
auto-creation of the main form disappered from the list in the project
options, together with the corresponding line in the .lpr file.
After adding that back it works.

What are the files that have to be added to our versioning system to be
able to chekout a copy somewhere else? Or, which files are automatically
generated by lazarus?

Thanks


> >[...]
>
> Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] moving a project and its files

2012-01-25 Thread Roberto P.
Hi List,

I need to move a project from a folder to another one; I tried using
"publish project", but not all files belonging to it were moved.
Also the hierarchy was lost; my projects always have the following folder
structure:
project_folder
\--- project.lpi
\--- project.lpr
\--- project.exe
\--- UnitMain.pas
\--- UnitMain.lfm
... other "main" files ...
\--- src\
\--- UnitDebug.pas
\--- UnitOther.pas
... other source files ...
\--- obj\
\--- all the files that are automatically created
during build.


I then tried to "Save project as" into the new folder and then moving all
the following:
*.lfm
*.pas
*.lpi
*.lpr

but then it complains that there are missing resources.
The original project was created with lazarus 0.9.28.2 and now I'm using an
own built 0.9.31 (specific svn r30999), so the resource management has
changed.
I then removed all $I with .lrs and added the {$R *.res}

Finally, it compiles and build fine...but:  the main form doesn't show
up when the application starts !!!
Of course I can see it and change in the IDE, I checked it is listed in the
Forms List.

What can i check next ?
BTW, what is the correct "project move" procedure? (given that publishing
it has missed a lot of files).
Finally, any opinion on my choice of project folder structure? Any better
suggestion?

Thanks all!

  R#
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Memory need on ARM

2011-07-14 Thread Roberto P.
2011/7/14 Michael Schnell :
> Hi Experts,
>
> We are designing a controller PCB using Linux on an ARM CPU.
>
> We would like to run Lazarus generated programs with a GUI on this hardware.
>
> Now we would like to know how much RAM is necessary (besides the "Business
> Logic" variables the program uses).
>
> I suppose we will need to use some Widget Set (QT ?, GKT ?) and X11 Server,
> even though the GUI should only be visible via VNC via TCP/IP.


Though I can't help with main question about the RAM needs, I dare
adding to your w.s. list fpGUI.
I would consider it for an embedded platform and I think it supports X11.

Roberto

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


Re: [Lazarus] error compiling latest SVN laz...

2011-06-02 Thread Roberto P.
2011/6/2 waldo kitty :

>
>> If this does not work: try another version of fpc.
>

Yesterday I succesfully built lazarus 0.9.31 (r30999) with fpc 2.5.1
built from svn r17599.

Roberto

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