Re: [Lazarus] Bugs in Delphi DragTo?

2009-03-13 Thread Paul Ishenin
Hans-Peter Diettrich wrote:

 Lazarus uses almost the same implementation in TDragPerformer, what IMO 
 should be fixed.

What needs to be fixed? Do you have an example where this does not 
works? DragImageList is not a control, so it is normal that it stops 
dragging when Target = nil.

 Furthermore I wonder whether it makes sense to show both a drag image 
 *and* an docking frame (in the code below the above snippet, when 
 ActiveDrag=dopDock).

DragImageLists is used only for usual drag operations while drag-dock is 
not a usual drag operation. To represent this operation docking frame is 
used and there is no need to mix both representations of drag.

Best regards,
Paul Ishenin.

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


[Lazarus] Trunk cannot compile. Missing unit 'PropEdits'

2009-03-13 Thread Graeme Geldenhuys
I just got an svn update for Lazarus to r18979.  I did a make clean
and build and it fails with the missing unit 'PropEdits' in the
SynPropertyEditObjectList unit.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Trunk cannot compile. Missing unit 'PropEdits'

2009-03-13 Thread dmitry boyarintsev
 I just got an svn update for Lazarus to r18979.  I did a make clean
 and build and it fails with the missing unit 'PropEdits' in the
 SynPropertyEditObjectList unit.
you nead to clean all.
infact, i've had to delete the whole units (compiler units) directory.

Thanks,
Dmitry

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


Re: [Lazarus] Trunk cannot compile. Missing unit 'PropEdits'

2009-03-13 Thread Paul Ishenin
Graeme Geldenhuys wrote:
 I just got an svn update for Lazarus to r18979.  I did a make clean
 and build and it fails with the missing unit 'PropEdits' in the
 SynPropertyEditObjectList unit.

We had some problems before but there were already solved. Try to make 
clean bigide.

Best regards,
Paul Ishenin.

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


Re: [Lazarus] Trunk cannot compile. Missing unit 'PropEdits'

2009-03-13 Thread Graeme Geldenhuys
On Fri, Mar 13, 2009 at 10:19 AM, dmitry boyarintsev
skalogryz.li...@gmail.com wrote:
 I just got an svn update for Lazarus to r18979.  I did a make clean
 and build and it fails with the missing unit 'PropEdits' in the
 SynPropertyEditObjectList unit.
 you nead to clean all.
 infact, i've had to delete the whole units (compiler units) directory.


I found the solution. It was explained in a message some time back
entitled 'SVN followers. incompatible changes'. after I did a
'make bigide', I could recompile the IDE from the Tools menu and
select GTK1 without problems.


Regards,
  - Graeme -


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

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


[Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Graeme Geldenhuys
Hi,

This relates to the new bug report:
  http://bugs.freepascal.org/view.php?id=13322

Code Folding seems to have gone way overboard!  It simply makes the
editor look like a mess at the moment (Lazarus svn trunk revision).
What is the end goal of code folding? Maybe is in the middle of the
overall goal and I am simply acting to quickly. Either way, I will
voice my concerns...

In older versions of Lazarus the Code Folding [+] was in logical
places. begin..end blocks.   Now they appear on Implementation
sections, uses classes, procedure/function level, begin..end block of
procedure/function, begin..end block of if statements, var blocks
etc...  You end up with code looking as follows (code folding plusses
everywhere)!

==
[+]implementation
[+]uses
  MyUnit1;

[+]procedure MyTest
[+]var
 x: integer;
[+]begin
[+]  if x  0 then begin
bla bla bal
  end;
end;
==

I would much rather prefer a more sanely and less verbose code folding
that does the following:

==
implementation
uses
   myUnit1;

[+]procedure MyTest
   var
 x: integer;
   begin
 if x  0 then begin
bla bla bal
  end;
end;
==



At the moment it is more like trying to spot a line of code that
doesn't have a [+] in the gutter!!  This is just causing clutter and
not actually adding any value as far as I can see. Especially now that
the code folding lines and +/- signs are inside the editor code area
and not the gutter area. OK, so we all know synedit now supports code
folding, but we don't need it on every line.  Maybe Lazarus should
have a Code Folding verbosity level going from 'Normal Code Folding'
to 'Insane Code Folding'.

This brings me to another point. Initially the Code Folding was not as
verbose, so I tied the Draw Code Divider feature into the Code
Folding feature. But now that Code Folding is so verbose it now makes
no more sense and seems to get broken quite often.  Maybe the draw
code divider should become a separate feature and not tied into the
code folding. The idea of draw code divider was simply to draw a
horizontal line at the end of each procedure or method (like visual
basic 6 did). I have no interest in drawing horizontal divider lines
wherever code folding can occur. And with the current verbose level of
code folding and horizontal lines (if they work) you will actually
struggle to see your code between the whole mess.

Your thoughts?


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TProcess 2-way conversation

2009-03-13 Thread Dave Coventry
Hi,

I'm writing a quick an dirty app to automate some commands which would
normally be issued by a terminal something like PuTTy.

To do this I'm using TProcess to call plink.exe and then trying to ssh
into the remote box and issue commands.

In short I want to log into the remote box and execute commands 'cd
/opt/someappdir' and './someapp', taking the input through one memo
and using another memo to issue the commands.

Can anyone point me in the right direction? I can open the terminal:

  PLink.CommandLine := 'plink.exe -ssh -pw
'+options.Values['Password']+' -batch
'+options.Values['User']+'@'+options.Values['Server'];
but sending subsequent calls fail:
  PLink.CommandLine := 'cd /opt/someappdir/ta';

Error message: 'Failed to execute cd /opt/someappdir/ta'

If I omit the subsequent calls it works roughly as expected:


  Plink.Options := [poUsePipes];
  Memo1.Append('-- executing --');
  Screen.Cursor:=crHourGlass;
  PLink.Execute;
  M.SetSize(BytesRead + READ_BYTES);
  n := PLink.Output.Read((M.Memory + BytesRead)^, READ_BYTES);
  if n  0
  then begin
S.LoadFromStream(M);
Memo1.Append(S.Text)
  end;
  S.Free;
  M.Free;

and I get the following in memo1:

-- executing --
Last login: Fri Mar 13 02:49:21 2009 from 192.168.37.43

Y?J??9?a?f??/F?#2۶?/??Y.KDPx?R?`?8?\.ow?z%

Can anybody suggest something here? Or point me in a better direction.

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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Martin Friebe
Graeme Geldenhuys wrote:
 Hi,

 This relates to the new bug report:
   http://bugs.freepascal.org/view.php?id=13322

 Code Folding seems to have gone way overboard!  It simply makes the
 editor look like a mess at the moment (Lazarus svn trunk revision).
 What is the end goal of code folding? Maybe is in the middle of the
 overall goal and I am simply acting to quickly. Either way, I will
 voice my concerns...
   
There is a general plan/idea to add some configuration (have to see how 
much) to define what you want to have foldable and what not. It wasn't 
seen as urgent yet (at least not by me...)

Most (if not all) of the places that allow folding now, do so in Delphi 
as well. this is part of why they have been added, to make it easier for 
(ex-) Delphi users.

IMHO most of the new ones are reasonable?
- Except maybe for: Program / Unit and Implementation / 
interface; but they don't occur very often in a normal unit.
- Maybe discussable are var Canost type blocks? Think is they can 
be very useful for bigger var sections (but I agree they can be 
irritating with just on line in it)
- Folding at class / private / public = IMHO should be ok?
- Folding at procedure in addition to the begin = arguable, if it 
should be instead of the begin?

Will be interested to see, if other people will voice opinions, which of 
the new foldings they like, which not

 In older versions of Lazarus the Code Folding [+] was in logical
 places. begin..end blocks.   Now they appear on Implementation
 sections, uses classes, procedure/function level, begin..end block of
 procedure/function, begin..end block of if statements, var blocks
 etc...  You end up with code looking as follows (code folding plusses
 everywhere)!
   
.
 At the moment it is more like trying to spot a line of code that
 doesn't have a [+] in the gutter!!  This is just causing clutter and
 not actually adding any value as far as I can see. Especially now that
 the code folding lines and +/- signs are inside the editor code area
 and not the gutter area. OK, so we all know synedit now supports code
   
You can change this:
The gutter divider line is moveable, and the code fold background color 
adjustable.
Only the code-folding is now on the right side  of the gutter (towards 
the text) rather than the left, as it used to be.

Enviroment=options=editor=display= gutter separator index
Enviroment=options=editor=color= code folding tree (3rd in box)

 folding, but we don't need it on every line.  Maybe Lazarus should
 have a Code Folding verbosity level going from 'Normal Code Folding'
 to 'Insane Code Folding'.

 This brings me to another point. Initially the Code Folding was not as
 verbose, so I tied the Draw Code Divider feature into the Code
 Folding feature. But now that Code Folding is so verbose it now makes
 no more sense and seems to get broken quite often.  Maybe the draw
 code divider should become a separate feature and not tied into the
 code folding. The idea of draw code divider was simply to draw a
 horizontal line at the end of each procedure or method (like visual
 basic 6 did). I have no interest in drawing horizontal divider lines
 wherever code folding can occur. And with the current verbose level of
 code folding and horizontal lines (if they work) you will actually
 struggle to see your code between the whole mess.
   
That can be looked at / I can see the benefit of such a feature.

Not sure where it gets broken? Are the pictures from different versions 
of lazarus? or are they with different settings?

If you want then at begin/end level you need to set the divider draw 
level higher = the down side is, there will be additional dividers.
This may not be the effect you desire, but it is the effect intended.

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


Re: [Lazarus] TProcess 2-way conversation

2009-03-13 Thread Burkhard Carstens
Am Freitag, 13. März 2009 12:23 schrieb Dave Coventry:
 Hi,

 I'm writing a quick an dirty app to automate some commands which
 would normally be issued by a terminal something like PuTTy.

 To do this I'm using TProcess to call plink.exe and then trying to
 ssh into the remote box and issue commands.

 In short I want to log into the remote box and execute commands 'cd
 /opt/someappdir' and './someapp', taking the input through one memo
 and using another memo to issue the commands.

 Can anyone point me in the right direction? I can open the terminal:

   PLink.CommandLine := 'plink.exe -ssh -pw
 '+options.Values['Password']+' -batch
 '+options.Values['User']+'@'+options.Values['Server'];
 but sending subsequent calls fail:
   PLink.CommandLine := 'cd /opt/someappdir/ta';

 Error message: 'Failed to execute cd /opt/someappdir/ta'

Your process is plink.exe. any further communication should go through 
plink.input and plink.output, e.g. (not tested):
...
plink.execute;
{ read welcome message from plink.output }
remoteCommand:='cd /opt/someappdir/ta'#10;
plink.input.write(remoteCommand[1],length(remoteCommand));
{ read (echo and?) result of previous command}

regards
 Burkhard


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


Re: [Lazarus] TProcess 2-way conversation

2009-03-13 Thread Vincent Snijders
Dave Coventry schreef:
 Hi,
 
 I'm writing a quick an dirty app to automate some commands which would
 normally be issued by a terminal something like PuTTy.
 
 To do this I'm using TProcess to call plink.exe and then trying to ssh
 into the remote box and issue commands.
 
 In short I want to log into the remote box and execute commands 'cd
 /opt/someappdir' and './someapp', taking the input through one memo
 and using another memo to issue the commands.
 
 Can anyone point me in the right direction? I can open the terminal:

See the process example:

http://wiki.lazarus.freepascal.org/Executing_External_Programs#Using_input_and_output_of_a_TProcess
and
https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/examples/process/

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


Re: [Lazarus] Compiling for both GTK1 and GTK2 in Lazarus built from SVN

2009-03-13 Thread Bart
On 3/11/09, Vincent Snijders vsnijd...@vodafonevast.nl wrote:
 b...@simenon:~/svnroot/lazarus make lcl LCL_PLATFORM=gtk1

 make lcl LCL_PLATFORM=gtk

Aargh
I'm feeling rather stupid now...

Thanks,

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


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-13 Thread Bart

 You included clocale unit in your .dpr (UNIX targets only) ?
  DecimalSeparator at programstart: '.' (period) = DEFAULT , that means that
  clocale unit is missing.

I was under the impression that the value of SysUtils.DecimalSeparator
was determined/set at programstart using locale settings?
(At least in Windows it seems to be)
Are they hardcoded in Linux version of SysUtils?

I'll try inclusing clocale unit and see what it does.
Do I have to call some proc/function to make it set the value of
DecimalSeparator?

  DecimalSeparator visible in control: ',' (comma) = that means that gtk
  controls uses libc (right) locales, setted up by LANG variable.
And GTK1 differs form GTK2 with same locale setting?

What LANG variable should I look for?
(I'm not sure but I think I only saw one: it's value being nl_NL or
something the like)

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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Graeme Geldenhuys
On Fri, Mar 13, 2009 at 2:16 PM, Martin Friebe laza...@mfriebe.de wrote:
 What is the end goal of code folding? Maybe is in the middle of the
 overall goal and I am simply acting to quickly. Either way, I will
 voice my concerns...

 There is a general plan/idea to add some configuration (have to see how
 much) to define what you want to have foldable and what not. It wasn't
 seen as urgent yet (at least not by me...)

OK thanks. So configuration is in the pipeline - that is good to know. :)


 Most (if not all) of the places that allow folding now, do so in Delphi
 as well. this is part of why they have been added, to make it easier for
 (ex-) Delphi users.

I did not know that. I last used Delphi 7 which had no code folding.
I've only seen code folding in other editors and they were not that
verbose as the current synedit in Lazarus. This is why I thought I
would mention it.


 IMHO most of the new ones are reasonable?
 - Except maybe for: Program / Unit and Implementation /
 interface; but they don't occur very often in a normal unit.

I don't see the point of 'Program' or 'Unit' level. Many the others
could be useful.

 - Folding at procedure in addition to the begin = arguable, if it
 should be instead of the begin?

I'm not sure about this one either. I would have thought the first
'begin' after a procedure or function should be ok.


 At the moment it is more like trying to spot a line of code that
 doesn't have a [+] in the gutter!!  This is just causing clutter and
 not actually adding any value as far as I can see. Especially now that
 the code folding lines and +/- signs are inside the editor code area
 and not the gutter area. OK, so we all know synedit now supports code

 You can change this:
 The gutter divider line is moveable, and the code fold background color
 adjustable.

I know the gutter divider line is movable, but I didn't know the
background color is adjustable. I'll give this another try. See the
original bug report for my editor colour scheme - it's not quite
standard colours which probably exaggerated the problem a bit. ;-)

 Enviroment=options=editor=color= code folding tree (3rd in box)

Thanks, this makes code folding look a lot better already. My gutter
is a different colour to the editor background. Now the code folding
tree blends in much better with the gutter part.

 code folding. The idea of draw code divider was simply to draw a
 horizontal line at the end of each procedure or method (like visual
 basic 6 did). I have no interest in drawing horizontal divider lines
 wherever code folding can occur. And with the current verbose level of

 That can be looked at / I can see the benefit of such a feature.

Before horizontal line drawing between procedures / functions, I have
seen programmers add spaces to separate methods. Or use comments as
dividers. eg: {---}

Those are all waisted efforts and get in the way of coding and
programs such as 'pasdoc'. The visual effect of synedit drawing the
line (without anything actually being in the source code) is brilliant
and gives a much better look!

I think it will be worth having as a separate feature to code folding.
And at the moment I can only see it being useful between procedures,
functions and methods. I would ignore nested methods for now - it can
be added at a later date if the need arises.


 Not sure where it gets broken? Are the pictures from different versions
 of lazarus? or are they with different settings?

Nope, the screenshots in the bug report is all taken using the same
project, settings and Lazarus version. I simply switched tabs and took
screenshots.

 If you want then at begin/end level you need to set the divider draw
 level higher = the down side is, there will be additional dividers.
 This may not be the effect you desire, but it is the effect intended.

I think my original idea or method dividers got lost somewhere. :-)  I
only indented the feature to have dividers between procedures,
functions and methods. No nested methods and no other code folding
areas.


Regards,
  - Graeme -


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

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


Re: [Lazarus] Compiling for both GTK1 and GTK2 in Lazarus built from SVN

2009-03-13 Thread Graeme Geldenhuys
On Fri, Mar 13, 2009 at 3:18 PM, Bart bartjun...@gmail.com wrote:
 On 3/11/09, Vincent Snijders vsnijd...@vodafonevast.nl wrote:
 b...@simenon:~/svnroot/lazarus make lcl LCL_PLATFORM=gtk1

 make lcl LCL_PLATFORM=gtk


Maybe I missed it, but is this information in any of the readme files?
 I looked in lazdir/readme and lazdir/docs/ and couldn't find this
information. It it's not mentioned anywhere, maybe we should add it.

I found information about 'bigide', 'idebig' etc., but nothing about
LCL_PLATFORM or the available options...


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Martin Friebe


Graeme Geldenhuys wrote:
 code folding. The idea of draw code divider was simply to draw a
 horizontal line at the end of each procedure or method (like visual
 basic 6 did). I have no interest in drawing horizontal divider lines
 wherever code folding can occur. And with the current verbose level of
   
 That can be looked at / I can see the benefit of such a feature.
 

 Before horizontal line drawing between procedures / functions, I have
 seen programmers add spaces to separate methods. Or use comments as
 dividers. eg: {---}

 Those are all waisted efforts and get in the way of coding and
 programs such as 'pasdoc'. The visual effect of synedit drawing the
 line (without anything actually being in the source code) is brilliant
 and gives a much better look!

 I think it will be worth having as a separate feature to code folding.
 And at the moment I can only see it being useful between procedures,
 functions and methods. I would ignore nested methods for now - it can
 be added at a later date if the need arises.
   
If you set the draw level to 3 or maybe 4, you should get the correct 
divider draw levels.
You will have to ignore the dividers drawn at the end of implementation 
sections

 Not sure where it gets broken? Are the pictures from different versions
 of lazarus? or are they with different settings?
 

 Nope, the screenshots in the bug report is all taken using the same
 project, settings and Lazarus version. I simply switched tabs and took
 screenshots.
   
so they are all with
Settings:
  Code Folding: Enabled
  Divider Draw Level: 1

?

In that case the first picture is wrong = with DDL=1 there should be no 
line between procedures (it would be at the end of the unit level.)
Not sure if complete:
DDL 1: unit level
DDL 2: implementation/ interface
DDL 3: Procedure implementation / class declaration



since you only switched tabs = did you aybe change config in your 
session? maybe the issue was that the config change was not set to all 
editors?


   
 If you want then at begin/end level you need to set the divider draw
 level higher = the down side is, there will be additional dividers.
 This may not be the effect you desire, but it is the effect intended.
 

 I think my original idea or method dividers got lost somewhere. :-)  I
 only indented the feature to have dividers between procedures,
 functions and methods. No nested methods and no other code folding
 areas.
   
try level 3.


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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Graeme Geldenhuys
On Fri, Mar 13, 2009 at 4:10 PM, Martin Friebe laza...@mfriebe.de wrote:

 so they are all with
 Settings:
  Code Folding: Enabled
  Divider Draw Level: 1
 
 ?

Yes


 In that case the first picture is wrong = with DDL=1 there should be no
 line between procedures (it would be at the end of the unit level.)
 Not sure if complete:
 DDL 1: unit level
 DDL 2: implementation/ interface
 DDL 3: Procedure implementation / class declaration

ah, nice to actually know what each level means. :-) Maybe that should
be place in the options screen instead of just numbers.


 since you only switched tabs = did you aybe change config in your
 session? maybe the issue was that the config change was not set to all
 editors?

That seems to be the partial cause. Setting the level to 3 gives the
most desirable outcome I wanted. But only after I restarted Lazarus,
did all the editors update. So there is one bug - not all editors get
updated.

I then played with the levels to see how they differ. After changing
the level, i did a Lazarus restart. It seems at Level = 2, I again get
the same behaviour as the bug report. Even with a restart. So that
seems to be another bug.


 try level 3.

Yes, that gives the best results for me.


Regards,
  - Graeme -


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

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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Stephano
Martin Friebe wrote:
 There is a general plan/idea to add some configuration (have to see how 
 much) to define what you want to have foldable and what not. It wasn't 
 seen as urgent yet (at least not by me...)
 
 Most (if not all) of the places that allow folding now, do so in Delphi 
 as well. this is part of why they have been added, to make it easier for 
 (ex-) Delphi users.
Is it possible have folding or more specifically identification for 
case/end pairs?
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFloatSpinEdit and DecimalSeparator (GTK)

2009-03-13 Thread zeljko
On Friday 13 March 2009 14:27, Bart wrote:
  You included clocale unit in your .dpr (UNIX targets only) ?
   DecimalSeparator at programstart: '.' (period) = DEFAULT , that means
  that clocale unit is missing.

 I was under the impression that the value of SysUtils.DecimalSeparator
 was determined/set at programstart using locale settings?
 (At least in Windows it seems to be)
 Are they hardcoded in Linux version of SysUtils?

Under windows SysUtils have correct locales, but under unix (linux  mac) it's 
a mess, so that's the reason of clocale unit usage.
With clocale included you'll get correct locales.


 I'll try inclusing clocale unit and see what it does.
 Do I have to call some proc/function to make it set the value of
 DecimalSeparator?

No, but you can always say DecimalSeparator := ',';


   DecimalSeparator visible in control: ',' (comma) = that means that gtk
   controls uses libc (right) locales, setted up by LANG variable.

 And GTK1 differs form GTK2 with same locale setting?

 What LANG variable should I look for?
 (I'm not sure but I think I only saw one: it's value being nl_NL or
 something the like)

if LANG=nl_NL then glibc (under linux) reads it's locale settings for nl_NL 
eg.
DecimalSeparator := ',';
ThousandSeparator := ' ';
DateSeparator := '.';
ShortDateFormat := 'something'
if LANG=en_US then DateSeparator := '/'  etc ...etc ...

SysUtils are not multiplatform in that case, so you have to use clocale 
unit.

zeljko



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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Alexander Klenin
On Fri, Mar 13, 2009 at 22:16, Martin Friebe laza...@mfriebe.de wrote:
 There is a general plan/idea to add some configuration (have to see how
 much) to define what you want to have foldable and what not. It wasn't
 seen as urgent yet (at least not by me...)

 Most (if not all) of the places that allow folding now, do so in Delphi
 as well. this is part of why they have been added, to make it easier for
 (ex-) Delphi users.

Actually, at least in Delphi 2007 code folding works only down to
classes and procedures, not below. Still, I think it is a good feature.

 IMHO most of the new ones are reasonable?
 - Except maybe for: Program / Unit and Implementation /
 interface; but they don't occur very often in a normal unit.
 - Maybe discussable are var Canost type blocks? Think is they can
 be very useful for bigger var sections (but I agree they can be
 irritating with just on line in it)
 - Folding at class / private / public = IMHO should be ok?
 - Folding at procedure in addition to the begin = arguable, if it
 should be instead of the begin?

I'd say that such deep nesting should have very detailed configuration.
I suggest to replace current numeric setting with a grid of checkboxes
controlling code folding and divider drawing separately at logical levels:

Level | Folding | Divider
Unit/Program | Off | Off
Section (interface/implementation/...) | On | Off
Class/Object/Record Type Definition | On | On
Class Visibility Specifier (public/private/...) | Off | Off
Other Type Definition | On | Off
Uses statement | On | Off
Global var/property/const | On | On
Procedure/Function/Method implementation | On | On
Nested Procedure/Function | On | Off
Local var/const | Off | Off
Begin/end blocks | Off | Off

Additionally, maybe for begin/end blocks a separate setting to turn folding on
for blocks longer that N lines.
The settings I above are my preferences, and I hope also reasonable defaults.


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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Martin Friebe
Graeme Geldenhuys wrote:
 In that case the first picture is wrong = with DDL=1 there should be no
 line between procedures (it would be at the end of the unit level.)
 Not sure if complete:
 DDL 1: unit level
 DDL 2: implementation/ interface
 DDL 3: Procedure implementation / class declaration
 

 ah, nice to actually know what each level means. :-) Maybe that should
 be place in the options screen instead of just numbers.
   
In a program it differs from a unit, because you do not have the 
implementation/interface section.
Include files may differ again.

Those differences were always present, even with the older folding. The 
level only represents how many nested folds you have

Unit: is the top level fold; not nested
implementation/ interface: is nested in the unit fold
procedures are nested into the implantation fold
..

 since you only switched tabs = did you aybe change config in your
 session? maybe the issue was that the config change was not set to all
 editors?
 

 That seems to be the partial cause. Setting the level to 3 gives the
 most desirable outcome I wanted. But only after I restarted Lazarus,
 did all the editors update. So there is one bug - not all editors get
 updated.
   
Ok, I will check this part: proper propagation of config changes, with 
regards to divider fold level

 I then played with the levels to see how they differ. After changing
 the level, i did a Lazarus restart. It seems at Level = 2, I again get
 the same behaviour as the bug report. Even with a restart. So that
 seems to be another bug.
   
Are all 3 files units? with unit keyword at the start, and 
implementation/interface sections
if you have an include file, with no unit, no interface / 
implementation = then procedure is the top level fold (divider 
level = 1)

I will need some feedback to reproduce this.

Or if the behaviour is due to differences in the nesting structure, then 
the bug breaks down into:
- propagation (see above)
- restore the old behaviour that procedure divider lines, can be drawn 
independent of the fold-nest level.
  (they used to be top level, which is why they used to be content 
independent = that has changed)


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


[Lazarus] Stringgrid woes...

2009-03-13 Thread Michael Van Canneyt

Hello,

The stringgrid editor does the following:

procedure TStringCellEditor.Change;
begin
  inherited Change;
  if FGridnil then begin
FGrid.SetEditText(FCol, FRow, Text);
  end;
end;

procedure TStringCellEditor.EditingDone;
begin
  inherited EditingDone;
  if FGridnil then
FGrid.EditingDone;
end;

This makes it completely impossible to do any checking of the entered
values, because the SetEditText() event has no way of knowing when the
editing ends. In my opinion, the SetEditText() should only be called
when the editing is done, i.e. it should be like this:

procedure TStringCellEditor.Change;
begin
  inherited Change;
end;

procedure TStringCellEditor.EditingDone;
begin
  inherited EditingDone;
  if FGridnil then
begin
FGrid.SetEditText(FCol, FRow, Text);
FGrid.EditingDone;
end;
end;

Imagine a stringgrid where you want to allow only real numbers in a
cell. In that case you normally do 2 things:
- Only allow numerals and  decimal points in the OnKeyPress event
- Only save the edit text when a valid number is entered, and give 
  an error message if it is not valid.

With the current situation, this is simply impossible, because of the
following:
1. User types 1 - Settext receives 1 - all is well.
2. User types . - settext received 1. - error, because 1. is not a valid 
number.

In other words, there is no way of knowing when you have received the final
text that the user has entered. 

Is there a reason for the current behaviour, and can it be changed ?

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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Martin Friebe
Stephano wrote:
 Martin Friebe wrote:
   
 There is a general plan/idea to add some configuration (have to see how 
 much) to define what you want to have foldable and what not. It wasn't 
 seen as urgent yet (at least not by me...)

 Most (if not all) of the places that allow folding now, do so in Delphi 
 as well. this is part of why they have been added, to make it easier for 
 (ex-) Delphi users.
 
 Is it possible have folding or more specifically identification for 
 case/end pairs?
   
Not yet.
this will at earliest be implemented, when individual folds can be 
configured. The same applies for repeat/until
It may also have to wait fro some more/other refactoring on the folding.

The highlighting currently depends on the detection for folding.

So it will be a while till that is done.

The problem is that there are already units, that take more than one 
second to parse, and that can behave sluggish if you insert words like 
begin. So implementing this must be done with care.
If you have an idea how to patch this, please feel free to discuss.

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


Re: [Lazarus] TProcess 2-way conversation

2009-03-13 Thread Dave Coventry
Thanks guys!

Actually, as I sent it off I thought This isn't the best way of doing
this and I thought I might get either a dignified lack of response or
howls of derision!

But I'm having great difficulty in stalling any of the Internet
suites: lNet doesn't install because of a missing __front_type__
identifier ( http://forum.lazarus.freepascal.org/index.php/topic,6126.0.html
), Indy installs but it can't find the 'uses' code.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Michael Van Canneyt wrote:

 ...
 Is there a reason for the current behaviour, and can it be changed ?
 
With Delphi, I used to check the grid.EditorMode property in 
OnSetEditText handler, and skip all validations when EditorMode=true.
Didn't check this with LCL, but there's a good chance it works.

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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Alexander Klenin
On Sat, Mar 14, 2009 at 02:03, Martin Friebe laza...@mfriebe.de wrote:
 Not yet.
 this will at earliest be implemented, when individual folds can be
 configured. The same applies for repeat/until
 It may also have to wait fro some more/other refactoring on the folding.
 The highlighting currently depends on the detection for folding.

I thought about it too when I composed the list in the previous message,
but considered them overkill. If single-statement folds, like for
'case', 'with', 'if' etc.
will be implemented, they should be able to merge with begin/end folds for
their bodies, to avoid useless almost-duplicate folds.

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Michael Van Canneyt


On Fri, 13 Mar 2009, Sergei Gorelkin wrote:

 Michael Van Canneyt wrote:
 
  ...
  Is there a reason for the current behaviour, and can it be changed ?
  
 With Delphi, I used to check the grid.EditorMode property in 
 OnSetEditText handler, and skip all validations when EditorMode=true.
 Didn't check this with LCL, but there's a good chance it works.

It doesn't, because Editormode is alwaus true in the OnSetEditText handler.
I tested that. Also, during testing I discovered that setting 
  EditorMode:=False;
doesn't save the value, while IMHO it should.

Apart from any workarounds around supposed bugs, calling SetText on each 
keystroke is IMHO also simply very inefficient (not to mention unnecessary)

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Jesus Reyes




--- El vie 13-mar-09, Michael Van Canneyt michael.vancann...@wisa.be escribió:

 De:: Michael Van Canneyt michael.vancann...@wisa.be
 Asunto: [Lazarus] Stringgrid woes...
 A: Lazarus mailing list lazarus@lazarus.freepascal.org
 Fecha: viernes, 13 marzo, 2009, 10:03 am
 Hello,

[...]

 
 This makes it completely impossible to do any checking of
 the entered
 values, because the SetEditText() event has no way of
 knowing when the
 editing ends. In my opinion, the SetEditText() should only
 be called
 when the editing is done, i.e. it should be like this:
 
 procedure TStringCellEditor.Change;
 begin
   inherited Change;
 end;
 
 procedure TStringCellEditor.EditingDone;
 begin
   inherited EditingDone;
   if FGridnil then
 begin
 FGrid.SetEditText(FCol, FRow, Text);
 FGrid.EditingDone;
 end;
 end;

This suggest that there should not be distinction between grid's OnSetEditText 
and OnEditingDone so why do we need both?.

 
 Imagine a stringgrid where you want to allow only real
 numbers in a
 cell. In that case you normally do 2 things:
 - Only allow numerals and  decimal points in the OnKeyPress
 event
 - Only save the edit text when a valid number is entered,
 and give 
   an error message if it is not valid.
 
 With the current situation, this is simply impossible,
 because of the
 following:
 1. User types 1 - Settext receives 1 - all is well.
 2. User types . - settext received 1. - error,
 because 1. is not a valid number.
 
 In other words, there is no way of knowing when you have
 received the final
 text that the user has entered. 
 
 Is there a reason for the current behaviour, and can it be
 changed ?

The grid behaves that way for the same reason there is a TEdit.OnChange event, 
I'm afraid there is no way to know that final text has been entered using this 
event.

Is this different on Delphi? I would like to improve compatibility if it's not. 
If OnSetEditText is enough in Delphi to know when editing is finished then I 
think we should do it also.

Currently the assumed way to know when the final text is entered is using 
OnEditingDone no OnSetEditText, maybe this is not working but I was aware that 
OnEditingDone was triggered for several causes not necesarily only when user 
ended editing, for this reason I usually do following on OnEditingDone of grid 
cells that need validation.

  if grid.Modified then begin
[Do validation on col,row cell. Revert changes if not validated, etc]
grid.Modified := false;
  end;

this works only on StringGrid actually.

 
 Michael.


__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Jesus Reyes wrote:
 
 Is this different on Delphi? I would like to improve compatibility if it's 
 not. If OnSetEditText is enough in Delphi to know when editing is finished 
 then I think we should do it also.
 
It appears to be different then. In Delphi, OnSetEditText is called 
multiple times during editing (with grid.EditorMode=True), and when the 
editing is complete, it is called once with grid.EditorMode=False.

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


Re: [Lazarus] Inconsistent behavior of LabeledEdit boxes on different pages of a TabbedNotebook

2009-03-13 Thread cobalt747
Здравствуйте, david.

In WinXP SP3 all right,

except that color of edit changed, when Object Inspector lose focus.

Вы писали 9 марта 2009 г., 19:12:05:
 Ok, the project is attached as test1.zip.  If you need anything else,
 just let me know.
 Help is much appreciated!

 david
-- 
С уважением,
 Cobalt747  mailto:cobalt...@mail.ru


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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Michael Van Canneyt


On Fri, 13 Mar 2009, Jesus Reyes wrote:

  This makes it completely impossible to do any checking of
  the entered
  values, because the SetEditText() event has no way of
  knowing when the
  editing ends. In my opinion, the SetEditText() should only
  be called
  when the editing is done, i.e. it should be like this:
  
  procedure TStringCellEditor.Change;
  begin
inherited Change;
  end;
  
  procedure TStringCellEditor.EditingDone;
  begin
inherited EditingDone;
if FGridnil then
  begin
  FGrid.SetEditText(FCol, FRow, Text);
  FGrid.EditingDone;
  end;
  end;
 
 This suggest that there should not be distinction between grid's 
 OnSetEditText and OnEditingDone so why do we need both?.
 
  
  Imagine a stringgrid where you want to allow only real
  numbers in a
  cell. In that case you normally do 2 things:
  - Only allow numerals and  decimal points in the OnKeyPress
  event
  - Only save the edit text when a valid number is entered,
  and give 
an error message if it is not valid.
  
  With the current situation, this is simply impossible,
  because of the
  following:
  1. User types 1 - Settext receives 1 - all is well.
  2. User types . - settext received 1. - error,
  because 1. is not a valid number.
  
  In other words, there is no way of knowing when you have
  received the final
  text that the user has entered. 
  
  Is there a reason for the current behaviour, and can it be
  changed ?
 
 The grid behaves that way for the same reason there is a TEdit.OnChange 
 event, 
 I'm afraid there is no way to know that final text has been entered using 
 this event.
 
 Is this different on Delphi? I would like to improve compatibility if it's 
 not. 
 If OnSetEditText is enough in Delphi to know when editing is finished then I 
 think we should do it also.

Hm. 
Did some checking in delphi. It behaves the same. So better leave it as it is.
Bad :(

Oh well, now I know again why I don't want to use grids for editing. 
But customers disagree, unfortunately :(

 Currently the assumed way to know when the final text is entered is using 
 OnEditingDone no OnSetEditText, 
 maybe this is not working but I was aware that OnEditingDone was triggered 
 for several causes not necesarily 
 only when user ended editing, for this reason I usually do following on 
 OnEditingDone of grid cells that need 
 validation.
 
   if grid.Modified then begin
 [Do validation on col,row cell. Revert changes if not validated, etc]
 grid.Modified := false;
   end;

The problem is that the actual data is not in the grid cells, so reverting it 
would not be that easy.
Is there a way to force the grid to save the data ? That would help, actually...

In Delphi, Setting 

  EditorMode:=False;

Saves the data (setedittext is called again). In Lazarus, it is not called. 

I think it would also be a good idea to have an event which helps to validate 
the data.

Something like

Procedure TForm1.ValidateEntry(Sender : TObject; ACol,ARow : Integer; Var Value 
: String);

begin
  // Do some things, possibly modify Value or raise exception.
end;

Which is called only once, when the data is saved finally. 
Currently, it's hard to do proper validation in a grid. Well, in my opinion of 
course...

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Michael Van Canneyt


On Fri, 13 Mar 2009, Sergei Gorelkin wrote:

 Jesus Reyes wrote:
  
  Is this different on Delphi? I would like to improve compatibility if it's 
  not. If OnSetEditText is enough in Delphi to know when editing is finished 
  then I think we should do it also.
  
 It appears to be different then. In Delphi, OnSetEditText is called 
 multiple times during editing (with grid.EditorMode=True), and when the 
 editing is complete, it is called once with grid.EditorMode=False.

Not in delphi 7, I tested ?

However, it is called when you set EditorMode explicitly to false. 
But never by itself.

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


Re: [Lazarus] Placing a TProgressBar into a TStatusBar

2009-03-13 Thread cobalt747
Здравствуйте, Andrea.

Try this:

procedure TForm1.FormCreate(Sender: TObject);
var
   ProgressBar1: TProgressBar;
begin
 ProgressBar1:= TProgressBar.Create(StatusBar1);
 with ProgressBar1 do
 begin
   Parent := StatusBar1;
   Left := 50;
   Visible:= true;
   Height:=15;
   Width:=50;
   Max:=100;
   Position:=20;
 end;
end;

Вы писали 10 марта 2009 г., 19:01:27:

 Dear all,
 anyone can suggest me a way in order to place a TProgressBar into a 
 TStatusBar?
 I found some tutorials but they are just for Delphi and Win.
 Thanks,
 Andrea
-- 
С уважением,
 Cobalt747  mailto:cobalt...@mail.ru


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


Re: [Lazarus] Code Folding mess and Code Divider feature

2009-03-13 Thread Michael Van Canneyt


On Fri, 13 Mar 2009, Martin Friebe wrote:

 Graeme Geldenhuys wrote:
  Hi,
 
  This relates to the new bug report:
http://bugs.freepascal.org/view.php?id=13322
 
  Code Folding seems to have gone way overboard!  It simply makes the
  editor look like a mess at the moment (Lazarus svn trunk revision).
  What is the end goal of code folding? Maybe is in the middle of the
  overall goal and I am simply acting to quickly. Either way, I will
  voice my concerns...

 There is a general plan/idea to add some configuration (have to see how 
 much) to define what you want to have foldable and what not. It wasn't 
 seen as urgent yet (at least not by me...)
 
 Most (if not all) of the places that allow folding now, do so in Delphi 
 as well. this is part of why they have been added, to make it easier for 
 (ex-) Delphi users.
 
 IMHO most of the new ones are reasonable?
 - Except maybe for: Program / Unit and Implementation / 
 interface; but they don't occur very often in a normal unit.
 - Maybe discussable are var Canost type blocks? Think is they can 
 be very useful for bigger var sections (but I agree they can be 
 irritating with just on line in it)
 - Folding at class / private / public = IMHO should be ok?
 - Folding at procedure in addition to the begin = arguable, if it 
 should be instead of the begin?
 
 Will be interested to see, if other people will voice opinions, which of 
 the new foldings they like, which not

As long as it can be switched off, you won't hear me complaining :-)

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


Re: [Lazarus] Placing a TProgressBar into a TStatusBar

2009-03-13 Thread Andrea Mauri
Thanks, it works.
Just the Left property seems to have no effect, the ProgressBar is 
placed on the left corner ot the StatusBar1, like having Left:= 0.

There's a way to associate a ProgressBar with a TStatusPanel?
I tried using this code, but nothing happens:

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
  if Panel = StatusBar.Panels[1] then
  with ProgressBar1 do
  begin
Top := Rect.Top;
Left := Rect.Left;
Width := Rect.Right - Rect.Left - 5;
Height := Rect.Bottom - Rect.Top;
  end;
end;

Regards,
Andrea

cobalt...@mail.ru ha scritto:
 Здравствуйте, Andrea.

 Try this:

 procedure TForm1.FormCreate(Sender: TObject);
 var
ProgressBar1: TProgressBar;
 begin
  ProgressBar1:= TProgressBar.Create(StatusBar1);
  with ProgressBar1 do
  begin
Parent := StatusBar1;
Left := 50;
Visible:= true;
Height:=15;
Width:=50;
Max:=100;
Position:=20;
  end;
 end;

 Вы писали 10 марта 2009 г., 19:01:27:

   
 Dear all,
 anyone can suggest me a way in order to place a TProgressBar into a 
 TStatusBar?
 I found some tutorials but they are just for Delphi and Win.
 Thanks,
 Andrea
 

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

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


Re: [Lazarus] SQLDB invalid handle

2009-03-13 Thread Bram Kuijvenhoven
Dear Stephano,

Stephano wrote:
 The following code produces an error:

Could you please provide some more details?
- FPC version
- A minimal but complete test program demonstrating the error

To ensure reproducibility of the problem, please report under which 
configuration of OS, DBMS and ODBC driver your minimal test program showed the 
problem.

It would also be great if you had a stack trace (see 
http://wiki.freepascal.org/Creating_a_Backtrace_with_GDB).

 error is: could not prepare statement
 Last return code: SQL_INVALID_HANDLE
 Invalid handle passed to SQLGetDiagRec/Field

So far I can see that the call to SQLPrepare failed (in 
TODBCConnection.PrepareStatement), but that unfortunately the ODBC error 
message could not be retrieved.

Regards,

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Jesus Reyes




--- El vie 13-mar-09, Michael Van Canneyt mich...@freepascal.org escribió:
if grid.Modified then begin
  [Do validation on col,row cell. Revert changes if
 not validated, etc]
  grid.Modified := false;
end;
 
 The problem is that the actual data is not in the grid
 cells, so reverting it would not be that easy.
 Is there a way to force the grid to save the data ? That
 would help, actually...

if grid.Modified=true when OnEditingDone triggers, then the cell has been
modified and the data is in cell (ok, that it could be any other cell which was 
modified it's true but that is a problem of program) and grid.cell[aCol,aRow] 
has the value.

the only problem is that grid.Modified needs to be reset to false manually, 
other way the grid doesn't know when the is appropiated to set modified := true.

 
 In Delphi, Setting 
 
   EditorMode:=False;
 
 Saves the data (setedittext is called again). In Lazarus,
 it is not called. 
 

I'm taking notes.

 I think it would also be a good idea to have an event which
 helps to validate the data.
 
 Something like
 
 Procedure TForm1.ValidateEntry(Sender : TObject; ACol,ARow
 : Integer; Var Value : String);
 
 begin
   // Do some things, possibly modify Value or raise
 exception.
 end;
 
 Which is called only once, when the data is saved finally. 
 Currently, it's hard to do proper validation in a grid.
 Well, in my opinion of course...

I thought the same and that's why I introduced grid.modified which has served 
me very well. But I agree that an event to do validation would be best, I will 
try to do something about it.

 
 Michael.

Jesus Reyes A.

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

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


Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Michael Van Canneyt wrote:
 
 Not in delphi 7, I tested ?
 
 However, it is called when you set EditorMode explicitly to false. 
 But never by itself.
 
Yep, I was wrong, details tend to become forgotten with time :( But only 
partially.
It is called when you finish editing by pressing Enter, or by moving 
current cell with the keyboard, or by activating another control. It is 
not called when you finish editing by mouse click elsewhere in the grid.

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


Re: [Lazarus] TProcess 2-way conversation

2009-03-13 Thread Dave Coventry
Hi Vincent,

2009/3/13 Vincent Snijders vsnijd...@vodafonevast.nl:
 See the process example:

 http://wiki.lazarus.freepascal.org/Executing_External_Programs#Using_input_and_output_of_a_TProcess
 and
 https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/examples/process/

 Vincent

That was the article on which I based my code.

I'm not having much luck.


  PLink.CommandLine := plink.exe -ssh -pw
'+options.Values['Password']+' -batch
'+options.Values['User']+'@'+options.Values['Server'];
  Plink.Options := [poUsePipes];
  Memo1.Append('-- executing --');
  PLink.Execute;
  M.SetSize(BytesRead + READ_BYTES);
  n := PLink.Output.Read((M.Memory + BytesRead)^, READ_BYTES);
  if n  0 then
  begin
S.LoadFromStream(M);
for i:=0 to S.Count-1 do
begin
  Memo1.Lines.Append(S[i]);
end;
  end
  else
  begin
Memo1.Lines.Append('Unable to open '+options.Values['Server']);
  end;
  remoteCommand:='ls -l'+#10;
  plink.input.write(remoteCommand[1],length(remoteCommand));
  M.SetSize(BytesRead + READ_BYTES);
  n := PLink.Output.Read((M.Memory + BytesRead)^, READ_BYTES);
  if n  0 then
  begin
S.LoadFromStream(M);
for i:=0 to S.Count-1 do
begin
  Memo1.Lines.Append(S[i]);
end;
  end;

I would expect the output of 'ls -l' to give me quite a lot of
information but S.LoadFromStream(M); doesn't contain anything at all.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Placing a TProgressBar into a TStatusBar

2009-03-13 Thread cobalt747
Здравствуйте, Andrea.

I think, now it is no way to associate some control with
TCollectionItem-descendant like TStatusPanel

I make it with OnResize event by updating it's coordinates.


Вы писали 14 марта 2009 г., 0:02:36:

 Thanks, it works.
 Just the Left property seems to have no effect, the ProgressBar is 
 placed on the left corner ot the StatusBar1, like having Left:= 0.

 There's a way to associate a ProgressBar with a TStatusPanel?
 I tried using this code, but nothing happens:

 procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
   Panel: TStatusPanel; const Rect: TRect);
 begin
   if Panel = StatusBar.Panels[1] then
   with ProgressBar1 do
   begin
 Top := Rect.Top;
 Left := Rect.Left;
 Width := Rect.Right - Rect.Left - 5;
 Height := Rect.Bottom - Rect.Top;
   end;
 end;
-- 
С уважением,
 Cobalt747  mailto:cobalt...@mail.ru


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