Re: [Lazarus] Ann: class code creation

2016-03-07 Thread Luiz Americo Pereira Camara
2016-03-07 17:25 GMT-03:00 Ondrej Pokorny :

>
>
> Hit Ctrl+Shift+X on the undeclared variable x and you get a dialog:
>

Thanks for the work

In the dialog title, i suggest to replace "variable" by "field"

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


Re: [Lazarus] Form Resizing

2016-03-06 Thread Luiz Americo Pereira Camara
2016-03-06 19:47 GMT-03:00 Giuliano Colla :

> Il 06/03/2016 18:27, Bo Berglund ha scritto:
> [...]
>
>> I have no idea what you mean by this statement...
>> What is LXDE and how do I test Lazarus for LXDE?
>>
> [...]
>
>> Apart fromn that I
>> have no idea how to use svn, which I assume you mean I should do.
>>
>>
> A general hint: whenever you don't know what an acronym means (such al
> LXDE = Lightweight X11 Desktop Environment, which btw is most likely the
> desktop you're using),


According to a previous message he is using Mate

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


Re: [Lazarus] Run/debug app with command line params through the IDE

2016-02-28 Thread Luiz Americo Pereira Camara
Thanks

Luiz

2016-02-28 18:39 GMT-03:00 Denis Kozlov <dez...@gmail.com>:

>
> Lazarus Main Menu > Run > Run Parameters...
>
>
>
> On 28/02/2016 21:32, Luiz Americo Pereira Camara wrote:
>
>> I'd like to debug a console app inside the ide.
>>
>> In order to the program work i need to pass some command line params
>>
>> Is there a way to run the app through the IDE passing command line params?
>>
>> Luiz
>>
>
>
> --
> ___
> 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] Run/debug app with command line params through the IDE

2016-02-28 Thread Luiz Americo Pereira Camara
I'd like to debug a console app inside the ide.

In order to the program work i need to pass some command line params

Is there a way to run the app through the IDE passing command line params?

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


Re: [Lazarus] Procedure List dialog regressions

2016-02-28 Thread Luiz Americo Pereira Camara
2016-02-28 2:13 GMT-03:00 Ondrej Pokorny :

> On 27.02.2016 10:46, Graeme Geldenhuys wrote:
>
>> I implemented the Procedure List functionality for Lazarus - I know how
>> it works and what it is supposed to do. I'm not going to keep fixing
>> things that others break on it.
>>
>
> Unfortunately this happens all the time :(
>
>
If is the case, i can revert the patch and ask the author to rework it to
match the expected functionality

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


Re: [Lazarus] Tool to convert a multiline text to a pascal string constant

2016-02-03 Thread Luiz Americo Pereira Camara
Thanks for all
Getting time i will do a Lazarus extension

Luiz
Em 3 de fev de 2016 03:13, "Martin Schreiber" <mse00...@gmail.com> escreveu:

> On Tuesday 02 February 2016 22:33:56 Luiz Americo Pereira Camara wrote:
> > Hi is there any tool for Lazarus to convert a multi line text (xml
> snipet,
> > SQL) to a string constant?
> >
> In MSEide select the text in source editor, RightClick-'Convert to Pascal
> string'. Code is here:
>
> https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/kernel/mseformatstr.pas
> Function "stringtopascalstring()".
>
> Martin
>
> --
> ___
> 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] Tool to convert a multiline text to a pascal string constant

2016-02-02 Thread Luiz Americo Pereira Camara
2016-02-02 18:40 GMT-03:00 Dmitry Boyarintsev <skalogryz.li...@gmail.com>:

> On Tue, Feb 2, 2016 at 4:33 PM, Luiz Americo Pereira Camara <
> luizameri...@gmail.com> wrote:
>
>> Hi is there any tool for Lazarus to convert a multi line text (xml
>> snipet, SQL) to a string constant?
>>
>
> Shouldn't there be something already in Lazarus itself that you could use?
>

I dont know. That's why i'm asking


> Back at the time when all resources were pascal string constants?
>
>
>>
>> Currently i'm using the following regular expression
>>
>> http://regexr.com/3cna5
>>
>
> I think it doesn't replace single-quote character (') by doubled
> single-quote character ( '' )
>
>
It's pretty simple if someone can improve it, it would help

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


[Lazarus] Tool to convert a multiline text to a pascal string constant

2016-02-02 Thread Luiz Americo Pereira Camara
Hi is there any tool for Lazarus to convert a multi line text (xml snipet,
SQL) to a string constant?

Currently i'm using the following regular expression

http://regexr.com/3cna5

If some one knows a better regular expression that handles putting ';'
instead of '+ LineEnding +' in last line would help also

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


Re: [Lazarus] Sparta docked form editor moved to trunk

2015-11-19 Thread Luiz Americo Pereira Camara
2015-11-19 4:25 GMT-03:00 Ondrej Pokorny :

> On 19.11.2015 02:40, Anthony Walter wrote:
>
>> Juha, wow this is gonna be the gold standard. One BIG problem I noticed
>> right off however. If you put a control on the form, for example a button,
>> you cannot remove it.
>>
>> Tested on Gtk2 Linux, Ubuntu with Unity desktop.
>>
>
> This works correctly on Windows (10), undocked environment.
>

There's a difference in design time behavior under gtk2 when compared with
windows. Maybe this is your case.

Here are my findings, posted sometime ago:

While trying to fix the bug reported in
http://forum.lazarus.freepascal.org/index.php/topic,28352.0.html

I found that the designer acts different in gtk2 related to Qt and win32

Under Qt (same environment as the gtk2 build) and Win32 if a put a control,
e.g. TTreeView in the designer, in TDesigner.MouseMoveOnControl the Sender
and DesignSender is always TForm regardless of the mouse being above the
child controls or not. See result of commenting a DebugLn:

TDesigner.MouseMoveOnControl Sender=Form1:TForm1 Form1:TForm1

Under gtk2 if a put the same control, the Sender and DesignSender will be
the TTreeView when mouse is over this child:

TDesigner.MouseMoveOnControl Sender=TreeView1:TTreeView TreeView1:TTreeView

Any clue why this difference?

Is it a bug?

BTW: i modified VTV to work but there may be other components affected

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


Re: [Lazarus] Dynamic resolution of IDE Macros (at first usage)

2015-11-08 Thread Luiz Americo Pereira Camara
Em 08/11/2015 18:02, "Mattias Gaertner" <nc-gaert...@netcologne.de>
escreveu:
>
> On Sun, 8 Nov 2015 16:38:47 -0300
> Luiz Americo Pereira Camara
>
> > I have in mind a feature that when an unknow macro is found a dialog is
> > show asking for the Macro value then store in Session file.
>
> How to change it later?

Good question. There's no GUI to edit CustomSessionData which is used by
some packages

Since there's currently no way, i will write an addon to register a Macro
$CustomDir to save / restore from CustomSessionData.

In addition will create a GUI to edit stored values

At first look, should be easy. Will call again if get stuck somehow

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


[Lazarus] Dynamic resolution of IDE Macros (at first usage)

2015-11-08 Thread Luiz Americo Pereira Camara
I'd like to setup a IDE Macro to be used in project output file path.

Since the value of this Macro is enviroment dependent (the directory of a
web server) it can not be saved hardcoded in project options

I have in mind a feature that when an unknow macro is found a dialog is
show asking for the Macro value then store in Session file.

I looked in Conditionals / Additions and overrides and could not find how
accomplish this.

Is it possible with the current IDE features?

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


Re: [Lazarus] External SIGSEGV (random) when assigning TBookmark

2015-11-02 Thread Luiz Americo Pereira Camara
2015-11-01 13:06 GMT-03:00 Luca Olivetti :

> El 01/11/15 a les 13:25, Leonardo M. Ramé ha escrit:
>
> To me, the code looks correct, but I'm getting a SIGSEGV while assigning
>> the bookmark. I must add the error only happens the 2nd or 3rd time this
>> method is called:
>>
>
> I suppose that's because the bookmark is only valid while the query is
> opened, buy you close it between getting the bookmark and setting it.
>
>
Yes. In TBufDataset, the bookmark references the internal buffer memory. As
soon dataset is closed, the memory may change

Luiz


> Bye
> --
> Luca Olivetti
> Wetron Automation Technology http://www.wetron.es/
> Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
>
>
> --
> ___
> 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] Literature about REST

2015-10-12 Thread Luiz Americo Pereira Camara
2015-10-11 7:03 GMT-03:00 Koenraad Lelong <lazar...@de-brouwerij.be>:

> Op 08-10-15 om 17:23 schreef Luiz Americo Pereira Camara:
>
>>
>>  > Hi,
>>  >
>>  > I would like to know more about web-programming with REST. Can anyone
>> recommend books or web-sites to read about it ? I virtually know nothing
>> about it.
>>
>> I read this book
>>
>> http://shop.oreilly.com/product/mobile/9780596805838.do
>>
>> Its a good one, with a few shortcomings:
>>
>> It uses examples with XML
>> Has a focus in HATEOAS. Particularly i dont buy HATEOS stuff, so i read
>> only until the CRUD service chapter.
>>
>> I have some free books/resources about it. I can send later
>>
>> Luiz
>>
>
> Hi Luiz,
>
> I would like those extra resources you mentioned.
>

<http://code.tutsplus.com/tutorials/a-beginners-introduction-to-http-and-rest--net-16340>
http://bitworking.org/news/How_to_create_a_REST_Protocol (search for its
archive for more articles)
https://dzone.com/refcardz/rest-foundations-restful (requires free
registration)
https://msdn.microsoft.com/en-us/library/dd203052.aspx (skip WCF specific
content)
https://pages.apigee.com/rs/apigee/images/api-design-ebook-2012-03.pdf
(more advanced, about best practices)

I have tons of bookmarks some very specific or redundant. I can share anyway

Meanwhile I read some articles on the web, but I need more knowledge about
> html.
>
>
While REST is mostly used in web apps, is not tied to it. It's possible to
use, for example in desktop applications


PS: in the last years i read a lot about REST just to learn that is not a
closed concept / interface. Is more an  architecture  style based in some
principles. So don't despair if you feel lost or if some "Restful way" of
doing things does not match what you need or do.
In my case i threw away all the HATEOAS stuff keeping the rules of using
nouns in resource identifiers, using HTTP verbs and return codes etc. If is
Restful or not i don't know and don't care. It works for me.

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


Re: [Lazarus] Literature about REST

2015-10-08 Thread Luiz Americo Pereira Camara
Em 08/10/2015 10:58, "Koenraad Lelong"  escreveu:
>
> Hi,
>
> I would like to know more about web-programming with REST. Can anyone
recommend books or web-sites to read about it ? I virtually know nothing
about it.

I read this book

http://shop.oreilly.com/product/mobile/9780596805838.do

Its a good one, with a few shortcomings:

It uses examples with XML
Has a focus in HATEOAS. Particularly i dont buy HATEOS stuff, so i read
only until the CRUD service chapter.

I have some free books/resources about it. I can send later

Luiz

> Searching amazon gives a number of  books, but since those are not cheap,
I would like to get a good book for my money.
>
> Thanks,
>
> Koenraad.
>
> --
> ___
> 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] multi step dialog

2015-08-21 Thread Luiz Americo Pereira Camara
2015-08-20 19:54 GMT-03:00 Anthony Walter sys...@gmail.com:

 I think this might help. I wrote a trivial custom graphic step control. It
 is in my Cross.Codebot package.

 http://codebot.org/snapshops/step-pick.jpg

 property Steps: TStrings;
 property StepIndex: Integer;
 property OnStepClick: TStepEvent;


Nice.

Looking for the Cross.Codebot availability

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


Re: [Lazarus] multi step dialog

2015-08-16 Thread Luiz Americo Pereira Camara
2015-08-16 11:33 GMT-03:00 Marc Santhoff m.santh...@web.de:

 Hi,

 is there any template like dialog having multiple steps the user
 switches with next/previous/finish-buttons?


https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluicontrols%2Fdemos%2Fwizard

The API is a bit cumbersome but works. Plan to improve the interface

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


Re: [Lazarus] An online package manager

2015-08-10 Thread luiz americo pereira camara
Em 10/08/2015 06:30, Juha Manninen juha.mannine...@gmail.com escreveu:

 On Mon, Aug 10, 2015 at 8:52 AM, Aradeonas aradeo...@operamail.com
wrote:
  Im agree with Luiz,Its better to have them in a server as a pack,


 In fact I like the FreeBSD ports system. Does it depend on SCM tools
 or does it download some ready made Zip packages from GitHub and other
 sites?
 Both ways have a problem : It is easy to get only the latest version
 of a package.

The SCM allows to retrieve older versions like tags or even specific
revisions.

In fact, allows to have  multiplex versions without the burden of havê to
upload every time a new version is released.

About using SCM to something that does not need: really it does not need
but would make the feature more flexible and easier to maintain (think of
the server maintanance and how a shutdown would affect the Lazarus users).

Luiz


 Anyway we should add support for different download sites for the
 Lazarus packages, in the spirit of FreeBSD ports.
 Maybe like this :

 Phase 1 :
 Support zipped meta-packages but allow to download them from any URL
 (HTTP or FTP).
 The difference to Kostas' minimal design is that the Lazarus .lpk
 files are not needed separately. The client can extract them and check
 dependencies. Having dependency info in other places would be
 duplicate info.
 A list of available packages must be in one file. Doing a FTP
 directory listing eats resources.
 Note: no server side SW is needed.

 Phase 2 :
 Support also downloading from sites hosting code (SF, GitHub etc.)
 when they provide direct download.
 Using the SCM tools directly cannot be supported because we cannot
 impose such a dependency for the cross-platform Lazarus.
 Still no server side SW is needed.

 Phase 3 :
 Support user rating and comments for packages.
 Support using the SCM tools from server. When a download URL refers to
 a SCM repo, the server SW loads the sources and zips a meta-package.
 Clients can use that package directly.
 Server side SW is needed obviously.

 Juha

 --
 ___
 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] An online package manager

2015-08-09 Thread luiz americo pereira camara
Em 08/08/2015 21:49, Kostas Michalopoulos badsectorac...@gmail.com
escreveu:

 I would make this more complicated than absolutely necessary.

 lpk files have version and dependency information. AFAIK that is all you
need to get a minimum working package manager using a central repository
although i'd like to see multiple repositories that provide packages (f.e.
personally i'd prefer to host my own packages on my server).

 IMO what needs to be done is quite simple:

  1. Have the downloadable packages be a zip file (tons of tools can make
them, Lazarus can read them, etc) with the package directory as it should
be after installation, with the lpk and all.

I would make even simpler by not requiring to zip and upload to a server
the package and corresponding files. I would download from the SCM (
git/svn) directly, like bower does. The data necessary to register the
package would be name, description, dependencies, the SCM type, and the
repository URL.

Luiz

  2. Once a package is uploaded to a repository, it should extract the lpk
file so that it can show information about the package in a web view and...
  3.  Lazarus can download a list of available packages from a repository
and when requested, it will download the lpk file to show the details. Once
the user decides to download a package, the full zip is downloaded with the
dependencies (if they are not already installed) and have them extracted in
some place (user designated or just C:\lazarus\downloaded or something like
that) and the lpk files installed.
  4. Done. Restart Lazarus for the new stuff to take effect.

 I know that there might be some minor issues or things people would like
(like multiple lpk files or even separate metadata file, a format with
better compression, a better gui, etc) but really those can be done later
and IMO the majority of packages will work just fine with this setup. The
other things like comments, rating, etc can also be done later.

 I think that if something is going to be done, it needs to be the minimal
work that needs to get things going because otherwise, it will get stalled
(and it has been a while I hear about an online package installer :-P).


 On Sun, Aug 9, 2015 at 2:11 AM, Juha Manninen juha.mannine...@gmail.com
wrote:

 On Sat, Aug 8, 2015 at 4:27 PM, Aradeonas aradeo...@operamail.com
wrote:
  Is there any work on this subject until now or any one like to work on
this
  subject? If yes I want to help.

 The fppkg is for FPC packages. It does not work with Lazarus packages.
 There is a GUI for fppkg in Lazarus named LazarusPackageManager but it
 is broken. It should be fixed or removed.

 We need a similar system for Lazarus packages and maybe other Lazarus
resources.
 The idea is not new and there is even some skeleton code for it in
 package Aarre. Nothing functional yet unfortunately.

 Studying this issue has been on my ToDo list for long. Some open
questions :

 1. How much synergy with fppkg should it have? Can it share code?

 2. Meta-package file format? I guess it should be a GZip package
 containing Lazarus package sources + other metadata. What other
 resources should be supported? More metadata is needed.

 3. Support for user comments and votes for the packages. The GUI in
 Lazarus must support adding and viewing them.

 4. List of servers. Initially it should be CCR but can be extended.
 The ideal situation is that all package authors provide such
 meta-packages somewhere.

 5. A website. Is it needed to find the packages and advertise them?
 This may have synergy with fppkg again.

 If you are serious about this project, you should study the issue and
 make a plan with some diagrams even.
 I believe a SVN branch in Lazarus repo can be organized if needed.
 If fppkg code must be refactored and then reused, it may be easier to
 first fork it and then later offer to FPC project as a patch.

 Regards,
 Juha

 --
 ___
 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] Compiler Options - Conditionally add a package dependency?

2015-07-09 Thread luiz americo pereira camara
2015-07-09 12:58 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:



 On Thu, 9 Jul 2015, Graeme Geldenhuys wrote:



 Is there a way with the Compiler Options - Other (or Additions and
 Overrides) to include a specific package based on a compiler define?



 I would even go further, and have a package included or not depending on
 the OS.


+1.

I hit similar issue and tried to use the Conditionals script with the IDE
Macro but could not get working .

My idea was do the following, but did not work:

  if SomeCondition then begin
UsageSrcPath += GetIDEValue('$PkgSrcPath(''apackagname'')');
  end;

In my specific case the condition was the avaibility of a package. See
thread Check if a package is available through macros

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


Re: [Lazarus] Compiler Options - Conditionally add a package dependency?

2015-07-09 Thread luiz americo pereira camara
Guys, i suggest to create another thread to discuss namespace.

This thread is a different topic, related to the IDE, while namespace is a
compiler thing.

Luiz
Em 09/07/2015 16:12, silvioprog silviop...@gmail.com escreveu:

 On Thu, Jul 9, 2015 at 4:05 PM, silvioprog silviop...@gmail.com wrote:
 [...]

 This option also enables the 'UseUnitScopeNames' directive, so you can
 use a unit declaration like 'uses {$IFNDEF
 UseUnitScopeNames}MyCompany.{$ENDIF}SysUtils'.


 Oops,

 ... so you can use an unit declaration like 'uses {$IFNDEF
 UseUnitScopeNames}MyCompany.{$ENDIF}SysUtils', that is very useful for
 keep support for legacy codes.

 --
 Silvio Clécio
 My public projects - github.com/silvioprog

 --
 ___
 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] Selectable desktops in Lazarus IDE

2015-07-09 Thread luiz americo pereira camara
Em 09/07/2015 16:23, Juha Manninen juha.mannine...@gmail.com escreveu:

 I am happy to tell that Lazarus trunk now (r49514) supports desktop
 settings which can be saved and selected by user.

Can you elaborate a bit about the feature?

Luiz

 Also a debug desktop is supported.
 This is brought to you by Ondrej Pokorny and myself.
 Please test.

 Regards,
 Juha

 --
 ___
 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] fast mathematical matrix operations

2015-07-07 Thread luiz americo pereira camara
2015-07-07 10:10 GMT-03:00 Graeme Geldenhuys mailingli...@geldenhuys.co.uk
:

 On 2015-07-07 13:36, Andrea Mauri wrote:
  mrmath actually works on MacOSX. why should be a big problem porting to
  linux?

 Indeed. If you limit the scope to x86 and amd64 CPU's then the port
 shouldn't be too hard. Can you confirm is these are the only CPU types
 you want to target?


Be aware that calling conventions differ in win64 and non win 64bit.

See Same 64bit assembly code compiles under windows but not in linux (fpc
260) and
win64 calling convention threads in fpc-devel

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


[Lazarus] Check if a package is available through macros

2015-07-05 Thread luiz americo pereira camara
I'd like to check if a package is installed to add conditional defines.

Following the wiki instructions, i added this script in Compiler Options/
Other / Conditionals of a package

  PackageName := GetIDEValue('$PkgName(''LCL'')');
  if Defined(PackageName) then begin
CustomOptions := '' + PackageName + '';
  end;

There's no dedicated macro to check if a package is installed so i tried to
use $PkgName macro.

Unfortunately, the PackageName is always empty

Is this the correct way to call the $PkgName macro?

Any hints?

Refs:
http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames

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


Re: [Lazarus] VCLJS

2015-06-30 Thread luiz americo pereira camara
2015-06-30 5:44 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:


 On Tue, 30 Jun 2015, Bee wrote:

 TypeScript outputs JavaScript, right? Is it possible to use the JS
 directly?



Yes. TypeScript outputs JavaScript.
Is it possible to use the JS directly in VCLJS? - I dont know


 I have no idea. I dropped the idea of Typescript as soon as I saw that you
 need Visual Studio to be able to handle it halfway decent.


I dont use TypeScript today and dont have plans to use it, but is gaining
traction in the JS landscape. The next version of Angular (the most popular
JS framework) will be written in TypeScript.

Regarding IDE support WebStorm has native support. Other editors like
Sublime or Atom have plugins for it.


 The new features in upcoming releases of Javascript should remove the need
 for Typescript anyway...


TypeScript is a superset of ECMAScript2015, which as TypeScript also needs
a transpiler like Babel

BTW: not impressed by VCL.JS

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


Re: [Lazarus] VCLJS

2015-06-30 Thread luiz americo pereira camara
2015-06-30 6:07 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:




 We use ExtJS at work, but are switching to Angular.


If you want to go with Angular in the long run you will need to use
TypeScript.

http://www.itworld.com/article/2894936/googles-angular-2-being-built-with-microsofts-typescript.html

Unless you stay in 1.x and all it's problems

https://javascriptkicks.com/articles/2657/i-wont-be-using-angular-for-my-next-project-and-neither-should-you
https://news.ycombinator.com/item?id=9325501

https://medium.com/@mnemon1ck/why-you-should-not-use-angularjs-1df5ddf6fc99
https://news.ycombinator.com/item?id=8830640

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


Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error

2015-06-25 Thread luiz americo pereira camara
2015-06-24 19:02 GMT-03:00 Bo Berglund bo.bergl...@gmail.com:


 In order to port it we had to convert an OBJ file from the dongle
 maker to a format FPC accepts (coff) using a 3rd party tool, which
 also has some bug in it.


There's a tool called CVTRES.EXE that comes with Visual Studio that does
such conversion. It's an alternative to get a proper coff format

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


Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error

2015-06-23 Thread luiz americo pereira camara
Take a look at
https://msdn.microsoft.com/pl-pl/library/vstudio/7dz62kfh(v=vs.110).aspx
(it suggests a cvtres.exe tool)

Ask to fpc guru if is possible to use manually an different linker like
http://www.digitalmars.com/ctg/optlink.html

In the end, i would try to compile a delphi dll and access it in fpc.

Another try (don't know if is possible) is to use delphi to compile
spromeps.pas as a obj in COFF

Luiz

2015-06-23 15:50 GMT-03:00 Luca Olivetti l...@wetron.es:

 El 23/06/15 a les 20:38, Bo Berglund ha escrit:

 On Tue, 23 Jun 2015 18:30:46 +0200, Luca Olivetti l...@wetron.es
 wrote:

  El 23/06/15 a les 17:51, Bo Berglund ha escrit:


 The problem is most likely in the conversion because even the smallest
 test application throws an exception on the very first call into the
 driver, the initialization of the Api data interface array.


 Or in the calling convention

 http://freepascal.org/docs-html/prog/progse22.html#x174-1770006.3

 you can try and define the external as stdcall or if that fail try cdecl
 (though I'm not sure the default is different than delphi).


 STDCALL has been there forever (since about 2002)...


 You could try cdecl then (though I doubt it will make a difference).

 Bye
 --
 Luca Olivetti
 Wetron Automation Technology http://www.wetron.es/
 Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

 --
 ___
 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] Newbie, porting class to FPC but get procedure assignment error

2015-06-22 Thread luiz americo pereira camara
In my experince sigsegv occurs mostly when a field or variable is accessed
before initialization.

Try to set a breakpoint in dongle.initkey call. And evaluate the dongle
field (open debugger evaluate window)

Look for dongle or one of the tsentinel fields being nil

Liiz

Em 22/06/2015 05:10, Bo Berglund bo.bergl...@gmail.com escreveu:

 On Mon, 22 Jun 2015 09:16:20 +0300, patspiper patspi...@gmail.com
 wrote:

 On 22/06/15 02:00, Bo Berglund wrote:
 
  I just made a first test by adding the object to my main form as a
  private variable.
 Which object? Better show the code.

 Here is the current state of the main form where the object is
 handled:

 unit FormMain;

 {$mode objfpc}{$H+}

 interface

 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
 StdCtrls,
   ExtCtrls,
   Sentinel;

 type

   { TfrmMain }

   TfrmMain = class(TForm)
 btnFindKey: TButton;
 stxSerialNo: TStaticText;
 procedure btnFindKeyClick(Sender: TObject);
 procedure FormClose(Sender: TObject; var CloseAction:
 TCloseAction);
 procedure FormCreate(Sender: TObject);
 procedure Timer1Timer(Sender: TObject);
   private
 { private declarations }
 Dongle: TSentinel; == My private object variable
   public
 { public declarations }
   end;

 var
   frmMain: TfrmMain;

 implementation

 {$R *.lfm}

 { TfrmMain }


 procedure TfrmMain.btnFindKeyClick(Sender: TObject);
 var
   SerialNo: word;
 begin
   //Code to check for the dongle and if found display its contents
   Dongle.InitKey; = I get the exception here
   Dongle.AppNumber := 1;
   if Dongle.CheckKey then
   begin
 SerialNo := Dongle.SerialNo;
 stxSerialNo.Caption := IntToStr(SerialNo);
   end;
 end;

 procedure TfrmMain.FormClose(Sender: TObject; var CloseAction:
 TCloseAction);
 begin
   Dongle.Free; = Destroying the object
 end;

 procedure TfrmMain.FormCreate(Sender: TObject);
 begin
   Dongle := TSentinel.Create; = Creating the object
 end;

 end.

  Project DongleTest raised exception class
  'External: SIGSEGV'.
 The 1st thing that comes to mind is that spromeps.obj is 32 bit and your
 Lazarus/fpc and Windows are most probably 64 bit. But I am not sure how
 the compiler/linker would react to that.

 I think I create a 32 bit application, see below.

 You had posted previously:
 Input file: SPROMEPS.obj, output file: SPROMEPS.coff
 Converting from OMF32 to COFF32 
 Not adding or removing underscores for this filetype
 Warning 1211: 270 comment records ignored
 
 Do you have a 64 bit version of spromeps.obj?

 No, this is legacy code and is only for 32 bit applications.
 SafeNet has created the driver for both 32 and 64 bit Windows, but the
 64 bit driver is still used for 32 bit applications (like mine). Has
 always worked fine with the Delphi apps (used since end of the
 1990:s).

 They did not provide a SPROMEPS.obj file for 64 bit Delphi maybe
 because that does not really exist yet (according to the Embarcadero
 user forum the newly released 64 bit compiler is not ready for prime
 time...)

 Question:
 Could it be that Lazarus is anyway compiling for a 64 bit application
 since it is installed on a 64 bit Windows 7 laptop?
 I just assumed that the main application would be 32 bit as is the
 case for Delphi

 But if I go into Project Options and look at Compiler Options -
 Config and Target - Target-specific options there is a checkbox for
 Win32 gui application (-WG) and it is checked.

 So I guess I am creating a Win32 exe as intended...


 --
 Bo Berglund
 Developer in Sweden


 --
 ___
 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] Newbie, porting class to FPC but get procedure assignment error

2015-06-22 Thread luiz americo pereira camara
In the breakpoint do a step into (f7) and ser the exact line that crashes

Luiz
Em 22/06/2015 14:03, Bo Berglund bo.bergl...@gmail.com escreveu:

 On Mon, 22 Jun 2015 13:29:07 -0300, luiz americo pereira camara
 luiz...@oi.com.br wrote:

 In my experince sigsegv occurs mostly when a field or variable is accessed
 before initialization.
 
 Try to set a breakpoint in dongle.initkey call. And evaluate the dongle
 field (open debugger evaluate window)
 
 Look for dongle or one of the tsentinel fields being nil
 

 I have already a breakpoint in the on-click event handler for the
 button. The code is:

 procedure TfrmMain.btnFindKeyClick(Sender: TObject);
 var
   SerialNo: word;
 begin
   //Code to check for the dongle and if found display its contents
   Dongle.InitKey;  -- Breakpoint here
   Dongle.AppNumber := 1;
   if Dongle.CheckKey then
   begin
 SerialNo := Dongle.SerialNo;
 stxSerialNo.Caption := IntToStr(SerialNo);
   end;
 end;

 When Lazarus stops and I hover over the Dongle variable (which was
 created in the form's OnCreate event) I see all fields of the Dongle
 object and they seem to be normal, except for the FSentinelPacket.

 This is supposed to be an array of char [1..1028] but it says
 FSENTINELPACKET=#0#0#0#0Truncated 1027-1000

 Does this imply that the size of the packet has been initialized
 erroneously?
 It is defined thus: ARRAY [1..1028] OF CHAR;
 Can the indexing be a problem? The packet is defined with a starting
 index of 1 rather than 0...


 --
 Bo Berglund
 Developer in Sweden


 --
 ___
 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] uniqueinstance

2015-05-23 Thread luiz americo pereira camara
Check for the property PriorInstanceRunning in FormDestroy

Luiz

2015-05-23 7:12 GMT-03:00 Martin mailingli...@collins-email.co.uk:

 Hi,

 Just need a little advice on placement of code please, thanks in advance.

 I wanted my app to have only one instance, so found uniqueinstance -
 http://wiki.lazarus.freepascal.org/UniqueInstance (it has the ability to
 pass the command line parameters from the second to the first instance
 which is something I want but haven't got round to testing yet!)

 There's no problem with uniqueinstance, from reading the source I think
 that it's terminating the second instance before the onshow event of the
 main form so I'm guessing that the formcreate and formdestroy events of the
 main form from the second instance still occur and that's where I think my
 problem is.

 I am using the formcreate event to parse the command line arguments to the
 constructor of my main class, which amongst other things unzips files to
 the /tmp directory. I then use the formdestroy to clean up, deleting the
 files in the /tmp directory.

 If I start a second instance with the same command line parameters as the
 first, uniqueinstance terminates the second instance and no second form is
 seen on screen. However, all the files are deleted from /tmp (formdestroy)
 so they are no longer available to the first instance so it fails. (I know
 in a real life situation it would be unlikely that the second instance
 would be trying to open the same files as the first, but not impossible.)

 So either I use some form of file locking or keep uniqueinstance and move
 my code. I just wanted some advice please, as to where people on the list
 would suggest I put the code to parse the command line parameters to the
 constructor of my main class and/or clean up code. I was looking at some of
 the application events in the myapp.lpr file but I am not sure if that is
 the right place? Any help gratefully received.

 Thanks,

 Martin Collins

 --
 ___
 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] Feature request/inquiry

2015-04-27 Thread luiz americo pereira camara
2015-04-26 23:04 GMT-03:00 Dmitry Boyarintsev skalogryz.li...@gmail.com:

 On Sun, Apr 26, 2015 at 8:58 PM, luiz americo pereira camara 
 luiz...@oi.com.br wrote:


 Only TextHint support would be merged to TEdit.


 True. TextHint is required for Delphi compatibility in the first place.
 But to go a bit better than Delphi, IconHint method could be introduced as
 well... as requested by MVC originally!


 In fact SearchEdit is a bad name. Better would be ActionEdit


 why ActionEdit?


Add convenience feature to execute action on response to editing

To be clear: is not intended to add such control whatever it is name

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


Re: [Lazarus] Feature request/inquiry

2015-04-26 Thread luiz americo pereira camara
2015-04-26 8:41 GMT-03:00 Juha Manninen juha.mannine...@gmail.com:

 On Sun, Apr 26, 2015 at 1:26 PM, Michael Van Canneyt
 mich...@freepascal.org wrote:
  Is there such a thing for Lazarus' TEdit and related controls ? if not,
 is
  it planned ?

 It is planned :
   http://bugs.freepascal.org/view.php?id=21307

 I don't know how many widgetsets support it but we can implement it
 like already done in the FilterEdit components.


I implemented here long time ago:
https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas

If agreed i can add to LCL as TEdit.TextHint

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


Re: [Lazarus] Feature request/inquiry

2015-04-26 Thread luiz americo pereira camara
2015-04-26 15:18 GMT-03:00 Dmitry Boyarintsev skalogryz.li...@gmail.com:

 On Sun, Apr 26, 2015 at 1:35 PM, luiz americo pereira camara 
 luiz...@oi.com.br wrote:


 I implemented here long time ago:
 https://code.google.com/p/luipack/source/browse/trunk/luicontrols/searchedit.pas

 If agreed i can add to LCL as TEdit.TextHint


 Two notes here:

 #1
 for the case of TSearchEdit - it should be (optionally) a stand alone
 widget, rather than a hard-coded pure LCL control.
 otherwise it would not be rendered properly for OSX


Only TextHint support would be merged to TEdit.

In fact SearchEdit is a bad name. Better would be ActionEdit

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


Re: [Lazarus] Error compiling Lazarus: process_begin: CreateProcess(...) failed

2015-04-10 Thread luiz americo pereira camara
2015-04-10 16:32 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Fri, 10 Apr 2015 08:54:20 -0300
 luiz americo pereira camara luiz...@oi.com.br wrote:

  Copied Lazarus exe from other computer and recompiled through the IDE
  without issues

 Do I understand this correctly:
 Even 'make' gave strange problems. And by copying lazarus.exe this was
 fixed?


Yes.

I did not tried make through command line after that. I recompiled by the
IDE, which seems to also uses make.

Not sure if this helps:

I had two fpc installed fpc264rc1 and 264, only the later is on the path

The old Lazarus exe was compiled by rc1, the make and fpc used by
commandline where from 264

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


Re: [Lazarus] Package dialog ?

2015-03-23 Thread luiz americo pereira camara
2015-03-23 5:46 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:


 Hi,

 What is the rationale for duplicating the 'Add' button in the package
 dialog ?

 The buttons as they are now are highly confusing. I preferred the old
 system where there was only 1 button. That was clear and intuitive.


+1

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


[Lazarus] Criteria to add/remove UnitName from project (lpi) file

2015-03-22 Thread luiz americo pereira camara
From time to time, the UnitName row is added or removed from the Unit entry
in lpi file.

This occurs even in the same Lazarus version.

Take as example the following:

http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added in
lpi

http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files have
UnitName removed

Is this a bug ?

Lazarus 1.5 r48168 FPC 2.6.4 i386-win32-win32/win64

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


Re: [Lazarus] Criteria to add/remove UnitName from project (lpi) file

2015-03-22 Thread luiz americo pereira camara
2015-03-22 16:32 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 22 Mar 2015 10:15:23 -0300
  http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added
 in
  lpi
 
  http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files
 have
  UnitName removed
 
  Is this a bug ?

 Probably. Do you know how to reproduce it?


Not yet. Trying.

Tracked until TUnitInfo.SaveToXMLConfig where fUnitName sometimes is empty.

Tried to find where fUnitName is set (put breakpoints at
ImproveUnitNameCache, SetUnitName, ReadUnitSource and LoadFromXMLConfig)
but no luck.

Still trying

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


Re: [Lazarus] Criteria to add/remove UnitName from project (lpi) file

2015-03-22 Thread luiz americo pereira camara
2015-03-22 16:59 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:



 2015-03-22 16:32 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 22 Mar 2015 10:15:23 -0300
  http://imagebin.ca/v/1vhYYNAJuxPx : Here two files have UnitName added
 in
  lpi
 
  http://imagebin.ca/v/1vhYLsrfpWDd : One commit later, the same files
 have
  UnitName removed
 
  Is this a bug ?

 Probably. Do you know how to reproduce it?



Found something that may be related:

Take the following entry:

Unit1
Filename Value=views\mainview.pas/
IsPartOfProject Value=True/
ComponentName Value=MainViewForm/
HasResources Value=True/
ResourceBaseClass Value=Form/
/Unit1

In TUnitInfo.LoadFromXMLConfig:

A Filename is set to  FileName ('views\mainview.pas')
AFilename:=XMLConfig.GetValue(Path+'Filename/Value','');

Later AFileName is set again this time to ResourceFileName, that is empty
AFilename:=XMLConfig.GetValue(Path+'ResourceFilename/Value','');

Later AFilename is checked before setting fUnitName:
if FilenameIsPascalSource(AFilename) then

fUnitName:=XMLConfig.GetValue(Path+'UnitName/Value',ExtractFileNameOnly(AFilename));

Since AFileName is empty, fUnitName will not be set



In the other side, in the following file

  Unit2
Filename Value=models\patientclasses.pas/
IsPartOfProject Value=True/
UnitName Value=PatientClasses/
  /Unit2

fUnitName is set to empty at LoadFromXMLConfig, but at the time of saving
fUnitName gets its correct value 'PatientClasses'. Could not detect where
gets the correct value. Breakpoints  at ImproveUnitNameCache, SetUnitName,
ReadUnitSource and LoadFromXMLConfig

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


Re: [Lazarus] Criteria to add/remove UnitName from project (lpi) file

2015-03-22 Thread luiz americo pereira camara
2015-03-22 16:32 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 22 Mar 2015 10:15:23 -0300
 luiz americo pereira camara luiz...@oi.com.br wrote:

  From time to time, the UnitName row is added or removed from the Unit
 entry
  in lpi file.

 
  Is this a bug ?

 Probably. Do you know how to reproduce it?


See http://bugs.freepascal.org/view.php?id=27713

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


Re: [Lazarus] Criteria to add/remove UnitName from project (lpi) file

2015-03-22 Thread luiz americo pereira camara
2015-03-22 17:44 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:




 2015-03-22 16:59 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br
 :



 2015-03-22 16:32 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 22 Mar 2015 10:15:23 -0300
  Is this a bug ?

 Probably. Do you know how to reproduce it?



 fUnitName is set to empty at LoadFromXMLConfig, but at the time of saving
 fUnitName gets its correct value 'PatientClasses'. Could not detect where
 gets the correct value. Breakpoints  at ImproveUnitNameCache, SetUnitName,
 ReadUnitSource and LoadFromXMLConfig



In the case of 'PatientClasses' the FUnitName is set through
ReadUnitNameFromSource. Follows backtrace.

I think i can reproduce now. If i do i will create a bug report

#0 TUNITINFO__SETFUNITNAME(0x15984878 'PatientClasses', error reading
variable) at project.pp:1996
#1 TUNITINFO__READUNITNAMEFROMSOURCE(false, error reading variable) at
project.pp:1626
#2 TFILEOPENER__OPENKNOWN(error reading variable) at
sourcefilemanager.pas:849
#3 TFILEOPENER__OPENEDITORFILE(-1, 0, 0x158c63c8,
[OFPROJECTLOADING..OFONLYIFEXISTS, OFMULTIOPEN], error reading variable)
at sourcefilemanager.pas:1157
#4 OPENEDITORFILE(0x15882278
'D:\repositories\nefrolog\lclclient\models\patientclasses.pas', -1, 0,
0x158c63c8, [OFPROJECTLOADING..OFONLYIFEXISTS, OFMULTIOPEN], true) at
sourcefilemanager.pas:338
#5 TLAZSOURCEFILEMANAGER__INITOPENEDPROJECTFILE(0x15674318
'D:\repositories\nefrolog\lclclient\NefroLog.lpi', [OFADDTORECENT], error
reading variable) at sourcefilemanager.pas:3406
#6 TMAINIDE__DOOPENPROJECTFILE(0x15674318
'D:\repositories\nefrolog\lclclient\NefroLog.lpi', [OFADDTORECENT], error
reading variable) at main.pp:6319
#7 TLAZSOURCEFILEMANAGER__OPENPROJECT(0x155b31d0, error reading variable)
at sourcefilemanager.pas:3778


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


Re: [Lazarus] Received a pull request from github - Fixes build_debug_apk.bat

2015-03-19 Thread luiz americo pereira camara
2015-03-19 10:44 GMT-03:00 Graeme Geldenhuys mailingli...@geldenhuys.co.uk
:

 On 2015-03-19 10:51, Felipe Monteiro de Carvalho wrote:
  On Thu, Mar 19, 2015 at 11:26 AM, Lukasz Sokol el.es...@gmail.com
 wrote:
  Click on 'commits' then on the file link.
 
  This leads to:
 https://github.com/shenxh/lazarus/commit/633dc282555e9d12d945628d1c069bfcdba871d7

 You can then click the View button to see the complete new file which
 you can copy over your existing one. SVN will then show you the diff.

 It doesn't seem that GitHub's web inteface allows downloading of patch
 files.


https://github.com/shenxh/lazarus/commit/633dc282555e9d12d945628d1c069bfcdba871d7.patch

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


Re: [Lazarus] Received a pull request from github - Fixes build_debug_apk.bat

2015-03-19 Thread luiz americo pereira camara
If you prefer:
https://github.com/shenxh/lazarus/commit/633dc282555e9d12d945628d1c069bfcdba871d7.diff

Luiz

2015-03-19 10:51 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:



 2015-03-19 10:44 GMT-03:00 Graeme Geldenhuys 
 mailingli...@geldenhuys.co.uk:

 On 2015-03-19 10:51, Felipe Monteiro de Carvalho wrote:
  On Thu, Mar 19, 2015 at 11:26 AM, Lukasz Sokol el.es...@gmail.com
 wrote:
  Click on 'commits' then on the file link.
 
  This leads to:
 https://github.com/shenxh/lazarus/commit/633dc282555e9d12d945628d1c069bfcdba871d7

 You can then click the View button to see the complete new file which
 you can copy over your existing one. SVN will then show you the diff.

 It doesn't seem that GitHub's web inteface allows downloading of patch
 files.



 https://github.com/shenxh/lazarus/commit/633dc282555e9d12d945628d1c069bfcdba871d7.patch

 Luiz


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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-22 Thread luiz americo pereira camara
2015-02-22 8:05 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  compiler options:

 -dUseCThreads

 -FcUTF8

 -dEnableUTF8

 this is test code:
 var
   wProgram: String;
   z:longint;
   s:string;
 begin
  Result   := False;
  wProgram :=ParamStrUTF8(0);
  wFileStr := TFileStream.Create(wProgram, fmOpenRead);
  z:= -1;
  z:=wFileStr.Handle;
  s:=wFileStr.FileName;

 result:
 wProgram -- ^char($00010CA86358)  '/opt/proje_laz/myproject.app'
 z -- 40
 wFileStr.FileName -- '/opt/proje_laz/myproject.app'
 s -- ^char($00010CA86358) '/opt/proje_laz/myproject.app'

 I getted this result while debugging from Whach list, via copy value.
 wFileStr.FileName and s showing different value. ^char


OK.

Thanks.

Personally don't have more idea of what is wrong. Hopefully someone else
can find the problem

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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-22 Thread luiz americo pereira camara
2015-02-22 11:46 GMT-03:00 FreeMan freema...@delphiturkiye.com:

 I wrote before, I'm not use this code block now. I remove that code block
 to function. still not remove it, save for your tests. please let me know,
 need test etc. when you tell me you finished or cansel work on it, I'll
 remove that from my code.


For my sake, feel free to remove from your code. I really don't have a clue
what went wrong.
Anyway, if someone wants to take a look, the code can be easily
reconstructed from the info in this thread.

Luiz
--
___
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-22 Thread luiz americo pereira camara
Thanks.

I updated at
https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fmultilog

For using svn you can look at
http://wiki.lazarus.freepascal.org/Getting_Lazarus#Getting_SVN
Replace lazarus url by http://luipack.googlecode.com/svn/trunk/ luipack

For creating a patch look at
http://wiki.lazarus.freepascal.org/Creating_A_Patch

Luiz

2015-02-21 20:27 GMT-03:00 Roberto P. padovan...@gmail.com:

 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 luiz...@oi.com.br
 :

 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. padovan...@gmail.com:

 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 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 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. padovan...@gmail.com:

 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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-21 Thread luiz americo pereira camara
2015-02-20 10:27 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  Sorry I been late.


OK. They are equal so problem is elsewhere

One  last shot.

Can you check the values of wFileStr FileName and Handle properties?

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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-19 Thread luiz americo pereira camara
May you also check the DefaultSystemCodePage value

and StringCodePage(wParam) before and after assigning wParam

Luiz

2015-02-19 8:02 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:



 2015-02-19 5:30 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  osx fpc  lazarus svn QT x64
 my project's Compiler options has
 -FcUTF8
 -dEnableUTF8

 this is my code: this code work normal without ut8 params

 const
   WIN_EXE: String = 'MZ';
   LINUX_EXE: String = #127 + 'ELF';
 var
   wFileStr: TFileStream;
   ar: array[0..4] of byte;
   ExecType: char;
  wProgram := ParamStrUTF8(0);



 What type is wParam?

 Can you check the return value of the below procedure when passing wParam
 with and without -FcUTF8?

 function StrToHex(const S: RawByteString): String;
 var
   i: Integer;
 begin
   Result := '';
   if S = '' then
 Exit;
   for i := 1 to Length(S) do
   begin
 Result := Result + IntToHex(Byte(S[i]), 0);
   end;
 end;

 Luiz

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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-19 Thread luiz americo pereira camara
2015-02-19 8:19 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  showmessage(StrToHex('1234567890'));
 results:
 Compiler Options -- Other is empty
 31323334353637383930

 Compiler Options -- Other -FcUTF8

 31323334353637383930

 Compiler Options -- Other -FcUTF8 , -dEnableUTF8

 31323334353637383930


Thanks. This means problem is not in ParamStrUTF8(0);

I have two more tips to try to see where the problem is:

What is the type of wProgram?

Compile with the option -al (without debug info to get smaller files) and
look to the generated asm file (has .s extension and lives the same dir the
units are store)

look at the generated code for

wFileStr := TFileStream.Create(wProgram, fmOpenRead);

and

wFileStr.Read(ar, 4);

BTW: the compiler are being recompiled with those options -FcUTF8 ,
-dEnableUTF8 or only LCL?

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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-19 Thread luiz americo pereira camara
2015-02-19 9:41 GMT-03:00 FreeMan freema...@delphiturkiye.com:

where to add this parameter?


Custom Options. just put -al in the memo

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


Re: [Lazarus] -FcUTF8,-dEnableUTF8 create problem

2015-02-19 Thread luiz americo pereira camara
2015-02-19 9:41 GMT-03:00 FreeMan freema...@delphiturkiye.com:



 maybe I have a another bug
 Project option - Compiler options - Other
  Button All options ... open All options form but not show anything.
 Just filter bar and checkbox


Same here. Probably related to compiler version (v3.x). When i open a
project that uses fpc 2.6.4 the options are show

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


[Lazarus] Freepascal/Lazarus port of JEDI Code Library (JCL)

2015-02-16 Thread luiz americo pereira camara
Hi,

I ported JCL to Freepascal/Lazarus. More info at
https://github.com/blikblum/jcl

Although most of the changes was adjusting defines / uses clause to make
compilable, it needs more tests since I only tested JclExprval.

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


Re: [Lazarus] PageControl tabs not showing

2015-01-19 Thread luiz americo pereira camara
2015-01-18 18:07 GMT-03:00 Werner Pamler werner.pam...@freenet.de:


 Since other controls work fine on a PageControl these two components seem
 to miss something which prevents the other tabs to show up. Any idea what
 could be wrong?



Yes. Those controls are forcing handle creation earlier, e.g., in Loaded.

I looked TsCustomWorksheetGrid. Try to move NewWorkbook from Loaded to
InitializeWnd

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


Re: [Lazarus] PageControl tabs not showing

2015-01-19 Thread luiz americo pereira camara
2015-01-19 14:21 GMT-03:00 Werner Pamler werner.pam...@freenet.de:

 Thanks Luiz. Unfortunately, after I removed Loaded and added a new
 method InitializeWnd containing the NewWorksheet call there is no
 improvement. Your answer, however, guided me to the Setup method in which
 the column and rows are prepared. At its beginning I added an if csLoading
 in ComponentState then exit - and now the issue is gone even with the old
 Loaded in place.


Good you got the tip.

I hope the other control get fixed also.

A more precise way to know what is forcing the Handle creation is add an
override of CreateHandle method and put a breakpoint there. Than follow the
callstack.

Luiz



 --
 ___
 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] Inversion of control (IoC) and Dependency injection (DI)

2015-01-11 Thread luiz americo pereira camara
2015-01-11 17:12 GMT-03:00 silvioprog silviop...@gmail.com:

 On Mon, Jan 5, 2015 at 5:07 PM, luiz americo pereira camara 
 luiz...@oi.com.br wrote:

 I created a IoC Container that can be found at
 https://code.google.com/p/luipack/source/browse/trunk/luicomponents/luiioccontainer.pas
 . It has no dependencies.


 Awesome!


Thanks.



 With it is possible to implement Service Locator and Property Injection
 patterns. Constructor Injection is not possible due to lacking of Extended
 RTTI support in fpc.


 Can you send a small (and isolated) sample showing how to use it?


There's a demo in demos/ioccontainer folder

In a real project, in the app start, i do:

  FPresentations := TPresentationManager.Create(Self);
  Services.Register(IPresentationManager, FPresentations);

When i need the service i do:

  FPresentations :=
IPresentationManager(Services.Resolve(IPresentationManager));

The global, nor the actual implementation is exposed, making easier to test.
There's still a dependency to the container (Services), this is the whole
point of criticism to service locator pattern.
In the other side there always be a place where the dependency is set, even
in other DI patterns.

BTW: Custom Attributes support would help to have a nicer Property
 Injection implementation


 I've plan to use something like this (CDI inspirations:
 http://cdi-spec.org):


Seems a full ORM plus a MVC like framework.

I'm more modest. I use these classes to make modular code thus a bit more
maintanable.

All in all i use the IoC container little, in my project i register only
two interfaces. In other places, i configure the dependency manually

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


Re: [Lazarus] Inversion of control (IoC) and Dependency injection (DI)

2015-01-05 Thread luiz americo pereira camara
2015-01-05 21:44 GMT-03:00 Marcos Douglas m...@delfire.net:

 On Mon, Jan 5, 2015 at 6:07 PM, luiz americo pereira camara
 
  I created a IoC Container that can be found at
 
 https://code.google.com/p/luipack/source/browse/trunk/luicomponents/luiioccontainer.pas
  . It has no dependencies.

 
  So in the end, i use the service locator and have plans to use Property
  Injection pattern
 
  BTW: Custom Attributes support would help to have a nicer Property
 Injection
  implementation

 Interesting.
 Could you give us some example how this class works?


There's a demo in demos/ioccontainer

In a working project i use a IPresentationManager
https://code.google.com/p/luipack/source/browse/trunk/luicontrols/presentationmanager.pas#36

When a class needs to use it, resolves from a TIoCContainer (Service
Locator pattern). The global variable and concrete class are not exposed.
In the other hand depends of the IoCContainer. I have plans to switch to a
Property Injection pattern that helps to decouple a bit more.

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


[Lazarus] Inversion of control (IoC) and Dependency injection (DI)

2015-01-05 Thread luiz americo pereira camara
Starting a new thread.


2015-01-05 15:16 GMT-03:00 silvioprog silviop...@gmail.com:

 On Mon, Jan 5, 2015 at 12:54 PM, Marco van de Voort mar...@stack.nl
 wrote:


 As a first step in the 3.0.0 release process the stable branch was
 branched
 off to branches/fixes_3_0 and the version number was updated to 3.0.1

 The version in trunk was raised to 3.1.1

 Scripts might need modification accordingly.


 Good news!

 Chances of custom attributes[1] (or something like this) in release 3.0? I
 have plans to use IoC[2] and DI using this feature.


I created a IoC Container that can be found at
https://code.google.com/p/luipack/source/browse/trunk/luicomponents/luiioccontainer.pas
. It has no dependencies.

With it is possible to implement Service Locator and Property Injection
patterns. Constructor Injection is not possible due to lacking of Extended
RTTI support in fpc.

While the C# crowd  praises the Constructor Injection pattern (
http://www.devtrends.co.uk/blog/how-not-to-do-dependency-injection-the-static-or-singleton-container
), i had hard times figuring how it would work in real world / Lazarus
projects. Also, polluting the constructor  signature is not something that
i like. And finally with Constructor Injection is not possible to use with
TComponent / TForm

So in the end, i use the service locator and have plans to use Property
Injection pattern

BTW: Custom Attributes support would help to have a nicer Property
Injection implementation

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


Re: [Lazarus] Another Where is Error

2014-12-02 Thread luiz americo pereira camara
You have a Lazarus package that depends of sqlite3


You should uninstall this package or install  the sqlite3-dev system package

Luiz

2014-12-02 12:01 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  Copied from messages form. I can see /usr/bin/ld: cannot find -lsqlite3
 this line, but I don't know witch *lpk or pas*. How can I find wrong file
 or lpk and remove or fix error?

 *Build IDE: Exit code 512, Errors: 1, Warnings: 1*
 Verbose: /usr/bin/make -C ide idepkg
 Verbose: make[1]: Entering directory `/opt/lazarus/ide'
 Verbose: /usr/bin/make --assume-new=lazarus.pp lazarus OPT=' -gs -gl
 @/home/freeman35/.lazarus-freeman/idemake.cfg -vbq
 -FU/opt/lazarus/units/x86_64-linux/qt'
 Verbose: make[2]: Entering directory `/opt/lazarus/ide'
 Verbose: /opt/freepascal/2.7.1/bin/fpc -gl -Sci -dlclqt -Fu../designer
 -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager
 -Fu../packager/frames -Fu../components/custom -Fuframes -Fu.
 -Fu/usr/lib/fpc/2.7.1/units/x86_64-linux/rtl -Fiinclude -Fiinclude/linux
 -Fi../images -FE.. -FU../units/x86_64-linux/qt -Cg
 -Fl/usr/lib/gcc/x86_64-linux-gnu/4.8 -Flinclude -Fl/etc/ld.so.conf.d/*.conf
 -gs -gl @/home/freeman35/.lazarus-freeman/idemake.cfg -vbq
 -FU/opt/lazarus/units/x86_64-linux/qt -dx86_64 lazarus.pp
 Verbose: Free Pascal Compiler version 2.7.1 [2014/12/02] for x86_64
 Verbose: Copyright (c) 1993-2014 by Florian Klaempfl and others
 Verbose: Target OS: Linux for x86-64
 Verbose: Compiling lazarus.pp
 Verbose: Compiling resource /opt/lazarus/units/x86_64-linux/qt/lazarus.or
 Verbose: Linking ../lazarus
 /usr/bin/ld: warning: ../link.res contains output sections; did you forget
 -T?
 /usr/bin/ld: cannot find -lsqlite3
 lazarus.pp(142,1) Warning: Error while linking
 lazarus.pp(142,1) Verbose: There were 1 errors compiling module, stopping
 Error: Compilation aborted
 Verbose: /usr/bin/ppcx64 returned an error exitcode
 Verbose: make[2]: Leaving directory `/opt/lazarus/ide'
 Verbose: make[1]: Leaving directory `/opt/lazarus/ide'
 Verbose: [lazarus] Error 1
 Verbose: [idepkg] Error 2


 --
 ___
 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] Another Where is Error

2014-12-02 Thread luiz americo pereira camara
2014-12-02 12:47 GMT-03:00 FreeMan freema...@delphiturkiye.com:

  My question is how to *find depend pas or lpk*.


AFAIK, there's no way.

You may look at package files src

sqlite3laz is a package that have such dependency

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


Re: [Lazarus] Another Where is Error

2014-12-02 Thread luiz americo pereira camara
2014-12-02 13:30 GMT-03:00 FreeMan freema...@delphiturkiye.com:

 Thank you Luiz,
 Afew second ago I found, luilazreportcomponents 0.0 I'm not remember how
 to added this :)  I was added so long time ago for test this pack.
 How to find: Uninstall and try rebuild IDE one by one :S


It's one of my packages.
It has a dependency of luicomponents that requires sqlite3
I have plans to remove this dependency unfortunately is low priority

Luiz



 On 02-12-2014 18:15, luiz americo pereira camara wrote:

 AFAIK, there's no way.

 You may look at package files src

 sqlite3laz is a package that have such dependency

 Luiz



 --
 ___
 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] UTF8 RTL for Windows

2014-11-24 Thread luiz americo pereira camara
2014-11-24 6:29 GMT-03:00 Michael Schnell mschn...@lumino.de:

 On 11/23/2014 07:52 PM, Felipe Monteiro de Carvalho wrote:


 Well, the first reports of how the unicode rtl would look like were
 pretty scary: Total break of the string part of millions of lines of
 code that people wrote with Lazarus since years.

  That is why I stopped recommending Lazarus to my colleagues who are
 doing Delphi.

 They took a huge amount of pain to convert their software from Delphi one
 byte strings to Delphi two bytes strings. Hence they will not be pleased to
 be forced to convert back to one byte strings to be able to use Lazarus and
 some time later convert to two byte strings again once Lazarus might be
 forced to finally follow Delphi on that behalf.


If the program does not explicitely assumesa specific encoding, i.e. use
only String type and do not do low level string handling, there will be no
need to change.

I did/do convert a lot of Delphi components and can assure that most will
not need changes as is today

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


Re: [Lazarus] UTF8 RTL for Windows

2014-11-24 Thread luiz americo pereira camara
2014-11-24 8:15 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 23 Nov 2014 21:37:56 -0300
 luiz americo pereira camara luiz...@oi.com.br wrote:

  The attached program show how data loss can occur

 The program uses writeln, which converts to console CP.
 When you save the strings to a file you can see what they contain. Or
 write the byte values.


Yes. I improved the program (see message that followed) to write the bytes
values so the comparison should be more exact.


 This works with or without {$codepage utf8}:

 S := 'João'; // constant to (Ansi or Short)string


Without {$codepage utf8}
When DefaultSystemCodePage is CP_ACP the variable S will have the content
of UTF8 but the encoding will be ACP (in my case 1252), just like is today.
With DefaultSystemCodePage as CP_UTF8 both content and code page will match

[..]

I guess it would be a good idea to pass -Fcutf8 with FPC 2.7.1. For
 both modes.


Probably yes.
There's one case that must be tested. When the file is encoded in ansi like
those shared with Delphi.
What i understand with -Fcutf8, the compiler will interpret those content
as UTF8 creating wrong encoded constant.

$codepage directive overrides -Fcutf8?
If so, to fix the developer could use $codepage with the correct file
encoding

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


Re: [Lazarus] UTF8 RTL for Windows

2014-11-23 Thread luiz americo pereira camara
2014-11-20 13:21 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:


 2. The new mode: The LCL, FCL and RTL treat all String as UTF-8
 encoded. Most RTL file functions now work with full Unicode.
 For example FileExists and aStringList.LoadFromFile(Filename) now
 support full Unicode.


[..]

Please test and tell what you find out.


The FormatSettings fields are still encoded with System Code Page
regardless of DefaultSystemCodePage value.

While for english locales there's no problem, other locales like PT-BR have
accented names in days and monthes.

The problem is in windows SysUtils.GetLocaleStr function that uses non
unicode Win Api function. This problem will affect also the UnicodeString
RTL.

Attached is a test app that shows the issue. It also has a version of
GetLocaleStr that fixes the issue for the RTL (both versions)

Luiz
program TestUTF8FormatSettings;

{$mode objfpc}{$H+}

uses
  {$ifdef Windows}
  Windows,
  {$endif}
  Classes, sysutils;

{$ifdef Windows}
function GetLocaleStrTest(LID, LT: Longint; const Def: string): String;
var
  L: Integer;
  Buf: array[0..255] of WideChar;
  W: WideString;
begin
  L := GetLocaleInfoW(LID, LT, Buf, SizeOf(Buf));
  if L  0 then
  begin
//SetString(Result, PWideChar(@Buf[0]), L - 1) leads to wrong result
//Bug in Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt) ?
SetString(W, PWideChar(@Buf[0]), L - 1);
Result := W;
  end
  else
Result := Def;
end;
{$endif}

var
  i: Integer;
  S: String;
  List: TStringList;
begin
  WriteLn('DefaultSystemCodePage: ', DefaultSystemCodePage);
  DefaultSystemCodePage:=CP_UTF8;
  DefaultRTLFileSystemCodePage:=CP_UTF8;
  List := TStringList.Create;
  for i := 1 to 12 do
  begin
Write(StringCodePage(DefaultFormatSettings.LongMonthNames[i]), ' - ');
WriteLn(DefaultFormatSettings.LongMonthNames[i]);
List.Add(DefaultFormatSettings.LongMonthNames[i]);
  end;
  for i := 1 to 7 do
  begin
Write(StringCodePage(DefaultFormatSettings.LongDayNames[i]), ' - ');
WriteLn(DefaultFormatSettings.LongDayNames[i]);
List.Add(DefaultFormatSettings.LongDayNames[i]);
  end;
  {$ifdef Windows}
  S := GetLocaleStrTest(GetThreadLocale, LOCALE_SDAYNAME1+1, 'xx');
  Write(StringCodePage(S), ' - ');
  WriteLn(S);
  List.Add(S);
  {$endif}

  List.SaveToFile('TestUTF8FormatSettingsOut.txt');
  List.Destroy;
end.

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


Re: [Lazarus] UTF8 RTL for Windows

2014-11-23 Thread luiz americo pereira camara
2014-11-20 13:21 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:


 Please test and tell what you find out.



Without {$codepage utf8} directive String constants will get Code Page 0
(CP_ACP) and not the 1200 (UTF16 - UnicodeString).

String variables assigned to those constants will also have Code Page = 0

This is because the constant string code page is evaluated at compile time

Not sure if there's a compiler command line param with same effect as
{$codepage utf8}

The attached program show how data loss can occur

Luiz
program testStringConstantCP;

{$mode objfpc}{$H+}

uses
  Classes, sysutils;
var
  W: UnicodeString;
  S, S_2: String;
  SUTF8, SUTF8_2: UTF8String;
begin
  SetMultiByteConversionCodePage(CP_UTF8);
  W := 'João';
  Write('W: ': 10, StringCodePage(W), ' - ');
  WriteLn(W);

  S := 'João';
  Write('S: ': 10,StringCodePage(S), ' - ');
  WriteLn(S);

  S_2 := W;
  Write('S_2: ': 10,StringCodePage(S_2), ' - ');
  WriteLn(S_2);

  SUTF8 := W;
  Write('SUTF8: ': 10,StringCodePage(SUTF8), ' - ');
  WriteLn(SUTF8);

  SUTF8_2 := S;
  Write('SUTF8_2: ': 10, StringCodePage(SUTF8_2), ' - ');
  WriteLn(SUTF8_2);
end.

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


Re: [Lazarus] UTF8 RTL for Windows

2014-11-23 Thread luiz americo pereira camara
I added {.$codepage utf8} and all strings output as Joao.

Got confused. I did not to expect changes in the constant assigned to the
UnicodeString variable

Need to check what is the correct UTF8 output:  JoA£o or Joao

Luiz

2014-11-23 21:37 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:



 2014-11-20 13:21 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:


 Please test and tell what you find out.



 Without {$codepage utf8} directive String constants will get Code Page 0
 (CP_ACP) and not the 1200 (UTF16 - UnicodeString).

 String variables assigned to those constants will also have Code Page = 0

 This is because the constant string code page is evaluated at compile time

 Not sure if there's a compiler command line param with same effect as
 {$codepage utf8}

 The attached program show how data loss can occur

 Luiz

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


Re: [Lazarus] UTF8 RTL for Windows

2014-11-23 Thread luiz americo pereira camara
I updated the test app to show the hexadecimal representation of the string.

When {$codepage utf8} is set, all string encoding and content is right
matching each other regardless of MultiByteConversionCodePage

Without {$codepage utf8}:

When MultiByteConversionCodePage is CP_ACP (default) one string gets the
UTF8 content but code page is system ansi (1252 in my case)
When MultiByteConversionCodePage is UTF8 and two strings (converted from
WideString) get code page UTF8 but content is wrong

Luiz


2014-11-23 22:06 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br:

 I added {.$codepage utf8} and all strings output as Joao.

 Got confused. I did not to expect changes in the constant assigned to the
 UnicodeString variable

 Need to check what is the correct UTF8 output:  JoA£o or Joao

 Luiz

 2014-11-23 21:37 GMT-03:00 luiz americo pereira camara luiz...@oi.com.br
 :



 2014-11-20 13:21 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:


 Please test and tell what you find out.



 Without {$codepage utf8} directive String constants will get Code Page 0
 (CP_ACP) and not the 1200 (UTF16 - UnicodeString).

 String variables assigned to those constants will also have Code Page = 0

 This is because the constant string code page is evaluated at compile time

 Not sure if there's a compiler command line param with same effect as
 {$codepage utf8}

 The attached program show how data loss can occur

 Luiz



program testStringConstantCP;

{$mode objfpc}{$H+}
{.$codepage utf8}

uses
  Classes, sysutils;

function StrToHex(const S: String): String;
var
  i: Integer;
begin
  Result := '';
  if S = '' then
Exit;
  for i := 1 to Length(S) do
  begin
Result := Result + IntToHex(Byte(S[i]), 0);
  end;
end;

var
  W: UnicodeString;
  S, S_2: String;
  SUTF8, SUTF8_2: UTF8String;
begin
  SetMultiByteConversionCodePage(CP_UTF8);
  W := 'ã';
  Write('W: ': 10, StringCodePage(W): 6, ' - ');
  WriteLn(W: 6);

  S := 'ã';
  Write('S: ': 10,StringCodePage(S): 6, ' - ');
  WriteLn(S: 6, ' - ', StrToHex(S));

  S_2 := W;
  Write('S_2: ': 10,StringCodePage(S_2): 6, ' - ');
  WriteLn(S_2: 6, ' - ', StrToHex(S_2));

  SUTF8 := W;
  Write('SUTF8: ': 10,StringCodePage(SUTF8): 6, ' - ');
  WriteLn(SUTF8: 6, ' - ', StrToHex(SUTF8));

  SUTF8_2 := S;
  Write('SUTF8_2: ': 10, StringCodePage(SUTF8_2): 6, ' - ');
  WriteLn(SUTF8_2: 6, ' - ', StrToHex(SUTF8_2));
end.

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


Re: [Lazarus] TSQLQuery: Getting autoincremented ID value after insert (MySQL)

2014-11-14 Thread luiz americo pereira camara
2014-11-14 11:43 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:

On Fri, 14 Nov 2014, Marcos Douglas wrote:


 This RETURNING clause works for all DBMS?


 AFAIK Only sqlite does not (maybe it does today). But that is not a DBMS
 :-)


MySQL also does not implement it

This is the workaround i use today:

var
  Info: TSQLStatementInfo;
  ActualConnection: TSQLConnection;
  InsertQuery: TSQLQuery;
begin
  Result := '';
  if (FConnection is TSQLConnector) then
ActualConnection := TSQLConnectorAccess(FConnection).Proxy
  else
ActualConnection := FConnection;

  Info :=
TSQLConnectionAccess(ActualConnection).GetStatementInfo(Query.SQL.Text,
True, stNoSchema);
  InsertQuery := CreateInsertQuery(Query, Info.TableName,
ActualConnection.FieldNameQuoteChars);
  try
if (ActualConnection is TPQConnection) or (ActualConnection is
TIBConnection) then
begin
  InsertQuery.SQL.Add(Format('Returning %s', [FPrimaryKey]));
  InsertQuery.Open;
  if InsertQuery.RecordCount  0 then
 Result := InsertQuery.Fields[0].AsString;
 ActualConnection.Transaction.CommitRetaining;
  end
  else
  begin
InsertQuery.ExecSQL;
ActualConnection.Transaction.CommitRetaining;
if (ActualConnection is TSQLite3Connection) then
  Result := IntToStr(TSQLite3Connection(ActualConnection).GetInsertID)
else if (ActualConnection is TConnectionName{MySql}) then
  Result := IntToStr(TConnectionName(ActualConnection).GetInsertID);
  end;
  finally
InsertQuery.Destroy;
  end;
end;

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


Re: [Lazarus] Visual Form Inheritance support

2014-08-04 Thread luiz americo pereira camara
2014-08-04 3:22 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Sun, 3 Aug 2014 18:41:27 -0300
 luiz americo pereira camara luiz...@oi.com.br wrote:

  Does Lazarus implements Visual Form Inheritance feature present in
 Delphi?

 Yes.


Thanks. For the record, in Lazarus is not necessary to use the workaround
used in the Delphi component

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


[Lazarus] Visual Form Inheritance support

2014-08-03 Thread luiz americo pereira camara
Does Lazarus implements Visual Form Inheritance feature present in Delphi?

If yes, is there an example?
If no, are there plans to add this feature?


FYI: I don't need/plan to use this feature. I'm asking because i'm porting
a Delphi component that introduced a change to support VFI. I want to know
if i will bother with it or just ignore this change.

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


Re: [Lazarus] What GetChildParent does in designer and reader?

2014-03-04 Thread luiz americo pereira camara
Hi Fabio,

I'd like to share how i  implemented similar behavior of TDbCtrlGrid, so
maybe you can be interested. If not just ignore.

First i create a TFrame in Lazarus put the controls that i need to be there.

In the control i want to display the instances of the frame i create at
runtime according to a configuration

This way i have the easy of use of Lazarus designer with a lot of
flexibility.

I created an control (
https://code.google.com/p/luipack/source/browse/trunk/luicontrols/jsonmediators.pas)
that does the above. The frame class
(TJSONBooleanRadioButtonViewFrame)
is hardcoded but it can be decoupled by using an interface.

To implement TDbCtrlGrid like control with this approach seems easier then
you are trying:

- Define an interface with what you need to configure the DbCtrls like
  IDbCtrlItem = interface
  SetDatasource(Datasource: TDataSource);
  end;
- Create a control that has a TFrameClass property
- When the TFrameClass is set, check if implements IDbCtrlItem
- At runtime create as many TFrameClass instances as needed configuring
them at initialization through the IDbCtrlItem interface
- Bind to dataset events and update the controls accordingly

Luiz


2014-03-04 10:41 GMT-03:00 Fabio Luis Girardi fluisgira...@gmail.com:

 Hi Mattias!!

 This solution don't work too.


 2014-03-04 9:46 GMT-03:00 Fabio Luis Girardi fluisgira...@gmail.com:

 Maybe RemoveHandlerAddClicked is a replacement?


 2014-03-04 9:43 GMT-03:00 Fabio Luis Girardi fluisgira...@gmail.com:

 mytesthelper.pas(40,20) Error: identifier idents no member
 RemoveHandlerComponentAdded

 Lazarus 1.3



 2014-03-03 18:56 GMT-03:00 Mattias Gaertner nc-gaert...@netcologne.de:

 On Mon, 3 Mar 2014 16:47:30 -0300
 Fabio Luis Girardi fluisgira...@gmail.com wrote:

  Hi!!
 
  Attached the code of my prototype of TDBCtrlGrid. It works as
 expected on
  Delphi (except the function GetDesignerDropTarget that don't exists on
  Delphi TWinControl), but it don't works as expected on Lazarus.

 On second thought the LCL method is not very flexible.
 I added a general designer event.

 See

 http://wiki.lazarus.freepascal.org/Extending_the_IDE#Example:_When_dropping_a_new_component_move_control_to_a_child

 Please test.

 Mattias

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




 --
 The best regards,

 Fabio Luis Girardi
 PascalSCADA Project
 http://sourceforge.net/projects/pascalscada
 http://www.pascalscada.com




 --
 The best regards,

 Fabio Luis Girardi
 PascalSCADA Project
 http://sourceforge.net/projects/pascalscada
 http://www.pascalscada.com




 --
 The best regards,

 Fabio Luis Girardi
 PascalSCADA Project
 http://sourceforge.net/projects/pascalscada
 http://www.pascalscada.com

 --
 ___
 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] Advanced TrackBar / Rating control

2014-02-18 Thread luiz americo pereira camara
Does someone knows an open source rating control (similar to
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=74089lngWId=1)

A TTrackBar that shows the tick value below the tick mark also fit my needs

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


Re: [Lazarus] Lazarus compilation problems with 2.6.4 RC1

2014-02-16 Thread luiz americo pereira camara
I'm having similar problem.

When trying to rebuild from the IDE, the compilation stops with the
following message:
..\debugger\debugger.pp(41,3) Fatal: Can't find unit DbgIntfBaseTypes used
by Debugger

I added debuggerintf dependency to Lazarus project and no luck
Added debugger.pp to Lazarus project and also no luck

make clean all worked

Luiz


Luiz




2014-02-15 12:59 GMT-03:00 Michael Van Canneyt mich...@freepascal.org:


 Hi,

 I tried to compile a new lazarus version from inside the IDE, using the
 2.6.4 release candidate.

 It failed on the sqldb package. The sources mistakenly assume that the
 MySQL 5.6 connector will be included with 2.6.4.
 I fixed the define that controls this.

 It then failed on the debugger package. I could not immediatly determine
 what the problem was, the unit with types was not found (when the sources
 were in fact there)

 So, I first removed all .ppu and .o files in the lazarus dirs. It didn't
 help.

 I then tried compiling on the command-line, using a make clean all.

 This failed:

 /bin/cp -f Makefile.compiled lib/x86_64-linux/DebuggerIntf.compiled
 /bin/cp: cannot stat `Makefile.compiled': No such file or directory
 make[1]: *** [compiled] Error 1
 make[1]: Leaving directory `/home/michael/projects/lazarus/components/
 debuggerintf'
 make: *** [debuggerintf] Error 2

 I faked the file:

 araminta: cd /home/michael/projects/lazarus/components/debuggerintf
 araminta: touch Makefile.compiled
 araminta: make  PP=ppcx64-2.6.4
 /bin/rm -f lib/x86_64-linux/debuggerintf.ppu
 ppcx64-2.6.4 -MObjFPC -Scghi -O1 -g -gl -vewnhi -l
 -Fu../../packager/units/x86_64-linux -Fu../lazutils/lib/x86_64-linux -Fu.
 -Fu/usr/local/lib/fpc/2.6.4/units/x86_64-linux/rtl -FE.
 -FUlib/x86_64-linux -Cg -dx86_64 debuggerintf.pas
 /bin/cp -f Makefile.compiled lib/x86_64-linux/DebuggerIntf.compiled

 All went well, and I could build the IDE, and from then on I could build
 the IDE from inside the IDE.

 Strange problems. So I decided to report here...

 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/FPC for Web Development only

2014-02-06 Thread luiz americo pereira camara
2014-02-04 14:42 GMT-03:00 glpu...@gmail.com:

  Hi all,

  and I would like to know your opinion if it's worth to develop web
 applications using server side with Brook (for example), and HTML5 and JS
 for client side, against other options like Java, PHP, Python.


For some times i'm working in a architeture that uses fpc in the server side

Basically is a library built on top of fpc-web that helps to create REST
services

This allows to use the same backend to both desktop and web thus making
easy to share or migrate from one to another

I already have a full (desktop) application running in production with this
architeture

Only recently i started to learn how to work with web client (HTML/JS), so
no production code yet, just some proof of concept

Unfortunatelly i still did not document, did extensive demos or stabilized
the interface for the library, so no release or announcements (as most of
code of my repository)

If you are curious you can take a look at:
https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluirest

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


Re: [Lazarus] Added PascalScriptFCL.lpk and PascalScriptLCL.lpk in official repository of PascalScript

2013-10-02 Thread luiz americo pereira camara
2013/10/1 Martin laza...@mfriebe.de

  On 01/10/2013 22:14, luiz americo pereira camara wrote:


 I looked at the commited files and this configuration will cause problems
 when installing both packages. Notice that is important to allow the
 installation of the two packages, in the same IDE. In some projects (a
 desktop) may be necessary to use the complete package while in others (a
 web service) only the base package is necessary.

You do NOT need to install, in order to use in projects.

 Install is only needed for editor macros.


   There are some solutions:

  - Put source files of each package in separated folders. As an example
 see: https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fcairo. 
 Each package has it's own folder.

 I need to keep files easy to sync with the original GIT. Therefore no.
 (unless it happens in the original too.)



 - Use the same folder for the source  and ensure that all files are added
 to it's corresponding package. As an example see:
 https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluicomponents. 
 Failing to setup properly the package may lead to problems. Recently i
 fixed one in
 https://code.google.com/p/luipack/source/detail?spec=svn1089r=1079

Same folder for source does not work, the LCL package will find
 fcl-belonging pas files, and use them instead of ppu (even if not listed in
 package)


   - Use the same folder for the source but configure a different unit
 output dir. Example
 https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluidialogs

 See above.


I'm just exposing my experience of 13 years developing with Lazarus and
creating / maintaining more than 30 lazarus packages. All the above
designs works, i can assure. However it's not my intention to say what
you should do.

Anyway, i don't use PascalScript and does not know if will work as is now,
but if i use it and find some problem i can fix myself.

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


Re: [Lazarus] Added PascalScriptFCL.lpk and PascalScriptLCL.lpk in official repository of PascalScript

2013-10-01 Thread luiz americo pereira camara
2013/10/1 Martin laza...@mfriebe.de

 On 01/10/2013 14:14, Martin wrote:


 I looked at it. But currently, it looks like it may cause problems.

 Both packages share the same folders, that can lead to conflicts.


[]





 I have added the fcl package. BUT

 - The normal package, is kept as it. One package that contains all, and
 does not need the fcl package (in fact may have issues if both are used /
 not tested)
 - The fcl pacage as a separate unit directory. It can be used INSTEAD of
 the normal package.


Your worries are pertinents. I hit this problem sometimes.

I haven't looked at this specific package but the best approach is to
create a package that depends only from FCL and create a LCL package that
uses the first one. Most of the time, this can be done without sharing
source paths without much work.

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


Re: [Lazarus] Added PascalScriptFCL.lpk and PascalScriptLCL.lpk in official repository of PascalScript

2013-10-01 Thread luiz americo pereira camara
2013/10/1 luiz americo pereira camara luiz...@oi.com.br




 2013/10/1 Martin laza...@mfriebe.de

 On 01/10/2013 14:14, Martin wrote:


 I looked at it. But currently, it looks like it may cause problems.

 Both packages share the same folders, that can lead to conflicts.


 []





 I have added the fcl package. BUT

 - The normal package, is kept as it. One package that contains all, and
 does not need the fcl package (in fact may have issues if both are used /
 not tested)
 - The fcl pacage as a separate unit directory. It can be used INSTEAD of
 the normal package.


 Your worries are pertinents. I hit this problem sometimes.

 I haven't looked at this specific package but the best approach is to
 create a package that depends only from FCL and create a LCL package that
 uses the first one. Most of the time, this can be done without sharing
 source paths without much work.


I looked at the commited files and this configuration will cause problems
when installing both packages. Notice that is important to allow the
installation of the two packages, in the same IDE. In some projects (a
desktop) may be necessary to use the complete package while in others (a
web service) only the base package is necessary.

There are some solutions:

- Put source files of each package in separated folders. As an example see:
https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fcairo . Each
package has it's own folder.

- Use the same folder for the source  and ensure that all files are added
to it's corresponding package. As an example see:
https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluicomponents.
Failing to setup properly the package may lead to problems. Recently i
fixed one in
https://code.google.com/p/luipack/source/detail?spec=svn1089r=1079

- Use the same folder for the source but configure a different unit output
dir. Example
https://code.google.com/p/luipack/source/browse/#svn%2Ftrunk%2Fluidialogs

In all cited examples there's dependency between packages and it's working
fine.

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


Re: [Lazarus] TControl.EndDrag is missing

2013-09-17 Thread luiz americo pereira camara
2013/9/17 Graeme Geldenhuys gra...@geldenhuys.co.uk

  I would go
 out on a limb and say that nobody has ported DND based apps to LCL.


The drag and drop feature  of LCL VirtualTreeView port is working fine.

Here you can find an example of DND between a VTV and a ListBox:
http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/virtualtreeview-new/branches/4.8/demos/dragdrop/

Here the OLE DND (windows only):
http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/virtualtreeview-new/branches/4.8/demos/ole/

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


Re: [Lazarus] VirtualTreeView question, horizontal jump

2013-08-26 Thread luiz americo pereira camara
2013/8/25 Jürgen Hestermann juergen.hesterm...@gmx.de

 Am 2013-08-24 04:58, schrieb luiz americo pereira camara:

  In the mean time try to set hoAutoResize in Header.Options and set
 Header.AutoSizeIndex to 1
 You should get the desired behavior
 Luiz


 Yes, that solves the problem (though I don't know why ;-)).
 Thanks for investigating in this.



Basically, these options tell the component to automatically resize the
Column 1 to fill the remaining header space (control width - width all
other columns)

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


Re: [Lazarus] VirtualTreeView question, horizontal jump

2013-08-24 Thread luiz americo pereira camara
I can reproduce the bug.

I will investigate further to see if occurs also in Delphi

Luiz


2013/8/23 Jürgen Hestermann juergen.hesterm...@gmx.de

 Am 2013-08-22 18:51, schrieb luiz americo pereira camara:


 Please create an example and add a bug report



 http://mantis.freepascal.org/**view.php?id=24905http://mantis.freepascal.org/view.php?id=24905





 --
 __**_
 Lazarus mailing list
 Lazarus@lists.lazarus.**freepascal.orgLazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarushttp://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] VirtualTreeView question, horizontal jump

2013-08-24 Thread luiz americo pereira camara
In the mean time try to set hoAutoResize in Header.Options and set
Header.AutoSizeIndex to 1

You should get the desired behavior

Luiz


2013/8/23 luiz americo pereira camara luiz...@oi.com.br

 I can reproduce the bug.

 I will investigate further to see if occurs also in Delphi

 Luiz


 2013/8/23 Jürgen Hestermann juergen.hesterm...@gmx.de

 Am 2013-08-22 18:51, schrieb luiz americo pereira camara:


 Please create an example and add a bug report



 http://mantis.freepascal.org/**view.php?id=24905http://mantis.freepascal.org/view.php?id=24905





 --
 __**_
 Lazarus mailing list
 Lazarus@lists.lazarus.**freepascal.orgLazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarushttp://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] VirtualTreeView question, horizontal jump

2013-08-22 Thread luiz americo pereira camara
2013/8/22 Jürgen Hestermann juergen.hesterm...@gmx.de


 Am 2013-08-21 18:40, schrieb luiz americo pereira camara:


 2013/8/21 Jürgen Hestermann juergen.hesterm...@gmx.de


 I now found that toDisableAutoscrollOnFocus (under AutoOptions) is
 changing between these both behaviours:

 If I set it to TRUE I can navigate as usual within the tree (without
 horizontal shifting) *but* when reaching the bottom border of the window
 the cursor disappears below it without shifting up the tree display. So I
 don't see my cursor anymore (which is totally useless).
 If I set it to FALSE the tree display is shifted up when reaching the
 bottom of the display *but* now it jumps to the right border every second
 down move (so that I don't see the tree anymore, only when shifting it back
 with Ctrl+Enter).


  Try to set toCenterScrollIntoView and toDisableAutoscrollOnFocus



 With
 toCenterScrollIntoView = True
 toDisableAutoscrollOnFocus = False
 the only change is, that the horizontal scroll is now centering (instead
 of moving to the right margin). This does not solve the problem because the
 tree is still out of sight.

 With
 toCenterScrollIntoView = True
 toDisableAutoscrollOnFocus = True
 I get the same as before (cursor moves below the bottom without shifting
 up the tree to make it visible).


Please create an example and add a bug report

Make sure you are using
http://sourceforge.net/p/lazarus-ccr/svn/2775/tree/components/virtualtreeview-new/branches/4.8/

Luiz




 --
 ___
 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] VirtualTreeView question, horizontal jump

2013-08-21 Thread luiz americo pereira camara
2013/8/21 Jürgen Hestermann juergen.hesterm...@gmx.de


 Am 2013-08-21 11:16, schrieb Jürgen Hestermann:

  Why does a normal move down shift the whole tree horizontally to the
 right margin each second move (slider is at max right position) and back to
 the left again?


 I now found that toDisableAutoscrollOnFocus (under AutoOptions) is
 changing between these both behaviours:

 If I set it to TRUE I can navigate as usual within the tree (without
 horizontal shifting) *but* when reaching the bottom border of the window
 the cursor disappears below it without shifting up the tree display. So I
 don't see my cursor anymore (which is totally useless).
 If I set it to FALSE the tree display is shifted up when reaching the
 bottom of the display *but* now it jumps to the right border every second
 down move (so that I don't see the tree anymore, only when shifting it back
 with Ctrl+Enter).


Try to set toCenterScrollIntoView and toDisableAutoscrollOnFocus

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


Re: [Lazarus] Error with TSQLite3Dataset?

2013-08-05 Thread luiz americo pereira camara
Try ExecSQL

What is in auxstr?

What is your Table definition?

Since you are updating data using direct SQL, you will need to close
and re open the dataset so the dataset record is in sync

Luiz

2013/8/5 Arí Ricardo Ody ar...@gmx.com:
 I use ExecuteDirect method to insert a record in a SQLite3 SQL tabel. The
 primary key is a sequential integer number. I have the follwoind contruction
 in the moment I will execute the SQL Insert command:

 try
   cdsInventario.ExecuteDirect(auxstr);
 except
   On e:Exception do
  begin;
ShowMessageMobile(Self,'Error INSERT Item = ' + e.Message);
Exit;
  end;
 end;

 I discover that when the PK value is equal to the last(at least) sequential
 number recorded in the SQL tabel the command Insert does nothing and the
 except clause is not executed(I'm sure of this). Late I change the logic to
 ensure that the value given to the PK in the Insert differ from any one in
 the dataset and then everything's fine.

 Do somebody have comments?

 Greeting from São Paulo - Brasil

 Ricardo

 P.S.: The problem occurs with Lazarus 0.9.30 since the last Lazarus version
 the clear screen for windows CE version is in error.
 --
 ___
 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] TPageControl.TabVisible not working properly

2013-05-25 Thread luiz americo pereira camara
2013/5/25 Daniel Gaspary dgasp...@gmail.com:
 The bug #0021723 is still happening even after the related

This seems a different  issue (carbon specific?)

 issue(#23251) appears to be patched.

 To test:

 -Create a project with a TPageControl

 -Create two Pages

 -Put a TLabel on each page

 -On formcreate set TabSheet1.TabVisible to false;

 When the program is running the tab shown is the second, but the
 contents are from page 1.

I fixed this issue in rev 41407

Luiz

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


Re: [Lazarus] TPageControl.TabVisible not working properly

2013-05-25 Thread luiz americo pereira camara
2013/5/25 luiz americo pereira camara luiz...@oi.com.br:
 2013/5/25 Daniel Gaspary dgasp...@gmail.com:

 When the program is running the tab shown is the second, but the
 contents are from page 1.

 I fixed this issue in rev 41407

Try 41408

Luiz

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


Re: [Lazarus] Bored?

2013-04-15 Thread luiz americo pereira camara
2013/4/15 Michael Van Canneyt mich...@freepascal.org:

 On Mon, 15 Apr 2013, Graeme Geldenhuys wrote:

 I've been a very long user and contributor of FPCUnit, and it is a very
 problematic framework.


 Let's not exaggerate the problems.

 I use it for years, and except for 1 issue, there are no problems.

For the record, can you point what is this issue?

Luiz

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


Re: [Lazarus] Bored?

2013-04-15 Thread luiz americo pereira camara
2013/4/15 Graeme Geldenhuys gra...@geldenhuys.co.uk:
 The list is much larger than just 1 issue. You should take a look at
 DUnit2/FPTest at some point to see just how far behind FPCUnit is in
 functionality.


Where can we find it?

Any docs?

Is there a GUI runner?

I'm starting now in test world. If i can base my work in a more solid
framework, it's better.

Luiz

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


Re: [Lazarus] New package graph - more screenshots

2013-04-04 Thread luiz americo pereira camara
2013/4/3 Mattias Gaertner nc-gaert...@netcologne.de:
 On Tue, 2 Apr 2013 20:30:27 -0300
 luiz americo pereira camara luiz...@oi.com.br wrote:

 See previous email about package graph

 http://imagebin.org/252597

 http://imagebin.org/252598

 That's definitely a bug.

I added a report: http://bugs.freepascal.org/view.php?id=24227

Luiz

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


[Lazarus] Option to get old package graph feature

2013-04-02 Thread luiz americo pereira camara
The new package graph feature is making harder to find what i'm looking for.

The attached screenshot show how is my package graph. (Other messages
with more screenshots will follow to get through the 100k limit of
mail list)

I'd like to see an option to get the old treeview based graph. It
works better, at least to me


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


[Lazarus] New package graph - more screenshots

2013-04-02 Thread luiz americo pereira camara
See previous email about package graph

http://imagebin.org/252597

http://imagebin.org/252598

Luiz

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


Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-14 Thread luiz americo pereira camara
I just tested with sqlite3ds and works fine. See test below. You may
look at its source and see if the approach used can be adapted for
zeos

Luiz

  Sqlite3Dataset1.FileName := 'data.db';
  Sqlite3Dataset1.TableName := 'Test';
  if not Sqlite3Dataset1.TableExists then
  begin
Sqlite3Dataset1.FieldDefs.Add('AFloat', ftFloat);
Sqlite3Dataset1.CreateTable;
Sqlite3Dataset1.Open;
Sqlite3Dataset1.Append;
Sqlite3Dataset1.FieldByName('AFloat').AsFloat := 1;
Sqlite3Dataset1.Post;
Sqlite3Dataset1.Append;
Sqlite3Dataset1.FieldByName('AFloat').AsFloat := 2;
Sqlite3Dataset1.Post;
Sqlite3Dataset1.ApplyUpdates;
Sqlite3Dataset1.Close;
  end;
  Sqlite3Dataset1.SQL := 'Select SUM(AFloat) as SUM1 from Test';
  Sqlite3Dataset1.Open;
  S := Format('Type: %s  Value: %f',
[Fieldtypenames[Sqlite3Dataset1.FieldByName('SUM1').DataType],
Sqlite3Dataset1.FieldByName('SUM1').AsFloat]);

 // Type: Float  Value: 3,00

2013/2/14 zeljko zel...@holobit.net:
 Hi,
 When using eg. sum(somecolumn) AS sum1, sum(somecolumn2) AS sum2 sqlite
 returns (zeos recognizes) result columns as string not as float.
 I've tried CAST(sum(somecolumn) AS REAL) AS sum1 but have same problem.
 If I use pure data from table (eg. item INTEGER,value float) then results are
 ok.

 I know that sqlite3_column_type() is tricky about correct results, but asking
 if someone have solution for this.

 Anyone ?

 zeljko

 --
 ___
 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] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 10:54, luiz americo pereira camara wrote:

 2013/1/5 luiz americo pereira camara luiz...@oi.com.br:
 I've found a suspect.

 SetParent triggers the handle creation
 TSynEdt.CreateWnd calls SizeOrFontChanged that calls UpdateScrollBars
 Here, since PaintLock  0 the scrollbar change is postponed

 Martin/Bart, can you check if you pass the check for PaintLock in
 UpdateScrollBars?

 Alternatively comment the call to SizeOrFontChanged in CreateWnd and
 see what happens

 More info:

 SynEdit.CreateHandle - DoDecPaintLock - UpdateScrollBars -
 ShowScrollBar (LCL) - ShowScrollBar (Win32) - Windows.RedrawWindow

 I don't think it can be avoided.

 I can detect the situation of course, but preventing that call, might lead
 to wrong display results.

OK.

What OS are you using.

Here with windows 7 no Paint occurs at all. See previous mail

Can you check (comment ShowScrollBar) if the paint you are seeing is
really from ShowScrollBar?

After that we can look what to do

Luiz

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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 11:19, luiz americo pereira camara wrote:


 What OS are you using.

 Here with windows 7 no Paint occurs at all. See previous mail

 Can you check (comment ShowScrollBar) if the paint you are seeing is
 really from ShowScrollBar?

 After that we can look what to do


 If I single step, it is not painted by that line.

 It happens here

   Perform(CM_SHOWINGCHANGED, 0, 0); // see TWinControl.CMShowingChanged


This ends with TWin32WSWinControl.ShowHide that calls SetWindowPos
which should not trigger a immediate wm_paint

What OS are you using?

Did you tried commenting the code inside TWin32WidgetSet.ShowScrollBar?

Luiz

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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:

 Someone might check WDD?

Whats WDD?

Luiz

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


Re: [Lazarus] win32 ShowScrollBar triggers immediate paint

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Mattias Gaertner nc-gaert...@netcologne.de:
 Hi,

 ShowScrollBar - Windows.RedrawWindow

 Can some win32 developer explain, why the paint is immediate. Why not
 queue?

Some notes:

Here in windows 7, no wm_paint is called

according to docs:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd162911%28v=vs.85%29.aspx
no immediate paint should occur with the used falgs

Luiz


 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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 11:43, luiz americo pereira camara wrote:

 If I single step, it is not painted by that line.

 It happens here

Perform(CM_SHOWINGCHANGED, 0, 0); // see
 TWinControl.CMShowingChanged

 This ends with TWin32WSWinControl.ShowHide that calls SetWindowPos
 which should not trigger a immediate wm_paint

 What OS are you using?


 Win Vista 32 bit


 Did you tried commenting the code inside TWin32WidgetSet.ShowScrollBar?


 No, I single stepped, and checked, when the paint happened.


Due to LCL/Win message nature, not always the backtrace correspond to
the code that actually triggered the event.

At this time, i'm not sure what exactly is triggering the paint
message you are seeing.

Sometimes the only way to know is by trial and error.

If commenting the code inside TWin32WidgetSet.ShowScrollBar avoids the
paint, we will know that the problem is there, so we can try to fix,
otherwise we will look elsewhere

BTW:

I just double checked and here no WM_PAINT message is triggered

Maybe is related to windows below windows 7

Luiz

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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 11:19, luiz americo pereira camara wrote:

 Can you check (comment ShowScrollBar) if the paint you are seeing is
 really from ShowScrollBar?

 This would not make sense?

 Nothing, except the scrollbars is painted (SynEdit does not paint).

I understood that SynEdit.Paint was called when setting Parent in your
system, but seems this is not the case.

Although in the description of Bart he sees the whole SynEdit painted.

Luiz

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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
@Bart:

Did you tried to set Visible to false before setting Parent and Align
and then setting visible to True, like below?

  s:=PageControl1.AddTabSheet;
  PageControl1.ActivePage := s;
  l := TSynEdit.Create(self);
  l.Visible := False
  l.Parent := s;
  l.Align := alClient;
  l.Visible := True


Luiz

2013/1/4 Bart bartjun...@gmail.com:
 Hi,

 I have a text editor (LazEdit on Lazarus CCR) which uses a
 TPageControl to act like a Tabbed Document Interface (much like
 Lazarus SE).

 Upon creating a new Tab it basically does:
 - Add a new TTabSheet to the PageControl
 - Create an instance of a TSynEdit
 - Set TSynEdit.Parent to the newly created TTabSheet
 - Set TSynEdit.Align := alClient

 This works as expected.
 However there is one visual anomaly: when you create a new Tab, for a
 brief moment you can see the TSynEdit, unaligned, with Width and
 Height set to it's defaults (like you would drop it on a Form in
 Lazarus).

 Long time ago, in Delphi, I solved this by doing:

   Try
 LockWindowUpdate(TheHandle);
 ...
//Create the TSynEdit, align it etc.

   Finally
 LockWindowUpdate(0);

 This delayed any painting up to the point the TSynEdit was aligned.
 However, this is a Windows only fix.

 The relevant code is at:
 https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/applications/lazedit/editorpagecontrol.pp
 (function TEditorPageControl.AddPage: TEditor; appr. at line 994)

 Does anyone have a suggestion how to fix this in a cross-platform manner?

 Bart

 --
 ___
 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] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 12:57, luiz americo pereira camara wrote:

 2013/1/5 Martin laza...@mfriebe.de:

 On 05/01/2013 11:19, luiz americo pereira camara wrote:

 Can you check (comment ShowScrollBar) if the paint you are seeing is
 really from ShowScrollBar?

 This would not make sense?

 Nothing, except the scrollbars is painted (SynEdit does not paint).

 I understood that SynEdit.Paint was called when setting Parent in your
 system, but seems this is not the case.

 Although in the description of Bart he sees the whole SynEdit painted.

 I am sure he was mistaken:

   for a
 brief moment you can see the TSynEdit,


 He would see the 2 scrollbars, and in the sort time he would not have paid
 attention to the absence of all else. Seing the 2 scrollbars *flicker* it is
 only natural to assume one saw the synedit flicker.

OK.

Now i see the issue. At runtime i could not notice the flicker and
there's no WM_PAINT message involved, only stepping with the debugger
is possible to see the control painted

Try

putting SWP_NOREDRAW in SetWindowPos

It fixed here, but not sure of collateral effects

Luiz

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


Re: [Lazarus] Visual uglyness when creating TSynEdit @ runtime in my app

2013-01-05 Thread luiz americo pereira camara
2013/1/5 luiz americo pereira camara luiz...@oi.com.br:
 2013/1/5 Martin laza...@mfriebe.de:
 On 05/01/2013 12:57, luiz americo pereira camara wrote:

 2013/1/5 Martin laza...@mfriebe.de:

 On 05/01/2013 11:19, luiz americo pereira camara wrote:

 Can you check (comment ShowScrollBar) if the paint you are seeing is
 really from ShowScrollBar?

 This would not make sense?

 Nothing, except the scrollbars is painted (SynEdit does not paint).

 I understood that SynEdit.Paint was called when setting Parent in your
 system, but seems this is not the case.

 Although in the description of Bart he sees the whole SynEdit painted.

 I am sure he was mistaken:

   for a
 brief moment you can see the TSynEdit,


 He would see the 2 scrollbars, and in the sort time he would not have paid
 attention to the absence of all else. Seing the 2 scrollbars *flicker* it is
 only natural to assume one saw the synedit flicker.

 OK.

 Now i see the issue. At runtime i could not notice the flicker and
 there's no WM_PAINT message involved, only stepping with the debugger
 is possible to see the control painted

 Try

 putting SWP_NOREDRAW in SetWindowPos

 It fixed here, but not sure of collateral effects

The collateral effect is that if a control is hidden, it will be still
be show until is there a new paint cycle

I come with the below implementation that will have the following
behavior. I could not find issues but needs more testing

- When a control is hidden, it's redraw immediately as is today
- When a control is show, its not redraw immediately. The window is
invalidated and a paint message is queued

class procedure TWin32WSWinControl.ShowHide(const AWinControl: TWinControl);
const
  VisibilityToFlag: array[Boolean] of UINT = (SWP_HIDEWINDOW,
SWP_SHOWWINDOW or SWP_NOREDRAW);
var
  WinHandle: HWND;
  WinVisible: Boolean;
begin
  WinHandle := AWinControl.Handle;
  WinVisible := AWinControl.HandleObjectShouldBeVisible;
  Windows.SetWindowPos(WinHandle, 0, 0, 0, 0, 0,
SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_NOACTIVATE or
VisibilityToFlag[WinVisible]);
  //invalidate the window so it can be painted after show
  if WinVisible then
Windows.RedrawWindow(WinHandle, nil, 0, RDW_INVALIDATE or RDW_FRAME);
end;


Luiz

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


  1   2   3   >