Re: [Lazarus] GDB is not good, any tricks to improve it?

2016-05-26 Thread Martin Frb

On 26/05/2016 06:31, Dennis wrote:

I am using Lazarus 1.7 (2016-04-20) with FPC 3.1.1

Great Work guys!

However, the gdb that comes with it is not as good.  I know debugger 
is hard to write so I am not blaming it.
I just hope someone can share some tips or settings tricks that I can, 
perhaps, make it work better?


e.g. it is very slow and its speed is not stable.
Sometimes, it is extremely slow or even stall the execution of the 
main program.  But when I delete all breakpoints and restart it and 
add back the breakpoints, it runs faster.


OS, bitness?

For windows we have alternative gdb versions on our Source forge site. 
They might improve stability.


try dwarf (ensure you also do that for all packages).
My tests (on windows) show that gdb 7.11 has massive issues with stabs.

Also on windows, 7.7 was the most stable. All above becomes less stable. 
More crashes
7.7 has one bug mixing records and classes there is a list of some 
gdb issuse on http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips


Speed (for watch evaluation): Use fpdebug (install the package). But it 
is still early beta, maybe alpha. And it does not work with generics.


Antivirus:
I run AVG and have no issues. I did exclude gdb and my lazarus project 
directory.



As for what watches can be evaluated That problem is much deeper 
than gdb.


correct scoping. (unit order for globals, if several used units have a 
global var of the same name).
dwarf (2 and 3, not sure about newer) do not support that. so fpc doesnt 
even include the info in the exe.


properties
same dwarf (2 and 3, not sure about newer) do not support that.

function calls. that is gdb. so fpdebug could learn that. but it still 
would not know what function a property maps to.


properties/functions that return string or dyn-array(managed type) or 
take them as argument.
dwarf (2 and 3, not sure about newer) do not support that. There is on 
spec how to get/discard the managed type, so leak and crashes would happen.


All in all, even with a debugger written for pascal, there would be many 
issues left.
Newer dwarf might have solved some, or fpc could add custom tags only 
for the "custom fpc debugger"




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


Re: [Lazarus] How TDBGrid works

2016-05-08 Thread Martin Schreiber
On Sunday 08 May 2016 08:44:37 Aradeonas wrote:
> A simple way is to make BufferCount=RecordCount so all record will be in
> buffer, it will be fast and easy to use and good for even couple of
> thousands records but not a real solution.
>
The data will be dupplicated.

Martin

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


Re: [Lazarus] How TDBGrid works

2016-05-08 Thread Martin Schreiber
On Sunday 08 May 2016 04:31:29 Jesus Reyes A. wrote:
> En Sat, 07 May 2016 01:26:38 -0500, Martin Schreiber <mse00...@gmail.com>
>
> escribió:
> > On Friday 06 May 2016 23:20:41 Aradeonas wrote:
> >> Thanks.
> >>
> >> So what is the best way to provide those 100 to 1100 record at least
> >> without Dataset calling AfterScroll event?
> >> I want to not make any event while scrolling my custom Grid so other
> >> connected DB controls change their values otherwise while Im scrolling
> >> my custom grid it will cause calling all connected DB controls to update
> >> their values.
> >> I hope it is more clear now.
> >
> > If the wanted record is in window of TDataLink.FirstRecord..FirstRecord +
> > BufferCount - 1 you can temporarily switch the record which supplies the
> > field data by setting TDatalink.ActiveRecord which doesn't fire any
> > events. I
> > assume you know that. ;-)
> > See for example the MSEgui functions TGridDatalink.GetDisplay*Buffer(),
> > BeginGridRow() and EndGridRow().
> > https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/m
> >sedbedit.pas
>
> Good luck by trying that while FirstRecord is "pointing" to record 1000
> AND keeping RecNo at 1, maybe I misunderstood something.
>
Then the "wanted record" is *not* in in window of 
TDataLink.FirstRecord..FirstRecord + BufferCount - 1 a dataset with direct 
data access like TMSEBufDataset or the problematic 
DisableControls()/EnableControls() trick is necessary.

Martin

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


Re: [Lazarus] How TDBGrid works

2016-05-07 Thread Martin Schreiber
On Saturday 07 May 2016 11:03:28 Aradeonas wrote:

>
> > A possible workaround could be to call TDataset.DisableControls(), to
> > fetch the needed records and to restore the DB cursor position before
> > calling EnableControls(). I fear it is not efficient and has
> > sideeffects.
>
> What side effects do you think about?
>
Maybe changed record buffer window which could trigger recentering of grids. 
You must try it, the buffer and scrolling system is complicated...

Martin

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


Re: [Lazarus] How TDBGrid works

2016-05-07 Thread Martin Schreiber
On Friday 06 May 2016 23:20:41 Aradeonas wrote:
> Thanks.
>
> So what is the best way to provide those 100 to 1100 record at least
> without Dataset calling AfterScroll event?
> I want to not make any event while scrolling my custom Grid so other
> connected DB controls change their values otherwise while Im scrolling
> my custom grid it will cause calling all connected DB controls to update
> their values.
> I hope it is more clear now.
>
If the wanted record is in window of TDataLink.FirstRecord..FirstRecord + 
BufferCount - 1 you can temporarily switch the record which supplies the 
field data by setting TDatalink.ActiveRecord which doesn't fire any events. I 
assume you know that. ;-)
See for example the MSEgui functions TGridDatalink.GetDisplay*Buffer(), 
BeginGridRow() and EndGridRow().
https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/msedbedit.pas

If the wanted records are anywhere in the dataset you need a dataset with 
random row data access. TMSEBufDataset supports it, please see the 
TMSEBufDataset.Current* properties.
https://gitlab.com/mseide-msegui/mseide-msegui/raw/master/lib/common/db/msebufdataset.pas

The MSEgui dropdownlist DB-edits use this approach for lookups if 
Dropdown.OptionsDB odb_directdata is set.

A possible workaround could be to call TDataset.DisableControls(), to fetch 
the needed records and to restore the DB cursor position before calling 
EnableControls(). I fear it is not efficient and has sideeffects.

Martin

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


Re: [Lazarus] Source Editor font size

2016-04-22 Thread Martin Frb

On 22/04/2016 13:04, Graeme Geldenhuys wrote:

Hi,

1) I remember years back you could specify the editor font as a
positive value (point size) and a negative value (pixel size). This
doesn't seem possible with v1.7 any more. Why was that removed?
EditerOpts has not changed. Not sure why if fails now, maybe spinedit 
changed.

Its supposed to still work, please report.



2) Why can't I specify point sizes with a decimal? eg: 10.5pt
For example: I just switched my editor to DejaVu Sans Mono (from
Raize) because I needed to work with unicode text. The font size
changed drastically between to the two fonts. DejaVu Sans Mono 10pt
is now too small, and 11pt is too big. I would like 10.5 (like I've
done in other text editors I use). Or better yet, specify the font
size in pixels.



Well even if font.height or size would accept them, it would be a 
problem. In fact the problem exists on some OS, even without this.
SynEdit requires not only monospace, but at current it also requires 
that each char a width of a full int. If that is not the case SynEdit 
enforces it, but that causes very slow drawing. (and other side effects)


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


[Lazarus] Need feedback from Windows 64 users about GDB

2016-04-18 Thread Martin Frb
Since I only can test on a rather old w64 system, I would appreciate 
some feedback.


First of all, nothing of this affects the issues listed here 
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Inspecting_data_types_.28Watch.2FHint.29
On any issues listed on this page, or present in both GDB versions, do 
*NOT* reply to this mail, open a new mail thread if you want to mail 
about them.


Currently Lazarus w64 ships with GDB 7.3.50. This is rather old, and I 
do not know how it performs on newer versions of windows.


I did run some test with several newer versions and uploaded GDB 7.7
https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Alternative%20GDB/

The page (in the folder GDB7.7) describes some issues that I found.
If any one likes to test this, it would be good to hear, if you find any 
differences to 7.3.50. Anything that only works in 7.7? Or anything that 
no longer works in 7.7


Why 7.7? Its not very new either?
Well I also tested some other versions (7.8, 7.9 and 7.11)

7.11 (at least the build I obtained / on my test platform) kept 
crashing/hanging in my tests (i.e. gdb crashes, taking the entire debug 
session down), so it is not usable with fpc generated exe.


7.8 and 7.9 may work, but they failed more of my tests than 7.7.  I 
didnt spent the time to analyse in details what failed. (32 bit gdb have 
similar issues).



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


[Lazarus] Transparent TPanel reloaded

2016-04-10 Thread Martin Grajcar
I've found quite a few posting regarding a transparent TPanel and somehow
nothing fits. All I need is to place controls on a panel and let it look
like there were directly on its parent. I don't want to create a component
for this.

The panel is colored clDefault and placed on a form colored clDefault, too.
Using ParentColor := TRUE, on Ubuntu 12 with GTK2 the form is $F2F5F7 and
the panel is much darker.

I guess, I finally found a solution, but I don't really understand it:

BevelInner := bvNone;
BevelOuter := bvNone;
Caption := '';
BorderStyle := bsNone;
ParentColor := False;
IF Assigned (Parent) THEN Color := Parent.GetRGBColorResolvingParent;

The final line is funny. I thought, just GetRGBColorResolvingParent should
work, but it doesn't. Any idea?

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


Re: [Lazarus] *** GMX Spamverdacht *** help writing help [was: Re: Re: Suggestion for TRadioGroup documentation]

2016-04-09 Thread Martin Frb

On 09/04/2016 13:05, Jürgen Hestermann wrote:

Am 2016-04-08 um 20:36 schrieb Martin Frb:
> On VirtualTreeView: I dont know if the Author is around, and if he 
could/would answer questions, or even proof read contributed docs. But 
if he was, then the question  "How long do you think would it take to 
(fully) understand" is just the wrong question. The question should 
be: how much time do you have? Is there a chance, that in that time 
you can document at least one property or method? If yes, well then 
start. If you get more done (now or later), then even better.


Okay.
Then please find the bug that you cannot collapse/expand nodes with the
mouse if the main column is not the most left one.

Absolutely off topic, what is the point off that?

Proving that docs can be useful? No need, no one ever said that they 
were not. This mail is not about what you can or can not do with docs, 
but who can contribute to them.
Fixing a bug, will not contribute a single word to documentation. (a bug 
fixer may choose to add doc in addition to the fix, but that is 
unrelated to the fix.





And believe me, I have already spend a lot of time on reading the code of
the VirtualTreeView unit (and many other units too) but it is impossible
to dig that deep into each to fully understand them.
I cannot do the documentation for every single function and concept in 
Free Pascal/Lazarus.
Is that a reason that I am not allowed to complain about missing 
documentation?
No one said you have to document ALL of them, start with just one. That 
was the big point of my last mail. If you ignore that then there was no 
point in any answer at all.


If indeed you studied that much, and can not yet specify for one single 
function what it does, then that is really just unlucky. That said, I do 
not claim that the docs you may be able to add at that point, are of any 
help to your current problem, they may document functions you are not 
interested in, but that would still be documentation.


Worst case you could add docs that leaves certain questions open, and 
document only what you were able to find (advertising that they miss out 
some effects.) this would still be something the next person could build on.





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


Re: [Lazarus] German umlauts in component names

2016-04-08 Thread Martin Grajcar
On Mon, Apr 4, 2016 at 5:48 PM, Ondrej Pokorny <laza...@kluug.net> wrote:

> On 04.04.2016 12:05, Special wrote:
>
>> BTW too: Some English words became part of german, like 'Computer' und
>> 'Button'. We don't say "Elektronische Rechenmaschine" any longer, and more
>> and more german book authors say "Button" instead of the strange
>> "Schaltfläche". Yes, I confess, I used "Schaltfläche" too in some of my
>> early books three decades ago, but now I don't.
>>
>
> I see a good progress here. The first step was using "Computer" instead of
> "Elektronische Rechenmaschine", the second step was using "Button" instead
> of "Schaltfläche". The next logical step is to teach pupils from the very
> beginning that the programmer's language is English.
>
> English is part of the compulsory education from very early classes,
> AFAIK. They definitely can understand the very limited vocabulary needed to
> write programs. The word "Close" is used in event names, after all. So I
> really don't see a gain using "SchließenButton" instead of "CloseButton".


Agreed. For everything related to programming, using Non-English words is a
non-sense as you can only lose. How could "SchließenButton" make anything
better, when you can't invoke "Fenster.Schließen" anyway?

The only case when national identifiers make sense is when they come from a
business domain. Translation of e.g. financial business terms is not
exactly something a programmer should do, so either the customer supplies
English terms or I leave them as they are.

Except for removing diacritics. This is fortunately easy for the languages
I use. I wonder what I'd do if I used a language not based on a Latin
alphabet. Then I might end up with a 賣Button.

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


[Lazarus] help writing help [was: Re: Re: Suggestion for TRadioGroup documentation]

2016-04-08 Thread Martin Frb

On 08/04/2016 19:24, Jürgen Hestermann wrote:

Am 2016-04-08 um 18:18 schrieb Martin Frb:
Or the person reading the code with the intend of documentation, is 
more clever than this. They could report any suspicious parts, and 
clarify the intend. That way the code would be additionally be 
checked for bugs.
Bugs where the original implementer may have had a wrong 
understanding of what he was doing. In which case had the original 
coder documented it, the bug would have gone into docs.
Assuming the original coder is available for comment, then a person 
different from that coder can often write much better documentation. 
(simple because then 2 (or more) people will have though about what 
it should be)


I aggree  that this can happen.
But it requires that the reader has at least the same skills
regarding the topic of what has been coded.
How long do you think would it take to (fully) understand the code for 
VirtualTreeView?

I have already found bugs in it but never understood why they occur
because I do not understand how the whole unit is coded.
So how should I even write documentation for it?



I have maintained SynEdit for nearly a decade now. Yet there is code in 
SynEdit I never looked at, and consequently I have not understood yet. 
According to you, it is a good thing I have not tried to add any docs. 
(Actually I should delete the parts I added to the wiki)


On the other hand according to me, anyone could have investigated a 
single property, or method. To do so would not require an understanding 
of everything. Yet that person could have documented the one 
method/property.

If so then at least some parts would have docs.

On VirtualTreeView: I dont know if the Author is around, and if he 
could/would answer questions, or even proof read contributed docs. But 
if he was, then the question  "How long do you think would it take to 
(fully) understand" is just the wrong question. The question should be: 
how much time do you have? Is there a chance, that in that time you can 
document at least one property or method? If yes, well then start. If 
you get more done (now or later), then even better.


The problem is, everyone (including me) is very good at pointing out why 
someone else should do it. And everyone just keeps pointing out it needs 
to be done.
Well that is fine. Lobbying for a cause is great. But the expectations 
in that case must be set correct. Someone else may also have a reason 
not to do it.


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


Re: [Lazarus] *** GMX Spamverdacht *** Re: Suggestion for TRadioGroup documentation

2016-04-08 Thread Martin Frb

On 08/04/2016 18:10, Jürgen Hestermann wrote:


Not only that it would take a lot of (unneccessary) additional time to 
wade through
foreign code (while the original coder already knew this after writing 
it).
Also, every bug would become part of the documentation as it is "how 
it is coded".


Or the person reading the code with the intend of documentation, is more 
clever than this. They could report any suspicious parts, and clarify 
the intend. That way the code would be additionally be checked for bugs.


Bugs where the original implementer may have had a wrong understanding 
of what he was doing. In which case had the original coder documented 
it, the bug would have gone into docs.


Assuming the original coder is available for comment, then a person 
different from that coder can often write much better documentation. 
(simple because then 2 (or more) people will have though about what it 
should be)


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


Re: [Lazarus] PDF generator, try 2

2016-04-07 Thread Martin Schreiber
On Thursday 07 April 2016 13:49:06 Graeme Geldenhuys wrote:
> I was about to mention that. This was discussed before, and there was a
> reason (which eludes me now) why FillChar() will not be changed.

Because out parameters are finalised on caller side:

"
Procedure FillChar1(out x;count:SizeInt;Value:Byte);
begin
 fillchar(x,count,value);
end;

procedure tmainfo.exe(const sender: TObject);
type
 testty = record
  a: int32;
  b: string;
 end;
 ptestty = ^testty;
var
 po1: ptestty;
begin
 getmem(po1,sizeof(testty));
 pointer(po1^.b):= pointer(123467); //random value
// fillchar(po1^,sizeof(testty),0); //OK
 fillchar1(po1^,sizeof(testty),0); //crash because out paramters are 
   //finalized on caller side
 po1^.b:= 'abc';
 finalize(po1^);
 freemem(po1);
end;
"

Martin

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


Re: [Lazarus] Class & Method info line at top of editor

2016-04-06 Thread Martin Frb

On 06/04/2016 12:03, Graeme Geldenhuys wrote:

Hi,

I don't really know what it is called, but when I'm in a method of a
class, the top line of my editor (I call it "info line"), tells me what
class and method I am in. This is very useful information.

I have noticed today that if I work with Object types (not Class types),
then I don't see that info line. And yes, the method is longer that the
editor is high (what triggers the info line).

Is there some place where I need to activate when that info line is
displayed, or is support for Object types not implemented?


It works for me. It all depends on the HL recognizing them. Can you test 
with a simple example? Maybe there is something else that prevents it.


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


Re: [Lazarus] German umlauts in component names

2016-04-02 Thread Martin Schreiber
On Saturday 02 April 2016 10:30:51 Mattias Gaertner wrote:

> > We have many Delphi Programs with German Umlauts in component names and
> > would like to go to Lazarus with them.
> > Any hints?
>
> This is not supported by FPC yet.

Not supported *yet*?
Shudder.

Martin

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


Re: [Lazarus] Xamarin becomes free and open-source

2016-04-01 Thread Martin Schreiber
On Thursday 31 March 2016 20:30:59 Anthony Walter wrote:
> I thought this was newsworthy and of interest to us:
>
> https://blog.xamarin.com/xamarin-for-all/

A date effect maybe? ;-)

Martin

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-30 Thread Martin Schreiber
On Wednesday 30 March 2016 11:23:49 Juha Manninen wrote:
> > If one wants to handle BMP-chars comfortably and with good performance
> > one has to convert from utf-8 in AnsiString to UnicodeString first.
>
> Maybe, but BMP-chars are not enough for a proper Unicode support.

But they are enough to be used in Russian and German pupils homework, utf-8 
code units are not enough, please read lazarusformum.de. ;-)

Martin

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-30 Thread Martin Schreiber
On Wednesday 30 March 2016 10:13:36 Juha Manninen wrote:

> With Unicodestring we don't need to care about backwards compatibility
> really because it is so new type.

Ouch!

WideString has been introduced in Delphi 4 IIRC, FPC had an on all platforms 
reference counted 16-bit string which worked like current UnicodeString. IIRC 
it was about version 1.8 when FPC introduced this string type.
Kylix WideString (Linux) also was reference counted.
Later FPC changed WideString on Windows ( against my strong opposition, 
well-understood ;-)  ) to the not reference counted OLE-string.
A little bit later FPC added the on all platforms reference counted 
UnicodeString again.
So one can say that at the moment when Lazarus became Unicode capable there 
was a UnicodeString-like stringtype available in FPC. It was very buggy, so 
probably this was one of the reasons that Lazarus used utf-8 in AnsiString 
instead.
For MSEgui on the other hand I used WideString/UnicodeString from beginning 
and wrote FPC bug-reports until FPC WideString became production ready.

> What more, Unicodestring is not needed often when using our new Unicode
> system.
>
If one wants to handle BMP-chars comfortably and with good performance one has 
to convert from utf-8 in AnsiString to UnicodeString first.

Martin

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


Re: [Lazarus] Feature Request: Disable/clear the "Recent files" and "Recent projects" lists

2016-03-29 Thread Martin Frb

On 29/03/2016 17:19, Dmitry Boyarintsev wrote:
On Tue, Mar 29, 2016 at 12:15 PM, Martin Frb <laza...@mfriebe.de 
<mailto:laza...@mfriebe.de>> wrote:


If 0 currently means unlimited, then:
1) a new value is needed for unlimited
2) the configfile version must be increased, so the config reader
knows according to the version what 0 means.


So why to change IDE instead of an IDE plugin?

This question bothers me all the time. Despite of the fact there's a 
decent plugin API (IDEIntf), a lot of changes are making into IDE itself.



In general I agree, many thinks can be done as plugin.

In this case, I think:

part 1 is an actual bug in the current implementation. If I reduce "max 
recent procject" from 10 to 1, then the list will still display 10. That 
is wrong. It should be cut to 1. But it will only be cut, if I open a 
new project (via the open dialog).


part 2 is a feature. It could go in a plugin (assuming IdeIntf allows 
access to all needed functions).
And then it can not use the current spin edit, but instead must have a 
checkbox. Or always active if installed.


Not sure how practical that is in this case. A plugin could probably 
hide the menu entry. So that would be possible. Not sure if it can (with 
current IdeIntf) prevent the values from being written to the config file.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Feature Request: Disable/clear the "Recent files" and "Recent projects" lists

2016-03-29 Thread Martin Frb

On 29/03/2016 17:11, Martin Frb wrote:

On 29/03/2016 16:59, Dmitry Boyarintsev wrote:
On Mon, Mar 28, 2016 at 2:25 PM, Ondrej Pokorny <laza...@kluug.net> 
wrote:


On 28.03.2016 18:14, max.lemradt2 wrote:

I'd like to be able to disable or clear the "Recent files"
and "Recent projects" lists, e. g. for privacy reasons.



2) make it work with 0.

If 0 currently means unlimited, then:
1) a new value is needed for unlimited
2) the configfile version must be increased, so the config reader knows 
according to the version what 0 means.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Feature Request: Disable/clear the "Recent files" and "Recent projects" lists

2016-03-29 Thread Martin Frb

On 29/03/2016 16:59, Dmitry Boyarintsev wrote:
On Mon, Mar 28, 2016 at 2:25 PM, Ondrej Pokorny > wrote:


On 28.03.2016 18:14, max.lemradt2 wrote:

I'd like to be able to disable or clear the "Recent files" and
"Recent projects" lists, e. g. for privacy reasons.


I will probably never use it but if you need it, feel free to
create such a function and send a patch to mantis. A good place
would be to create a button in Options -> Environment -> Files.


Why a patch instead of an IDE plugin?


I dont think it needs a button.

There already is "Max recent files". If this is set to a lower value, 
then it should cut the existing list. So 2 steps:

1) fix this setting to cut old entries if the value was reduced
2) make it work with 0.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Martin Frb

On 24/03/2016 20:36, Aradeonas wrote:

Aha!
If found the problem!
I have a config folder in my Lazarus directory that has every config 
xml files like default Lazarus have in Appdata.
When I open Lazarus forms shortcut like I said there was no problem 
but when I add that path to cfg it has problem until I changed the 
address to this : --primary-config-path=C:\Trunk\lazarus\config and 
now it solved and no problem.
What did you use before? --pcp? If that works on commandline but not in 
.cfg, then report a bug please.
But Im still curios about how GetLazarus version works without a cfg 
file and it will be very good if any one can check that.




You need to ask them.

Just to understand, you can download getlazarus, install the same 
version into 2 different folders, and run them and they have separate 
config?


Maybe they changed the code to use a folder inside the install dir?
The problem with the install dir is that on Linux you can not always 
find it easily. E.g. if the lazarus exe is linked (hard linked) to 
another location. (In that case the lazarus.cfg can not be found 
either). On Windows that is on problem.


Lazarus stores the config files by default in the location that is 
typical for the OS (each OS has guidelines for that). Storing inside the 
exe folder is against that rules. It can cause problems if:
- the install folder is read only to the user (the lazarus.cfg file is 
part of the install, it does not get changed by lazarus, so no problem)
- the folder can not be found, because the exe is outside the folder 
(hard link on linux). In this case lazarus.cfg will not work either, but 
at least a normal install will still work. lazarus.cfg is optional.


If the folder can not be found, lazarus will find the install folder, 
once it has the config, because the config contains the location where 
the lazarus sources are installed.
(Obviously if you get the install folder only from the config, then it 
is to late for --pcp)


And yes an install folder can be write protected (default on many linux 
installs), if you rebuild the IDE, then all the new ppu files are 
created inside the config folder.


So there are good reasons why Lazarus does it the way it does.

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


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Martin Frb

On 24/03/2016 19:48, Aradeonas wrote:


The same as when you specified --pcp
If you copied the lazarus.exe from another install, then you need
to rebuild it once. And add or remove packages if needed.

unfortunately I cant understand you.

well using a lazarus.cfg file (with --pcp inside) is exactly the same as 
specifying --pcp on the commandline or in a shortcutp


If you get warnings with --pcp in one case, you get them in the other 
case too.

Otherwise you made some mistake and the --pcp was not regocnized at all.

lazarus.cfg is internally handled as part of the commandline.

The advantage of lazarus.cfg is, that you can create as many shortcuts 
(or pin it) as you like. They all go to the same lazarus.exe, and then 
the lazarus.cfg is loaded.

So you do not need to add --pcp to all the shorcuts.

My lazarus.cfg contains one line
--primary-config-path=B:\laz_configs\lazarus_latest

And one the first start that path (must exist) will be populated with 
default config. And since them it is an independend installation.


---
As for the warnings about packages.
I do not know what you did.
But lets say you got trunk from svn. Then copied the lazarus.exe from 
your 1.6 install into that folder. Added the --pcp (in lazarus.cfg). And 
then run it. This exe will give warnings, as it now no longer has its conf.

You can ignore them. Menu Tools, build ide. And all is fine.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Martin Frb

On 24/03/2016 15:44, Aradeonas wrote:


I understood your remark as
"getlazarus offers this functionality already".

Yes and I want to know how.



Lazarus itself only offers --pcp
that can be given
- on the commandline
- in a bat file
- in a shortcut
- in the lazarus.cfg

If GetLazarus does it in another way, then they added that. And you need 
to ask them.


I dont see a need for another way. The lazarus.cfg should be good. (it 
was created for that purpose only)


If you install different versions of Lazarus (1.4 up, when this was 
added), using the installer, then there is a checkbox, and it will set 
it all up for you.

Independent installs.
No missing package error.

Of course there is no installer for trunk. So when you get the sources, 
you need do build your first lazarus.exe (you can use make and the 
makefile, I never tried).
If you copy a lazarus.exe from another install, that is when you get 
warnings. But rebuild it once, and that is it.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Martin Frb

On 24/03/2016 15:23, Aradeonas wrote:


And with that you can start c:\laz_trunk\lazarus.exe anyway you
want, it will use the pcp given in the cfg file.

I done that but it will be the reason of many errors about installing 
packages. and again I cant find any cfg file about this config with 
GetLazarus version.

The same as when you specified --pcp

If you copied the lazarus.exe from another install, then you need to 
rebuild it once. And add or remove packages if needed.



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


Re: [Lazarus] Having multiple Lazarus like GetLazarus version

2016-03-24 Thread Martin Frb

On 24/03/2016 14:35, Aradeonas wrote:


The recommende way is and has always been to use the
--pcp=path/to/config commandline parameter.
Why do you insist that it must be done in another way?
Why can you simpy use the mechanismes we have provided for just that?

If you don want a shortcut (why???) then just start it from the
console (as i do with lazarus fixes branch).

Ok. One simple reason I dont like to make shortcut with custom 
parameter with my apps and one good reason for that is, Windows 
Taskbar that you can pin apps dont accept parameters so if you pin you 
Lazarus that runs with parameters and next time click on icon on 
taskbar it will open but keep another shortcut on Taskabr.

It is annoying for someone likes me that like to keep my stuff organized.
Second reason is Im curious, everytime I saw shortcut way for running 
multiple reason and it seems there is a better reason out there and Im 
a programmer I like to find a better way and when I cant I ask from 
others.
Originally I should ask @Anthony about his works but it seems he 
refuse answering or supporting about his works so I ask here for 
future needs of others like me.




That is what the lazarus.cfg file is for.

Instead of supplying the parameters fer --pcp, you put them into the cfg 
file.


lazarus.exe, when started, looks for a lazarus.cfg file in the same 
folder as the exe. If found it adds the content to its command line 
params. (one per line).


so if you have
c:\lazarus   installation of 1.6, should use config in the default location
c:\laz_trunk   needs different config

then you add
c:\laz_trunk\lazarus.cfg
with the --pcp param you need.

And with that you can start c:\laz_trunk\lazarus.exe anyway you want, it 
will use the pcp given in the cfg file.



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


Re: [Lazarus] Strange behaviour of TCustomEditButton ancesters

2016-03-12 Thread Martin Frb

On 12/03/2016 20:20, Frans wrote:

I do understand what you mean, but I do not think that is th case.
I send my test program, it's very simple.

Did a quick test.
When first time hit TForm1.TabSheet2Show
FileNameEdit1.FEDIT.FBOUNDSREALIZED : record RECT {  LEFT = 0, TOP 
= 0,   RIGHT = 80,   BOTTOM = 23 }

TabSheet2.FAUTOSIZINGLOCKCOUNT : 1

The Tab has the correct Size (and it has a handle too), the edit does 
not yet have the final size.


The 2nd time
FileNameEdit1.FEDIT.FBOUNDSREALIZED : record RECT {  LEFT = 0, TOP 
= 0,   RIGHT = 406,   BOTTOM = 21 }


This is because sizes (such as in result of anchors, align, ...) are 
only applied when it makes sense (not sure, parent visible, handle 
created, ). In fact they probably need a handle, for the proper 
clientrect. And the tab-page only gets a handle when first shown.


I dont know at which time AUTOSIZINGLOCKCOUNT  is set (this avoids doing 
the resize multiple times). Maybe it should be cleared by the time of 
the event. But it is not.





Op 12-03-2016 om 20:59 schreef Martin Frb:


I dont have the "how to fix", but it looks like the first time you 
call SetFocus is before the tab got created, (or at least before it 
gets its true size). At that time the tab will have a dummy size 
(maybe 200 pixel width).
The SetFocus may or may not create those handles, but the size is 
likely not yet set. So the content of the edit is "scrolled".


It could also be, that it is created, but the autosize lock is still 
on, deferring the initial resize.



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


Re: [Lazarus] Strange behaviour of TCustomEditButton ancesters

2016-03-12 Thread Martin Frb

On 12/03/2016 19:38, Frans wrote:

Hi

I use TFileNameEdit (but TDirectoryEdit acts the same) on the second 
tabsheet of a PageControl where it's the first control to receive 
focus. I set the focus manually in the method form.tabshow for the 
event OnShow.
The first time I activate that tab, SetFocus has the effect as shown 
in FirstTime.png. When I select the tab another time, the effect is 
normal, as shown in Second time.png.

Is can't find out why. Is this a bug? I use Lazarus 1.6 and FCP 3.0.0.


I dont have the "how to fix", but it looks like the first time you call 
SetFocus is before the tab got created, (or at least before it gets its 
true size). At that time the tab will have a dummy size (maybe 200 pixel 
width).
The SetFocus may or may not create those handles, but the size is likely 
not yet set. So the content of the edit is "scrolled".


It could also be, that it is created, but the autosize lock is still on, 
deferring the initial resize.


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


Re: [Lazarus] how to search in files but skip commented text

2016-03-08 Thread Martin Frb

On 08/03/2016 10:28, Dennis wrote:

When source files become big, the search function becomes very important.
Does anyone share my desire for the Search function in Lazarus to be 
smart enough to skip those commented out texts?


I often comment out a portion of the source files before permanently 
deleting it (after I am really sure the new code is better than the 
old ones).


I hope the IDE will one day be smart enough to skip those commented text.

Also, sometimes I use meaningful english words as my routine and 
variable names. A search on those names will then also return those 
words in my commented txt.


You can use find identifier references. IIRC that can skip comments. But 
it also skips identifiers of the same name, if they are not the same 
(e.g a field of equal name defined in a different class, or local var)


Another method with similar results, is to add "deprecated 'find me';" 
to the identifier you are interested, and compile.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] How do events come into the glib event queue?

2016-03-03 Thread Martin Grajcar
Our Lazarus-GTK2 application crashes due to a GTK event whose target has
been freed. My problem is that I can see only the place where this happens
and the data has already been overwritten. *What I need is the place where
the event was generated or enqueued.*

I thought it'd be gtk2msgqueue.pp, but TGtkMessageQueue.AddMessage gets
never called before the crash. A side question: What is TGtkMessageQueue
good for?

Below is the stacktrace... I'm sure it's not helpful for finding out the
bug, it just illustrates my problem.

Regards,
Martin.

#0  g_type_check_instance_is_a (type_instance=0x85e58f0,
iface_type=139661072) at gtype.c:3967
#1  0x0820f28a in
GLIB2_G_TYPE_CHECK_INSTANCE_TYPE$POINTER$LONGWORD$$BOOLEAN ()
#2  0x08200345 in GTK2_GTK_CHECK_TYPE$POINTER$LONGWORD$$BOOLEAN ()
#3  0x082009c6 in GTK2_GTK_IS_WIDGET$POINTER$$BOOLEAN ()
#4  0xb78d8000 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb77ed641 in g_idle_dispatch (source=source@entry=0x85ee160,
callback=0x82e3430 , user_data=0x85e58f0) at
gmain.c:5321
#6  0xb77f0bb9 in g_main_dispatch (context=0x85305d0) at gmain.c:3066
#7  g_main_context_dispatch (context=context@entry=0x85305d0) at
gmain.c:3665
#8  0xb77f0ecf in g_main_context_iterate (context=context@entry=0x85305d0,
block=block@entry=0, dispatch=dispatch@entry=1, self=0x8508000) at
gmain.c:3736
#9  0xb77f0f83 in g_main_context_iteration (context=0x85305d0, may_block=0)
at gmain.c:3797
#10 0x081d8462 in TGTK2WIDGETSET__APPPROCESSMESSAGES (this=) at ./gtk2/gtk2widgetset.inc:2326
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Keys not recognized by Lazarus 1.6 code editor

2016-02-24 Thread Martin Frb

On 24/02/2016 15:33, Bo Berglund wrote:

On Wed, 24 Feb 2016 15:00:42 +, Martin Frb <laza...@mfriebe.de>
wrote:


On 24/02/2016 13:10, Bo Berglund wrote:

When I connect via VNC from my Windows7 PC I can not enter the
characters < or + via the keyboard keys into the Lazarus code editor.

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

I dont know if the issue is in the LCL, or in VNC.
Apparently the data received from VNC does only occur with VNC. Other
app may not have the issue, may simply mean that they do not check this
particular part of the data, independent of its correctness

Too bad then


It doesnt mean that it cant be fixed (or if broken in vnc: worked 
around) in lazarus. But no one has the time to work on it


And the time check IIRC is there for a reason.
I believe (from what I heard) there are cases where the event for the 
same keystroke can be received again, leading to duplicate input. The 
time field is a way to identify this. The key code can not be used, 
since event handlers can change it, and it would then be received with 
the new value.

I am not sure if the origin of the 2nd event would be the OS or LCL.

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


Re: [Lazarus] Keys not recognized by Lazarus 1.6 code editor

2016-02-24 Thread Martin Frb

On 24/02/2016 13:10, Bo Berglund wrote:

I have discovered a strange problem with my Lazarus 1.6 release
installation on RPi2 (Raspbian Jessie) concerning keyboard entries.

When I connect via VNC from my Windows7 PC I can not enter the
characters < or + via the keyboard keys into the Lazarus code editor.


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

I dont know if the issue is in the LCL, or in VNC.
Apparently the data received from VNC does only occur with VNC. Other 
app may not have the issue, may simply mean that they do not check this 
particular part of the data, independent of its correctness


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


Re: [Lazarus] Lazarus 1.6 EditorMacroScript error on startup

2016-02-19 Thread Martin Frb

On 19/02/2016 14:10, Bo Berglund wrote:

I have retrieved 1.6 from SVN and built it using make bigide.
When I strat for the first time a dialog pops up saying:

Error in EditorMacroScript
The package EditorMacroScript (pascalscript macros)
has detected a problem and was deactivatyed.
The package filed its selftest with the message:
"Failed getstr2 [Exp: "456" / Got: "abc"]"
If you clear the error (options, editor macro, test again), does the 
error happen again?


What platform/OS, what cpu? Which optimization settings?
Pascal script has to emulate function calls, so it builds (or attempts 
to build) the stack for that call. That stack differs between OS and CPU.




I have seen this before but thought it would be fixed in the release
version...
It does not matter much because it will be shown only once on first
start, however it is pretty strange.
Once failed Editor Macro deactivates pascal script. That is why it does 
not warn again.



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


Re: [Lazarus] RFC : "Resolved View"

2016-02-12 Thread Martin Frb

On 12/02/2016 12:45, Michael Van Canneyt wrote:


Well, if it is on the todo list, I don't need to file a feature 
request ;)


Not really on todo, only remembered as being wanted.

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


Re: [Lazarus] RFC : "Resolved View"

2016-02-12 Thread Martin Frb

On 12/02/2016 16:10, Michael Van Canneyt wrote:


On Fri, 12 Feb 2016, Martin Frb wrote:



Not really on todo, only remembered as being wanted.


Should I file a request anyway or has memory been sufficiently 
refreshed ?


I had not yet read Mattias will go for a different approach solving it.

The problem for me is, that I will not have the time to look at it any 
time soon.


Also my approach would have more been "editing includes inline" rather 
than a cleaned source.


If I surprisingly will get time, then we can still have both one day in 
the future.


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


Re: [Lazarus] Guess the problem with Heap

2016-02-12 Thread Martin Frb

On 12/02/2016 19:04, Aradeonas wrote:

Hi,
Im working on one of my projects and tried to make a release version, 
so I used shortcut button in build modes and add release mode but when 
I compile and run I get SIGSEGV error when main form want to be create.
After many tries I found out that if I check "Use Heaptrc unit" in 
project debugging option program will run correctly even it is release 
mode so there is no debug info.

So simple :
If I check that option and use Heaptrc, no problem and if I unchecked 
it, error .
Its a old project and I dont remind any code I write about heap so I 
cant find the problem so I want to ask anyone can guess what code can 
make such problem?




Common candidates are any code that
1) accesses memory behind or before allocatien
  dynArray[-10]  := x
  dynArray[length(dynArray)+10] := x

  foo := TObject.create;
  TChildClass(foo).something 

  getmem, and then access outside the bounds
  pointer 

2) any code accessing memory that was freed (any of the above)

---
and worst of all, the error may or may not be triggered at the time of 
accessing the invalid mem. Sometimes it fails at some other completely 
valid code.


heaptrc changes memory layout as it stores the leaktrace info, and that 
means that by pure luck, the invalid memory access you do, does not 
affect the rest of your data. (or not anything that you detected yet)


A)
compile with heaptrc
and -Criot  and any other flag you can find. Note the LCL does not work 
with -CR (upper R)


set the HEAPTRC environment to "keepreleased"

B)
If you can compile an Linux and run with valgrind.




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


Re: [Lazarus] RFC : "Resolved View"

2016-02-11 Thread Martin Frb

On 11/02/2016 23:54, Michael Van Canneyt wrote:



By this I mean a view of a unit as the compiler will see it:
- Correct include files included


This has been long on the list. But still no in the doing.

Ignoring:
- any high/low-light or other markup to indicate the fact that the text 
comes from a different file

- probably also ignoring line numbering

this should actually be relatively easy.

There are already "views" wrapped around the textbuffer. All that it 
needs is to wrap another view around it, that combines 2 real textbuffers.


This could even be editable. Except it needs to prevent joining lines 
accross file bound.


There is work on the IDE side (outside SynEdit) to ensure it knows the 
file is open. Could be resolved by pretending it is open in its own 
editor (which is simply hidden)


- IFDefs properly resolved. 

lowlight exists.

Actual hiding is more work, because it needs to shift x positions in 
some line. Probably needs big changes. Though readonly may be doable.



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


Re: [Lazarus] Panel Top Negative Limitation

2016-02-04 Thread Martin Schreiber
On Thursday 04 February 2016 23:09:39 Graeme Geldenhuys wrote:
> On 2016-02-04 17:51, i...@voiceliveeditor.com wrote:
> > How can this be corrected; or is there a workaround?
>
> I'm not 100% sure, but I believe some windowing environments have a
> 65535px (or around that) upper limit. It might be that you are hitting
> that boundary.
>
X11 has a range of -32768..32767. Although the OP is on Windows AFAIK.

Martin

--
___
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 Martin Schreiber
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


Re: [Lazarus] Is there tool for testing class methods speed?

2016-01-20 Thread Martin Frb

On 20/01/2016 19:17, Krzysztof wrote:
Almost 10 years ago I worked in company where they used tool (Delphi 
5) which automatically added "checkpoints" after BEGIN and before END 
of each method of pointed class / pascal unit. Then after run, it 
reported (as extension for IDE) what was execution time of each method 
and how many times it was called. With the same easy way we could 
clean up unit from checkpoints. Totally forgot name of this tool but 
do we have something similar for Lazarus / FPC?

If you are on linux: valgrind + kcachegrind

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


Re: [Lazarus] Debugging in Libraries.

2016-01-18 Thread Martin Frb

On 18/01/2016 18:34, Donald Ziesig wrote:

Hi All:

I have encountered a problem doing things that used to work. (Using 
Lazarus 1.4.4 on Linux and 1.4.2 on Raspbian)


Specifically, I can no longer step into subprograms in library units, 
and when I set a breakpoint in the library code it is colored dull 
green as opposed to bright red in the main program. Some, but not all, 
of the library code is implemented using generics.


I can't see anything I am doing differently than before (except that I 
copied the entire source for the program and library from a Raspberry 
PI, including the configurations.  The PI also had this problem).


Dull green, usually (check debug output window) means that gdb returned, 
that there is on code on the requested line/number.


With generics, usually the oposite is the case, there are several blocks 
of code containing the location (and on windows, I have seen gdb 
handling that, at least in some cases).


The question then is, if fpc did generate sufficient debug info or if 
gdb has an issue.  (try stabs and dwarf)


ensure you disable "inlining"

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


Re: [Lazarus] Debugging in Libraries.

2016-01-18 Thread Martin Frb

On 18/01/2016 20:51, Donald Ziesig wrote:




ensure you disable "inlining"


where?

there may be an option to fpc

I place {$INLINE OFF}(IIRC) in units that need it

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


Re: [Lazarus] Elastic Tabstop - what would the bounty be worth?

2016-01-12 Thread Martin Frb

Just a tech note.

All that should be needed is one new unit, that replaces 
"SynEditTextTabExpander" (and then in SynEdit an option to use it 
(synedit.create does that)).


Must be based on TSynEditStringsLinked like the existing.

It has access to all lines, so it can calculate each tab. It also can 
(and has to) trigger line invalidation if tabs change.


DoGetPhysicalCharWidths retunrs how many "cells" a tab/char occupies.
For other chars is is
- 1 (first byte of utf8 char)
- 0 (2nd or later byte)
- 2 (first byte of FULL WIDTH utf8 char (Chinese and some other))

there is a locking mechanism as well, so if a line is inserted (with 
text), it can skip notifications on the temp empty line.


On 12/01/2016 15:47, Graeme Geldenhuys wrote:

Hi,

If I was to create a bounty to have this implemented in Lazarus (and
hopefully somebody has the skill and time to implement it), what would
the cost be? I'll be funding this personally as Elastic Tabstop support
has been on my Lazarus wishlist for years. The algorithm of Elastic
Tabstops is pretty simple, I just don't know what would be involved in
modifying Lazarus's TSynEdit component to support this.


Some Elastic Tabstops (ET for short) background:

Elastic Tabstops homepage:
   http://nickgravgaard.com/elastic-tabstops/

Visual Studio add-on:
   https://www.alwaysaligned.net/
   This also shows a nice animated image of what ET does to source code

jEdit, Gnome's gEdit etc also support ET.

ET is a replacement for TAB and Space indentation. It is a age old
argument which I don't want to go into here... All I can say is that ET
is in my personal opinion by far the best option of the lot. jEdit has
been supporting it for years, and it is immensely useful with source
code, CSV files, SQL, XML etc. I've personally used jEdit with ET
enabled for almost a year now, and it rocks!

Basically ET's representation of a tabstop is similar to that found in a
word processor (eg: MS Office, LibreOffice). The size of the Tab can
vary. On the flip side, programmer editors and IDE's often hard-code a
Tab size to a set number of spaces, and this size is applied everywhere.
Programmer editors in turn also limit you to only using monospace fonts.
With ET, the code is grouped into columns and each column can have a
variable Tab size (normally defined in pixels).

It has many benefits like using variable width fonts and still keeping
code perfectly aligned or indented. It makes reading column data like
CSV or SQL files very easy. Because it normally uses a single Tab to
indent or align code, the file size is reduced too - not sure if this
helps with compiler parsing speed. End-users can configure the threshold
and the amount of indentation (in pixels) so if you are a 2-space indent
guy, with ET you can still make your code look identical to what it was
before. If you like a bigger indentation, configure it with a larger
indent - the source code number of TAB characters will still stay the
same regardless, so different settings per developer doesn't cause
source code repository whitespace diffs (unlike Space or static TAB
indentation does).

More feature complete ET implementations also support converting Space
indentation files to/from ET. But I'm not really interested in this
ability for the bounty. Gnome's gEdit had ET plugins that showed this
ability and it actually worked pretty well though. I'll be doing a once
off conversion of my source code to ET style indentation and then keep
it like that.

You are welcome to read the ET homepage for further information (I
suggestion you do, if you are interested in this bounty). I even
recommend you download the Java .jar file which implements a mini editor
with ET support so you can try it yourself, or run jEdit and enable ET
support in the settings.


So for those knowledgeable of TSynEdit, how much effort would it be to
implement Elastic Tabstop support in Lazarus IDE, and what would be your
estimated cost? Hopefully I can afford the cost, because I would really
love ET support in Lazarus. ;-) The resulting implementation would
obviously be shared back to the Lazarus project and hopefully get
accepted in the repository.

You can reply here in the mailing list, or reply in private if you want.
If you need any more information, just let me know.

Regards,
   - Graeme -




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


Re: [Lazarus] IDE extension and Debug Output window

2015-12-31 Thread Martin Frb

On 31/12/15 12:25, Ondrej Pokorny wrote:

On 28.12.2015 07:49, Dmitry Boyarintsev wrote:
What's the correct IDEIntf APIs to show "Debug Output" window as well 
as populate with some debugging output?


Nobody has more information about this issue? I am interested as well.

My intention is: Open "Debug Output" window in the IDE that will catch 
DebugLn output from the debugged application.


"Debug Output" has nothing todo with debugln.  It displays the ide <> 
gdb communications. It is only useful for diagnostics of the ide or gdb.


If and only if the debugged apps stdout goes to gdb, then it will appear 
in that window. (that may (still) be the case on Mac).


On Linux there is a console window, on windows an app has its own 
console window (or if not, it has no stdout)



the window is somewhere defined in the debugger package or the IDE (but 
not ideintf) (afaik)


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


Re: [Lazarus] Lazarus compile project via ssh?

2015-12-20 Thread Martin Schreiber
On Sunday 20 December 2015 10:34:33 Mark Morgan Lloyd wrote:
> Martin Schreiber wrote:
> > On Sunday 20 December 2015 08:59:35 Anthony Walter wrote:
> >> I am wondering, is it possible to configure Lazarus to compile a project
> >> on a remote computer running a different platform/architecture through
> >> ssh?
> >>
> >> I've been doing Lazarus development on Linux on a quad core amd64
> >> desktop PC for a while now and it feels comfortable. But I do have a few
> >> arm6/7 Raspberry Pi computers with FPC/Lazarus as well.
> >
> > I successfully use cross-compiling and remote debugging from x86 Linux to
> > Raspberry Pi. MSEide has project templates for that purpose in
> > apps/ide/templates/crossarm*.prj, please see README.TXT.
> > http://mseide-msegui.sourceforge.net/pics/crossarm.png
> >
> > It is probably possible to setup Lazarus to to the same.
>
> Generally works well, provided that the desktop machine's X11 server
> fully supports the primitives expected by the target machine's widget set.
>
I use remote debugging by gdbserver running on Raspberry Pi. The target uses 
the Rpi X11 server, so one needs to see the Rpi screen and reach the target 
keyboard and mouse in order to debug a graphical application with this setup.

Martin

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


Re: [Lazarus] Lazarus compile project via ssh?

2015-12-20 Thread Martin Schreiber
On Sunday 20 December 2015 08:59:35 Anthony Walter wrote:
> I am wondering, is it possible to configure Lazarus to compile a project on
> a remote computer running a different platform/architecture through ssh?
>
> I've been doing Lazarus development on Linux on a quad core amd64 desktop
> PC for a while now and it feels comfortable. But I do have a few arm6/7
> Raspberry Pi computers with FPC/Lazarus as well.
>
I successfully use cross-compiling and remote debugging from x86 Linux to 
Raspberry Pi. MSEide has project templates for that purpose in 
apps/ide/templates/crossarm*.prj, please see README.TXT.
http://mseide-msegui.sourceforge.net/pics/crossarm.png

It is probably possible to setup Lazarus to to the same.

The cross-compiling environment is here:
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/

Martin

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


[Lazarus] Lazarus versions in git

2015-12-17 Thread Martin Grajcar
I wonder what commit corresponds to Lazarus 1.4.2. There's an official git
mirror at https://github.com/graemeg/lazarus.git, but I can't see there
neither branches nor tags corresponding to releases (except for some oldies
up to v0.9.28.2).

We want to stick with 1.4.2 for now, but apply some patches (both official
fixes and ours).

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


Re: [Lazarus] Lazarus versions in git

2015-12-17 Thread Martin Grajcar
Hi Graeme!

On Thu, Dec 17, 2015 at 5:58 PM, Graeme Geldenhuys <
mailingli...@geldenhuys.co.uk> wrote:

> On 2015-12-17 15:09, Martin Grajcar wrote:
> > I wonder what commit corresponds to Lazarus 1.4.2.
>
>
> With the limitation in mind (as mentioned in my other replies), I pushed
> a couple of release tags to Github.


That's nice, thank you! However, after having executed git reset --hard
v1.4.2 && make clean && make I've got Lazarus 1.5. As I understand it (or
as I hope), there are just odd versions in the repository and switching to
1.5 was the very first done after releasing 1.4. So taking this commit and
setting the version to 1.4.2 should be all I need?

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


Re: [Lazarus] Lazarus versions in git

2015-12-17 Thread Martin Frb

On 17/12/2015 16:35, Graeme Geldenhuys wrote:

On 2015-12-17 16:19, Vincent Snijders wrote:

Maybe you should convert the svn to a git branch instead of a git tag.

I tried that it the past - tracking svn branches (seeing as svn tags are
just like svn branches), at it inflated the Git repository size
massively, because each branch was a 100% copy of all files. Branching
is not as "cheap" in SVN like they are in Git. So I gave up on that idea
too.



Actually there are only 2 or 3 branches that do the 100% copy thing.

That are branches which branch only a subdirectory (or in the last case 
parent dir) of trunk. (that is the one svn feature git does not have 
changing the root folder in a branch)


The first 1 or 2 where just the lcl folder. To clone those it the 
duplication is needed. (at least I found no better way).


The there is an 1.4.x branch, that was based on the parent of trunk, and 
has no content. It is possible to skip this, and automatically follow 
all other branches.


And that will work, as long as no accidental or intentional svn branch 
of just one folder is created in future.


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


Re: [Lazarus] lazarus 1.6 rc1 fpc 3.0 opendialog

2015-12-16 Thread Martin Frb

On 16/12/2015 19:57, Sven Barth wrote:


What about fpdebug? Does it work for Win64?


Not tested recently, but a year ago it did.

It is missing many features though. Even breakpoints do not always work 
(e.g. generics, where the same pascal code has more than one address in 
memory.


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


Re: [Lazarus] lazarus 1.6 rc1 fpc 3.0 opendialog

2015-12-16 Thread Martin Frb

On 16/12/2015 16:52, Andrea Mauri wrote:

Dear all,
windows 10, lazarus 1.6 rc1 fpc 3.0

32 or 64 bit?


I put a button and an opendialog on a form
Onclick button I put
opendialog.execute
clicking button lazarus stop workin with message debugger error
gdb stop working


Does it work outside the IDE? (without gdb).

If 64 bit: We currently have no maintainer for 64 bit gdb, so the gdb 
exe for 64 bit is rather old. It may not work well on modern windows.


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


Re: [Lazarus] lazarus 1.6 rc1 fpc 3.0 opendialog

2015-12-16 Thread Martin Frb

On 16/12/2015 17:26, Ondrej Pokorny wrote:

On 16.12.2015 18:20, Bart wrote:

On 12/16/15, Ondrej Pokorny  wrote:


>I had the same issue on Windows 10 and was advised to check
>DisableLoadSymbolsForLibraries (I don't remember who advised me, 
sorry).

Yoe beat me to it.
(And I was the one.)


:)

Is it possible/reasonable to check the settings by default? Maybe more 
people will be affected by the Win10 issue and not by disabling load 
symbols by default?


If we could get a more uptodate gdb for 64 bit that should solve it 
(providing it passes the gdbmi test case without crash)


If the option is active and you develop a library project, then you can 
not debug it.


-
In the past 64 bit did not work because of SEH, so the error was 
encountered with 32 bit. For 32 bit gdb was updated to 7.7.1 and that 
should (afaik) fix the issue. (On 32 bit gdb > 7.7.1, tested up do gdb 
10 are less stable, they crash in the testcase)


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


Re: [Lazarus] [offtopic] Debugger is not working...

2015-12-16 Thread Martin Frb

On 16/12/2015 10:41, William Ferreira wrote:

Hi,

I got a problem that seems more related to Windows than Lazarus itself.

I simply can debug an application.

I'm using a notebook that cames with Windows 8. I've updated to W8.1 
and to W10. After updating to W8.1, if I run a project via F9 key, I 
always get that message ('Hit stop and hope the best, we're pulling 
the plug', 'Failed to load application executable')


I thought updating lazarus should help but I got no success.

It heappens with all projects.

Is there a way check what is heappening?


1) Antivirus. I ve seen it before, the AV removes the exe before it can 
run. (some av do that without asking, even if they are set to ask 
first). The list of AV is always changing, as they get updated and may 
stop doing so.


2) Can you find and run the exe outside the IDE?

3) which lazarus? 1.4 (32bit ?).x or 1.6 (32 or 64 bit?)
For 1.4 (32 bit) try download the alternative gdb 7.7.1 from our 
sourceforge site. 1.6 already has that.


4) name of directory in which you saved the project, and where the exe 
is. For testing use a folder without spaces or accents (in the 
entire path, so no "documents and settings". Use C:\mytest



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


Re: [Lazarus] UTF8String and UTF8Delete

2015-12-10 Thread Martin Schreiber
On Friday 11 December 2015 08:05:12 Sven Barth wrote:
> Am 10.12.2015 23:04 schrieb "Mattias Gaertner" <nc-gaert...@netcologne.de>:
> >
> > What about:
> >
> > UTF8Delete(AnsiString(Pointer(s)),1,1);
>
> While the typecast itself would probably work I strongly advice against it
> since you're relying on implementation details. Also I doubt that you can
> do this for var parameters...
>
It is difficult to make efficient Free Pascal applications without 
such "tricks". ;-)

Martin

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


Re: [Lazarus] Release Candidate 1 of Lazarus 1.6

2015-12-09 Thread Martin Frb

On 09/12/2015 15:27, Mattias Gaertner wrote:

On Wed, 09 Dec 2015 14:31:20 +
Mark Morgan Lloyd  wrote:

[...]
How about a stable Lazarus v2.0.x, with as many bugs and development
quirks as possible worked out of it, based on FPC 3.0.x and with a
support commitment from both teams?

...

If you want to maintain a third branch with longer life, you can
volunteer to maintain it. Note that building all release binaries and
uploading them takes some hours. If you have a build farm
you can automate a lot of things. I can help you set it up.


+1
man power is the main issue. Building and testing.

Then a set of rules how to decide what to merge to lts.

As for the version number, I dont see any relation between 2.0 and lts. 
it can same as good be based on 1.4 (if you want 2.6.4 continued), or on 
1.6 (once 1.8 or 2.0 is out).



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


Re: [Lazarus] Release Candidate 1 of Lazarus 1.6

2015-12-08 Thread Martin Frb

On 08/12/2015 15:19, Mattias Gaertner wrote:

The Lazarus team is glad to announce the first release candidate of Lazarus 1.6.

This release was built with FPC 3.0.0.
The previous release Lazarus 1.4.4 was built with FPC 2.6.4.



checksums on our website 
http://www.lazarus-ide.org/index.php?page=checksums#1_6_0RC1


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


Re: [Lazarus] Detecting when decompiler is running

2015-12-04 Thread Martin Frb

On 04/12/2015 08:29, Richard Mace wrote:

Hi All,
I was wondering if there was a way where an application, written in 
Lazarus, could detect when a compiler is running, perhaps by it's mutex?
My idea was, in my application, I could periodically check to see if a 
decompiler was running and then my app could perform an operation, 
such as maybe closing.


Well there is no 100% protection.
Even if you make it so hard, that it is financially not interesting for 
a cracker, there will be someone who does the job to make him self a 
name, add it to their trophy list.
Hence my opinion: if you spent to much time/money on protection, then 
thats already your loss.


Anyway, there are 2 ways your app can be hacked.
1) a key can be distributed.
  1a) Either stolen, or bought with wrong credentials
  1b) a key generator can be written
2) a patch can be written to modify your exe.

(2) is always possible, and will happen unless (1) is really simple. But 
(2) is not so attractive to the users, as the risk is that they download 
a virus with it. IMHO attempting to protect against (2) is a waste of time.


(1) is important. Because downloading a key (usually a bit of text) is 
easy. Sign licenses with a private key. That should stop (1b).


(1a) can IMHO only be solved by phoning home. That in itself can loose 
you a small number of potential buyers.
Download a revocation list: hashes of keys no longer allowed, the 
overall list is signed, and it is issued with a time stamp, updated 
every minute. Your app will only run, if it can get a list not olden 
than x days.  Downside if your server is down, longer that this . 
Also the user needs internet.
Alternatively you can try to bind the license key to the hardware 
signature of the users pc. Allowing to reactivate a few times, then 
having to phone you I remember some big company did that in the past.


The other option is a dongle. Then you do not need to phone home. Again 
some hacker will create a patch to your software. But hopefully enough 
users will pay, rather than risking a virus.



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


Re: [Lazarus] Fast GUI

2015-11-30 Thread Martin Schreiber
On Monday 30 November 2015 13:51:38 Aradeonas wrote:
> Martin is mse support transparent text box or these
> component with OpenGL?

In the experimental MSEgui OpenGL backend? Yes, transparent text is supported. 
But it is experimental and the performance is not very good.

> As I remember you said that mse use no handle per 
> control so what mse do for text component or lists?
>
MSEgui sends graphics primitives to xlib or xrender on Linux and FreeBSD or to 
gdi32 or gdi+ on Windows.

Martin

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


Re: [Lazarus] Fast GUI

2015-11-30 Thread Martin Schreiber
On Monday 30 November 2015 11:35:08 Aradeonas wrote:
> Hi,
>
> I am working on a specefic GUI that need to be too fast and for this I
> have fpGUI or mse but in this project I need fast image and resizing and
> as I tested the fastest way for this kind of jobs OpenGL is the best so
> I made a project on it and everything is great and much much fast! So I
> want to ask is there any works on creating GUI with OpenGl that not be
> only for games or be for games but useful for specific applications and
> maybe using OS theme.

MSEgui has an experimental OpenGL backend. OpenGL is not well-suited to 
support 2D GUIs IMO. Because of the many different versions and 
implementations, all with different extensions, limitations and bugs, working 
with OpenGL is a difficult task.
MSEgui uses hardware acceleration if available. A framework for animations 
with a central frame tick and the like is planned, although performance of 
simple hardware accelerated canvas drawing is not bad, see for example:
http://mseide-msegui.sourceforge.net/pics/blend.mpeg
http://mseide-msegui.sourceforge.net/pics/blend1.png
http://mseide-msegui.sourceforge.net/pics/blend2.png
http://mseide-msegui.sourceforge.net/pics/blend3.png
The project is here:
https://gitlab.com/mseuniverse/mseuniverse/tree/master/samples/widgets/blendpos
(needs MSEide+MSEgui git master version).

The code:
"
procedure tmainfo.childmouseeventexe(const sender: twidget;
   var ainfo: mouseeventinfoty);
begin
 image.face.image.center:= 
TranslateWidgetToPaintPoint(ainfo.pos,sender,image);
end;
" 
The whole rest are design time property settings only.

> I remember FireMonkey but in what we have Lazarus? 

AFAIK FireMonkey has no good performance.

Martin

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


Re: [Lazarus] Failed to build lazarus release 1.4.4 from svn

2015-11-08 Thread Martin Schreiber
On Sunday 08 November 2015 21:59:28 Bo Berglund wrote:
> On Sun, 08 Nov 2015 16:15:59 +0100, Bo Berglund

> Is seed fpc 2.6.4 not enough to compile lazarus 1.4.x release?
>
For RaspberryPi you need the EABIHF version of the FPC-ARM compiler. For 
example 3.0.1 from here:
http://sourceforge.net/projects/mseide-msegui/files/fpcarm/

> I want to get the release versions working since I had problems with
> the trunk versions
>
> Please HELP! I have spent probably 10 hours today on this with
> multiple downloads, builds and apt-get updates all in vain. :(

Please remember:
http://www.mail-archive.com/lazarus%40lists.lazarus.freepascal.org/msg50406.html
;-)

Martin



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


[Lazarus] D7 compatibility in component definition concerning TPage

2015-11-06 Thread Martin Grajcar
I've tried to unify some Lazarus and D7 sources and succeeded except for
one thing:

TYPE TMyForm = CLASS(TForm)
{$IFDEF FPC}
 SomePage: TPage;
{$ENDIF}
END;

Delphi parses it wrongly and always offers to remove the declaration.

I don't need the declaration in L, but removing it led to a class not found
error.

While in LFM the form looks like

object SomeBook: TNotebook
object SomePage: TPage
end;
end;

there's just

object SomeBook: TNotebook
object TPage
end;
end;

in Delphi. I modified it to look like L, but it changed nothing.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 18:19:14 Michael Van Canneyt wrote:
>
> But presumably you mean some construct as
>
> With QMyVeryLongQueyObjectName as Q do
>try
>  // Do things with Q
>finally
>  Q.Close;
>end;
>
> ?
>
Correct. There have been some more notations suggested.

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:
> On 2015-11-06 17:19, Michael Van Canneyt wrote:
> > With QMyVeryLongQueyObjectName as Q do
> >try
> >  // Do things with Q
> >finally
> >  Q.Close;
> >end;
>
> var
>   Q: TQuery absolute QMyVeryLongQueyObjectName;
> begin
>   with Q do
> try
>   // Do things with Q
> finally
>   Q.Close;
> end;
>
>
> problem solved! ;-)
>
Not a good idea IMHO, that hinders readability because one doesn't see the 
real container at the "with" block start. Another important use of "with" is 
to make complex address calculations only once at the "with" block start 
without the need to define a pointer variable in "var" and to dereference in 
every statement.

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
>
> Nevertheless I am of the opinion that WITH is evil and should be removed
> from the IDE/LCL code (unless only identifiers from within the with
> scope are used; but even then they could be removed...).

Or implement a safe "with" in Free Pascal without waiting until it is enforced 
by Delphi compatibility...

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 17:42:39 Michael Van Canneyt wrote:
> On Fri, 6 Nov 2015, Martin Schreiber wrote:
> > On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
> >> Nevertheless I am of the opinion that WITH is evil and should be removed
> >> from the IDE/LCL code (unless only identifiers from within the with
> >> scope are used; but even then they could be removed...).
> >
> > Or implement a safe "with" in Free Pascal without waiting until it is
> > enforced by Delphi compatibility...
>
> Ehm. How can "with" ever be safe ?
>
You are joking, no? It has been discussed on fpc-pascal/fpc-devel several 
times. An IIRC Italian community member then usually shows a syntax 
description of a safe "with" statement from a maybe more than 20 year old 
pascal dialect.
But probably such language additions are not sexy enough.

Martin

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


Re: [Lazarus] Using event driven components in console application

2015-11-04 Thread Martin Schreiber
On Wednesday 04 November 2015 14:31:34 JuuS wrote:
>
> But this is what, ultimately, fpGUI will address I believe? Wiki page
> says it is still alpha but I anxiously await the opportunity to use it
> natively (I work in 1.4.4, I SVN only occasionally in special
> circumstances)
>
It is also possible to use fpGUI directly without LCL layer. Same applies to 
MSEgui if identical look and feel on all supported platforms is important.

Martin

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


[Lazarus] Forwarding events/messages

2015-11-04 Thread Martin Grajcar
I'd like to forward a TLMVScroll message to the parent component as a
workaround for controls preventing parents from receiving mouse wheel
events (I couldn't find out how to let the parents receive them).

The problem is that the handler is

PROCEDURE TWhatever.WMVScroll(VAR Message : TLMVScroll);

and I need to put it in

FUNCTION SendMessage(HandleWnd: HWND; Msg: Cardinal; WParam: WParam;
LParam: LParam): LResult;

Or am I missing a more suitable procedure? Why is there no

SendMessage(Message : TLMVScroll);

which would do exactly this?



My workaround is to scroll manually, like

TScrollingWinControl(Parent).ScrollBy (0, ScrollAmount);

but this feels stupid as it duplicates the ScrollAmount computation.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Forwarding events/messages

2015-11-04 Thread Martin Grajcar
On Wed, Nov 4, 2015 at 6:07 PM, Ondrej Pokorny <laza...@kluug.net> wrote:

> On 04.11.2015 17:54, Martin Grajcar wrote:
>
> I'd like to forward a TLMVScroll message to the parent component as a
> workaround for controls preventing parents from receiving mouse wheel
> events (I couldn't find out how to let the parents receive them).
>
> The problem is that the handler is
>
> PROCEDURE TWhatever.WMVScroll(VAR Message : TLMVScroll);
>
> and I need to put it in
>
> FUNCTION SendMessage(HandleWnd: HWND; Msg: Cardinal; WParam: WParam;
> LParam: LParam): LResult;
>
> Or am I missing a more suitable procedure? Why is there no
>
> SendMessage(Message : TLMVScroll);
>
> which would do exactly this?
>
>
> There is TControl.WndProc, but don't call it directly if you don't know
> what and why you are doing it.
>

I found it in the meantime... and the usage seems to be obvious (if the
parent instance and message type checks pass, then send it to the parent,
otherwise call inherited). The tiny problem is that it does nothing at all.

My workaround is to scroll manually, like
>
> TScrollingWinControl(Parent).ScrollBy (0, ScrollAmount);
>
> but this feels stupid as it duplicates the ScrollAmount computation.
>
>
> AFAIK forwarding of messages works only on Windows,
>

This could be the reason for my code doing nothing. :(


> so if you need it cross-platform, you will have to use
> "TScrollingWinControl(Parent).ScrollBy (0, ScrollAmount);" in any case. So
> this should be the correct way to do it.
>

That's ugly like hell and I can only guess the ScrollAmount, which means
that it can scroll much more or less than when the mouse it outside of my
TControl.

Anyway, thank you!

Martin.


> - Zeljko, correct me if I am wrong, you are the specialist here :)
>
> Ondrej
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Finding memory leaks

2015-10-24 Thread Martin Frb

On 24/10/2015 13:51, Aradeonas wrote:
Is there any way to count objects or whatever so I can find what 
object will not free?
I cant gett much of help from report becuase its very big (about 
100,000 line) and it have many items like this :


Call trace for block $0030EEC8 size 88
  $0049664B  TFONTHANDLECACHE__ADD,  line 104 of ./include/font.inc
  $00497F37  TFONT__REFERENCENEEDED,  line 1157 of ./include/font.inc
  $00498275  TFONT__GETREFERENCE,  line 1277 of ./include/font.inc
  $0041FE77  SCREENGETSYSTEMFONT,  line 51 of ./include/screen.inc
  $0049A6B1  TCANVAS__TEXTRECT,  line 1290 of ./include/canvas.inc
  $00520133  TCUSTOMPANEL__PAINT,  line 127 of
./include/custompanel.inc
  $004FF413  TCUSTOMCONTROL__PAINTWINDOW,  line 126 of
./include/customcontrol.inc
  $BAADF00D

Or it address end of procedures or ... .
So how can I find out what is the problem?



 look at http://wiki.freepascal.org/leakview
If you redirect above to a file ( set environment HEAPTRC to log=file / 
on windows setting environment requires a newer gdb, see the Lazarus 
sourceforge site), then you can load them.


Search for those that include your code.
The ide shows how often each leak recurred "(n times)",  find the ones 
with low count


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


Re: [Lazarus] Lazarus implementation of TListView etc?

2015-10-23 Thread Martin Schreiber
On Friday 23 October 2015 09:44:58 Michael Schnell wrote:

> On 10/22/2015 11:13 PM, Bo Berglund wrote:
> > So it had helpers to show the recorded data in listviews and other
> > such GUI related stuff
>
> This is called "RAD" ("Rapid Application Development")  and a big
> marketing argument of all companies who sold Delphi.
>
> But it is very bad for portability.  Investing some effort, it can be
> overcome, though (see my message to Graeme.)
>
In my understanding "RAD" is visually placing components in forms and 
datamodules, to set component properties in objectinspector and to use event 
properties in order to react on events.
Separating GUI and business logic is perfectly possible with RAD. Implement 
the business logic by components, properties and code in datamodules and 
additional units, for the GUI use forms witout or only GUI specific code.
And before Graeme shows his image with the thousand components in a single 
datamodule here how it could look:
http://mseide-msegui.sourceforge.net/pics/mseguirad.png
;-)
In order to connect the GUI with the business model use TDatasource and 
TAction for example or use glue code. MSEgui additionally has the MSEifi 
components from component palette tab "ifi".
Applications without GUI use tnoguiapplication instead of tguiapplication as 
application instance for the main-eventqueue. tnoguiapplication has no 
dependency on GUI-libraries and GUI-services and provides a platform 
independent API. I assume Lazarus has a similar approach.

Martin

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


Re: [Lazarus] annoying *SPAM* (attn: Michael Schnell)

2015-10-23 Thread Martin Frb

On 23/10/2015 19:34, Dmitry Boyarintsev wrote:


That's why I'm asking the participant to adjust his email client, 
rather than doing anything on my end.




Well my email client does sort them correct.
Yet I find it (personal opinion) annoying to have a SPAM keyword in 
those mails.


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


Re: [Lazarus] Lazarus implementation of TListView etc?

2015-10-23 Thread Martin Schreiber
On Friday 23 October 2015 15:49:25 Graeme Geldenhuys wrote:
> On 2015-10-23 13:07, Marcos Douglas wrote:
> > LOL!
> > One or two times on year I see this image do you talked hehehe
> >
> :-)
>
> Two additional points:
>  - Martin's example is not nearly as big or complex as the example I
>showed in the past.

You don't know what is in the other datamodules. ;-)

Martin

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


Re: [Lazarus] The GDB command: "-gdb-set confirm off" did not return any result

2015-10-22 Thread Martin Frb

On 22/10/2015 22:04, Bo Berglund wrote:
What I really wonder about next is the fact that it is different from 
in Delphi when one starts a command line program while developing. In 
Delphi the black terminal window shows up and one can see the progress 
of the execution there. In this case there was nothing, not even a 
single message in the messages window. It was as if the program did 
not run at all. But it might be intended to be like this on Linux, 
this is my first try really. 


On Windows you should get a terminal, if your app was compiled as console.

On linux the terminal is just a device /dev/pty,  and the terminal in 
which the command is running does the display.


Lazarus on linux has a debug window (menu view) to show the console output

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


Re: [Lazarus] Working on big units

2015-10-21 Thread Martin Frb

On 21/10/2015 20:53, Aradeonas wrote:
But I remember I read somewhere Its good too have minimum count of 
units and also its easier to use and also I saw many units that have 
thousands of code and its interesting that how they work on these codes?
These classes are in a subject like controls and I didnt want to have 
Edit,Label,List,Panel ... units .



Code tools (read the entire page, it is useful not just for navigation)
  http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools
  Method_Jumping   and Find_Declaration

Code explorer  (try it, the description is not that good))
  http://wiki.lazarus.freepascal.org/IDE_Window:_Code_Explorer

bookmarks

folding (if that is your thing)

find next/previous occurrence of word at caret

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


Re: [Lazarus] Working on big units

2015-10-21 Thread Martin Frb

On 21/10/2015 21:58, Aradeonas wrote:

Thanks, Im using all of these tools except folding (I just use JCF and
it is very good at losing the point that where you was!) and still hard
to maintain, so it seems its just my problem.

If you used "find declaration", that adds a jump point, and you can go 
back ctrl-h (I recommend you put that on a key you like)

You can also add your own jump points. (search the menu, or keymapping)

Also look at the overview gutter (next to scrollbar), it shows where 
interface and implementation are. That can be helpful.
You can also set inactive breakpoints (ctrl click on gutter), they show 
in the overview gutter too. If you have a limited number of them they 
can help finding things.


I dont know about jcf, and how well it keeps any line info (bookmarks, 
breakpoints,...)


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


Re: [Lazarus] Working on big units

2015-10-21 Thread Martin Frb

On 21/10/2015 21:02, Martin Frb wrote:


folding (if that is your thing)

There are shortcuts to fold ALL nodes at a specific level.
alt-shift-1  (or 2, 3 4 ... for level)
alt-shift-0 unfold

depending on what you have configured as fold-able try alt-shift-3 
(maybe 4) and you just see function headers.


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


Re: [Lazarus] *SPAM* Re: Win 10 IOT Core

2015-10-20 Thread Martin Schreiber
On Tuesday 20 October 2015 11:26:25 Michael Van Canneyt wrote:
> On Tue, 20 Oct 2015, Michael Schnell wrote:
> > On 10/20/2015 11:05 AM, Michael Van Canneyt wrote:
> >> Except that it is not remote.
> >
> > 
> >
> > With the QNAP it is remote. Or am I hit by a misconception of that
> > wording ?
>
> I understand it as follows:
>
> A browser application (any RIA) such as used in QNA is in fact a
> client/server application. The client just happens to be a browser.
>
> ExtJS is meant to run in the browser.  The gui is built from A to Z in the
> browser. It is there for a 'local' GUI from the point of view of a
> developer or end user.
>
That is exactly the working principle of MSEifi. The difference is that MSEifi 
is not implemented by a Javascript environment but by MSEgui components and 
widgets written in Free Pascal. On client side a MSEifi runtime which could 
be implemented as browser plug-in fetches the *.mfm form data (the MSEgui 
equivalent of Lazarus *.lfm files) and PascalScript snippets and instantiates 
the forms and datamodules. If wanted there are ifi components available in 
order to connect data points and events between server and client by a TCP/IP 
or other serial connection but that is no requirement.
The same connection components can be used for separation of GUI and business 
logic in a standalone desktop application so it is possible to use the same 
GUI definition in both. At least in theory. ;-)

Martin

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


Re: [Lazarus] *SPAM* Re: Win 10 IOT Core

2015-10-20 Thread Martin Schreiber
On Tuesday 20 October 2015 14:11:09 Michael Schnell wrote:
> On 10/20/2015 02:00 PM, Martin Schreiber wrote:
> > At least in theory. ;-)
>
> What is the state of the "ifi" project right now ?  (AFAIK, you did not
> publish it for others to use yet.)

In process MSEifi is used in production and standard in MSEide since years, 
the experimental MSEifi-remote components can be integrated by compiling 
MSEide with -dmse_with_ifirem. MSEide git master version has them integrated 
by default.
https://gitlab.com/mseide-msegui/mseide-msegui

>
> Are there any example that could demonstrate that it's not pure theory :-)
>
There is still the pipe demo I made for you, feel free to build some more. :-)

Martin

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


Re: [Lazarus] *SPAM* Re: Win 10 IOT Core

2015-10-20 Thread Martin Schreiber
On Tuesday 20 October 2015 14:20:42 Michael Van Canneyt wrote:
> >
> > That is exactly the working principle of MSEifi. The difference is that
> > MSEifi is not implemented by a Javascript environment but by MSEgui
> > components and widgets written in Free Pascal. On client side a MSEifi
> > runtime which could be implemented as browser plug-in
>
> And that's where the ship sinks for me...
> Browser plugins are not acceptable as a viable solution.
>
Certainly not for universal internet use. In an industrial environment the 
requirements are different.

Martin

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


Re: [Lazarus] *SPAM* Re: Win 10 IOT Core

2015-10-20 Thread Martin Schreiber
On Tuesday 20 October 2015 14:49:28 Michael Schnell wrote:
> On 10/20/2015 02:29 PM, Martin Schreiber wrote:
> > There is still the pipe demo I made for you, feel free to build some
> > more. :-)
>
> Maybe you could provide a compiled version (simply two applications) so
> that the others can see what is possible with that paradigm.
>
There *are* compiled versions I made especially for you and which blow up the 
repository now. ;-)

https://gitlab.com/mseuniverse/mseuniverse/tree/master/attic/msedocumenting/mse/trunk/help/tutorials/mseifi/ifipipedemo/bin

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


Re: [Lazarus] Win 10 IOT Core

2015-10-19 Thread Martin Schreiber
On Monday 19 October 2015 10:00:33 Michael Van Canneyt wrote:
> On Mon, 19 Oct 2015, Michael Schnell wrote:
> > On 10/16/2015 03:00 PM, Michael Van Canneyt wrote:
> >> So, that is not the GDI winapi...
> >
> > Obviously.So a Delphi program never will show a a Form.
> >
> > But with Lazarus, the "fpGUI" and "Custom Drawn" widget sets should work,
> > as - AFAIK - they can be configured to use DirectX.
> >
> > -> Graeme can you comment on this ?
>
> As far as I know, fpGUI works on GDI.
>
And AggPas.

Martin

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


Re: [Lazarus] Hiding a component by changing its parent

2015-10-19 Thread Martin Grajcar
On Mon, Aug 24, 2015 at 4:43 PM, Mattias Gaertner <nc-gaert...@netcologne.de
> wrote:

> On Mon, 24 Aug 2015 16:29:49 +0200
> Martin Grajcar <maaarti...@gmail.com> wrote:
>
> > In code I'm working on, I've found a pattern like
> >
> > PROCEDURE HideIt;
> > BEGIN
> >   SomeComponent.Visible := FALSE;
> >   SomeComponent.Parent := SELF;
> >   SomeComponent.Visible := TRUE;
> > END;
> >
> > PROCEDURE ShowIt(NewParent: TForm);
> > BEGIN
> >   SomeComponent.Visible := FALSE;
> >   SomeComponent.Parent := NewParent;
> >   ...some more stuff...
> >   SomeComponent.Visible := TRUE;
> >   ...some more stuff...
> > END;
> >
> > I can't really see what it's good for. I guess, the idea was to preserve
> > the widget, but the widget seems to get freed immediately in the first
> > line. It comes from D7 or older. Does it make sense on Lazarus 1.4 using
> > GTK+?
>
> No.
> Simply do "SomeComponent.Parent := NewParent;".
>

Thank you for the information! Simplifying helped to get rid of a crash on
Linux
http://bugs.freepascal.org/view.php?id=28840
but there's still an event-related problem on Mac. Could someone tell me
more about what problem may get solved by using the more complicated stuff?

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


Re: [Lazarus] GB18030 support in Lazarus

2015-10-16 Thread Martin Frb

On 16/10/2015 10:19, Tony Whyman wrote:


In terms of "work", if I use functions such as UTF8Length and 
ValidUTF8String on a GB18030 string should they always work, or are 
there exceptions?


IIRC ... UTF8Length counts codepoints, not chars. So if the chars you 
are interested in have chars that need more than one codepoint then this 
is not the  length in char.
This can even happen with some western languages, but it is not likely 
with them.


The same is for char accessing function (NextUtf8CharByteLen or 
similar). They only get codepoints.


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


Re: [Lazarus] Lazarus eats comment characters using Swedish keyboard

2015-10-11 Thread Martin Frb

On 10/10/2015 23:33, Bo Berglund wrote:

I wanted to comment out a number of lines so I hit the key combination
to produce the { } pair. But nothing was printed in the Lazarus
editor.
If I switched to the text editor in the GUI the keys produced the
wanted characters.

So something in Lazarus eats the key presses needed in Sweden to
produce the braces (RightAlt-7 and RightAlt-0).
Is there a configuration somewhere to stop this from happening so one
can enter comments in Lazarus?

This sometimes happens, if the key combo matches a configured shortcut. 
You can check this in tools > options> editor > keyboard


Right Alt = AltGr ? that is usually seen as equal to ctrl-alt.

Though I am not aware of anything an ctrl-alt 7 or 0 by default. 
Bookmarks are on ctrl-0 to 9. Maybe test this, set bookmark 7 and see if 
your key combo jumps there.


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


Re: [Lazarus] Lazarus eats comment characters using Swedish keyboard

2015-10-11 Thread Martin Frb

On 11/10/2015 17:33, Bo Berglund wrote:

I have investigated further now and when I use the Pi directly
(monitor connected to Pi and keyboard/mouse too) then the {} keys do
work.
When I noticed the problem I was using TightVNC to remotely access the
GUI. So somehow VNC might be involved here.



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

Never had time to work on it, and probably wont have anytime soon.

See note in bug. I dont know if same timestamp is allowed or if that is 
an issue in VNC. But in the LCL (for any custom control) it is 
interpreted as, this is the same keystroke, therefore it was already 
handled.


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


Re: [Lazarus] Lazarus Release 1.4.4

2015-10-07 Thread Martin Frb

On 06/10/2015 12:56, Mattias Gaertner wrote:

The Lazarus team is glad to announce the release of Lazarus 1.4.4.

This release was built with FPC 2.6.4, same as the previous
release Lazarus 1.4.2.

Forgot to mention, checksums of the original files are on our website: 
http://www.lazarus-ide.org/index.php?page=checksums


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


Re: [Lazarus] Lazarus Release 1.4.4 (debugging on some versions of Windows )

2015-10-06 Thread Martin Frb

On 06/10/2015 15:56, Mattias Gaertner wrote:

On Tue, 6 Oct 2015 13:44:54 +0100
Martin Frb <laza...@mfriebe.de> wrote:


On 06/10/2015 12:56, Mattias Gaertner wrote:

The Lazarus team is glad to announce the release of Lazarus 1.4.4.

This release was built with FPC 2.6.4, same as the previous
release Lazarus 1.4.2.


Windows users with Windows 7 or up may in some cases need to change the
debugger:

You may try the following setting:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working

Or (32 bit) download an alternative GDB:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Alternative%20GDB/

Is this new?

Its been around for a while.

It seems that it depends on other software installed on those systems 
(mainly shell extensions => usually problems happen when debugging 
Open/Save-dialog)



Should it be added to the announcement?

Maybe

It is in the sourceforge Readme. But feedback indicates that it is not 
getting noticed there.


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


Re: [Lazarus] Lazarus Release 1.4.4 (debugging on some versions of Windows )

2015-10-06 Thread Martin Frb

On 06/10/2015 12:56, Mattias Gaertner wrote:

The Lazarus team is glad to announce the release of Lazarus 1.4.4.

This release was built with FPC 2.6.4, same as the previous
release Lazarus 1.4.2.



Windows users with Windows 7 or up may in some cases need to change the 
debugger:


You may try the following setting: 
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working


Or (32 bit) download an alternative GDB:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Alternative%20GDB/

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


Re: [Lazarus] Compiling lazarus on arm-linux

2015-09-30 Thread Martin Schreiber
On Wednesday 30 September 2015 14:56:54 Koenraad Lelong wrote:
> Hi,
>
> I'm trying to compile lazarus on an arm-linux system (odroid C1, but
> also on RPi model 2). It works until this :
>
> ...
> make --assume-new=svn2revisioninc.pas svn2revisioninc
> make[2]: Entering directory `/home/odroid/Downloads/source/tools'
> Makefile:2332: warning: overriding commands for target `.'
> Makefile:2330: warning: ignoring old commands for target `.'
> /home/odroid/fpc-2.6.4/bin/ppcarm -gl  -Fu.
> -Fu../components/lazutils/lib/arm-linux -Fu../lcl/units/arm-linux
> -Fu../lcl/units/arm-linux/nogui -FE. -FU.
> -Fl/usr/lib/gcc/arm-linux-gnueabihf/4.9 -Flinclude
> -Fl/etc/ld.so.conf.d/*.conf -dFPC_ARMHF -darm svn2revisioninc.pas
> Free Pascal Compiler version 2.6.4 [2014/03/21] for arm
> Copyright (c) 1993-2014 by Florian Klaempfl and others
> Target OS: Linux for ARMEL  <<<<<<<<<<<<<<<<--

This is wrong, you need a eabihf compiler, either a patched FPC 2.6.4 or 
better FPC 3.0.1 from here:
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/

Martin

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


Re: [Lazarus] Compiling lazarus on arm-linux

2015-09-30 Thread Martin Schreiber
On Wednesday 30 September 2015 18:46:11 Koenraad Lelong wrote:
> Op 30-09-15 om 15:43 schreef Martin Schreiber:
> > This is wrong, you need a eabihf compiler, either a patched FPC 2.6.4 or
> > better FPC 3.0.1 from here:
> > http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/
> >
> > Martin
>
> Thanks,
>
> Although the link points to a crosscompiler, I managed to compile
> lazarus on the odroid with binaries from your repo.

Ah, sorry, wrong link, please use
http://sourceforge.net/projects/mseide-msegui/files/fpcarm/

> I had to configure 
> the device to run without GUI because of lack of memory.
> Unfortunately, when I start lazarus, it complains it can't find the
> fpc-sources, which is true, because I only have a number of binaries.
> Can I just get the svn-sources and use these ?
>
> And when I try to add packages in lazarus, I can't because of lack of
> memory. So how can I add packages from the command-line ?
>
I normally use cross compiling and remote debugging with MSEide:
http://mseide-msegui.sourceforge.net/pics/crossarm.png
It needs current MSEide+MSEgui from git master:
https://gitlab.com/mseide-msegui/mseide-msegui
and the FPC cross environment from:
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/
There soon will be a MSEide+MSEgui 4.0beta1 release.
You probably can can configure Lazarus for cross development too.

Martin

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


[Lazarus] Problem with PDF printing

2015-09-29 Thread Martin Grajcar
I've just found out that our printing with Lazarus 1.4.2 on 64 bit Linux
doesn't work, e.g., it always produces a nearly empty PDF file (2.6 kB)
with CUPS PDF printer and an empty page on a real printer with a message
stating

Error Name: undefined
Offending Command: -nan
Operand Stack:
53.641

It works on 32 bit Linux (and Mac) and it works with Lazarus 1.2.6, which
we used before. Printing uses Fastreport 4.15.13. and there's no problem
with the preview, it's just the real printing what fails. There's no
exception, seemingly just garbage gets produced somewhere. All in all, it
looks like a pretty tough problem, so I wonder if someone could give me
some good advice how to approach it.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-22 Thread Martin Schreiber
On Wednesday 23 September 2015 06:33:02 Bo Berglund wrote:
> On Tue, 22 Sep 2015 10:00:12 +0200, Michael Schnell
>
> <mschn...@lumino.de> wrote:
> >On 09/21/2015 04:42 PM, Bo Berglund wrote:
> >> Unfortunately since the existing code is built on non-blocking serial
> >> communications and events to handle the data reception ...
> >
> >You can convert a blocking socket (or serial port receive) to be a
> >non-blocking Event-triggering (i.e. Delphi-Paradigm based) code by
> >encapsulating the blocking API in a thread and fire an event to the main
> >threads by TThread.Synchronize, TThread.Queue or
> >Application.QueueAsyncCall. Now you can do the complex work in the main
> >Thread event.
>
> That is what I figured I could do with the TInetSocket I found in some
> response here. I have verified it ships with FPC so I don't have to do
> any install or such to get it too.
>
> But since I did not find any documentation "for Dummies" on
> TInetSocket I am not at all sure what I should do to add a therad to
> manage it via an event handler.

The MSEgui socket components (and the pipe reader and RS232 components too 
BTW) implement the model Michael describes. They have the event 
properties "oninputavailable" and "onsocketbroken". If you like to build 
something like this yourself based on "TInetSocket" the code is here:

https://gitlab.com/mseide-msegui/mseide-msegui/tree/master/lib/common/ifi
(msesockets.pas) 
https://gitlab.com/mseide-msegui/mseide-msegui/tree/master/lib/common/serialcomm
(msesercomm.pas)
https://gitlab.com/mseide-msegui/mseide-msegui/tree/master/lib/common/kernel
(msepipestream.pas).

Martin

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


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-21 Thread Martin Schreiber
On Monday 21 September 2015 16:42:15 Bo Berglund wrote:

> That is where I
> have to tie in the conditional for TCP/IP comm using whatever socket
> implementation I find most suitable.
>
MSEgui also has nonblocking socket components with ssl support. Please compile 
MSEide with -dmse_with_ifirem in order to activate them.
It also has "tnoguiapplication" in order to build daemon applications with an 
event loop where all nonvisual components including ttimer can be used.

Martin

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


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-18 Thread Martin Schreiber
On Friday 18 September 2015 16:14:35 Bo Berglund wrote:

> I have not really used Lazarus except for some hello world tests and
> for checking how to port a Sentinel dongle function to FPC.
>
Now that is a chance to use MSEide instead. ;-)
MSEide runs amazingly fast on Raspberry Pi and has very good suport for 
development of embedded and microprocessor projects written in Pascal or C, 
cross development with MSEide is very comfortable. I use it daily for 
different ARM and AVR32 projects.
With MSEgui you also have a state of the art cross platform GUI toolkit with 
excellent database options at your fingertips. MSEgui probably is the most 
versatile GUI toolkit on the market.

Martin

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


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-18 Thread Martin Schreiber
On Friday 18 September 2015 16:08:20 Martin Schreiber wrote:
> 2. Port the FPC Windows to FPC Linux X86 on a Linux X86 PC.
2. Port the FPC Windows application to FPC Linux X86 on a Linux X86 PC.

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


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-18 Thread Martin Schreiber
On Friday 18 September 2015 15:44:40 Bo Berglund wrote:
> On Fri, 18 Sep 2015 11:02:23 +0200, Michael Schnell

>
> What would be the best way in your view?

1. Port the Delphi 7 application to FPC Windows X86 on a Windows X86 PC.
2. Port the FPC Windows to FPC Linux X86 on a Linux X86 PC.
3. Cross compile and cross debug the Linux application to RaspberryPi on the 
Linux X86 PC.

Martin 


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


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-17 Thread Martin Schreiber
On Friday 18 September 2015 01:28:16 Bo Berglund wrote:
> I have a need to port a Delphi console program written for Windows to
> be used on Raspberry Pi2.
> Apparently it is possible to use Freepascal to get programs running on
> the Pi2 platform, but can it be done in Windows so I don't have to
> install the complete IDE on a Pi and set it up with a monitor,
> keyboard and mouse just for running the compile?
>
On Linux X86 you could use MSEide and the FPC cross compiling environment from 
here:
http://mseide-msegui.sourceforge.net/pics/crossarm.png
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/

I assume it is possible to make something similar for Lazarus and Windows, I 
don't know if it already exists.

For integrated development with FPC 3.0.1 MSEide+MSEgui git master version is 
necessary:

https://gitlab.com/mseide-msegui/mseide-msegui

>From MSEide+MSEgui README.TXT:
"
Crosscompiling and remote debugging i386-linux -> arm-linux
***
For Raspberry Pi:
- Establish a ssh login without password (public key authentication).

- On the i386-linux host install the scp program
- download and extract 
  
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/crossfpc-i386_linux-eabihf_3_0_1.tar.gz
  to .

- Start MSEide, in 'Settings'-'Configure MSEide'-'Global Macros' add:

Name          Value

CROSSMSEDIR   <MSEide+MSEgui directory>
CROSSFPCDIR   
HOSTIP        
REMOTEIP      
REMOTEPORT    
REMOTEUSER    pi

- 'Project'-'New'-'From Template', select "crossarmdefault.prj" or
  "crossarmconsole.prj".
- Create the new project.
- 'Project'-'Options'-'Macros', set the TARGETPROJECTDIR value to the project
  path in remote target, ex: "/home/pi/proj/testcase".
- Check the TARGETENV macro.
- If your application needs additional libraries copy them from Raspberry Pi
  /lib/arm-linux-gnueabihf or /usr/lib/arm-linux-gnueabihf to
  /eabihf/lib

Press F9 and hope the best. ;-)
"
MSEide+MSEgui also runs amazingly fast natively on the Raspberry Pi, the 
limiting factor is FPC compiling speed and memory consumption especially for 
smart linking.

Martin

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


[Lazarus] test

2015-09-12 Thread Martin Frb

test

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


Re: [Lazarus] Desktops and multiple source editors

2015-09-09 Thread Martin Frb

On 09/09/2015 11:58, Juha Manninen wrote:

Martin Friebe noticed a problem with desktops and multiple source
editor windows.
In fact I also noticed that a second source editor is not restored
correctly when changing desktops.
Now I realized the 2nd, 3rd etc. editor windows are project specific,
while other layout settings are global. This is not very logical. How
to solve it?
I think all layout settings should be global for the sake of consistency.



IMHO global is ok. Maybe an option to add project specific layouts?

In any case SourceEditors. The layout should store the positions and 
sizes. The project defines which of them to use.
But that needs decision what to do, if a layout was created with 2 
editors, but a project has 3 open. Where to get the initial pos for the 
new source editor?

- default pos
- pos from global "default" layout  (if it specifies such a pos)
- pos from hidden layout "last pos of any window by name"
- have a parent mode (layout was created as "child" of other mode)
- search the mast similar one (probably not)


Also does it affect design forms? Then that would have similar issues

position of open package windows...
At first similar to the source edit issue, only projects are more likely 
to have different packages.

[pos from hidden layout "last pos of any window by name"] might help here.


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


Re: [Lazarus] Lazarus IDE - One Hundred Papercuts

2015-09-09 Thread Martin Frb

On 09/09/2015 11:42, Graeme Geldenhuys wrote:

On 2015-09-08 23:16, Martin Frb wrote:

In respect to "fixed locally" (your comment below): How?
Does it use the storage that can be edited via the "windows" tab in
tools/opitons? (like breakpoints)?

That's another problem I have with Lazarus IDE...

In my haste to fix the annoyance (which was really bugging me at the
time) I simply used a local TINIFile in the Procedure List dialog, and
saved the relevant information to that standard lazarus primary config
directory.
Then IMHO it is not a papercut (though it may still be easy/moderate to 
fix, but that depends how deep the new multi desktop changes go.)



- deleting some breakpoints after a debug session. I don't see the 
point it forcing me to press an extra key between every delete action. 
Also when the window is opened for the first time, why is the focus 
set, but no selection. It is such little annoyances that I consider 
"papercut bugs". Developers are creatures that like efficiency. ;-) At 
least that is me. 

Fixed/Improved

If you have a patch for the "first open" I am happy to apply it. Just 
not going to search the code now, for where this needs to be done.



Can be solved via editor macro. But if you have a patch...

I use a few copies of Lazarus IDE - in various VM's. In two of them I
can't find any reference to Macros in the IDE menus or how to record a
new macros. Searching the wiki for "macros" brings up the paths and
filename macros - not what I wanted.

So I wrote a IDE add-on package which does what I want, and include it
in my local "custom-mods" branch.

Is macros support an IDE add-on package that must be installed? It is
such a useful feature of any IDE or text editor, so why can't Lazarus
IDE come standard with macros support, and put it right there in the
main menu, easy to find. See attached screenshot of EditPad Pro - can't
get more clear than that!

http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros

It should be installed by default. But maybe, if you did "svn up" from 
an older version, then it was not installed.




Just adding them to mantis (patches subproject), and mention "patch" in
the subject.

That's find for the ones I have fixed, but what about the other 95
papercut bugs - that don't have patches yet. Could we have a separate
sub-section in Mantis to file these easy to fix (1-2 hours max) bugs -
or should we simply attach a tag to an existing Mantis report. Again I
know tags exist in Mantis, but I don't know how useful they are in real
life.

I have no preference.

Personally, I hardly use tags, but neither do I look at which subproject 
a bug is in. I mainly look at the subject. (and the content, if needed)



The issue is not just if the can be fixed in a line or two, but also if
that is deemed the correct solution.

Obviously, and why it needs to be discuss - hence my preference to file
them in Mantis, instead of simply listing them in a Wiki page.


When it is bugs, always mantis. When it is improvements, then Mantis or 
mail list (depends on how likely others see the need for such an 
improvement and the ability to do it quick)



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


  1   2   3   4   5   6   7   8   9   10   >