[Lazarus] Highlighter/line-Remainder patch [Re: [Fwd: A few hacky patches (resent)]]

2009-05-26 Thread Martin

Brad Campbell wrote


laz-synpatch-007.patch
This is another gross hack, but in a highlighter I've written I use 
this to enable me to ensure the
remainder of a line is painted in the right background colour. Synedit 
calls this GetLineRemainder
routine (if assigned in the highlighter) to get the colour the 
remainder of the line is to be
painted after it has finished painting all its tokens. Without this I 
was getting odd line

remainders when I scrolled often. With this I get perfection every time.



Not really a gross hack.

It slightly goes out of the current functionality of a highlighter = 
which so far is/was a token based highlighter. Line highlighting was 
reserved for Markup modules.


However this is/was more be evolution as specific design. It is quite 
reasonable to say that some text-formats/languages want to use full line 
markup to highlight language features. (Pascal uses  Divider-Lines instead).
It also does not interfere with any other functionality, and requires 
very little modifications.


I have integrated this patch in Lazarus (rev 20243).

A few modifications:
Function has been renamed to have Attribute in name: GetEndOfLineAttribute
The parts in SynEdit have been changed to be more in line with other 
code, and obey other features too.


Also note, that:
- the part in SynEdit may change in the future, but should continue to 
obey the attribute returned.
- May in future obey underline or Frame color or new features. It is 
therefore important to set those correctly (clNone)


Best Regards
Martin



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


[Lazarus] Codetools and insert unit names lowercase?

2009-06-04 Thread Martin
I noticed that lately codetools inserts all unit nems (in uses clause) 
in lowercase only?

Is there are reason, or an option for that?

They looked reall nice and readable in mixed case...

Martin


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


[Lazarus] Everyone, time to vote for lazarus

2009-06-22 Thread Martin

http://sourceforge.net/community/cca09/vote/

section Best Tool or Utility for Developers



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


[Lazarus] utf8 to lowercase?

2009-07-21 Thread Martin

sometimes it's the simple stuff

s:='utf8 string with german umlauts'
s2:=AnsiLowerCase(s);

on windows, does not convert the umlauts.

Anyone knows how to do this correctly? (or maybe it depends on the unit 
used, if there is more than one AnsiLowerCase?)


Martin

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


Re: [Lazarus] Debugging and Structured Data Arrays

2009-08-02 Thread Martin

Andrew Brunner wrote:

Thanks Silvio,

I'm not having a problem a problem with code running.  I'm not able to
Inspect the contents of VStringArray while debugging via GDB in
Ubuntu.

Can you inspect the variable VStringArray?  How about VStringArray[0]?
 I can not.

This is a fresh build of FPC and Lazarus from TRUNK and a BRAND new
install of Ubuntu 9.04.

  


There a various problems, like this. It is an issue between fpc and gdb.
A lot may depend on the version of  fpc and the version of gdb you use.

A few thinks you can try, but I don't know if they will work for you.

Try Dwarf versu stabs (Compiler option in Lazarus), Tab: Linking

While debugging the following has worked for me under window (not sure 
if I used dwarf, I think not). And it only worked if there was an 
explicit type:

 type TStringArray = Array of String; var a: TStringArray
but not for
 var a: Array of String;

instead of
a[0]
I wrote (in the watch window)
a^[0]


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


Re: [Lazarus] Debugging and Structured Data Arrays

2009-08-02 Thread Martin

please also read
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips

Martin wrote:

Andrew Brunner wrote:

Thanks Silvio,

I'm not having a problem a problem with code running.  I'm not able to
Inspect the contents of VStringArray while debugging via GDB in
Ubuntu.

Can you inspect the variable VStringArray?  How about VStringArray[0]?
 I can not.

This is a fresh build of FPC and Lazarus from TRUNK and a BRAND new
install of Ubuntu 9.04.

  


There a various problems, like this. It is an issue between fpc and gdb.
A lot may depend on the version of  fpc and the version of gdb you use.

A few thinks you can try, but I don't know if they will work for you.

Try Dwarf versu stabs (Compiler option in Lazarus), Tab: Linking

While debugging the following has worked for me under window (not sure 
if I used dwarf, I think not). And it only worked if there was an 
explicit type:

 type TStringArray = Array of String; var a: TStringArray
but not for
 var a: Array of String;

instead of
a[0]
I wrote (in the watch window)
a^[0]


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



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


Re: [Lazarus] Debugging and Structured Data Arrays

2009-08-02 Thread Martin

Try  (note you need to add 4, to get to the next string)

PChar(^LONGINT(^LONGINT(@t)^+0)^)
PChar(^LONGINT(^LONGINT(@t)^+4)^)
PChar(^LONGINT(^LONGINT(@t)^+8)^)

and for the length of array (minus 4)
^LONGINT(^LONGINT(@t)^-4)^

Read also
http://forum.lazarus.freepascal.org/index.php/topic,4763.msg22954.html#msg22954 
(just strings are a pointer them self, so they need one level more)
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Dynamic_Arrays  
(updated)


If that doesn't help, then it wont work. (or i don't know how)

Problem is that the debugger doesn't understand the pascal concept. so 
you unfortunately need a lot of  understanding, of how fpc encodes your 
data, what is a pointer, what is which kind of record


It is improving in 2.3.1 (and maybe even more with dwarf).

If nothing helps:
LCLProc.debugln
writeln


Silvio Clecio wrote:

Em 2/8/2009 19:58, Martin escreveu:

please also read
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips

Martin wrote:

Andrew Brunner wrote:

Thanks Silvio,

I'm not having a problem a problem with code running. I'm not able to
Inspect the contents of VStringArray while debugging via GDB in
Ubuntu.

Can you inspect the variable VStringArray? How about VStringArray[0]?
I can not.

This is a fresh build of FPC and Lazarus from TRUNK and a BRAND new
install of Ubuntu 9.04.



There a various problems, like this. It is an issue between fpc and 
gdb.

A lot may depend on the version of fpc and the version of gdb you use.

A few thinks you can try, but I don't know if they will work for you.

Try Dwarf versu stabs (Compiler option in Lazarus), Tab: Linking

While debugging the following has worked for me under window (not sure
if I used dwarf, I think not). And it only worked if there was an
explicit type:
type TStringArray = Array of String; var a: TStringArray
but not for
var a: Array of String;

instead of
a[0]
I wrote (in the watch window)
a^[0]


Martin, thanks for the strength ;-) .

With I showed, had no errors. I'm using now the following (see pictures):

GDB - [http://www.4shared.com/file/122487107/bfb46cfd/gdb.html].
Lazarus - [http://www.4shared.com/file/122487336/e01adbc6/lazarus.html].

ps. Friends, I don't know much English but I try to help somehow. :-)



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


Re: [Lazarus] Problem with syncompletion.pas

2009-08-03 Thread Martin

Zaher Dirkey wrote:

syncompletion.pas in synedit component

1 -
in TSynBaseCompletionForm class

What for

FAnsi: boolean;
property ffAnsi: boolean read fansi write fansi;

2 -same for TSynBaseCompletion

RFAnsi: boolean;
SFAnsi: boolean;

property AnsiStrings: boolean read SFAnsi write RFAnsi;

If not used i made some modification on it (removed that variables and
add CaseSensitive to it)

Can i send the patch
  

You are right, in there current form, they make little sense.
They are the left over from a basic latin1/ansi only CaseSensitive flag.

RFAnsi/SFAns used to forward the setting from Completion to the Form 
(that got broken in 2002)


I think I will  replace it by a CaseSensitive (utf8 based) option?
Thanks for pointing this out, anyway.

Before this can be fixed, the below needs to be fixed, otherwise it will 
be hard to test it.



3 - The Auto Complete in TSynCompletion not worked fine with me, it is
just 2 char and then stop search for the keyword, after that pressing
Enter not close the AutoComplete


procedure TMainForm.LoadCompletion;
  procedure FillNow(Name: string; SchemaItems: TmncSchemaItems);
  var
i: Integer;
  begin
for i := 0 to SchemaItems.Count - 1 do
  Completion.ItemList.Add(SchemaItems[i].Name);
  end;
begin
  //Completion.AddEditor(SQLEdit);
  Completion.Editor := SQLEdit;
  Completion.EndOfTokenChr := Completion.EndOfTokenChr + #13;
  Completion.TheForm.Font.Assign(SQLEdit.Font);
  //Completion.CaseSensitive := True;
  EnumerateKeywords(Ord(tkDatatype), SqliteTypes, SQLEdit.IdentChars,
@DoAddKeyword);
  FillNow('Table', sqlvEngine.Session.Tables);
  
Just tried this, you are right it doesn't seem to work at all. probably 
buggy. You can report it on mantis, so it wont be forgotten.


Thing is the IDE uses it's own code to do this, search ccComplet in 
SourceEditor.pp if interested







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


Re: [Lazarus] new edit icon in gutter?

2009-08-04 Thread Martin

Graeme Geldenhuys wrote:

Mattias Gaertner wrote:


See here
http://wiki.lazarus.freepascal.org/New_IDE_features_since#Syncron-Edit


By the way, that feature could not have come at a better time!! I'm 
busy porting our company test suite from FPCUnit to DUnit2 - a very 
tedious job. I have to change thousands of AssertEquals(..) to 
CheckEquals(..) and then reorder the parameters. Search and Replace 
could work, but this is so much better because I can clearly see which 
methods I need to reorder the parameters for on a screen by screen basis.

Maybe you know, maybe not, anyway, just a tip.

Reordering params, etc: I often use regular-expesion search. (needs a 
bit of experience)


AssetEquals('some text', foo  b, bar);

now assuming there are no comma in the boolean expression (a in [1,2]), 
and no escaped quotes( '' ) in the text:

( including various  * to skip spaces)


match: AssertEquals\( *('.*?'), *(.*?), *(.*?)\);
replace: CheckEquals($2, $3, $1);

I use No-Confirmation, replace single instance = and use F3, so I see 
each replacement as it was done.


Additionally you can use alt-m while being on a word, to keep this 
word highlighted, even if you move the cursor away.


Best Regards
Martin



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


Re: [Lazarus] Problem with syncompletion.pas / update SVN

2009-08-04 Thread Martin

Zaher Dirkey wrote:

syncompletion.pas in synedit component

1 -
in TSynBaseCompletionForm class

What for

FAnsi: boolean;
property ffAnsi: boolean read fansi write fansi;

2 -same for TSynBaseCompletion

RFAnsi: boolean;
SFAnsi: boolean;

property AnsiStrings: boolean read SFAnsi write RFAnsi;
  

Replaced with CaseSensitive




3 - The Auto Complete in TSynCompletion not worked fine with me, it is
just 2 char and then stop search for the keyword, after that pressing
Enter not close the AutoComplete
  

I fixed the issue with Enter (SVN revision 21100)

You can assign your own search in OnSearchPosition

example see ide/sourceeditor.pp  line 3492



procedure TMainForm.LoadCompletion;
  procedure FillNow(Name: string; SchemaItems: TmncSchemaItems);
  var
i: Integer;
  begin
for i := 0 to SchemaItems.Count - 1 do
  Completion.ItemList.Add(SchemaItems[i].Name);
  end;
begin
  //Completion.AddEditor(SQLEdit);
  Completion.Editor := SQLEdit;
  Completion.EndOfTokenChr := Completion.EndOfTokenChr + #13;
  Completion.TheForm.Font.Assign(SQLEdit.Font);
  //Completion.CaseSensitive := True;
  EnumerateKeywords(Ord(tkDatatype), SqliteTypes, SQLEdit.IdentChars,
@DoAddKeyword);
  FillNow('Table', sqlvEngine.Session.Tables);
--

Thanks

  



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


Re: [Lazarus] Problem with syncompletion.pas / update SVN

2009-08-04 Thread Martin

Zaher Dirkey wrote:

syncompletion.pas in synedit component


3 - The Auto Complete in TSynCompletion not worked fine with me, it is
just 2 char and then stop search for the keyword, after that pressing
Enter not close the AutoComplete
  
Search should work better now. Keystrokes where handled twice (utf8 and 
plain). The searchstring therefore contained every char twice, so it 
couldn't be found.





procedure TMainForm.LoadCompletion;
  procedure FillNow(Name: string; SchemaItems: TmncSchemaItems);
  var
i: Integer;
  begin
for i := 0 to SchemaItems.Count - 1 do
  Completion.ItemList.Add(SchemaItems[i].Name);
  end;
begin
  //Completion.AddEditor(SQLEdit);
  Completion.Editor := SQLEdit;
  Completion.EndOfTokenChr := Completion.EndOfTokenChr + #13;
  Completion.TheForm.Font.Assign(SQLEdit.Font);
  //Completion.CaseSensitive := True;
  EnumerateKeywords(Ord(tkDatatype), SqliteTypes, SQLEdit.IdentChars,
@DoAddKeyword);
  FillNow('Table', sqlvEngine.Session.Tables);
--

Thanks

  



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


Re: [Lazarus] Problem with syncompletion.pas / update SVN

2009-08-05 Thread Martin

Zaher Dirkey wrote:

Thanks ,update and worked :) , and it is add small experience to me,
(because it worked on it this morning).

Can i ask again
what is best
 Completion.AddEditor(SQLEdit);
or
 Completion.Editor := SQLEdit;
  


As it currently stands, makes no difference

Completion.Editor := SQLEdit; // calls AddEditor

If you want to add more than editor, you can repeat the above command, but it 
would be more logical to use AddEditor in that case


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


[Lazarus] intended behaviour of crDefault cursor on GTK?

2009-08-13 Thread Martin

Before submitting a bug, I just want to check my understanding is correct.

crDefault (at least on Windows) is supposed to show the Systems default 
for wherever the cursor is.

That means over an Edit field this is a IBeam cursor and not an arrow.

I don't know what the GTK2 default for edit controls is, but I checked 
with fireox on GTK, and firefox at least does show IBeam for edit fields?


If IBeam is the correct GTK2 behaviour then there is a bug
(because in lazarus, this does not seem to happen)


Martin

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


Re: [Lazarus] intended behaviour of crDefault cursor on GTK?

2009-08-13 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:

crDefault (at least on Windows) is supposed to show the Systems 
default for wherever the cursor is.


IMO crDefault means that the actual shape of the cursor is not 
determined by the control under the cursor, but instead the control's 
parent cursor is used (recursively). When even the form and Screen 
uses crDefault, the current system cursor is used (arrow, hourglass...).

I used to thing that do. But I am sure it isn't:
- Delphi does not fall back on the parent neither (ok no proof...)
- It would not make sense: put a TEdit (crDefault) on a TPanel = then 
the edit would have to follow the panel, but it wishes to show the IBeam 
still.


And about screen cursor. It is not a fallback for default. If 
screen.cursor is set to none crDefault, it overrides all other cursors 
(at least thats the windows implementation of the LCL.


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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Graeme Geldenhuys wrote:

Jürgen Hestermann wrote:


That's true. The general problem is not that the IDE is not
responsive when compiling/linking but that compiling/linking takes so
long.


FPC is a fast compiler and more speed is obviously also nice. The 
compiling is not the issue to me, it's the unresponsive IDE that gets 
me. I would like it to be similir to other users experiences. For 
example, you can print a large document and continue browsing your 
text or changing some setting in the menus etc... It doesn't block you 
from continuing. The Lazarus IDE does.


I compile very often - probably once every minute or two. I also 
practise Test-Drive Development, which makes sure you compile often. I 
would like to start a full build (which could take a while for large 
projects) and continue writing fpdoc documentation or start a new unit 
test (obviously without saving before the compile is complete) etc...

Try

ide\outputfilter.pas around line   295

 if (Applicationnil) and (abs(LastProcessMessages-Now)((1/86400)/3))

make it
 if (Applicationnil) and 
(abs(LastProcessMessages-Now)((1/86400)/10))

and maybe add an application.idle(flase); too



Martin

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


Re: [Lazarus] Circular references

2009-08-14 Thread Martin

Michael Van Canneyt wrote:

On Fri, 14 Aug 2009, Graeme Geldenhuys wrote:

Michael Van Canneyt wrote:

This is the world upside down.

So why is forward declarations allowed? It's the same principle!

No, because the declaration is guaranteed to follow in the same unit.
A unit forms a self-contained whole.

Unit loading is a difficult matter as it is. If you start spreading 
declaration and implementation over different units, I'm not sure that

the compiler can guarantee correctness.

But Florian should answer this, he is more knowledgeable about the
compiler internals.

Actually, I think the current design is right.

the gains of a class declared external are far less than thought.

A class of which the details where only known in the implementation, may 
be allowed to be referred in the interface. But otherwise it would be 
like any other class that was declare in implemantation: a type local to 
this unit.


That is, if a unit with that trick, did try to use this forwarded 
declaration in any public section, or anywhere where it was accessible 
by units using this unit, then the problems would start.


Because if I am using unit XYZ, and access the public property or method 
ABC that refers to some class, then add this time this some class *must* 
be fully known (or the compiler will have to go into all kind of extra 
checks and whatever else).
If  it was on public methods properties how would the compiler know that 
outside units are supplying the correct type? Only by reading the 
implementation, and then you will need multipass compiling


So that a class can only be used for private stuff on this class. it can 
no be used for the customer/order relations, as they would require this 
internal class, on public methods/properties.


My 2 cents

Martin





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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Graeme Geldenhuys wrote:

Martin wrote:

make it
  if (Applicationnil) and 
(abs(LastProcessMessages-Now)((1/86400)/10))

This does not make much difference on my system.  :-(
Hm I tested on windows only. Try adding the 2 lines I inserted with 
comments (I have not tested this!!)


Just seeing
 if (TheAsyncProcess=nil) and (fProcess.Outputnil) then begin
   // using a blocking TProcess
//Count := 0;
//if fProcess.Output.NumBytesAvailable  0 then
 Count:=fProcess.Output.Read(Buf[1],length(Buf));
   if Count=0 then begin
 // no output on blocking means, process has ended
 break;
   end;
 end;



One more remark, if it works, it will allow normal editing,etc.

But you can not do:
- search and replace
- find in files
...

Because those themself are long running, and while being inside the 
compile's processMessages, the compile will not read the output, and 
that may block compiling.


This is because all this stuff is not event-driven, so it cannnot be mixed.
It would work in a single thread and all this, but it must be fully 
event-driven.




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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

sorry tested now.
doesn't work, outside windows world...

So even a blocking pipe should have some kind of CanRead that returns 
immediately?


Martin wrote:

Graeme Geldenhuys wrote:

Martin wrote:

make it
  if (Applicationnil) and 
(abs(LastProcessMessages-Now)((1/86400)/10))

This does not make much difference on my system.  :-(
Hm I tested on windows only. Try adding the 2 lines I inserted with 
comments (I have not tested this!!)


Just seeing
 if (TheAsyncProcess=nil) and (fProcess.Outputnil) then begin
   // using a blocking TProcess
//Count := 0;
//if fProcess.Output.NumBytesAvailable  0 then
 Count:=fProcess.Output.Read(Buf[1],length(Buf));
   if Count=0 then begin
 // no output on blocking means, process has ended
 break;
   end;
 end;



One more remark, if it works, it will allow normal editing,etc.

But you can not do:
- search and replace
- find in files
...

Because those themself are long running, and while being inside the 
compile's processMessages, the compile will not read the output, and 
that may block compiling.


This is because all this stuff is not event-driven, so it cannnot be 
mixed.
It would work in a single thread and all this, but it must be fully 
event-driven.




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



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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Mattias Gärtner wrote:

Zitat von Vincent Snijders vsnijd...@vodafonevast.nl:
I like Florian's idea too. As for your statement above, how often 
does this really happen? In the last 4-5 years that I have been 
using FPC, the compiler has not once crashed on me. Yes it might 
report that there is a compiler error in my project, but I do not 
consider that a crash.


The compiler is started on every compile which is the cleanest start 
you can get. A threaded compiler must have a restart, which is less 
clean. There will be more crashes and bugs.

What happens if the restart fails?


For the debugger, we have reset debugger.
For the compiler, we would add a reset compiler option.


I meant, when the compiler is in another thread and the restart fails, 
what should happen? You can only restart the IDE.


Just out of curiosity, what are we trying to solve?

How much benefit would a build in or preloaded fpc inside Lazarus be? 
Most Operating System cache disk access. So once you used, it is in 
memory, never mind if that memory belongs to lazarus, or the OS.


Of course another thread would solve issues with unresponsiveness. But 
that could be done by having another thread, that runs the external 
process. Or if the AsyncProcess worked, it could be done, by using this 
+ moving to an event-driven model.


Or am I missing some crucial point?

Martin


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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Vincent Snijders wrote:

Martin schreef:


Just out of curiosity, what are we trying to solve?


snip


Or am I missing some crucial point?


3 idle cores on a quad core CPU. Why pay for a quad core, if Lazarus + 
FPC use only one? I am still waiting during a compile and those 3 
other cores are idling. Let them to part of the work to get the job 
done faster. ;-)
True, but from the point of using FPC and the point of faster 
compilation = this needs a multithreaded fpc.


Running a single threaded fpc in it's own thread (never mind if compiled 
into lazarus, or loaded as process from a thread) will not do much 
(except for one core could do the updates of the message window

A multi-threade fpc can still be used in a forked process.


As for thinks happening inside lazarus (codetools, search in files,) 
different story


Martin

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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Mattias Gärtner wrote:

Zitat von Graeme Geldenhuys grae...@opensoft.homeip.net:


Martin Schreiber wrote:

From the MSEide config dialog, I gather MSEide also launches the
FPC compiler in a separate process and not built into the MSEide?


Yes. It can also call gcc and parse the error messages. Also possible


So how did you resolve the async process issue that Lazarus is 
experiencing under Linux? Or does running the compiler process 
(TProcess style) via a separate thread bypass the issue of 
TAsyncProcess that Lazarus IDE is using. That means MSEide doesn't 
need a TAsyncProcess type component?


If so... Mattias, could Lazarus IDE be modified to run the compiler 
TProcess in a separate thread. And then another thread which filters 
the compiler output to the Messages window. Or is that a huge task?


No. Just write a ThreadedProcess. That would work pretty much like 
TAsynProcess.

And I guess it will suffer the same bug.
I don't know what you mean by ThreadedProcess unless you meant yes, 
but wanted to indicate a different form of implementation?


IMHO, if the process running fpc is started from a different thread, 
then the IDE can be kept as functional, as it can with TAsyncProcess.
In fact if the TProcess is in started from a thread of it's own, it does 
not want to be Async, it wants to be blocking, so you don't need to put 
a lot of sleeps into your code.


As separate thread *can* also solve one more issue.

Currently  even the AsyncProcess is done in a loop. It does use the 
OnDataRead event, but only to fill a cache, which is then used in a loop.
It should not be in a loop at all. It should be purely event driven. 
Then it would continue to run, even if a search in files is started 
while compiling


If you create a class TThreaded Process (just to simulate an 
AsyncProcess within a (hidden) Thread), then you still must transform 
the current loop into an event driven model.



However this 2 issues can be addressed on their own. even using a 
blocking thread, you can go (almost) event drive. Put the read on a 
timer (every 10 milliseconds) or OnIdle, The read will block, but after 
each read, it will return to the event loop = events will be processed 
normally (instead of ProcessMessages), and then the next read happens on 
timer, or idle



In fact if you make everything eventdriven, then you could introduce 
some method to mark events as thread-save, and the event-loop could 
automatically deploy threads, if a lot of events occur = that would be 
cool.


Martin


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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

Vincent Snijders wrote:
I have looked a bit more why outputfilter is so slow at parsing a lot 
of compiler output (e.g. compiling a simple LCL app with -va). The 
pipe buffer is rather small, NumBytesAvailable is not bigger than 1280 
bytes. So OnAsyncReadData reads only 1280 bytes at a time. 
OnAsyncReadData is only called after an application.handlemessage. So 
on line 319 of outputfilter.pas, the buffer is most times empty, but 
NumBytesAvailable = 1280, and we are sleeping until 
Application.HandleMessage is called.


I had some success with the following patch. It does a sleep(0) to 
give the compiler the chance to write to the pipe again and tries to 
read it again.

--- ide/outputfilter.pas
+++ ide/outputfilter.pas
@@ -1206,9 +1206,12 @@ var
   Count: LongWord;
 begin
   if fProcess=nil then exit;
-  Count:=TAsyncProcess(fProcess).NumBytesAvailable;
-  if Count0 then
-FAsyncOutput.Push(TStream(TAsyncProcess(fProcess).Output),Count);
+  repeat
+Count:=TAsyncProcess(fProcess).NumBytesAvailable;
+if Count0 then
+  FAsyncOutput.Push(TStream(TAsyncProcess(fProcess).Output),Count);
+sleep(0);
+  until Count=0;
 end;

 function TOutputFilter.CreateScanners(ScannerOptions: TStrings): 
boolean;
If I understand it correctly the problem is that TAsyncProcess, 
currently only reads data, when the event is triggered, which is in a 
ProcessMessages. Ouch.


Either TAsyncProcess.OnReadData is transferred into the main loop, in a 
similar way as for the normal TProcess.
I have not tested this, but it should work, as NumBytesAvailable seems 
to be none blocking.
= This could simplify the overall loop as the handling of the 2 
projects would be more or less the same.


Alternatively, before we sleep(3), we could check for data, and process it.
   end else begin
 // no new input, but process still running
 if TheAsyncProcess.NumBytesAvailable  0 then
   Application.ProcessMessages
 else
   Sleep(30);
   end;



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


Re: [Lazarus] Multi-threading support in IDE

2009-08-14 Thread Martin

The loop in outputfilter can be simplified quite a bit

All the extra handling of the asyncprocess can be reduced to the 
following lines (the event handlers can be removed):


   if fProcess is TAsyncProcess then begin
 Count:=TAsyncProcess(fProcess).NumBytesAvailable;
 if Count  0 then
   Count:=fProcess.Output.Read(Buf[1], Min(Count, length(Buf)));
   end
   else
 // using a blocking TProcess
 Count:=fProcess.Output.Read(Buf[1], length(Buf));
   if (Count=0) and (not fProcess.Running) then
 break
   else if count = 0 then
 sleep(30);

Works on windows / shouldn't change anything on *nix


Martin wrote:

Vincent Snijders wrote:
I have looked a bit more why outputfilter is so slow at parsing a lot 
of compiler output (e.g. compiling a simple LCL app with -va). The 
pipe buffer is rather small, NumBytesAvailable is not bigger than 
1280 bytes. So OnAsyncReadData reads only 1280 bytes at a time. 
OnAsyncReadData is only called after an application.handlemessage. So 
on line 319 of outputfilter.pas, the buffer is most times empty, but 
NumBytesAvailable = 1280, and we are sleeping until 
Application.HandleMessage is called.


I had some success with the following patch. It does a sleep(0) to 
give the compiler the chance to write to the pipe again and tries to 
read it again.

--- ide/outputfilter.pas
+++ ide/outputfilter.pas
@@ -1206,9 +1206,12 @@ var
   Count: LongWord;
 begin
   if fProcess=nil then exit;
-  Count:=TAsyncProcess(fProcess).NumBytesAvailable;
-  if Count0 then
-FAsyncOutput.Push(TStream(TAsyncProcess(fProcess).Output),Count);
+  repeat
+Count:=TAsyncProcess(fProcess).NumBytesAvailable;
+if Count0 then
+  FAsyncOutput.Push(TStream(TAsyncProcess(fProcess).Output),Count);
+sleep(0);
+  until Count=0;
 end;

 function TOutputFilter.CreateScanners(ScannerOptions: TStrings): 
boolean;
If I understand it correctly the problem is that TAsyncProcess, 
currently only reads data, when the event is triggered, which is in a 
ProcessMessages. Ouch.


Either TAsyncProcess.OnReadData is transferred into the main loop, in 
a similar way as for the normal TProcess.
I have not tested this, but it should work, as NumBytesAvailable seems 
to be none blocking.
= This could simplify the overall loop as the handling of the 2 
projects would be more or less the same.


Alternatively, before we sleep(3), we could check for data, and 
process it.

   end else begin
 // no new input, but process still running
 if TheAsyncProcess.NumBytesAvailable  0 then
   Application.ProcessMessages
 else
   Sleep(30);
   end;



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



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


Re: [Lazarus] Lazarus has unique font sizes

2009-08-15 Thread Martin

Michael Van Canneyt wrote:



On Sat, 15 Aug 2009, Graeme Geldenhuys wrote:


Michael Van Canneyt wrote:


Am I missing something ?


Yes, why is it an option in the first place? No other application 
asks the user for the Font Size or Font Height. If the one can be 
calculated from the other, then just give us the ONE normal option - 
Font Size. Anything else is just confusing to the user.


User, yes. programmer: no.


Yes, but a programmer is a user to, depends on context.

In the object inspector, the positive and negative values should be 
displayed.


But on the editor options dialog, I don;t actually see the point. The 
Editor option dialog doesn't have a Size and a height field, it has 
one field only.
IMHO the dropdown should be the same as the listbox on the 
font-selection-popup-dialog = all positive values. It can accept 
negative values, but only if manually entered by the user.


Martin

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


Re: [Lazarus] IDE editor's NoteBook component problems

2009-08-18 Thread Martin

Vincent Snijders wrote:

Graeme Geldenhuys schreef:

Hi,

What could be a solution so we can position the tabs in the editor. 
With wide screen monitors, it will be much more beneficial to have 
the tabs on the right edge compared to the default top. No scroll (or 
much less scrolling) of tabs will occur.


What does this have to do with wide screen monitors?


With all tabs in one line, and the fact that the tabs/text is raotated 
by 90 degree, indeed it gets worse if tabs are on the side.
But yes the take one less line on top, and you can see one more line of 
source code..


If you have multipline tabs, then on a widescreen you can stack as many 
as you want on the side.


Or maybe he was hoping that tabs on the side would not be rotated, but 
shown like items in a listbox.

(like tree style tab extension in firefox)

Maybe he should have a look at 
http://bugs.freepascal.org/view.php?id=13930 that may help him.



Overall it seems there are a lot of people holding a great amount of 
iles open at the same time (sometimes me too).
Having them listbox style on the side could be of interes. especially if 
you could also group them in some way...


But then TNotebook.ShowTabs := false
and add an extension that displays the selection in an otherway.

Martin

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


Re: [Lazarus] IDE editor's NoteBook component problems

2009-08-18 Thread Martin

Graeme Geldenhuys wrote:

Vincent Snijders wrote:


Do you claim, that with a normal screen, there is not enough space to 
put the tabs vertical (on the left) and then you have to scroll 
vertically?


I quickly hacked my IDE to show what I mean.

http://opensoft.homeip.net/~graemeg/laz_notebook_right.png

Here I have an LCD screen with standard 1440x900 resolution. I 
currently have 13 units open in the editor with space for about 3 more 
units before scrolling occurs. So that's 16 units open and no 
scrolling in the editor window. I also  have some remaining desktop 
space to the right of the editor, which is cropped in the screenshot. 
So I can even resize the editor more if I wanted to.


Oh, and I have the Message Window Doc plugin installed, which allows 
me to dock my Messages window onto the Editor window, to save on a bit 
more space vertically.


That wouldn;t work for windows, because tabs are ratoted by 90 degree 
(verical text) if you put them on the side


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


Re: [Lazarus] codetools tooltip showing method visibility

2009-08-18 Thread Martin

Mattias Gaertner wrote:

A path information would indeed be nice. Especially if you are in a
nested procedure.
The statusbar has not enough space for this.
What about the code explorer?
A node can be added showing a list of quick jumps. 
For example when you are in a nested procedure, it can show a node for

each nested procedure, so you can jump to each level with one click.
In a class it would show the visibility and the class header.

On a second thought: Forget it, there is probably already a
patent for this one-click-to-related-stuff.
  
It is something a lot of html editors (probably xml too) have. Or 
firebug (extension to firefox) has it too.


Martin

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


[Lazarus] hints missing new line [Re: codetools tooltip showing method visibility]

2009-08-18 Thread Martin

Mattias Gaertner wrote:

Graeme Geldenhuys wrote:


Hi,

Many times I am working with large classes that are much bigger
than what is visible in the editor view. Is there any way the
tooltip shown over a property or method can include visibility
information?

That way I can simply hover the move over a method or property and
see if it is protected or public etc...
  


Implemented in 21283.
  


I can't get a screenshoot, because hints disapear on keyboard.

but if you haver over Synedit. create (in the class declaration), 
several of the ancestor methods are listed in a single paragraph, just 
glued behind each other


Martin

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


Re: [Lazarus] hints missing new line [Re: codetools tooltip showing method visibility]

2009-08-18 Thread Martin

Mattias Gaertner wrote:

On Tue, 18 Aug 2009 17:18:25 +0100
Martin laza...@mfriebe.de wrote:

  


I can't get a screenshoot, because hints disapear on keyboard.

but if you haver over Synedit. create (in the class declaration), 
several of the ancestor methods are listed in a single paragraph,

just glued behind each other



At the moment they are collected and added as simple text lines.
So each ancestor is separated by a new line character.

The hint that you see is an arbitrary control. By default it is a
TLabel. So no html possible. That's why it looks glued together. 
But I also started a html hint control using the tpipro

control.
  

Hm, but there are some new lines, so the ability to show new lines is there.
There are about 5 or 6 ancestor classes with Create,  after the first 
is a new line, then all in one single block, and another new line in 
front of the last.


Looks like maybe the 2 with the newline, have a newline in the actual 
help text, so it is copied from there?

The newlines used by codetools: are the LineFeed or just #13?

Martin

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


Re: [Lazarus] hints missing new line [Re: codetools tooltip showing method visibility]

2009-08-18 Thread Martin

Mattias Gaertner wrote:

Hm, but there are some new lines, so the ability to show new lines is
there. There are about 5 or 6 ancestor classes with Create,  after
the first is a new line, then all in one single block, and another
new line in front of the last.

Looks like maybe the 2 with the newline, have a newline in the actual 
help text, so it is copied from there?

The newlines used by codetools: are the LineFeed or just #13?



It was not in the codetools, but in the fpdoc help.
I added a line break.

  
Hm now I am getting no hint at all, but the following in the message 
window (synedit.pp line: 748 constructor Create)

(the /ul is in the xml)

C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (expected /ul)
C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (expected /ul)
C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (expected /ul)



and in the log:
TCodeHelpManager.GetFPDocFilenameForSource Hint: file without owner: 
C:\lazarus_latest\components\synedit\synedit.pp
TCodeHelpManager.LoadFPDocFile 
C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (

expected /ul)
TCodeHelpManager.LoadFPDocFile 
C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (

expected /ul)
TCodeHelpManager.LoadFPDocFile 
C:\lazarus_latest\docs\xml\lcl\controls.xml(15714,14) Error: Unmatching 
element end tag (

expected /ul)
TCodeHelpManager.GetFPDocFilenameForSource Hint: file without owner: 
C:\FPC\SVN\trunc\rtl\win32\classes.pp
TCodeHelpManager.GetFPDocFilenameForSource Hint: file without owner: 
C:\FPC\SVN\trunc\rtl\win32\system.pp
TLazFPDocFile.GetElementWithName create failed: missing module name. 
ElementName=TCustomControl.Create
TLazFPDocFile.GetElementWithName create failed: missing module name. 
ElementName=TWinControl.Create
TLazFPDocFile.GetElementWithName create failed: missing module name. 
ElementName=TControl.Create



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


Re: [Lazarus] local procedure - MultiThreadProc

2009-08-19 Thread Martin

Mattias Gärtner wrote:

Zitat von Jan Kowalski bor...@gmail.com:
I need to call ProcThreadPool.DoParallel with local procedure as a 
parameter.

Does DoParallel allow local procedures to pass a procedural parameters ?
I get err: Error:
Incompatible type for arg no. 1: Got address of local
procedure(Int64,Pointer,TMultiThreadProcItem);Register, expected
procedure variable type of
procedure(Int64,Pointer,TMultiThreadProcItem);Register


That would be really helpful.
But I don't know how to define a local procedure type:


I wouldn't be sure it's possible. It makes no sense.

My guess:
A local (nested) procedure has access to the outer(parent or 
grand-parent if recursive) procedures variables (stackframe). Therefore 
a local procedure must expect to be somewhere below this parent.


If it was given as a pointer to some other procedure/object, and then 
called later, this may happen outside the parent. Then no such 
stackframe does exist, and the local procedure can not work.


Martin


type
  TMTLocalProcedure = procedure(Index: PtrInt; Data: Pointer;
Item: Pointer); ?
var
  p: TMTLocalProcedure;

procedure TestWithLocalProc;

  procedure LocalProc(Index: PtrInt; Data: Pointer; Item: 
TMultiThreadProcItem);

  begin

  end;

begin
  p:=...@localproc;
end;


Mattias



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



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


Re: [Lazarus] local procedure - MultiThreadProc

2009-08-19 Thread Martin

Mattias Gärtner wrote:

Zitat von Vincent Snijders vsnijd...@vodafonevast.nl:


Martin schreef:

Mattias Gärtner wrote:

Zitat von Jan Kowalski bor...@gmail.com:
I need to call ProcThreadPool.DoParallel with local procedure as 
a parameter.
Does DoParallel allow local procedures to pass a procedural 
parameters ?

I get err: Error:
Incompatible type for arg no. 1: Got address of local
procedure(Int64,Pointer,TMultiThreadProcItem);Register, expected
procedure variable type of
procedure(Int64,Pointer,TMultiThreadProcItem);Register


That would be really helpful.
But I don't know how to define a local procedure type:


I wouldn't be sure it's possible. It makes no sense.


It makes enough sense in this case.


Sorry badly worded on my behalf.

It makes no sense, should have been: it can not be used the same way 
like normal procedure references, because it is limited to the scope.

the way described on the link by Vincent indeed makes sense

For example when you want to execute a loop in parallel, then you 
extract the loop into a procedure. With a local procedure you can keep 
the variables, which would make the process quite easy. If you can not 
use a local procedure, then you must define a record and move the 
local variables there.
Of course nested local procedures creates a whole bunch of problems, 
so maybe the record approach is much safer.
Maybe the extract procedure tool can be extended to do some of the 
monotone work automatically.

I will explain the process in more detail on the wiki.



My guess:
A local (nested) procedure has access to the outer(parent or 
grand-parent if recursive) procedures variables (stackframe). 
Therefore a local procedure must expect to be somewhere below this 
parent.


If it was given as a pointer to some other procedure/object, and 
then called later, this may happen outside the parent. Then no such 
stackframe does exist, and the local procedure can not work.




And therefore such a local procedure type must be a combination of 
local scope and address: 
http://wiki.freepascal.org/Mac_Local_Procedure_Parameters


This feature is not yet implemented: 
http://wiki.freepascal.org/Language_related_articles#Ideas_for_new_stuff


Mattias


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



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


Re: [Lazarus] Documentation and Help for Lazarus

2009-08-20 Thread Martin
One thing that has been mentioned a couple of times in the past, is the 
ability of searching for entries.


More thna once this has been put down to a simple text search:
- web based docs can be googled 9or whatever your favourite search is)
- text base can be searched a la find in files (grep)

That is more than insufficient.

That is why the docomentation on the wiki is so oft judged as having no 
info on anything. Searche return plenty of matches, but even if you are 
lucky and the right page is somewhere in the list, you still have to 
search a lot of pages by hand.


Words in documentation often have special meaning, and often more than 
one. They must either be marked in hte text, as being a keyword X, or 
listed in a separate keyword list


Example;

- Frame (also in plural Frames must much the same pages):
There are at least 3 ways it can occur in the doc
1 - TFrame = visual form inheritance
2 - Stack frame
3 - just the plain English word.
If you search for it, you should be asked if you mean 1 or 2.

Not to speak of related topics that may want to be suggested...

My 2 cents
Martin


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


[Lazarus] delphi - virus

2009-08-20 Thread Martin

Just something I found:

http://www.h-online.com/security/Virus-infects-development-environment--/news/114031

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


Re: [Lazarus] Documentation and Help for Lazarus

2009-08-20 Thread Martin

Graeme Geldenhuys wrote:

2009/8/21 Martin laza...@mfriebe.de:
  

That is more than insufficient.



Speaking about plain text docs (Asciidoc). keywords can be generated
from them or maybe a more informed keyword file could be built
manually. Something like meta-tags used in blogs or web page headers.
Alternatively, we can look how fpdoc generates keywords and indexes
and use something similar.
  

I don't know, but don't think fpdoc currently has that feature.

The problem is that you cannot trust the user to search for TFrame or 
StackFrame or TException, the user will search for the plain english 
word frame or exception. And that will bring a lot of extra results.


So its to steps:
- a list of translation: ask the user what frame he wants
- inside the page, make sure that the plain english word is not taken in 
account. With Tframe this si solved by the first step, because the 
actual search will be for TFrame and therefore miss the simple word 
frame. (yet with function the pascal keyword is equal to the english word)



As long as we can start having help in a offline (and possible online)
format, that would be a good push in the right direction. Currently
wiki docs is not helping and is in the wrong (non-portable) format.
  

Agree.
but the discussion so far mostly went about portability.
If a decision is made it should address the search issue too.

otherwise you could just download all wiki pages as html, and rewrite 
the links to point to the local pages. there are plenty of programs that 
can do exactly this. Of course the downloaded version would no longer 
have the search button since that is server side. But it would be 
portable. Simple html files on your local disk.
  

- Frame (also in plural Frames must much the same pages):
There are at least 3 ways it can occur in the doc
1 - TFrame = visual form inheritance
2 - Stack frame
3 - just the plain English word.
If you search for it, you should be asked if you mean 1 or 2.



In this case search for frame has a 'complete word', which should
then ignore 1 and only return 2 as a result.
  

complete word would also ignore the plural frames which you do not want.

But it was never about finding 3. It was about explicit search for 1 or 2

But yes I get what you mean. Extra keywords or meta-tags for each
document pages would be helpful. What does fpdoc do in this regards?
  



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


Re: [Lazarus] Documentation and Help for Lazarus (content)

2009-08-21 Thread Martin

Mattias Gärtner wrote:

Zitat von Hans-Peter Diettrich drdiettri...@aol.com:


Martin schrieb:

This is the first problem: how much of the base class to repeat? Or 
how many links does the user have to follow to find what he seeks.


In PasDoc2 I imported inherited descriptions automatically, so that 
only really overridden behaviour must be documented, when it really 
does something different, or when it implements an abstract and 
unspecific method. This can also reveal in which class a method or 
property has been introduced, when the search starts in 
TDerived.ident and the help mentions TBase.ident.


The fpdoc help of the IDE (mouse hints) shows every fpdoc entry 
including all ancestor entries and all pasdoc comments, including all 
ancestor entries.

We have already a bug report from Graeme that this is too much.


For a hint I agree. Even for a webpage, which is what I was talking about.
hence the question: how much.

I gave an example, which had one phrase giving a very short description, 
of what is explained in greater detail on the inherited page.


Martin

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


Re: [Lazarus] Documentation and Help for Lazarus (content)

2009-08-21 Thread Martin

Chris Kirkpatrick wrote:



Martin wrote:
Another thing about the help. And i feel bad about saying this, 
because I really appreciate the effort that was made. And criticizing 
it without having contributed seems all wrong.

Never the mind, since we talk about it, I feel it should be mentioned

Some of the documentation still reads like a mockup, providing not 
more help than looking at the function itself.


Thank you for your comments: I take them very much to heart. I have 
been trying to get through most of the LCL classes, to produce at 
least SOME documentation, and I agree that much of it is very 
simplistic, but yours is probably the first useful feedback I have 
had, in several years of work, and I thank you especially for this.
I only starting looking at the help again when this thread came up. when 
I was new to lazarus (less than a year), I gave it a try, and I must 
have ended up a couple of times on docs that didn't help me (and back 
then I did probably not explore the See also link. I just thought: ok, 
new usable help, never mind.

That is why I pointed this out.

In fact before I send the mail, I had a draft, where I had nearly 
rewritten the base-help of Notification, before I discovered it. Once 
you know that, there is indeed a lot of help available.




As Waldo Kitty said in the next post, 'maybe someone who understands 
geek but doesn't speak geek should be involved to average joe the 
documentation'. I thought perhaps I was that average joe, being a 
retired physician rather than a programmer.
I think it is not only he wording:  calls inherited to me is useless, 
since it is no more than the pascal code reads. calls inherited so 
inherited can do better. IMHO writing it in more natural language 
passing the information/message/signal on to it's parent, so ... makes 
it more readable.

( we were recently told that programmers are users too   SCNR ;- )

The essential is IMHO and as I said, to answer the first curiosity on 
the first page, which no need to click any link.it is the answer to a at 
least one of the question:

- Why is this called (in the example, why is the action list removed)
- When/Where is this called
In most cases at least one of the 2 (or both) should be present, even if 
it is just a short sentence. The details can be on a link (maybe the see 
also can be local attached to the sentence)


then of course the:
- What does it question.
This is already covered (in the example it already said, it removes the 
action-list).


Part of the problem is that several of the methods involved are 
overridden at every level of inheritance: your example of Notification 
is a good one, as every class that uses it overrides the ancestor, and 
usually calls inherited Notification as part of its code. By the time 
you get to the classes that actually appear as widgets on a Form, 
there may be up to five or six levels of inheritance, each of which 
has added an override to the original description of the method. How 
much should I reiterate the information present in all the ancestors? 
I thought that was one of the reasons we used links and 'seealso'.
True, that's why I gave an example. I didn't re-explain the full: it 
need to be registered by FreeNotification or to be owned.


Notification can be used for a lot of different things, if a user wants 
to user it on it's own.

In the IDE it is used for a few different causes too.

The main one is that a child, or linked control is destroyed

There are 2 main reason why someone may have pressed help for it
1) they see it being used, and need to know what it does
2) They seek a function doing something, and need to find out if this is 
the one.


1) the first is answered (imho) by my example
 Called to notify the Form  that another control has been destroyed (or 
otherwise removed). 

which is the main difference to the existing entry.

2) requires the full context from the base class and probably even examples.
So it cannot be repeated in every class.



My proposal is that I concentrate on classes that are most immediately 
apparent to the user/application programmer, the ones represented by 
symbols in the component palette (or their immediate parent 
CustomX classes), and produce as full a description as possible, 
along the lines you suggest, even if it involves re-iterating some of 
the material from more primitive levels. So I shall concentrate first 
on overridden methods in StdCtrls, ComCtrls and ExtCtrls.


I agree with you it may be could to put some more info (maybe a copy) 
into the visible components T(Cutom)Form class. Those 2 should ideally 
have a combined help entry. Well for Notifiaction they will have that. 
For the properties, that are in TForm's published section, I do not know 
if it is possible.
Anyone with ideas for improvement is free to post a message, or even 
better, submit a patch for improved documentation.


I know...


Best Regards
Martin

Re: [Lazarus] Groupboxes in the IDE

2009-08-27 Thread Martin

Graeme Geldenhuys wrote:

Marc Weustink wrote:
  
Groupboxes were cluttering the real info, therefore we made a change to 
the bevels. Not all parts are done.




Any objects in creating a custom component which does the dividing
instead of using 100's of TBevel components and lots of advanced Align
settings?
  
Actually, I attempted to create a frame for this, but run into some bugs 
that prevented it.


I also thought about a custom component. The idea goes a step further.
The component would also act as container for the items inside (like a 
panel). This can have several uses:
- depending on the availability off a layout manager, the custom 
component can do this. (like a groupbox, you just add the inner components)
- it can be used to help doing a keyword oriented search for *all* 
option-pages (each container searches the captions of all children)
- it may become collapsible (if no children matches the search) / not 
sure if really a good idea



It should be very simple to knock together a simple divider component -
custom drawn and only to be used in the IDE (not available on component
palette).

This is what I meant before by creating custom drawn components, which
are only meant to be used inside the IDE. A more versatile NoteBook
component for the editor is another candidate.
  
IMHO not. I think the notebook is better solved by hiding the tabs, and 
using a listbox or even tree-view (sort by directory,...).
What is the advantage of putting the drawing of such a list into the 
notebook itself?



PS:
I have to agree, the Bevel+2xLabel does look less cluttered that
GroupBoxes. An alternative might also have been the Gnome HIG style. One
bold label defining a section. Then the components for that section, but
slightly indented. See attached screenshot for very quick mock-up.
  
Well a custom component (accommodating the other controls as children) 
could very easily switch between a variety of layouts (but I think 
that's not really needed)




Regards,
  - Graeme -

  






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



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


Re: [Lazarus] Groupboxes in the IDE

2009-08-27 Thread Martin

Graeme Geldenhuys wrote:

2009/8/27 Martin laza...@mfriebe.de:
  

Actually, I attempted to create a frame for this, but run into some bugs
that prevented it.



And you didn't fix those bugs?  ;-)  Actually I never even though of
  
Why would I do this myself? I delegated it. ;- (that is to say I 
reported them)


Part of it is in fpc, so you need fpc trunc...


using a TFrame - that could have worked as well.

  

- it may become collapsible



This was my second thought for a custom grouping component. For the
more complex dialogs the grouping component would maybe collapse the
more advanced (or less used) options by default.
  

yes, that too


IMHO not. I think the notebook is better solved by hiding the tabs, and
using a listbox or even tree-view (sort by directory,...).



For GTK2, I hacked my copy of the editor notebook so that tabs appear
on the right with horizontal text. Windows can position tabs too, but
the text defaults to vertical which makes it much harder to read and
does not save on space - which defeats the whole exercise.
  

but a listbox will work on all OS.


To overcome the Windows tabs on right with vertical text issue, you
need to do custom drawing to solve it. Hence my idea of a custom
component for editor notebook. The other benefit will be that all
widgets can be made to support the x close button on tabs. I have no
  
true a list box does not have that (x button). but you could emulate the 
middle click, as it is used on tabs to close them.


But then this are 2 different things:
- custom draw tabs, to allow an [x] button (but keep orientation nativ)
 = IMHO this would make sense to add to the LCL for everyone.
- custom draw tabs, to change the orientation.
 = IMHO easier to use a listbox (better tree view), though it wont 
have the fancy border, and the [x] button was still left for solving



idea how OS X looks with tabs on right or left edges - if it's even
possible. Again a reason for custom drawn notebook component.

The idea of the listbox is actually a good one. There is already a
nice Lazarus add-on which uses a listbox, supports drag-to-reorder and
does filtering. I haven't had time to see if I can manually dock it
inside the editor window. My copy of Lazarus already has two manually
docked add-ons. The editor toolbar and the embedded messages window
below the editor. So this makes it a bit more tricking docking the
file listbox add-on.
  
It could be fixed into the the source-editor window (meaning not 
un-dockable).
The source-notebook is probably alClient. so any extension can just add 
an alLeft (or alRight) component).



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


[Lazarus] persistent block [Re: Release preparations]

2009-08-30 Thread Martin

Martin wrote:

Jürgen Hestermann wrote:
2.) Copying a block with Ctrl+K/C works, but moving it with Ctrl+K/V 
does not. Nothing happens except that the block is no longer marked 
after that key.

Another (separate) bug report please.


Fixed in the meantime.

Martin

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


[Lazarus] OT: Who ? [Re: Enhance Macro usage by making it easier to find]

2009-09-11 Thread Martin

Graeme Geldenhuys wrote:

Vincent Snijders het geskryf:
  
IMHO a better place for such feature requests without a clear owner (with a limited 
todo list) is: http://wiki.lazarus.freepascal.org/Feature_Ideas



OK, done that too, and added a reference to the Mantis report.
  
From the mantis report / Subject: Enhance Marco usage by making them 
easier to find


Who is Marco? :)

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


Re: [Lazarus] Mac OS X : Highlight text in editor followed by back space does not work...

2009-09-13 Thread Martin

Mattias Gaertner wrote:

On Sun, 13 Sep 2009 09:49:40 +0100
Martin laza...@mfriebe.de wrote:
  

domini...@savagesoftwaresolutions.com wrote:


Just built Lazarus from the latest SVN on Mac OS X 10.5.8 Intel.
  

To confirm that would be 0.9.29, not 0.9.27 (aka release candidate)?

I noticed that if I highlight some text from right to left ( from
the end of the word to the beginning of the word ) in the editor,
then hit back space, it does not delete the text, but instead moves
everything left. But if you highlight the text from left to right
and hit backspace it correctly deletes the text

I can confirm this under ...
  

But I do not have a Mac, yet I would not expect this to be OS
dependent.


... linux
  

I tried windows-vista and ubuntu

Can you please recompile with -dVerboseKeys and attach log?
Maybe attach editorsettings.xml ?


Martin

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


Re: [Lazarus] Mac OS X : Highlight text in editor followed by back space does not work...

2009-09-13 Thread Martin

Update: i found a way to reproduce.

This is if the following can be confirmed: The issue only occurs, if the 
cursor is on (right before) the first none-space char of the line.


In this case auto-unindent kicks in.
Same happens with a normal selection, if you select the spaces at the 
start of line, ending the selection at the first none space.


Martin


Martin wrote:

Mattias Gaertner wrote:

On Sun, 13 Sep 2009 09:49:40 +0100
Martin laza...@mfriebe.de wrote:
 

domini...@savagesoftwaresolutions.com wrote:
   

Just built Lazarus from the latest SVN on Mac OS X 10.5.8 Intel.
  

To confirm that would be 0.9.29, not 0.9.27 (aka release candidate)?

I noticed that if I highlight some text from right to left ( from
the end of the word to the beginning of the word ) in the editor,
then hit back space, it does not delete the text, but instead moves
everything left. But if you highlight the text from left to right
and hit backspace it correctly deletes the text

I can confirm this under ...
 

But I do not have a Mac, yet I would not expect this to be OS
dependent.


... linux
  

I tried windows-vista and ubuntu

Can you please recompile with -dVerboseKeys and attach log?
Maybe attach editorsettings.xml ?


Martin

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



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


Re: [Lazarus] Mac OS X : Highlight text in editor followed by back space does not work...

2009-09-13 Thread Martin

Please test with revision 21681

Mattias Gaertner wrote:

On Sun, 13 Sep 2009 11:13:41 +0100
Martin laza...@mfriebe.de wrote:

  

Update: i found a way to reproduce.

This is if the following can be confirmed: The issue only occurs, if
the cursor is on (right before) the first none-space char of the line.
In this case auto-unindent kicks in.
Same happens with a normal selection, if you select the spaces at the 
start of line, ending the selection at the first none space.



All confirmed.


Mattias

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



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


Re: [Lazarus] Two versions

2009-09-14 Thread Martin

Not sure where it is on the wiki.
Best is to download the source, snapshot or SVN, into a new directory, 
somewhere in your home dir, and compile them there (make)


One very important thing: use --primary-config-path, so they do not 
conflict with each others config.


Also if you are about to use 0.9.28 (0.9.27 at current) you need fpc 2.2.4.

Martin

Santiago A. wrote:

Hello.

My system has installed 0.96 (Ubuntu 8.10) , I would like to install
0.98 both at the same time.

I read somewhere in the wiki  how to have installed both versions. Any hint?

Santiago A.
s...@ciberpiula.net


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



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


[Lazarus] caret on codetools renames [Re: Last-minute 0.9.28 nominations]

2009-09-25 Thread Martin

Maxim Ganetsky wrote:

One more candidate:

4) http://bugs.freepascal.org/view.php?id=12344 (Renaming a component 
will change the editor line number)

   This issue is not major but rather annoying.



There are pro and contra to this one:

- pro: one issue less
- pro: TextBetweenPoints will not be released, and changed to a slightly 
changed implementation in the next release


- contra: the fix affects everything that uses OnCodeBufferChanged 
(plus possible anything I have overlooked, even though I don't think I did)
OnCodeBufferChanged is used for *any* change that is originated by 
codetools (except for identifier completion).
This includes the renaming, and insertions of components. Also the 
insertions of units into uses. For those three it is correct not to move 
the caret (or keep it in the text).
I don't know if there are any other changes originating through 
OnCodeBufferChanged, and if any of them need the caret to move (havent 
found any yet) = if there are, they are broken now.


If Mattias can confirm that OnCodeBufferChanged can always and safely 
keep the caret where it is, then maybe ok, but otherwise
(Codetooljumps, such as jump to error location are done elsewhere and 
not affected)


Best Regards
Martin

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


[Lazarus] german translations

2009-09-26 Thread Martin
A few things I noted while looking at the German translations (in the 
options dialog)


* Umgebung
** Dateien
 Kompilerdialog versus  Compilerdateiname = K oder C
** Formulareditor
 aktualisieren des Designer veringern = vielleicht: (Neu)zeichnen 
... ?


* Editor
** Allgemein
 pos1 / Ende = naechten Anfang vs nahesten End
*** Diverses
 Zuschneiden ueberfluessiger Leerzeichen = Abschneiden / Entfernen  
von Leerzeichen am Zeilenende


Einstellungen
* Code-Explorer
** Aktualisieren
 Wenn nichts ansteht = (Wenn) im Leerlauf



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


Re: [Lazarus] Error while debugging: No symbol in current context

2009-09-30 Thread Martin

Graeme Geldenhuys wrote:

Hi,

I just can't seem to debug anything inside the Lazarus IDE. Maybe my
computer just doesn't like me or something. :-(

See attached screenshot. Slots is a local variable which is a
record structure.  I can't seem to get any debug information about
the fields in that record, using Lazarus IDE.

Does anybody actually debug code inside the Lazarus IDE?  Or do you
all use external debugging tools or log files? I seem to get the
feeling that debugging is the single biggest feature missing from the
Lazarus IDE. Unfortunately debuging is a vital part of any IDE.
  


Yes I do, a lot.
And yes painfully aware of the limitations.  Well at least I anyway 
never used evaluation through hint, I always use watches window.


Lot's depends on the version of FPC, and the version of gdb you have. I 
have in the past assembled workarounds, and put them in FAQ ( 
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips / reachable via the 
FAQ )


Another thing is that sometimes all watches start returning an error, in 
which case you must remove all of them, and add them again, and they 
will work. Not sure what gets stuck there...


Best Regards
Martin


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


[Lazarus] dejavu [Re: Error while debugging: No symbol in current context]

2009-09-30 Thread Martin

I had the feeling I had a dejavu.
Please, before this ends up in a long discussion again, a lot was 
already mentioned earlier. See links below.


http://lists.lazarus.freepascal.org/pipermail/lazarus/2008-October/039225.html
http://bugs.freepascal.org/view.php?id=12522

and of course: google

Best Regards
Martin


Graeme Geldenhuys wrote:

Hi,

I just can't seem to debug anything inside the Lazarus IDE. Maybe my
computer just doesn't like me or something. :-(

See attached screenshot. Slots is a local variable which is a
record structure.  I can't seem to get any debug information about
the fields in that record, using Lazarus IDE.

Does anybody actually debug code inside the Lazarus IDE?  Or do you
all use external debugging tools or log files? I seem to get the
feeling that debugging is the single biggest feature missing from the
Lazarus IDE. Unfortunately debuging is a vital part of any IDE.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
  






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



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


Re: [Lazarus] debugger feature request created

2009-09-30 Thread Martin
I still thin you exaggerate Debugging from inside the IDE is near 
impossible.  = it is not very comfortable though.


Some of the problems are not gdb specific, some a solved.

* CPU window = available in 0928

* Record.field = Not (always) a gdb problem. Never mind which debugger 
you use, no debugger can guess what the context of your mouse pointer is.
If the IDE only passes the word-under-caret for the hint evaluation, 
then no debugger will know what field means.
If the watches window can show record.field then gdb can do it, but 
the IDE must be fixed.


* properties = discussed a thousand times.
With FPC trunc and dwarf debug info, some properties actually do return 
a result in GDB
Properties that read from a function, are the same as a function. For 
those who really want to run the function, it comes down to function 
calling from gdb, rather than being property specific


Martin


Graeme Geldenhuys wrote:

Hi,

It seems the other debugger thread was blocked - or Gmail is on the
frits again. :-/  Anyway, I added a feature request in the wiki for a
working / custom written debugger.

http://wiki.freepascal.org/Feature_Ideas#Integrated_and_Working_Debugger

If anybody has comments or ideas, please add them. I don't know where
is the best place for such communications - here or in the wiki page,
or wiki Talk pages (I have never used the latter yet).

Maybe we can get a renewed interest in the lazarus/debugger/fpdebug/
project. My knowledge of compiler or debugger internals are zero, so
don't know how much I can contribute. But if possible, I will try. A
working debugger will benefit everybody! I really think a working 
integrated debugger must be one of the high priorities for the IDE -
more that say new IDE eye-candy.  :-)


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

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



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


Re: [Lazarus] debugger feature request created

2009-09-30 Thread Martin

Graeme Geldenhuys wrote:

working debugger will benefit everybody! I really think a working 
integrated debugger must be one of the high priorities for the IDE -
more that say new IDE eye-candy.  :-)



Like ABorka told me in a private email. Once Embarcadero brings out
64bit support and cross-platform compiler (latter is what they are
working on now), then Lazarus will loose a large appeal from Delphi
developers. At the moment FPC and Lazarus offers features Delphi
doesn't have, but not the critical features which will allow them to
switch to Lazarus permanently.

  
Well this is because no one is getting paid for working on Lazarus. So 
manpower is an issue.


On the other hand it means no one depends on people using it. If they 
want to use it, that's great. If they don't no problem at all (because 
no one is losing there job/salary/means-of living).


Anyway, lots of companies just go for delphi, because there still is an 
implicit mistrust towards open source. They feel more secure if they 
have bought a product, and have the feeling they got some warranties 
towards it's usability or availability or whatever.


Anyway no one has denied that features are missing. As for debugging 
there is a dis-consent about the wording or extend that those missing 
feature have (at least between me and you (Graeme).  But  not about the 
fact that it would be nice (essential for some) to have.
But what can be done? There are limited amount of people to do the work 
on Lazarus. So it takes time.


As for making it a priority, anyone is welcome to supply patches. If 
not, it's a gift horse, so you know what not to do ;


Best Regards
Martin

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


Re: [Lazarus] debugger feature request created

2009-10-01 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:
Anyway no one has denied that features are missing. As for debugging 
there is a dis-consent about the wording or extend that those missing 
feature have (at least between me and you (Graeme).  But  not about 
the fact that it would be nice (essential for some) to have.
But what can be done? There are limited amount of people to do the 
work on Lazarus. So it takes time.


IMO one thing should be done:

Split Lazarus into an Stable and an Featured/Experimental branch. 
Remove all half-baked and troublesome features from the Stable branch, 
then make the remainder work properly, and add the most reqired yet 
missing features, step by step. Then base the Experimental branch 
(classes...) on the Stable branch, respecting *all* determined 
stability requirements.
IMO too much time and efforts is spent in new features and eye candy, 
while other features are blocked by bad design of essential classes, 
and the project members do not allow for the required downstripping.

Well again the question of man power.

Right after 0.9.26.2 was released, Vincent had ask if any one wanted to 
maintain the fixes branch, no one came forward (afaik).


Also having a branch doesn't change what people work on:
- If people still work on the eye candy (besides it is not as if 
people did only that), then those features would eventually be merged, 
and no other work was done on the stable branch.
- You still needed the people who do the most required yet missing 
features


I am not sure what was required to be down striped, but I would be 
surprised if the reason for not doing it was eye candy. So I doubt that 
a branch would help.


It has been done the other way round. Where huge experimental changes 
have been done in a branch and later merged. For example the lcl 
smartlink branch.
I am sure if there was a request, and someone behind it to do the work, 
and if the concept of the changes was *agreed* on, then a branch could 
be created, and later merged back (just my opinion).


As for getting the essentials done. the problem is to find a volunteer. 
The developers are volunteers too, they do what they volunteered for. 
Not what some one else would want them to do (well actually plenty of 
times they do, what others want).


Best Regards
Martin


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


[Lazarus] wiki - problems ?

2009-10-01 Thread Martin
Has any one else problems accessing the wiki? As of the last 24 hours, I 
can no longer access the wiki - I get a time-out.

(I use the link from the forum / main site)

Martin

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


[Lazarus] properties (delphi does it wrong too) [Re: debugger feature request created]

2009-10-02 Thread Martin

Santiago A. wrote:

Hello:
In barrapunto.com (a Spanish slashdot) there is an article asking 
What do you know about Lazarus?. Most comments were positive, and 
most negative comments were against Pascal (it's a dead language etc) 
more than against Lazarus.


Here is the link to the article (in Spanish) 
http://preguntas.barrapunto.com/article.pl?sid=09/09/28/2211206


But there were a few comments with objections to Lazarus. One of them 
was about debugger.
This comment the (also in Spanish) 
http://preguntas.barrapunto.com/comments.pl?sid=82108cid=1176899


In this comment he supported Lazarus, but the last paragraphs made 
some objections. Here is a translation of the last paragraphs, sorry 
if my English is not good enough


Some problems  I find in  Lazarus a those that unfortunatelly 
can be found in most OSS. On one hand they have amazing features

that can't be found in their commercial counterparts, on the other
hand they lack elemental features that are waiting to be
implemented and waiting and waiting and waiting and waiting

Well as I already mailed: Some properties can be inspected now (using 
fpc 2.3.1 and dwarf). So this is (partly) fixed.


Some properties  means properties that have an read-accessor pointing 
to a variable.


Properties that have a function to provide the value can not be inspected.
* And I am more than happy they can not *

Yes Delphi can do this and does do this. And what does it mean? If in 
Delphi I accidentally hover the mouse over a property, The function is 
called (actually Delphi calls it twice). As a result all Values on the 
object change (because many functions do more than just read values, 
they update values too).
The application is in a state that is no longer correct (because the 
values have changed to something they where not supposed to be). And I 
have to abort my debug session and start over. What help is that?


What help is it when an IDE (Delphi) silently and without warning does 
things that change the state of  my application. How can I expect any 
results from debugging if the IDE messes around in such ways with the 
application that I debug?



As far as I am aware the purpose of debugging is to get the same results 
as in a normal execution. This is unless I intentionally and explicitly 
ask the debugger/IDE to modify the data.



Please feel free to translate to Spanish, and post in the above forum.

Best Regards
Martin


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


Re: [Lazarus] properties (delphi does it wrong too) [Re: debugger feature request created]

2009-10-02 Thread Martin

Horacio Jamilis wrote:
I disagree with you. Most getter functions only do that, get the value 
without changing anything, but are functions because the resulting 
value is processed.

A property getter function, can, but should not, change anything.
Even if the getter changes something, it´s up to you, as a developer, 
to inspect such property or not...
I use this every day on Delphi and, in my work, is an invaluable tool, 
that lazarus should have.
May be, for people like you, in the debugger options page, could be an 
option to disable this funcionatility for tooltip debugging or for all 
the debugging, but this should be enabled by default.
The feature that is missing in lazarus is function evaluation and yes 
it is (yet) missing.
As for how valuable it is, is a personal question. I rarely need it, 
some other people can not live without it.


As for Most getter functions only do that, get the value : I don't 
have delphi sources, I cannot check. But for example the property 
Handle afaik does change things (if no handle has been allocated it 
will do that, including requesting it from the OS).


And delphi is inconsistent in that.
 property Foo read GetFoo;

if i put foo and getFoo in my watches window, then:
- Foo is evaluated (despite the fact that function evaluation is NOT 
ticked on the watches property)

 If you ask me, it should *only* work, if explicit enabled.
- getFoo is not evaluated (correct because function evaluation is NOT 
ticked on the watches property)


So why is Foo evaluating a function, even so this is not enabled by 
the settings for this watch? That is a bug if you ask me, and a severe 
one, since it can thrash hours of debugging work.
Oh yes, of course, I know when I add it as a watch. Actually I may do, 
but someone new to deplhi doesn't (I was once new to it too), so they 
get screwed...


And keep in mind, even a function that is not supposed to modify thinks 
can end up doing so. Evaluating the function, at a time the function was 
not meant to be called, may cause a crash, and may cause memory 
corruption. There are plenty of hidden dangers, they may only occur 
in a few situations, but the can and will. And there is no warning at 
all, Simple pointing your mouse on a property (and getting hint 
evaluation) can destroy hours of debugging effort (again no warning...)


And if the property has a function that does modifications: if you put 
it in the watches and then run the hint too = you see different values 
(because they changed in between)


I agree function evaluation in the debugger can be a very helpful 
feature. That is it is helpful when used intentionally, sot the 
developer knows what side-effects may happen.

The way Delphi has it, doing it with no warning at all = very dangerous.


Best Regards
Martin


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


[Lazarus] drag / dock mgr [Re: debugger feature request created]

2009-10-02 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:
I am not sure what was required to be down striped, but I would be 
surprised if the reason for not doing it was eye candy. So I doubt 
that a branch would help.


There exist a couple of troublesome elements in basic classes. IMO the 
Controls unit with those many managers deserves downstripping and 
refactoring, for better maintenance and extensibility. It should be 
reconstructed bottom-up, with defined hooks for features and 
implementations to-be-added.


I just had a look: all those many managers, there is a drag and a dock 
manager?


And then the question is who much of this does delphi has?

Martin



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


Re: [Lazarus] Some debug facts/improves

2009-10-03 Thread Martin

JoshyFun wrote:

Hello Lazarus-List,

Saturday, October 3, 2009, 3:36:46 AM, you wrote:

PI Debugger has one set of classes for IDE and another set of classes for
PI the debugging itself.
PI Classes which has IDE in name are used by IDE to save/load their values
PI to/from streams, etc.
PI TDBGWatch is used as a base class for the debugger - it has TIDEWatch as
PI slave. TGDBMIWatch is a paticular implementation for TDBGWatch which
PI works with gdb debugger.

Ok, I see that part of the path, but there is still a missing point
from my side. In one Watch window procedure the code looks like (not
exactly):

procedure Update(Watch: TIDEWatch);
begin
  Value:=Watch.Value;
end;

but manually following the execution flow, Watch.Value gets me to
TIDEWatch.GetValue which looks like a default stub. So maybe the
parameter should be different, maybe a TBaseWatch ?

  

TIDEWatch is just a baseclass

On the IDE side you realy deal with a TManagedWatch defined in 
C:\lazarus_latest\ide\debugmanager.pas


Martin

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


Re: [Lazarus] Some debug facts/improves

2009-10-03 Thread Martin

JoshyFun wrote:

Hello Lazarus-List,

I'm trying to improve some debug parts up to where my skills let me
and I had found some things that I was unable to understand:

1) I was unable to find how TIDEWatch is connected with GDBMIDebugger,
in special the GetValue property getter. As I understand GetValue
will return the default value representation so to add override
representation, in example memory dump, a new function should be
added like GetValue(FormatSet).
  

I am not sure, if formatting should happen in the debugger.

IMHO it would be better to have a GetValueStructure or GetValueEx or 
similat.


return a class/structure, that can be formatted by the IDE.

My 2 cents / Best Regards
Martin

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


Re: [Lazarus] Some debug facts/improves

2009-10-03 Thread Martin

Hi JoshyFun,

in this context, maybe have a look at: 
http://bugs.freepascal.org/view.php?id=10665


I don't know if it overlaps with your plans, or is unrelated...

Best Regards
Martin

JoshyFun wrote:

Hello Lazarus-List,

I'm trying to improve some debug parts up to where my skills let me
and I had found some things that I was unable to understand:

1) I was unable to find how TIDEWatch is connected with GDBMIDebugger,
in special the GetValue property getter. As I understand GetValue
will return the default value representation so to add override
representation, in example memory dump, a new function should be
added like GetValue(FormatSet).

2) The IDE hints are always draw using DT_CENTER which ruins any
multiline representation. Is possible to remove this DT_CENTER from
procedure THintWindow.Paint ?

3) In the case of class debug I had added to the result the data
returned from evaluating de dereference, something like inspecting
Class and Class^ which offers more information. Are this kind of
improvements of some interest ?

4) gdb class information looks very strange to me, in example a
TMemoryStream dumps:

~type = TMEMORYSTREAM = class : public TCUSTOMMEMORYSTREAM \n
~  private\n
~FCAPACITY : LONGINT;\n
~\n
~  public\n
~procedure SETCAPACITY (TMEMORYSTREAM, ONGINT, );\n
~function  REALLOC (TMEMORYSTREAM, ONGINT, ) : POINTER; virtual;\n
~destructor  ~DESTROY (TMEMORYSTREAM, OINTER); virtual;\n
~procedure CLEAR (TMEMORYSTREAM);\n
~procedure LOADFROMSTREAM (TMEMORYSTREAM, STREAM, );\n
~procedure LOADFROMFILE (TMEMORYSTREAM, ANSISTRING);\n
~procedure SETSIZE (TMEMORYSTREAM, ONGINT, ); virtual;\n
~function  WRITE (TMEMORYSTREAM, onst7, ) : LONGINT; virtual;\n
~end\n

Note the missing L in second parameter when LONGINT was expected, or
missing T in LOADFROMSTREAM, but the most strange to me is the
onst7. What's const7 ? Does anybody know why those letters are
missing ?

5) When an exception is raised and stop button is pressed usually
the assembler window pops up instead the line where the exception
happends, or the nearest line with debug information. I had changed my
code to show the assembler window only if no line with debug
information is found in the backtrace. But I do not exactly know how
that procedure works and maybe I missed something important, or maybe
that's the expected behavior :-?

  



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


Re: [Lazarus] heaptrc - Is it even worth using?

2009-10-05 Thread Martin
Just one thing in case you don't know already. There is a package 
leakview (it's included in lazarus, but not installed by default (afaik))


Once installed , it appears in the tools menu, and you can load the 
leak-trace output. it will display similar like the stack view, allowing 
you to click the lines and jump to the code.

That should save some time.

Martin

Lee Jenkins wrote:


Does anyone else have any trouble reading heaptrc output?  The only 
thing that I can see of use is that it tells me there /is/ a leak.  
However, trying to figure out where it is according to heaptrc output 
seems more difficult and time consuming that searching through the code.


I'm not criticizing per se, just frustrated that I've spend 40 mins 
looking at a heaptrc output file with still no clue as to where the 
leak may be.


Heap dump by heaptrc unit
4669 memory blocks allocated : 1093920/1110888
4621 memory blocks freed : 1092756/1109608
48 unfreed memory blocks : 1164
True heap size : 360448 (112 used in System startup)
True free heap : 355808
Should be : 356368
Call trace for block $030FFC70 size 45
  $0040734F
  $005E9916  TTIOIDGENERATORGUID__ASSIGNNEXTOID,  line 489 of 
M:/lazarus/components/tiOPF2/Core/tiOIDGUID.pas
  $005CFA38  TTIOBJECT__CREATENEW,  line 2036 of 
M:/lazarus/components/tiOPF2/Core/tiObject.pas
  $005CFAF5  TTIOBJECT__CREATENEW,  line 2042 of 
M:/lazarus/components/tiOPF2/Core/tiObject.pas
  $004237AF  TFLEXOBJECTMAPPING__REGISTERPROPERTY,  line 259 of 
M:/lazarus/projects/flexserver/src/flex_persistence.pas
  $00423293  TMAPPINGREADER__REGISTERMAPPINGS,  line 128 of 
M:/lazarus/projects/flexserver/src/flex_mapping_reader.pas
  $00422EBB  TMAPPINGREADER__LOADMAPPINGS,  line 66 of 
M:/lazarus/projects/flexserver/src/flex_mapping_reader.pas

  $00422C86  TFORM1__BUTTON1CLICK,  line 40 of main_form.pas



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


Re: [Lazarus] fpchmod illegal character

2009-10-14 Thread Martin

Thanks,

I will attend to it asap.  Usually it is better to attach them to a 
mantis report. So they will not be lost/overlooked.


Martin

dmitry boyarintsev wrote:

Here's the patch for synedit pascal highlighter to support '%'
(binary) and '' (octal) as numbers, as shown here:
http://imagebin.org/67810
Otherwise the prefix character is colored as symbol rather than as number.

thanks,
dmitry

P.S. sorry, don't have much time for serious development.
  



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



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


Re: [Lazarus] fpchmod illegal character

2009-10-14 Thread Martin

dmitry boyarintsev wrote:

Here's the patch for synedit pascal highlighter to support '%'
(binary) and '' (octal) as numbers, as shown here:
http://imagebin.org/67810
Otherwise the prefix character is colored as symbol rather than as number.
  

Applied, in 22180, thanks.

slightly improved, the $% prefixes must be followed by a number (fpc 
does not even allow for a space). So if there is no number following the 
do not highlight as number


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


Re: [Lazarus] more locals: variable values in sub-functions

2009-10-27 Thread Martin

David Emerson wrote:

procedure foo;
  var a : longint;
  procedure bar;
var b : longint;
begin
  writeln (a);
end;

Given the above, is there a way to make the Locals window display the 
value of a while stepping through the code in proc bar?
  

I believe the latest 0.9.29 snapshots can do that.

But all versions of lazarus can do it, using the stack window.
In the stack window you can set the current frame to any stack-frame you 
want.

The local-var window, the hint, and the watches window, will all follow this



Martin

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


Re: [Lazarus] more locals: variable values in sub-functions

2009-10-27 Thread Martin

Marc Weustink wrote:

Martin wrote:

David Emerson wrote:

procedure foo;
  var a : longint;
  procedure bar;
var b : longint;
begin
  writeln (a);
end;

Given the above, is there a way to make the Locals window display 
the value of a while stepping through the code in proc bar?
  

I believe the latest 0.9.29 snapshots can do that.


nope. The latest snapshots can evaluate a, but have no knowledge if 
a is visible inside bar. And imo, a is not a local to bar.
Oh, yes. I was imprecis. I did mean hint/watches. The local doe snot do 
that = true.




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


Re: [Lazarus] Bug (whis) at Procedure List : SOLVED, can anyone apply?

2009-10-28 Thread Martin
A much better idea (imho)  would be, to add all and none *after 
sorting finished.


that way you would not rely on the name of them or anything like that.

 cbObjects.Sorted := true;
 cbObjects.Sorted := false;
 cbObjects.Items.Insert(0, lisPListAll);
 cbObjects.Items.Insert(1, lisPListNone);



Raistware wrote:

Could anyone check this code and apply to SVN?

---
diff --git a/ide/procedurelist.pas b/ide/procedurelist.pas
index 9e578af..96d8ba9 100644
--- a/ide/procedurelist.pas
+++ b/ide/procedurelist.pas
@@ -431,7 +431,8 @@ begin
  end;
end;
  finally
-cbObjects.ItemIndex := 0;   // select All as the default
+{ select All as the default }
+cbObjects.ItemIndex := cbObjects.Items.IndexOf(lisPListAll);
if cbObjects.Text = '' then
  cbObjects.ItemIndex := 1;
  end;

---

It solved the default item selected on bug on Procedure List. Default 
selection should be 'All' at local language, but before this change, 
the selection was allways the first item at list, at english is not a 
problem, because 'All' usually is the first item at list, but at other 
languages, like spanish: 'Todo' usually isn't the first item at list.
With this modification the default item will be allways 'All' in local 
language, solving that bug.


Cheers,
  Raul Ferriz




__ Información de ESET NOD32 Antivirus, versión de la base de 
firmas de virus 4550 (20091028) __


ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com



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



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


Re: [Lazarus] LineRange [Re: Auto indentation]

2009-11-03 Thread Martin

Mattias Gärtner wrote:

Zitat von Martin laza...@mfriebe.de:


Mattias,

have you looked at using
 StartLine := Min(Old:ogCaret.Y, LogCaret.Y);
 EndLine := Max(Old:ogCaret.Y, LogCaret.Y);


Sometimes synedit gives me too many lines, sometimes not enough. I 
need the real insert range.

Even if you use the info from the caret?

Yes, I looked at the FirstLinePos, LastLinePos range = it is wrong 
sometimes. But the caret seems to be ok for all I have seen.



Also, as I wrote before: FirstLinePos, LastLinePos is not usable for 
you, because in syncro-mode it will report more lines than you need (and 
that is by design).


In syncro mode, you can press enter inside a cell, and the cell 
willbecome multi-line = indenting in this case must be limited to the 
cell which was active,
-FirstLinePos, LastLinePos will include the range for *all* cells = if 
you indent every line in that range, the syncro module, will keep 
copying every change you make accross all cells = total chaos.

- the caret will give you the correct range




That would also have the advantage that an end would be unindented 
correctly. e.g typing


if a  1 then begin
 b:= 1; // the indenter has added 2 spaces = correct
 end;|

now hit return at |.
The line with the end in it does not change, so it is not in the 
range. But it is in the caret range. And it should be unindented


Correcting the leaving line is a todo and planned from the beginning.

use the caret-info and it should already happen

Another one is a better indenting for breaking long 
expressions/statements.

But first I want to find a better solution for the indent on paste.

Mattias



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



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


Re: [Lazarus] Auto indentation

2009-11-03 Thread Martin

Jürgen Hestermann wrote:


What I am missing with indentation is the good old turbo pascal way 
where TAB moved below the beginning of the next word in the line 
above. It was very easy to arrange code with this feature, especially 
if code was copied (partially) and changed afterwards so that it had 
to be rearranged manually.



Smart-tabs ? (editor options / general)

They work, but only if you are exactly at the beginning of the first 
word of the line


Example
 for a:=1 to b.count do
   |foo();

press tab, and you will be below a, then to, ...


Martin




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


Re: [Lazarus] white flash when opening new unit while debugging

2009-11-03 Thread Martin

Yes, please report as a bug.

This may not end up with the highest priority right now, but if you need 
a quick fix, you can modify synedit


line 1636 (within constructor SynEdit.create)
 Color := clWhite;


Change it to your preference, and recompile synedit and the ide

David Emerson wrote:

Hey everyone,

Since I've been asking a few questions now and then, I'd like to give a 
big thanks to everyone for your wonderful feedback and of course all 
the hard work! I hope to contribute someday when I am able.


On to the next question :)

I use an inverted color scheme, which helps me with a minor visual 
disability.


I often ctrl+click on an identifier to jump to its declaration. If the 
unit where the identifier is declared is not open, it is automatically 
opened for me. This is great!


As long as I am not debugging, everything looks great.

However, when I am debugging, the automatically opened unit is first 
rendered with a white background before my color scheme is applied. 
This results in a visually disturbing white flash.


Is this something I should formally report as a bug, or...?

Cheers,
~David.


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



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


[Lazarus] syncro mode[Re: Auto indentation]

2009-11-03 Thread Martin

Further thought about auto indent (for paste) and syncro/template mode.

The only reliable position is the final caret pos (based on that you can 
do indent on return)


- the line-range will be too big.
- the inital caret position will be unusable. because the if any cell 
was above the caret pos, then the text will have moved downwards, while 
the initial caretpos would still be on top



syncro and template edit are created in Sourceeditor around line 2565. 
They are owned and destroyed by synedit (however synedit only knows they 
are plugins, and has no idea what they do)


SourceEditor could keep a reference to the syncro and template module.

Both of them have an Active property. If it is true, you should not 
indent-on-paste


---
The alternative is to have an OnBeforePaste event, and modify the text 
to be pasted, *before* synedit inserts it

(or keep the to-be-pasted text, and act backwards on the final caret pos)

Martin


Martin wrote:

Mattias Gärtner wrote:


Hmm.
Apparently synedit's line range is unreliable to find out what was 
inserted or what lines have changed.

I will ask Martin.


It should be better now.

I tested for return and various paste events

Martin



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


Re: [Lazarus] Auto indentation

2009-11-03 Thread Martin

Graeme Geldenhuys wrote:

By the way, do you know if it is possible to implement the feature
request #9650 in Lazarus IDE yet? At the time of the feature request,
SynEdit did not have the capability to set variable length tabstops
(tabstops based on varying pixel widths) per line. SynEdit could only
set tab stops per complete file and were character based if I remember
correctly - every line has the same tab stop points.

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

I remember trying out the Java demo editor using Elastic Tabstops and
write some Object Pascal code with comments aligned on the right of
code etc. Elastic TabStops worked very nicely. And when saved, tabs
are removed and spaces inserted - so other developers using a
different editor or not using Elastic Tabstops feature will not be
hassled.


The following site explain benefits of Elastic Tabstops and bust some myths:
   http://tibleiz.net/code-browser/elastic-tabstops.htm

Yes it is possible, and yes it should be very easy to do so.
With one exception: Any form of auto Indent will not work with it yet

The calculation of tabs is done entirely (with the exception of auto 
indent) in the unit SynEditTextTabExpander


The unit can set the width (amount of spaces covered by) each tab 
individually.


If you subclass it, and then do the calculation inside (and add 
callbacks to tell synedit, that lines must be repainted), then it should 
work out of the box



Martin

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


Re: [Lazarus] LineRange [Re: Auto indentation]

2009-11-03 Thread Martin

BTW: what line rang should be reported if a line was deleted?

Martin wrote:

Mattias Gaertner wrote:

On Tue, 03 Nov 2009 17:46:48 +
Martin laza...@mfriebe.de wrote:
 

Mattias Gärtner wrote:
   

Zitat von Martin laza...@mfriebe.de

have you looked at using
 StartLine := Min(Old:ogCaret.Y, LogCaret.Y);
 EndLine := Max(Old:ogCaret.Y, LogCaret.Y);

Sometimes synedit gives me too many lines, sometimes not enough. I 
need the real insert range.
  

Even if you use the info from the caret?



For example:
inserting one line:
OldCaret=(x=1,y=47) NewCaret=(x=1,y=48) FirstLinePos=47 LastLinePos=48
  
You mean inserting a full line using paste? so you have a complet new 
line 47, and the old line 47 is now 48?  But then the info from  the 
caret is correct, with one addition


Text changed between 47/1 and 48/1 Since there is nothing before line 
48/1 That means the line has not changed (ending on the next line with 
pos=1 means that the last modified think is the linefeed)



replacing one line with one line
OldCaret=(x=1,y=48) NewCaret=(x=1,y=48) FirstLinePos=46 LastLinePos=48
  
Good point, if you had a selection before, then the caret is *not* 
sufficient


But in this situation, even if the line range was correct, this would 
bring back the problem of detecting how much of line 47 was changed.
= it could be that only the last few chars where selected, in this 
case the insert (according to you) should not re-indent line 47

= or line 47 was fully selected, and should be re-indented

So this case is a good example, even the combination of correct 
line-range and both carets are not enough. You must additionally take 
in account the selection that was present before the edit took place.
(and you must take in account if the selection is persistent, or 
will/will-not be overwritten)



replacing one line with one line
OldCaret=(x=1,y=47) NewCaret=(x=1,y=48) FirstLinePos=46 LastLinePos=48


 
Yes, I looked at the FirstLinePos, LastLinePos range = it is wrong 
sometimes. But the caret seems to be ok for all I have seen.


Also, as I wrote before: FirstLinePos, LastLinePos is not usable for 
you, because in syncro-mode it will report more lines than you need

(and that is by design).



Yes.
How to find out if synedit is in syncro mode?
  
Currently not available. The syncroEditModule is created in 
sourceditor line 2565 = So a reference could be kept.  Same would 
have to be done for TemplateEdits
And then each time any similar module is added, check will need to be 
added.


There is no central point, Synedit doesn't know. It was one of the 
important design goals that the syncro module can extend synedit, 
without synedit having to know about it.
Which is why (even if fixed) the FirstLinePos, LastLinePos range will 
always include such kind of edits.


Similar, it will be with persistent blocks, the can be moved to a new 
location, which will edit both places (delete them at the old place / 
insert them at the new place). Changed lines will be including all of 
this.


 
 
In syncro mode, you can press enter inside a cell, and the cell 
willbecome multi-line = indenting in this case must be limited to

the cell which was active,
-FirstLinePos, LastLinePos will include the range for *all* cells =
if you indent every line in that range, the syncro module, will keep 
copying every change you make accross all cells = total chaos.

- the caret will give you the correct range



How?
  


After the example with the overwriting of a selection. The correct 
answer is:
The caret and observing the selection (hooking synedit to know what it 
was before the edit action).



The end of story is, it seems there is no simple way to do this.
If I have time I will fix the line-range. But as far as I am concerned 
it is of little value. Using this (even now) the auto indent will 
cause big trouble if used during synro or template mode (if someone 
does paste into a cell)


The combination of monitoring block and caret (and maybe even more) 
would solve it. (as already noted above = replacing a selected line 
OR replacing a partly selected line, including the linefeed)


However instead of filling he generic beautifier with more and more 
IDE specific code, I would suggest to have a subclass of the 
Beautifier residing in source-editor. Every synedit that is created in 
the IDE will be assigned the special IDEBeautifier. the ide beautifier 
can then sort out what happened.
It basically has to know how synedit will react, and calculate the 
required data.



Martin



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



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


Re: [Lazarus] syncro mode[Re: Auto indentation]

2009-11-04 Thread Martin

Mattias Gaertner wrote:

On Wed, 04 Nov 2009 00:27:20 +
Martin laza...@mfriebe.de wrote:

  

Further thought about auto indent (for paste) and syncro/template
mode.



I disabled auto indent during syncro/template editing.
  
you need the same for TSynPluginTemplateEdit (template edit, which 
includes it's own syncro mode)


   TSynPluginTemplateEdit.Create(FEditor);
   FSyncroEdit := TSynPluginSyncroEdit.Create(FEditor);


 
  

- the line-range will be too big.
- the inital caret position will be unusable. because the if any cell 
was above the caret pos, then the text will have moved downwards,

while the initial caretpos would still be on top


syncro and template edit are created in Sourceeditor around line
2565. They are owned and destroyed by synedit (however synedit only
knows they are plugins, and has no idea what they do)

SourceEditor could keep a reference to the syncro and template module.

Both of them have an Active property. If it is true, you should not 
indent-on-paste


---
The alternative is to have an OnBeforePaste event, and modify the
text to be pasted, *before* synedit inserts it
(or keep the to-be-pasted text, and act backwards on the final caret
pos)



I guess this is the better solution for ecPaste.
Can you add such an event?

  
Yes, the question is, if it is ok for codetools, since it would be 
called before the paste = that is you have to interpret the 
to-be-pasted text before it is part of the source


At the moment you can indent based on the complete source *after*  the paste

The alternative is a combination:
- in the OnPaste event you store the text to be pasted (as well as the 
mode normal, column )
- in the OnIndent, you take the final caret pos and you know how far to 
go back (since the pasted text always ends at the final caret pos)



I'll update you, when I got it done.

Martin

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


Re: [Lazarus] syncro mode[Re: Auto indentation]

2009-11-04 Thread Martin

I just stumbled on the below

if SrcEdit.EditorComponent.SelectionModesmNormal then exit;

will not prevent the indent if an smColum mode block is inserted.

The mode of the data inserted has nothing to do with the mode of the 
current block.

And after the insert, there is no block, therefore it can not be checked.

the new event will explicitly report the mode.

The advantage of OnPaste is that it will also be called for quick-paste 
(middle mouse) which indenter currently is not.


Only thing that will not call anything, is drop-drag-edit (can be 
addressed later)


Martin




 ecPaste:
begin
  if not CodeToolsOpts.IndentOnPaste then exit;
  if SrcEdit.EditorComponent.SelectionModesmNormal then exit;
  if LogCaret.X1 then
inc(FirstLinePos);
  if LogCaret.Y=LastLinePos then
dec(LastLinePos);
  if LastLinePosFirstLinePos then exit; // not a whole line
end



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


Re: [Lazarus] Auto indentation

2009-11-04 Thread Martin

Hans-Peter Diettrich wrote:

Graeme Geldenhuys schrieb:

Also, as I mentioned, the gEdit plugin that enables elastic tabstops
has a option to automatically do conversions. So you can work with
elastic tabstops enabled, but when saved, the file gets converted back
to using spaces.

What will happen when you commit your changes?
Will everybody have to work with your formatting, casted into spaces?
If any commit converts tabs to spaces, then elastic tabs do not solve 
any problem any more or less than any other tab handling does.


In this case the stored text has only spaces. If you check it out again, 
and wish to edit it, you need an editor, that detects where those spaces 
should be tabs (magical guessing according to your taste)
Such conversion (to spaces / from spaces) can be applied to any form of 
tabs that you have in your source code


NOTE: The conversion of tabs to spaces can be defined in 2 ways:
1) tabs a converted to an as many spaces as needed, so the look on the 
pc of the converter does not change
2) tabs and consecutive tabs (as well as consecutive spaces) are 
converted to a single space nly (except in strings or other white space 
sensitive areas)


The first solution does not solve anything, as the checked in text still 
expresses the format of the one writer who converted it. = Format is 
still part of the content, not applied to a content


The 2nd form will work (exceptions see further down) but requires are 
really good formater for any one wanting to work with this text



Same thing should apply to code formatting, which is what Elastic
Tabstops does. You press the Tab key, which inserts the char $09 -
nothing more! Now the editor does the formatting for you, but doesn't
modify the source code contents to do it.


I'd agree with different tabstop codes, so that the formatting can be 
undone or suppressed at any time.
Tab stops in the source (white space insensitive area / outside strings 
etc) are formating.
They are formatting, because they cause different layout, unless they 
can be ignored / handled same as spaces


After all Graeme would only need a single (or 2) tab char in the source, 
in order to align comments at the end of several lines
I need maybe between 1 and 10 tab stops per line so my editor shows the 
comments aligned (using normal tabs)


If all editors are to handle them elastic, then they carry format into 
the content


content, and thus would track only changes in the content, 
regardless of

whitespace and line breaks.

Line breaks are interesting.

Since some people write:
if a then begin

or:
if a then
begin

the line break itself embeds formatting into the content.

If you want to archive, what you describe (format free content) then all 
whitespaces (including tabs, newline) must be stored as simple space 
(except some basic interpreters, which have linebreak as part of the 
language)


Applying tabs and linebreaks is eye candy, that your editor should apply 
on top of the content.


Linebreaks could be used  for paragraph like grouping of statements, 
that represent a logical entity in your code, yet are not presented as a 
procedure of their own.


---
I may have shlightly disconnected from reality while writing the above



Martin



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


Re: [Lazarus] syncro mode[Re: Auto indentation]

2009-11-04 Thread Martin

Martin wrote:

Mattias Gaertner wrote:

I guess this is the better solution for ecPaste.
Can you add such an event?
  
Yes, the question is, if it is ok for codetools, since it would be 
called before the paste = that is you have to interpret the 
to-be-pasted text before it is part of the source


At the moment you can indent based on the complete source *after*  the 
paste


The alternative is a combination:
- in the OnPaste event you store the text to be pasted (as well as the 
mode normal, column )
- in the OnIndent, you take the final caret pos and you know how far 
to go back (since the pasted text always ends at the final caret pos)



I'll update you, when I got it done.

Added. There are now
SynEdit.OnPaste: TSynCopyPasteEvent
SynEdit.OnCutCopy: TSynCopyPasteEvent   // you do not need

I still have to do the tests. It doesnt breek anything existing, but I 
havent checked if the events do 100% as advertised


The event is called immediately before the actual paste happens.

 TSynCopyPasteEvent = procedure(
Sender: TObject; // the synedit
var AText: String; // the text, which you can modify, before it will 
be pasted

var AMode: TSynSelectionMode;   // smNormal, smColumn
ALogStartPos: TPoint;   // The position at which it will be inserted ***
var AnAction: TSynCopyPasteAction   // see below
) of object;


TSynCopyPasteAction = (
scaContinue,   // do the insert as normal
scaPlainText,  // do the insert, but (except for 
smColumn,smNormal,smLine) ignore all synedit specifics (such as fold 
info that came with the paste)

scaAbort// do not insert anything
);

*** ALogStartPos: TPoint;   // The position at which it will be inserted ***
Is the position where the new text will start.

However the event does not include any information, if a block selection 
exists.

A BlockSelection MAY be deleted before the paste
- if it is not persistent
- if eoOverwriteSelection is set



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


Re: [Lazarus] Double click is needed to select/deselect item's checkbox in listview with checkboxes

2009-11-05 Thread Martin

Yes, I can reproduce this here (under Vista).

I didn't get the need for 4 clicks though

And3mD wrote:

Hello I made some tests about issue 13932

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

- Windows XP - everything works ok
- Windows Vista 32bit Home Premium - I need 2 or sometimes 4 clicks to 
change checkboxes state


Can anyone acknowledge?

I can't change issue status, and I don't want make duplicate one.

Greetings
Andrzej And3mD Kilijanski

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



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


Re: [Lazarus] region [elastic tabs [Re: Auto indentation]]

2009-11-05 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:

For section heading {%region} {%endregion} is usefull = since it 
allows folding


Such verbose formatting is unusable, for several reasons:
- it is bound to an special editor
- it is imposed on every user
- it must be maintained manually
- it is pure overhead


So what did you mean, what are your ideas of folding?

There are many possibilities, but most of them will be supported by very 
few editors, if any at all.


A few ideas I had, but not all worth doing:

- language specific folds (begin/end or open/close tags in xml) = 
existing for pascal


- temporary folds: not bound to any content. They exist as long as the 
editor is open, (and would be a poor substitute for having 2 windows of 
the same content)

 They would work, by selecting any amount of lines, and fold them

- folding any paragraph, (defined by at least one empty line in-between

- folding by level of indent

- folding by special comments (as you indicated ///) but that again is 
very editor specific. it is just a shorter notion of region.
 It could be configurable by specifing the pattern / and it has the 
advance of an automatic end at the next section / and they could be 
leveled (///, , /, ...)



The /// are what you mentioned in your post. But (with the exception 
maybe of overhead) it has the same properties as region:

- it is bound to an special editor
 (or a set of a few special editors)
- it is imposed on every user
(if it is not treated as editor specific directive it is a comment; so 
is {%region ...} )

- it must be maintained manually
(except for the end of each block is found automatically, sometimes an 
advantage, sometimes a disadvantage)



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


Re: [Lazarus] Delphi editor clone

2009-11-05 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:

Please have a look at examples/dockmanager/elasticsite/SiteTest 
project. It demonstrates how docking could work in the Lazarus IDE, 
and how multiple editor windows could be implemented.

Does not work with fpc trunk

C:\lazarus_latest\examples\dockmanager\package\felasticsite.pas(106,35) 
Error: Can't take the address of constant expressions


When a new FPC version imposes such restrictions, then it also should 
convert shortcuts like Inc and Dec into macros.


While Inc and Dec were *introduced* into the language as optimization 
hints, for using according machine instructions, they *nowadays* are 
means to eliminate duplicate code (expressions).


I know about the strange opinions of some FPC developers, which also 
require that Inc with an (small) negative amount should raise an 
overflow exception, only because an unsigned machine instruction would 
do so, on certain machines. Such argumentation is ridiculous, with 
regards to the Wirthian pragmas.


All fine and good. But it doesn't help, unless you convince the fpc 
developers.
Eventually the new Version of FPC will be used, and eventually all code 
has to be able to be compiled with it


For the moment though, you are right. I can not really complain if it 
doesn't work for me, simple because I use an unreleased fpc version. do 
you think it will be fixed before release?


Martin

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


Re: [Lazarus] Auto indentation

2009-11-05 Thread Martin

Hans-Peter Diettrich wrote:

Mattias Gaertner schrieb:


With the new synedit OnPaste event I will try to fix the indent on
paste.


IMO you should rethink the handling of insertion/deletion. A single 
Replace(start, delta, text) method can handle every case, with 
positive deltas meaning insertion and negative deltas meaning deletion 
or substitution of text. This single method knows about the range of 
the affected text, as required for the handling of all related 
attributes (line count, cursor position, syntax highlighting, blocks, 
folding, formatting, bookmarks...). All related objects should 
implement the same method for dealing with updates.


Maybe you can elaborate in which context you the above statement should 
be interpreted?


We are talking here about specifically selected (and selected only) 
events for which SynEdit is providing an interface for *external* 
components.
This is the same as a buttons OnClick, or OnFoo event that allows code 
not known to the component to react to events occurring inside the 
component.


Inside the IDE OnPaste is going to be used by codetools, but in user 
apps the programmer is free to use (and of course abuse) this on his/her 
terms.
Codetools does not need to know every edit/modification of the text. In 
fact there are many edits/modifications that this part of codetool 
should not react to.


Clipboard interaction (for an editor component) is a generic event that 
mat be of interest, in the same way as OnClick is on a button.


-
Internally SynEdit has a small set of methods through which *all* 
modifications to text are done.
Agreed one would have been enough. But it is the same distinction  has 
having 2 methods [cut and copy] or one [CutCopy(DeleteSelection:Boolean)].


They do however not move the caret. This would have meant to add special 
params. After all not every text modification moves the caret.
They do provide hooks, that are used by other editor feature to react to 
the changes.


I am aware that you (IIRC) prefer a micro-controller scenario. But for 
various features it is IMHO better to use generic hooks.
Example: No micro controller is/should be needed to update bookmarks 
(Except for the controlling element in the bookmark manager). The 
bookmark manager hooks into synedit, observes any text change, and 
adjusts all bookmarks.


This is actually a pre-condition for having the same content in multiply 
editor windows. Each SynEdit (using the same shared TextBuffer) can hook 
into the textbuffer and adjust to any change that happens.



A single Replace(start, delta, text) method 
Can not deal (unless given a specialized argument) with the 
differentiation between smNormal and smColum. smColumn is very specific 
to Block-Selection and therefore translated there.
the basic text modification only knows contineus/flowing text that can 
be edited/replaced.


This again makes it a difference to an OnPaste event, which exposes the 
speciality of smColumn. something that does not exist in other edit 
actions.


Martin




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


Re: [Lazarus] Passing properties as var paramatars (was: Delphi editor clone)

2009-11-07 Thread Martin

Alexander Klenin wrote:

On Sat, Nov 7, 2009 at 14:15, Martin laza...@mfriebe.de wrote:

  

The answer was that properties are meant to change the value on the object
immediately. Also a property setter can raise an exception, or additional
actions can take place or the value can be substituted
All this wouldn't happen with a temp variable (or at best deferred).
Therefore the behaviour would not be according to the rules of properties



I thought about that too. There are few counter-arguments here:

Strictly speaking, properties are not *meant* to change anything
neither immediately nor
  

As I said it is not my argument, you better take it to the fpc list.

The one thing I may not have repeated clear enough: expected to change

Of course the setter is expected to change (at least a member variable). 
So if your functions/procedure does

 MyProc(var SomeValueFromProertyasTempVar: integer);
begin
   SomeValueFromProertyasTemp := 1;
   Foo();
end

and Foo reads the property in question, then Foo sees the old value, 
even so it is expected to have changed already.




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


Re: [Lazarus] white flash when opening new unit while debugging

2009-11-08 Thread Martin

I've done a bit more looking into it.

The problem is that6 SynEdit is shown, when the notebook tab is changed 
(which will be hard to avoid).

At this time it is an empty SynEdit, with no highlighter.

and an SynEdit with no highlighter currently uses default, none 
configurable colors.


They are defined in  ide\editoroptions.pp (and not in synedit as I 
thought first)
in:   procedure TEditorOptions.SetMarkupColors(Syn: TSrcIDEHighlighter; 
aSynEd: TSynEdit;


Line 3668:
 if (SynColorScheme  '') then begin
.
 end
 else begin
   aSynEd.Color := clWhite;
   aSynEd.Font.Color := clBlack;
 end;

aSynedit.Color is what you need to change.

---
Not tested, but pretty sure.

Martin

Zaher Dirkey wrote:

This also not in Debug mode, some time in normal state, there is a
flicker by white background and black font in editor and the tab not
take the real name of the unit, it changed to the correct name with
applying the color themes.

I think (but not sure) it is around the source editor in IDE not
related directly to SynEdit.

Thanks for your patience.

On Sat, Nov 7, 2009 at 4:27 PM, Martin laza...@mfriebe.de wrote:
  

David Emerson wrote:


Thanks for the tip, Martin!

I did file a bug report.

I checked out the svn (actually used Graeme's git repo) made the change,
compiled, and ran, and it seems not to have had any effect.

(Since it was my first time, I played around and verified that my changes
were actually being incorporated.)

I also tried changing the default value where the property is declared, to
no avail.

  

In that case it is probably the underlying page of the notebook, that is
displayed to you. (and which happens to be white too).
I have to investigate at some time.

I know those things (various drawing/display effects) happen when the
debugger is active. I assume this to be, because the debugger does calls to
Application.ProcessMessages (which is required). That means that paint
events come in early.

Sorry no quick fix then.

Martin



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






  



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


[Lazarus] ghost images of the frame [Re: Delphi editor clone]

2009-11-09 Thread Martin

Try the following,

- open one or 2 sources in the main window (just to make sure you have 
some tabs)

- show object inspector (or messages...) and dock to the main window
 ( it must be docked to the main win, or it will not happen)

- now grab the OI at it's top left corner and start dragging

You should see the dragging rectangle for the OI. The mouse should touch 
(or be within pixel distance of) the corner of the rectangle
Move the mouse over the remaining tabs (and keep moving / move from one 
tab to the other and back, possible with a simultaneous up/down move).


Because the mouse and the drag border are over the tabs at the same 
time, the border leaves ghost images of itslef (windows)
The reason is that the tabs redraw themself if the mouse goes over (in 
order to show a bit of highlight indication) [ so the whole thing is 
theme dependent ]


Since the frame draws deletes by inverting the screen, any changes to 
the screen (as the redraw of the tab) causes frame-fragment to be left 
behind.



I haven't looked at your code.

but the IDE does setCapture (same as MouseCapture := true) to the 
control that is going to be dragged. That way all mouse events go there, 
and the tabs don't get them.


Martin




Hans-Peter Diettrich wrote:
Please have a look at examples/dockmanager/elasticsite/SiteTest 
project. It demonstrates how docking could work in the Lazarus IDE, 
and how multiple editor windows could be implemented.





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


Re: [Lazarus] Lazarus Goal

2009-11-11 Thread Martin

Brian Prentice wrote:

On Nov 11, 2009, at 6:18 AM, Vincent Snijders wrote:

I don't believe that Lazarus is an example.  
Ah, Why not? (Well you do not need to believe it, or you don't need a 
reason for disbelief). But why is Lazarus not an example? Which part of 
your question does it not fulfil?


You did ask  If so can someone please provide me with the source code 
of a non trivial program which runs on Windows, Linux and OS X (Intel) 


- Lazarus has the source avail
- It is certainly not trivial.
- It runs on all of the named platforms

As for 'write once, compile anywhere'

- Lazarus does allow you to write apps that fall into this category
- Lazarus does not force you do to so. You are fre to write apps that 
run on selected OS only


That is:
- The LCL is aimed works on all platforms. And it does so in most cases.
Some features are still under development. See here: 
http://wiki.lazarus.freepascal.org/Roadmap.
If you find a feature that is supposed to run, but does not, then you 
should report it as a bug.


- Additional Components: Some components are included in Lazarus, many 
others are provided by 3rd parties and can be downloaded.

Included components should be in asimilar state as the LCL
3rd party components are not part of lazarus, no statement about them 
is possible


You should look here for more guides how Lazarus is to be used, if you 
aim for cross platform: 
http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide


Your attached example...
a) I do not have a Mac, but IIRC Mac OS limits paint to inside the paint 
event (Someone can probably confirm this). Which even if an OS does not 
force it, is a good practice.
b) I only had a very very brief glance at your code, but it looks like 
DisplayPaint is called all over the place.


If my Memory on a is right, and my assumption on b is right too, then 
your code is written in a non cross platform way.


'write once, compile anywhere' does in no way mean, that every Windows 
feature (or every use/abuse of features possible in Windows) is 
available on all other platforms.
'write once, compile anywhere'  means that the features provided by the 
LCL, if correctly used are available cross platform (or aimed to be).


Best Regards
Martin


Here is a program that Compiles and runs under Windows XP and compiles 
but does not run under OS X on an Intel Mac.


http://linuxenvy.com/bprentice/Lazarus/LazarusSquareCell.zip



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


Re: [Lazarus] Lazarus Goal

2009-11-12 Thread Martin

dmitry boyarintsev wrote:

2009/11/12 Brian Prentice bprent...@webenet.net:
  

There is one issue which is pertinent to this topic though.
http://linuxenvy.com/bprentice/Lazarus/OSX.jpg
and
http://linuxenvy.com/bprentice/Lazarus/WindowsXP.jpg
show the Selection Control Dialog displayed on each operating system.  I
would be interested in your opinion on the differences.



2. Font size is different for both system.
  
It can even differ within the same OS. Take Windows: users can set 
different dpi for their screen. Any hardcoded Size of any control that 
displays text is very likely to break.

There's no proper aligner developed for the IDE or LCL, to align
controls properly. So the inteface would look like a candy. In my apps
i'm doing this re-aligment manually on the application start.
  
You can get pretty good aligning in many cases by using autosize and 
anchors.


Martin

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


[Lazarus] cross platform [Re: Lazarus Goal]

2009-11-12 Thread Martin

Bee Jay wrote:
'Lazarus and Free Pascal aim to be write once, compile anywhere for 
those
programs which only use the supported operating system features that 
share a

common design'.


And I would've thought that this was obvious. There are just some
things you cannot abstract/emulate.


Exactly. Even those platforms don't have same thought about what is 
common. What Java does is nothing more than standarized the common 
things within its own environment. But, whether it's common to the 
native platform, it's very much questionable. Obviously he can't see 
the obvious.


Well the understanding of cross platform is quite varying. The base 
obviously is that one source code can be executed on all of the 
supported platforms.


On top of this, there are at least 2 different understanding:
1) the application looks/feels like any application on that platform, it 
uses the platforms widgets, and the guidelines for the platform.
This means that the qpplication will look and feel different on every 
platform


2) The application looks and ffels the same on all platforms. It 
completely ignores the guidelines and standards of the platform



1) is what the LCL aims for. It is more enduser friendly, but requires 
more work by the developper
2) is what Java and fpgui (and afaik msegui) aim for. It is easier for 
the developper. But the enduser will find an application that is 
different to any other app he runs on his PC (and therefore harder to use)



Martin


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


Re: [Lazarus] cross platform [Re: Lazarus Goal]

2009-11-12 Thread Martin

Graeme Geldenhuys wrote:

Martin wrote:
  

2) is what Java and fpgui (and afaik msegui) aim for. It is easier
for the developper. But the enduser will find an application that is
 different to any other app he runs on his PC (and therefore harder
to use)



I guess we will have to agree to disagree on the part that it's harder
to use. :-)  Users are not as dumb and inflexible as most developers
make them out to be. End-users can adapt quite easily.

Some quick examples were applications don't follow the look  feel
rules of the platform, yet users have no problems in using them.

* Windows Media Player.
* latest Microsoft Office with it's new menu+toolbar design
* Pixel image editor. It fakes native look. But looking closer at it, it
is quite different to native platforms, yet users don't seem to have any
issue with using it.
* And the biggest one of them all. The INTERNET. Websites and Web
Applications like Gmail, Facebook etc... It adheres to NO single
platform, yet billions of users use the internet every day and don't
have problems using it. If you can read the screen, you can use the
interface.
I happen to know those users you do not name. Example: Learned IE, now 
struggling with firefox.


But the very best (and it is a true story, I happened to witness myself: 
A user who had only learned one (custom, none standard interface) only 
keyboard driven application (which was at his place of work).
This users happened to accidentally touch the mouse, and click the 
desktop. After that the application he used no longer responded to 
keystrokes. He called tech support, reporting his PC had crashed.


Those users exist too.

But of course, user interface is more that just using a specific set of 
widgets. And of course a custom widget set, with a well thought through 
command hierachy, offering the propper commonds at the right time, is a 
hundred times better than using the default widgets, but throwing all 
available commands into one or 2 unsorted menus.


Martin






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


Re: [Lazarus] run-time vs desgin-time packages

2009-11-14 Thread Martin

Mattias Gaertner wrote:

On Sat, 14 Nov 2009 17:27:07 +0200
ik ido...@gmail.com wrote:

  

Hello,

I'm trying to explain desgin-time vs run-time packages, and it seems
that I don't really fully understand them myself.
Desgin time are packages that changes the IDE or adds components
etc... Run-time are used only when compiling the program itself.

That much I understand (I hope). However, I can't install run-time
packages, so how does Lazarus knows about them ?



See
http://wiki.lazarus.freepascal.org/Lazarus_Packages#Design_Time_vs_Run_Time_package
  
This link seems to assume that a package is always either design, or 
runtime or both?


AFAIK: in delphi you can have the same package as onr runtime, and one 
design time package.


That is you have TMyComponent. Instead of having any if csDesigning in 
ComponetFlags you have a designtime package (containing your 
component,with all tghe cdesign code, and maybe prop-editors or the 
like) and you have your runtime package, that has the same component, 
but without csdesign code.


Now yes: the ide only needs to know about the design package, in order 
for you to put the component on your page. = but in this case the IDE 
would add the design time package as package/unit requirements to your 
project. And it should not. It should add the runtime package instead.


Maybe that is something that can be archive with build-modes? While 
compilng the IDE, you use the design-time build mode. While compiling an 
application you use the run-time build-mode. (The packages must have the 
ppu for both build-modes in  it's unit directory).


Martin

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


[Lazarus] fpdoc / something like a general topic, not bound to a method?

2009-11-14 Thread Martin
In FPDoc is it possible to create an extra page, that is not bound to a 
method, property or other code?


Sometimes  several Methods deal with some kind of problem, in order to 
give some background on the issue it would be nice to have a page, where 
you could describe the background. This page would then be linked 
(see-also) in all relevan topics.


At the moment all I found is to stuff this info on a (randomly) selected 
method, and link to that (but then the link in see-also) carries the 
short descripton of that method, which gives no clue about the extra info)


Martin

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


[Lazarus] Last post to fpc list, please / cross posted to lazarus list [Re: [fpc-pascal] Lazarus]

2009-11-15 Thread Martin
Since this is purely lazarus related, I cross post this, and set 
reply-to to lazarus list.


@Rainer: You can read relevant posts in the archive:

http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Rainer Stratmann wrote:

Am Sunday 15 November 2009 20:03:21 schrieb Martin:
  

Interesting. I almost never want to search the entire text (at least not
with the normal search). If I want to search the entire text, I much
prefer find in files (all open units), because it displays the results
in a nice list.

Martin



Why do you want to search 'from cursor'?
The feature 'find in files' is interesting.
I did not use it before.
  

If for example I am at the first relevant instance of an identifier.
e.g a procedure-local variable, and I am at it's declaration. If the 
same word occurs earlier in the text, it is a different variable, 
belonging to a different procedure.


Truth is I use the find dialog very seldom. If I need to search I do a 
incremental search (search as you type) via ctrl-e = it does a better 
highlighting
If I need to do a replace (usually limited to one procedure) I used to 
use the find/replace, but now I use syncro-mode (select block, press 
icon on gutter / or select and ctrl-j)


Of course, not every search is starting from the cursor, but as I said, 
then I use find in files. The find dialog is (if used at all) reserved 
to find the  next occurrence


And if I ever really want to use find, from top of file, I save myself 
the need of changing the option, I use:   ctrl-home  ctrl-f

and I search from cursor

But it all comes down to personal likings. : I did it may way ...

Martin



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


Re: [Lazarus] Multiple installations

2009-11-17 Thread Martin

waldo kitty wrote:

Martin wrote:

And last not least:
- Never mind where you installed Lazarus AND fpc = don't copy or 
move the folder later. All your config has this folder (including a 
file called fpc.cfg, in the fpc directory)
- Try to avoid spaces and special chars in the path to lazarus and 
your project. (There had  been issues, some may be fixed, but I do 
not know)


so in other words, do not try to install Laz/fpc package to Program 
Files or My Programs or such :?

I am not sure if 0.9.28 works with that. It may be fixed, it may not.

0.9.26 doesn't work, and also any projects in your user foled (which 
likely contains spaces) will have issues (even if lazarus is in c:\lazarus\)


IIRC The problem is/was something like winres (a resource compiler, 
which is afaik from the mingw package.) winres does/didn't take spaces well.
This could mean the issue will only be fixed, if it is fixed in the 
mingw project.


Martin

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


[Lazarus] New experimantal beta feature - View same source in multiple Windows

2009-11-18 Thread Martin

Note this is a beta feature. this is experimental.

The little bit that is there works. But many,many, many things have not 
yet been implemented. = So if you decide to test/use it, don't complain 
about the missing bits.


Compiling Lazarus (SVN / Snapshot) with   -dSynDualView  allows you to 
open a 2nd window for any open source file. The 2nd Window can be 
edited, and all edits made in one window, are also done in the other 
window (they edit the same source).


The extra Window(s) are very basic yet: (do NOT report any of those as bug)
- no statusbar
- no contextmenu
- position and size is *not* savable (see below)
- many keyboard shortcuts not working
- no codetools support at all (no code completion, no jumps, no nothing)
- no code templates
- no search / replace / incremental-search / ...
- no copy word on nothing selected
- many others missing
- no session, the IDE does not remember if you had any extra views open

The Window however does:
- show and edit a correctly highlighted version of your code.
- undo works cross both views  (changes made in one window, can be 
undone from the other = this is correct, since the changes happened in 
both windows)

- has it's own caret position
- has it's own selection, which is *not* reset by changes in the other 
window

- has it's own folds (you can fold nodes independent of the other window)
= however neither caret-pos, nor folds, nor anything else is saved in 
your session = it will all be lost when you close the window, or change 
projects

  (text changes are saved (of course))
- drag/drop selected text between windows. works partly, the source 
window starts/keeps scrolling while you are over the target win



Window position/size  / missing statusbar / etc
= All this is not likely to be fixed soon = the idea is to wait what 
happens to IDE docking


Therefore this feature will be beta for a considerable time


Martin

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


Re: [Lazarus] New experimantal beta feature - View same source in multiple Windows

2009-11-19 Thread Martin

Paul Ishenin wrote:

Martin wrote:

Compiling Lazarus (SVN / Snapshot) with   -dSynDualView  allows you 
to open a 2nd window for any open source file. 


I compiled but I don't see the second window. How to activate it?
There is an extra entry in the source-editor pop-up menu, open another 
view (3rd from top)


Martin

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


Re: [Lazarus] New experimantal beta feature - View same source in multiple Windows

2009-11-19 Thread Martin

Hans-Peter Diettrich wrote:

Martin schrieb:
Compiling Lazarus (SVN / Snapshot) with   -dSynDualView  allows you 
to open a 2nd window for any open source file. The 2nd Window can be 
edited, and all edits made in one window, are also done in the other 
window (they edit the same source).

Very nice, have to try out immediately! :-)

I get an error: uemOpenAnotherView not defined, in sourceeditor.pp?

it is in ide\lazarusidestrconsts.pas
Maybe you need to make clean all? (or tick the checkbox)

= All this is not likely to be fixed soon = the idea is to wait 
what happens to IDE docking


Why wait? When we fix the details now, I know what to implement for 
docking.

Well first, it is not wait only.
there are still bit's and pieces in SynEdit to be fixed. And 
sourceEditor/Notebook must be adapted too. So it simply is work in 
progress.


After that, it can be looked into.

See the MasterSite example for my current suggestion:

Every IDE window can become an elastic dock site, with added dock 
panels at the left, right and/or bottom, by calling AddElasticSites(). 
My plan is to make the editor windows such dock sites, but also the 
main bar can be configured in the same way. This is optional eye 
candy, can be replaced by the next option:


All (other) dockable forms are wrapped into floating forms with a 
DockManager, from which they can be docked together or into the 
elastic sites of another window. Empty floating host sites (after 
undocking their client) destroy themselves. Dockable forms are created 
by TDockMaster.CreateDockable, and can be configured further by the 
caller.


Please note that the MakeSite example is not yet finished, emptied 
notebook do not yet disappear - this will be cured in the next update.


It would be nice to have any number of editor windows, creatable on 
demand (your part).
Persistence of the layout has to be defined. All dock sites can be 
enumerated, and can store their coordinates, layouts and content. The 
restauration of an layout is just unclear, with regards to the 
recreation of the docked forms. We'll have to find a solution for 
multi-instance forms, like editor windows, and for re-creating the 
docked forms by their name and instance number, instead of their ID.
persistent layout, was one of the things I thought of, when I said 
waiting.


It has to be seen how good window state/size/pos can be saved with the 
current means (because there can be any amount of edit windows)




My current plan is to use the form name to specify the form type 
(class name) to create, e.g. TMessageWindow for MessageWindow or 
MessageWindow1 (see TDockMaster.CreateDockable). The instance number 
can be removed from the form name for all single-instance forms, to 
distinguish them from true multi-instance forms. This will prevent the 
creation of new instances, when a single-instance form already has 
been created. Every form must know whether it's single or multi 
instance, and change its name accordingly when it's created. 
Multi-instance forms can be connected by their instance number, e.g. 
CodeExplorer2 will reflect the current file in SourceEditor2. The 
layout configuration file will have to be modified, to contain the 
form instance names instead of unique form IDs, with multiple instance 
entries.


The anchor docking and its manager is no more required, and can be 
replaced by the TEasyDockSite and TDockMaster classes. Or the 
TDockMaster methods can be integrated into the existing layout manager.



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


Re: [Lazarus] melp /w TMainMenu

2009-11-27 Thread Martin

Chris Jennings wrote:

Hi All

I am brand new to Lazarus but have experience with Delphi in the 
distant past. I am just trying to acertain if Lazarus will meet my 
needs and am playing with some examples. I have run into a snag that 
is killing me.


I place a TManMenu component on an empty form for a new application 
project. I click on it to bring up the Menu Editor. I change the 
caption to File. I create a sub menu item and change the caption to 
Open. I click on File and go to repeat the process. Nothing happens.

right click the open entry and use insert new item before/after


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


Re: [Lazarus] melp /w TMainMenu

2009-11-27 Thread Martin

Chris Jennings wrote:

Martin wrote:

Chris Jennings wrote:

Hi All

I am brand new to Lazarus but have experience with Delphi in the 
distant past. I am just trying to acertain if Lazarus will meet my 
needs and am playing with some examples. I have run into a snag that 
is killing me.


I place a TManMenu component on an empty form for a new application 
project. I click on it to bring up the Menu Editor. I change the 
caption to File. I create a sub menu item and change the caption 
to Open. I click on File and go to repeat the process. Nothing 
happens.

right click the open entry and use insert new item before/after

That works for menu items hrizontally - I need to add items veticaly 
eg sub items to a top level file menu
That work for subittem (vertical) too, if you right click the first 
created subitem.



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


Re: [Lazarus] Release 1.0, part 2

2009-11-29 Thread Martin

Tom Lisjac wrote:

So what exactly is the Lazarus team afraid of in getting to v1.0?
  

Since we think it's not ready for 1.0.

Period.


...

The problem I see is credibility... or if we write a lot of code with
Lazarus/FPC, will it be maintainable with the project in perpetual
beta?. Delphi was stable from release 2 and code I developed with it
in versions 2, 3, 4 and 5 continued to just work as I upgraded. Not
the case here. I've been writing new code with Lazarus since 2002 and
have learned that anything I write today is virtually guaranteed to be
broken and uncompilable tomorrow because somebody thought it would be
cool to change some aspect of the Object Pascal language or completely
revise a library interface or function. It's become a lot of work to
maintain the stuff I've already written and I'm reluctantly
considering not using Lazarus for any new projects.
  
Then this may be an argument against 1.0. I agree, that in a none beta 
(V1.0) the interface should be stable.

So  if the interface isn't yet stable, if it still needs changes

Besides this, I don't know, if it does need incompatibility changes.

I don't know neither which ones you experienced. Unless you checked on 
the mailing list or attempted to report them, they may or may not have 
been intentional? They could have been bugs introduced by a new feature?


On the other hand, even after reaching V1.0 such things can happen. Like 
in FPC: V2.x and there where changes in FPC, some of them resulted from 
because people exploided a bug (like using properties as var param). Now 
the bug is closed, the feature doesn't exist anymore.


Anyway, if you want to help stabilizing the LCL interface = start a 
thread with examples (unless it has been reasonable explained why a 
change was made). Then it can be established if it was needed. And if 
the cost for people to fix/update their code was to high.



Businesses laugh in our general direction over the code breakage issue
where a project investment using Lazarus/FPC may end up a QA and
maintenance nightmare. This view is shared by many of my colleagues
who can't understand why I'm still using a beta ide on a dinosaur
language from the 80's. How's that for an insult? I agree with
Graeme's posting that this has become a public relations issue... an
obvious one. I'm also starting to see it as a squandered opportunity
  

It may be that a few people will be convinced by a V1.0..

I don't believe the majority will, they will change the wording of the 
argument, but keep it the same. It will then be:
- Lazarus, still about 10 versions behind Delphi (unless we skip a few 
versions and release V11.0)
- Lazarus they released to early, look at all the bugs (people a 
narrow minded in that they will ignore that delphi has bugs too)


And as for Graeme (correct me if I am wrong), who startet the topic in 
the other mail, IIRC it was him who mentioned one major argument for not 
going 1.0 = The debugger and it's usability (which is another thing 
people are going to hold against Lazarus, never mind what the version 
number is).


It is true, that Version numbers today are very often used for marketing.
But that implies that you have a lot ot people, time, and money to go 
into marketing.


That you can advertise, that you can present your products on 
exhibitions, and that you can tell people about all the good. Because 
only if you tell people activly about all the good, only then they may 
stop seeing the bad.


Oh, yes, Of course I would like to see Lazarus being more popular. but I 
don't believe that V1.0 will do a major difference here.


For example: There was a recent mail about some Linux magazine reporting 
about Lazarus. That is the only time I heard it was in the press. What 
about all the other Computer magazines? Many of them have a section 
where they introduce new Hard/Software. Some CAD product released a new 
Version = it gets an article (How many people use CAD?). Lazarus does 
not. Why? Because the company behind that product has people who write a 
release article, and send it to every magazine.
Get that for Lazarus and you may see a major burst in visibility. (like 
in germany their is CT magazine). Give them an article (and hope they 
publish it), announcing the release of Lazarus 0.9.28(.2) and in this 
article point out that Lazarus besides it' version number includes 
features, that delphi only had far later (in V5 or so).


There was another mail about free places for open source on the CEBIT. 
It got lost. Get people who can represent Lazarus, and try getting such 
a place.


Of course, once you actually get Lazarus that much visibility (cebit), 
yes then I will agree: The version number can be used as a marketing 
argument. But now? I don't think so.


My 2 cents (probably a little more than 2 cents)
Martin

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

Re: [Lazarus] Release 1.0, part 2

2009-11-29 Thread Martin

Graeme Geldenhuys wrote:

2009/11/29 Marco van de Voort mar...@stack.nl:
  

The serious users will consider the current restrained version policy as
more serious and see through a cheap spin.



That would be my view as well. Unfortunately we are then in the
minority. Version numbers on Windows etc. and been in popularity for
some time. No v1 release = rubbish software. Unfortunately that's what
they consider fact.
  

But if V1 = rubish, then Lazarus shouldn't go V1 ?

Of course there is an alternative approach. Remove versions (on windows) 
or lower their visibility. Brand the next version of Lazarus as Lazarus 
2010 Edition.


And offer it in different packages:
- 30 days Free Trial
- Gold Edition, 1 User unlimited
- Platinum Edition, Multi user unlimited (if the SVN package/component 
is ready and can be pre-installed)



scnr
Martin

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


Re: [Lazarus] QT bindings as defalt (was Release 1.0, part 2)

2009-12-02 Thread Martin

Graeme Geldenhuys wrote:

Marc Weustink wrote:
  

That process is already started.



I take it you mean cleaning up the code and not backporting to the
original code. In that case, excellent news. ;-)
  

Yes, he means cleaning up.

Some of the IFDEF have been removed already, and the only 
supported/compiling version is the Lazarus version.
The original SynEdit also has code that in LazArus is part of the LCL = 
that is also gradually removed from SynEdit, to use the LCL instead.


Martin

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


Re: [Lazarus] ctrl+j rename possible bug

2009-12-09 Thread Martin

ik wrote:

Hello,

I'm using Lazarus 0.9.29 r23051M FPC 2.5.1 x86_64-linux-gtk 2 (beta) .

I selected a whole procedure and used CTRL+J to rename a local 
variable and it's whole usage in the code like so:


procedure a_test;
var
  SelStart : integer;
begin
  SelStart := Edit1.SelStart;
...
end;

When I renamed SelStart to OldStart, it also renamed the Edit1.SelStart .
The expected result is not to touch the property itself.

Can it be configured somehow, or should I report it as a bug ?

You speak of the new syncro-edit (select block, then ctrl-j)?

Syncro edit does not interprete the text as pascal. Syncro-edit just 
edits all word's that are the same (as does a normal search replace). 
Therefore what you describe is intended behaviour. their is no 
configuration neither.


What you may be looking for is refactoring = rename identifier. You 
find it in the context menu, or you can assign it your own 
key-short-cut.  rename identifier. does not require a selection, since 
it finds the variable/identifier name by it's pascal scope.


Martin


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


Re: [Lazarus] Scrolling source editor in IDE with Ctrl+Up,Down

2009-12-12 Thread Martin

cobines wrote:

Hello,

I'm not sure if this is a bug or not. When I scroll the editor window
in the IDE with mouse wheel or by using scrollbar the cursor stays put
at its position (I have Persistent Cursor set to disabled). But when I
scroll the window with Ctrl+Up, Ctrl+Down the cursor moves when it's
at the top or bottom of the window, i.e., it behaves as if Persistent
Cursor was enabled. Is this how it was intended to work?
  

I have never given much thought to it.
It would be what I expect. Any keyboard action scrolls the cursor into 
view (or keeps it there).


Then again it's a matter of personal taste...

Best Regards
Martin



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