Re: [Lazarus] Which method is called at the very end of TWinControl creation?

2015-11-08 Thread Howard



On 08/11/2015 17:05, Krzysztof wrote:
What I'm looking is virtual method like 
"ThisIsCalledWhenControlIsCompletelyAdjustedAndReadyWithAllChildrens" 
. Tried other methods like VisibleChanged, ChildHandlesCreated etc 
but without success


Possible methods to try include:

Loaded
FormEndUpdated

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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-11 Thread Howard

On 11/01/2016 09:34, Anthony Walter wrote:
The point is, on a TPopupMenu if the pattern to the right is always 
alias arrows, and the pattern below is always check board, then it's 
entirely superfluous, nonessential, redundant, and unneeded.


The latest trunk accepts a patch which adopts Bart's suggestion of 
identifying the purpose of the dummy menuitem by displaying a 
self-descriptive text. The background is no longer patterned. Of course 
this can be further changed.


Howard


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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-11 Thread Howard



On 11/01/2016 12:35, Ondrej Pokorny wrote:

On 11.01.2016 13:31, Howard wrote:
The latest trunk accepts a patch which adopts Bart's suggestion of 
identifying the purpose of the dummy menuitem by displaying a 
self-descriptive text. The background is no longer patterned. Of 
course this can be further changed.


Where is the patch?

It is the second patch submitted on issue 29205

Howard

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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-11 Thread Howard



On 11/01/2016 16:07, Anthony Walter wrote:

Very nice. I like the new design.

Side note: Who wrote that FScroller for the new menu editor? It acts 
very erratic for me on Gtk2. I don't know about on other widget sets. 
See issue 29369. Why not use TScrollBox or make TShadowMenu a 
TScrollingWinControl?


I wrote it. It is definitely the weakest part of the new designer. I 
hate to reinvent the wheel. However, I could not get a TScrollBox 
container to work correctly for TShadowMenu, perhaps because its size 
calculation and painting is rather non-standard. Whatever the reason I 
was unable to get a TScrollBox container to respond correctly to 
TShadowMenu size changes when there were more than a screenful of menuitems.
I'm honestly not sure if the best approach to sorting it out is to mend 
(or rewrite) FScroller, or to figure out a way for TScrollBox to parent 
TShadowMenu correctly. I did not try making TShadowMenu a 
TScrollingWinControl descendant. Perhaps that would be a better option. 
What would others advise?


Howard

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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-12 Thread Howard



On 11/01/2016 21:51, Anthony Walter wrote:
Howard, good job on the new menu designer. It's working very nicely 
right now. I'll take a look at modifying TShadowMenu to be a scrolling 
control without the need for a TScrollBox.


Thanks. Yes, Ondrej's introduction of TSiblingFake and TFirstFake are a 
neat improvement.


Howard


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


Re: [Lazarus] New menu designer

2016-01-12 Thread Howard

On 12/01/2016 13:44, Péter Gábor wrote:
Please use complete sentences as much as possible and avoid storing > of partial sentences in resourcestrings. I mean don't compose > 
complete sentences in run/compile time from words or partial > 
sentences. Such resourcestrings makes localization harder or > 
completely impossible in languages that have different grammar: word > 
order, system of prefixes/suffixes, agglutination, inflection, and > 
other things that I can't imagine. > An example of how NOT to fragment 
sentences: msgid " conflicts%s" msgid " remain>" msgid " 
to resolve>" Also fragments can > have different meaning and 
translations depending on that they are > used combined or not.


OK, point taken. I will amend the offending resourcestrings in a patch.
I'm not a linguist nor a translator, so did not appreciate that this 
would cause difficulty.
My motive was simply to reduce the overall number of resourcestrings 
required by reuse of phrase "atoms", which I see now works 
satisfactorily only if a single language is ever employed.


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


Re: [Lazarus] New menu designer

2016-01-12 Thread Howard

On 12/01/2016 14:37, Péter Gábor wrote:


2016-01-12 15:26 keltezéssel, Howard írta:

OK, point taken. I will amend the offending resourcestrings in a patch.
I'm not a linguist nor a translator, so did not appreciate that this
would cause difficulty.
My motive was simply to reduce the overall number of resourcestrings
required

I know :) and thanks for your work!


I have attached a third small patch to issue 29205, to address the 
infelicity in some menu editor resourcestrings identified by Péter.

Could Ondrej or Juha review this?

Howard

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


Re: [Lazarus] New menu designer

2016-01-15 Thread Howard

On 14/01/2016 23:27, Maxim Ganetsky wrote:
String "composing" is still present e. g. in "Insert from template" 
dialog ("Choose template to ..." groupbox caption) and in main menu 
creation form in "add menu item" fields captions.


Also lismenueditororclickheadertosortbythatcolumn string looks 
suspicious from this POV.


As for lismenueditormoveseparatedeleteinsertitems: you shouldn't try 
to align text with buttons this way. It won't work with other than 
Windows' fonts/font sizes (e.g. on Linux) and other languages. Better 
change this string to regular caption like "Menu Item actions".


Also I noticed that e. g. "Insert from template" dialog is not 
resizable. It is better to have resizable dialogs in order to fit 
longer translation captions (e. g. combobox caption in this case).


I have submitted a patch (29411) which I hope addresses these issues, 
except for the issue:
'String "composing" is still present ... in main menu creation form in 
"add menu item" fields captions'


I am not clear about which string(s) you are identifying here. Can you 
give a specific line number in the source that exemplifies the problem 
you see?


Howard



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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-15 Thread Howard



On 15/01/2016 11:04, Ondrej Pokorny wrote:

On 15.01.2016 11:32, Ondrej Pokorny wrote:
I did not try making TShadowMenu a TScrollingWinControl descendant. 
Perhaps that would be a better option. What would others advise?


What were your problems? In r51298 I removed all the Scroller code 
and simply used TScrollBox for TShadowMenu and it works without any 
problems - much better than your Scroller experiment. I tested win32 
and Linux+Gtk2.


Sorry, my apologies - I missed that you didn't try it.


Yes working fine for me (Windows 7 32bit and Linux 64 bit).
I'm relieved that such a simple change has had such a good effect, and 
that no further tinkering with TShadowMenu size and positioning code was 
required; and that my poorly implemented scrolling code can therefore be 
dumped entirely.


Howard

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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-16 Thread Howard

On 16/01/2016 21:08, Ondrej Pokorny wrote:

On 15.01.2016 23:30, Howard wrote:

Sorry, my apologies - I missed that you didn't try it.


Yes working fine for me (Windows 7 32bit and Linux 64 bit).
I'm relieved that such a simple change has had such a good effect, 
and that no further tinkering with TShadowMenu size and positioning 
code was required; and that my poorly implemented scrolling code can 
therefore be dumped entirely.


Yes, you must have wasted a lot of time on the extra scrolling code :(
+ Could you take a look also at this one?: 
http://mantis.freepascal.org/view.php?id=29399
Basically you should use a simple parented TEdit and not a modal 
dialog. Take a look at grids in-place editor.


I'll have a look later next week.


To me it seems that you have taken hard and complicated routes at a 
lot of places in the new menu editor, which are very bug-prone, hard 
to maintain and hard to understand - instead of using easy and simple 
ways. As a result, you wasted your time and also mine and others that 
tried to understand what's going wrong in the unnecessary code and 
tried to fix it.


This is also the case of resource strings. Take a look e.g. at r51249 
and r51305. Why was the dialog so complicated with duplicate strings? 
Yes and No as answers are clear enough.

It stated:
"Deleting this item will delete all subitems too.
Delete this item and its subitems?"
You use the word delete three times, (sub)items 2+2 times. Why? (And I 
don't count the dialog title and former buttons.)
Why not only the second line?: "Delete this item and its subitems?" -> 
again it is clear enough. Furthermore, using the same words and 
phrases over and over again is stylistically wrong.
In this particular instance of deleting a submenu (not just a single 
item) my motivation was not to make it overly complicated (though I 
appreciate it may seem so).
It is quite possible a user may have spent 10 minutes designing a 
submenu with half a dozen items, and then hits the delete key 
accidentally. With a simple Yes/No dialog (especially if the the default 
button is Yes) it is all to easy to hit the wrong button and lose the 
last few minutes' work; and there is no undo facility implemented.
I may have written that dialog clumsily, but I wanted to avoid the 
possibility of an 'automatic' response which was disastrous. I quite 
agree a straightforward Yes/No dialog is simpler and more elegant, but 
it may not give a hurried user sufficient 'pause' to avoid accidentally 
losing valuable work.


Honestly, the new menu editor is a translator's nightmare. Although I 
do like what the new designer does, I don't really like how it is 
written :( I tried to fix some code but I am somehow already tired to 
go through all the issues.


Please don't get me wrong - I don't want to offend you in any way. I 
just want to explain that you should use the KISS-principle whereever 
possible. It will not only save everybody's time but also lead to 
better code. (I know, I also have hard time to apply KISS.)


Ondrej

PS: Just for comparison:
BEFORE:


AFTER:


Even as a user, I need much more time to understand what's going on in 
the first dialog...
No offence taken. I appreciate you taking the time to give constructive 
feedback, as well as tracing through code you find poorly written in 
order to improve it.


You'll realise I'm on a learning curve. This is my first significant 
code contribution to an open source project. I actually never thought I 
had the skill to offer a new menueditor. It was a forum comment by the 
late BigChimp some years ago about the previous menueditor which first 
got me thinking about its shortcomings, why it was so difficult to 
improve/maintain, and how a replacement might be designed to be better 
in that respect; and several developers said a complete rewrite was the 
only way forward. Months became years and no one as far as I could see 
was working on a replacement. So I decided to bite the bullet, and 
started to look at relevant bits of the IDE code (much of which I still 
don't understand). I've been learning on the job, as you plainly see...


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


Re: [Lazarus] New menu designer

2016-01-17 Thread Howard

On 17/01/2016 12:33, Péter Gábor wrote:

I found some Format calls that seems to be unneded: the first parameter
for them contains only formatting symbols and the second an array of
resourcestrings.

If no one else is currently working on the resourcestrings issue I will
try to finish my patch and post it on mantis...
This is more simpler than writing a lot of letter about what and how to
fix to be translation friendly.

Do you agree?

2016-01-15 23:19 keltezéssel, Howard írta:

On 14/01/2016 23:27, Maxim Ganetsky wrote:

String "composing" is still present e. g. in "Insert from template"
dialog ("Choose template to ..." groupbox caption) and in main menu
creation form in "add menu item" fields captions.

Also lismenueditororclickheadertosortbythatcolumn string looks
suspicious from this POV.

As for lismenueditormoveseparatedeleteinsertitems: you shouldn't try
to align text with buttons this way. It won't work with other than
Windows' fonts/font sizes (e.g. on Linux) and other languages. Better
change this string to regular caption like "Menu Item actions".

Also I noticed that e. g. "Insert from template" dialog is not
resizable. It is better to have resizable dialogs in order to fit
longer translation captions (e. g. combobox caption in this case).

I have submitted a patch (29411) which I hope addresses these issues,
except for the issue:
'String "composing" is still present ... in main menu creation form in
"add menu item" fields captions'

I am not clear about which string(s) you are identifying here. Can you
give a specific line number in the source that exemplifies the problem
you see?

Howard


Sure, fine by me. Go ahead.

Howard

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


Re: [Lazarus] New menu designer

2016-01-17 Thread Howard

On 17/01/2016 13:00, Juha Manninen wrote:
...
Howard, for curiosity, your patch has: LCLVersion = '1.6.0.2' The menu 
editor is developed in trunk 1.7. Are you using a fixex_1_6 version 
for editing? Juha


Yes, the code I worked on was the latest trunk (well perhaps it was from 
the day before). The IDE I used was 1.6.0. Does this matter?


Howard


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


Re: [Lazarus] New menu designer

2016-01-17 Thread Howard

On 17/01/2016 18:40, Péter Gábor wrote:

I think we can use one resourcestring ('')
instead of three:

'';
'';
'';

Yes or No?


Yes, I agree with you.

Howard

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


Re: [Lazarus] Parameter hints

2011-05-16 Thread Howard Page-Clark

On 16/5/11 10:03, Mattias Gaertner wrote:

Hi all,

For those wondering what the new button in the parameter hints is good
for:

http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Parameter_Hints


Thanks Mattias - this is a boon!

Howard

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


Re: [Lazarus] Whats happend for snapshots?

2011-06-09 Thread Howard Page-Clark

On 09/6/11 3:57, lazarusportugalwebmast...@gmail.com wrote:

Hi.
I'm using Lazarus from snapshots because is more easy correct the bugs
that Lazarus from SVN because WE NEED OF COMPILING IT AND IS HARD
CORRECT THE BUGS OF SYNTAX of an IDE or compiler.
So we want that snapshots existing and are updated.
When snapshot back?


The most up-to-date source seems to be via ftp:

ftp://ftp.freepascal.org/pub/lazarus/snapshots

Howard

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


Re: [Lazarus] New features since 0.9.30?

2011-06-17 Thread Howard Page-Clark

On 17/6/11 10:06, Joost van der Sluis wrote:


The Web-changes are more fpc changes, not really fpc. I did forget one
myself: the LCL is a package now. That's a new feature. (Very useful
when you do a lot cross-compiling, like I do)

Any more?
There's the shortcut [Ctrl][Shift][Space] when inside parameter brackets 
that gives you a full parameter hint window:


http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Parameter_Hints

Howard



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


Re: [Lazarus] LCL memory leak

2011-06-20 Thread Howard Page-Clark

On 20/6/11 7:04, Mattias Gaertner wrote:

On Mon, 20 Jun 2011 17:43:35 +0100
Howard Page-Clark  wrote:


Since the LCL has become a package like any other I've been building it
using the heaptrace unit.
This shows an 8 byte leak in line 30 of chmlcl.pas following the
creation of baseBaseURL: THelpBaseURLObject; (see attached .png)


Please create a bug report.


Done, issue 19597.
SVN revision is 31279 (but issue has been true for some time).

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


Re: [Lazarus] Drawing angle boundaries

2011-06-24 Thread Howard Page-Clark

On 23/6/11 1:11, Leonardo M. Ramé wrote:

Hi, I need to draw the angle(s) formed by any given four points.

As you can see in the attached image, there are two crossed lines and an
skewed-rotated ellipse that touches all four points, then between each
two points and the cross point I would like to draw the angle formed (in
the example filled in blue).

Does anyone knows how can I do this?.


Try the attached unit, for which the .lpr is as follows:

program pAngleDrawing;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, uAngleDrawing;

{$R *.res}

begin
  RequireDerivedFormResource := True;
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

It's a bit buggy and has no error checking for impossible point values, 
but should give you some ideas (uAngleDrawing.lfm is just an empty form).


Howard
unit uAngleDrawing;

{$mode objfpc}{$H+}

interface

uses
  Classes, Forms, Graphics, Dialogs,
  ExtCtrls;

type

  TPointArray = array[0..3] of TPoint;

  { Tquad }

  Tquad = class
  private
FCanvas: TCanvas;
Fa, Fb, Fc, Fd, FIntersection: TPoint;
FcAD, FcBC: integer;
FmAD, FmBC: double;
function Yad(anX: integer): integer;
function Ybc(anX: integer): integer;
function InterSecAdBc: TPoint;
  public
constructor Create(aCanvas: TCanvas; const dataPoints: array of TPoint);
procedure DrawAngleAB(col: TColor);
procedure DrawAngleBC(col: TColor);
procedure DrawAngleCD(col: TColor);
procedure DrawAngleDA(col: TColor);
property a: TPoint read Fa write Fa;
property b: TPoint read Fb write Fb;
property c: TPoint read Fc write Fc;
property d: TPoint read Fd write Fd;
property mAD: double read FmAD;
property mBC: double read FmBC;
property cAD: integer read FcAD;
property cBC: integer read FcBC;
  end;

  { TForm1 }

  TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
  private
FQuad: Tquad;
FTimer: TTimer;
  public
procedure DrawAngles(Sender: TObject);
  end; 

const ARR: TPointArray = (
   (x:6; y:7), (x:204; y:13), (x:23; y:245), (x:290; y:275) );

var
  Form1: TForm1; 

implementation

uses math;

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  FQuad:= Tquad.Create(Self.Canvas, ARR);
  FTimer := TTimer.Create(self);
  FTimer.Interval:= 300;
  FTimer.OnTimer:= @DrawAngles;
  FTimer.Enabled:= True;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FQuad.Free;
end;

procedure TForm1.DrawAngles(Sender: TObject);
begin
  FQuad:= Tquad.Create(Self.Canvas, ARR);
  Randomize;
  FQuad.DrawAngleAB(Random(High(TColor)));
  FQuad.DrawAngleBC(Random(High(TColor)));
  FQuad.DrawAngleCD(Random(High(TColor)));
  FQuad.DrawAngleDA(Random(High(TColor)));
end;

{$R *.lfm}

{ quad }

function Tquad.Yad(anX: integer): integer;
begin
  result := Round(FmAD*anX) + FcAD;
end;

function Tquad.Ybc(anX: integer): integer;
begin
  result := Round(FmBC*anX) + FcBC;
end;

function Tquad.InterSecAdBc: TPoint;
var x, mi, ma, diff: integer;
begin
  result := Point(0,0);
  mi := Min(b.x, c.x);
  ma := Max(b.x, c.x);
  if (ma = mi) then begin ShowMessage('Points must be distinct!'); Exit; end;
  for diff := 0 to mi do
  for x := mi to ma do
   begin
   if (Yad(x) - Ybc(x) = diff) then
begin
  result.x:= x;
  Result.y:= Ybc(x);
  Exit;
end;
   end;
  ShowMessage('No exit from Intersection loop!');
end;

constructor Tquad.Create(aCanvas: TCanvas; const dataPoints: array of TPoint);
begin
  inherited Create;
  FCanvas := aCanvas;
  Fa := dataPoints[0];
  Fb := dataPoints[1];
  Fc := dataPoints[2];
  Fd := dataPoints[3];

  FmBC:= (b.y - c.y) / (b.x - c.x);
  FcBC:= ((b.y + c.y) - Round(FmBC * (b.x + c.x))) div 2;
  FmAD:= (a.y - d.y) / (a.x - d.x);
  FcAD:= ((a.y + d.y) - Round(FmAD * (a.x + d.x))) div 2;
  FIntersection := InterSecAdBc;
end;

procedure Tquad.DrawAngleAB(col: TColor);
begin
 FCanvas.Pen.Color:= col;
  FCanvas.MoveTo(a);
  FCanvas.LineTo(FIntersection);
  FCanvas.LineTo(b);
end;

procedure Tquad.DrawAngleBC(col: TColor);
begin
  FCanvas.Pen.Color:= col;
  FCanvas.MoveTo(b);
  FCanvas.LineTo(FIntersection);
  FCanvas.LineTo(c);
end;

procedure Tquad.DrawAngleCD(col: TColor);
begin
  FCanvas.Pen.Color:= col;
  FCanvas.MoveTo(c);
  FCanvas.LineTo(FIntersection);
  FCanvas.LineTo(d);
end;

procedure Tquad.DrawAngleDA(col: TColor);
begin
  FCanvas.Pen.Color:= col;
  FCanvas.MoveTo(d);
  FCanvas.LineTo(FIntersection);
  FCanvas.LineTo(a);
end;

end.

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


Re: [Lazarus] Absolute paths on different platforms

2011-06-27 Thread Howard Page-Clark

On 27/6/11 8:12, Marco van de Voort wrote:


Some of these features have been added only after W2K, as Mark
annotated. It may be for compatibility reasons, or not-updated Explorer
behaviour, when links and shortcuts still are stored in the old-fashion way.


The tipping point is Vista, not XP afaik.

XP (NTFS 5.0 and higher) does support Junctions (a folder-only type of 
symlink). However they are unuseable on XP (unless you install a shell 
extension), because XP's Explorer does not handle them correctly. So few 
XP users are aware of Junction functionality.


Vista and Win7 have native Explorer support for Junctions as well as 
true POSIX-like symlink behaviour for files as well as folders. Though 
GUI access needs a shell extension, there is the command-line utility 
mklink, which confusingly (why does M$ do this?) has Source and Target 
parameters the opposite way round from what Linux experience leads you 
to expect.


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


Re: [Lazarus] Documentation style

2011-07-23 Thread Howard Page-Clark

On 23/7/11 1:20, Hans-Peter Diettrich wrote:

During the development of the doc tracker I stumbled over several issues:

The English wording often violates my feeling for the language. Can some
native English speakers proofread the documentation, and correct
stylistic flaws?




I also can assign doc files to those people, which are willing to
proofread the documentation, so that we can avoid duplicate work.


I'm a native English speaker, and I'm willing to proofread 
documentation, and make suggestions for improvements. However, I suspect 
it is almost an endless task, and probably too much for one person to 
undertake (although the ideal would be for one English-speaker to 
undertake this, to get a consistent 'house style' and consistent 
spelling [UK > US English?]).


Several questions arise immediately. Where precisely are the original 
documents? How can I (or anyone else) be trusted to edit them correctly?
What about formatting style, indenting etc. for code examples? It would 
be good to have consistency here too. I notice quite a lot of 
fpc/Lazarus source is quite terse:


[ result:=i*trunc(x/y); rather thanresult := i * Trunc( x/y ); ]

yours

Howard





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


[Lazarus] Problem with SQLite commit in Lazarus

2011-07-26 Thread Howard Lee Harkness
I am migrating a small Lazarus database application from PostgreSQL to
SQLite (PostgreSQL was overkill, and I need something which is
zero-config and can run from a flash drive on different machines). In
the process, I have run into several little oddities in the way that
SQLite differs from other DBMs with which I am familiar. Most of them
I have been able to puzzle out, but this one has me befuddled.

I construct an SQL insert statement in variable sql, and then do the following:

FormDatabase.SQLite3Connection.ExecuteDirect(sql);
FormDatabase.SQLite3Connection.ExecuteDirect('commit');

First time through, no problems. Second time through with another row
of data, and I get an exception with a message saying there is no
active transaction when it reaches the commit (both inserts actually
get saved in the table, however). If I omit the commit, nothing gets
saved to the table on exit from the program. If I add the line:

FormDatabase.SQLite3Connection.ExecuteDirect('begin');

...before the lines above, it gives an exception complaining that I
can't nest transactions.

I am guessing that I am missing some basic detail in the setup
somewhere, or not understanding some subtlety in the operation of
SQLite. I would greatly appreciate somebody sending me a clue on how
to deal with this. TIA!
-- 
Howard Lee Harkness

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


Re: [Lazarus] Problem with SQLite commit in Lazarus

2011-07-27 Thread Howard Lee Harkness
For now, I have a fairly ugly workaround, since I have another more
important task to finish:

The performance of the SQLite database is very poor. I was able to
speed it up a bit by putting indices on most of the commonly-search
columns on the main table, but it's still about 20 to 30 times slower
than the PostgreSQL version that I am replacing. As I slowly get back
up to speed in Lazarus (it's been 3 years since I wrote the last
iteration), it occurs to me that I may need some more sophisticated
tools than I currently have. I also see that the current version of
Lazarus made several subtle changes to the IDE, and I can't even find
the way to get the stack trace anymore. Probably nothing that can't be
solved with sufficient time and effort, but I was really hoping this
migration would be a lot easier.

Is there some way that I can get SQLite to just read all of the tables
into memory during the run of the program? Surely that would speed
things up.

2011/7/27 Max Vlasov :
>
>
> On Wed, Jul 27, 2011 at 6:28 AM, Howard Lee Harkness
>  wrote:
>>
>> I am guessing that I am missing some basic detail in the setup
>> somewhere, or not understanding some subtlety in the operation of
>> SQLite. I would greatly appreciate somebody sending me a clue on how
>> to deal with this. TIA!
>> --
>
>
> Howard, looking at the file
> \fpc\\source\packages\fcl-db\src\sqldb\sqlite\sqlite3conn.pp
> I suggest you to set breakpoints in StartdbTransaction and CommitRetaining
> and look at the call stack for the place that starts and ends the
> transaction without your intervention. The only problem could be the fpc
> sources usually compiled without debug info, don't know whether this
> applicable to fpc packages.
>
> Max
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] SQLitePass package install problems

2011-07-28 Thread Howard Lee Harkness
What is the status of SQLitePass? I went to what was supposed to be a
download page for it (http://source.online.free.fr/), but what appears
to be the only link to download the actual components was a link to a
dead GeoCities page. Is this available anywhere? Has it changed names?
Does it differ from the components in sqlite3laz 0.4?

Speaking of the latter, is there any user documentation for sqlite3laz
*anywhere*?

2010/7/12 K. P. :
> Thanks Jaroslaw,
> it does indeed work - quite different from Delphi. This will teach me not to
> assume too much but rather search for documentation!
> Cheers
> Kai
>
>> Date: Sat, 10 Jul 2010 11:20:23 +0200
>> From: j@poczta.fm
>> To: lazarus@lists.lazarus.freepascal.org
>> Subject: Re: [Lazarus] SQLitePass package install problems
>>
>> from SqlitePass docs:
>>
>> Packages Installation for Lazarus users (>=0.9.20)
>>
>> 1. Uninstall any previous version of SqlitePassDbo components :
>> Choose [Components] [Configure Installed Packages] from IDE menu
>> 2. Select the Laz_SqlitePassDbo_Runtime and
>> Laz_SqlitePassDbo_Designtime packages and click [Uninstall the
>> selection] then [Save and quit the dialog].
>> 3. Compile the Laz_SqlitePassDbo_Runtime package. Compile and
>> install the Designtime package : Choose [File] [Open] from the IDE menu
>> and select
>> ..\SQLitePass\Packages\Lazarus\Laz_SqlitePassDbo_Designtime.lpk. In
>> package dialog, Choose compile - this way, the Laz_SqlitePassDbo_Runtime
>> will automatically be compiled. Then select install to rebuild the IDE.
>> 4. Check installation : Select SqlitePassDbo on Component palette
>> pages and drop a SqlitePassDatabase and a SqlitePassDataset on a new
>> form. Check the components versions are correct in object inspector.
>>
>> it works :)
>>
>> --
>> Doladuj telefon przez Internet.
>> Sprawdz >>> http://linkint.pl/f2778
>>
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
> 
> Hotmail: Free, trusted and rich email service. Get it now.
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>



-- 
Howard Lee Harkness
(214) 390-4896

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


[Lazarus] SQLite performance problem. Simple query takes too long.

2011-07-28 Thread Howard Lee Harkness
I am doing a conversion of a small database application from
PostgreSQL to SQLite.

I have gotten the program to work, but it it about 2 orders of
magnitude slower than the PostgreSQL version. In particular, a query
like

select distinct clients.* from clients where  lastname like
'Hark%' order by lastname, firstname, middlename;

...take nearly 3 seconds, whereas in the PostgreSQL version, it was
done instantly. Before I indexed the clients table on lastname, it was
something like 6 seconds. This is for a table with about 8000 records,
and the above query returns 3 rows. I tried reducing the "order by"
clause to just lastname, but that made no difference. I even removed
the "order by" clause completely, and that made no difference. I tried
without "distinct" and that made no difference. What did make a
difference was running the above query using sqlite3.exe from the
command line -- which was instantaneous. This implies that the LCL
components are taking 3 seconds to do some sort of setup for the
query.

This makes no sense to me. The LCL looks fairly straightforward. Here
is the call:

 qClients.Close;
 qClients.SQL.Text:=sql; // where sql contains the above select statement
 qClients.Open;

The Open step is the one taking the time. The database setup is below,
since I suspect that may be where the problem is. I hope this is
enough info.

Any clue about what is taking so long?

Environment:
Windows 7
SQLite3.dll
Lazarus 9.30 using TSQLite3Connection, TSQLTransaction, TSQLQuery,
TDataSource, TDBGrid

object FormDatabase: TFormDatabase
  Left = 473
  Height = 240
  Top = 169
  Width = 184
  Caption = 'FormDatabase'
  OnDestroy = FormDestroy
  LCLVersion = '0.9.30'
  object SQLite3Connection: TSQLite3Connection
Connected = True
LoginPrompt = False
DatabaseName = 'DB.s3db'
KeepConnection = True
Password = 'test'
Transaction = SQLTransaction
UserName = 'user'
Options = []
left = 53
top = 123
  end
  object SQLTransaction: TSQLTransaction
Active = True
Action = caNone
Database = SQLite3Connection
left = 53
top = 67
  end
end


excerpts from main form:

  object dsClients: TDatasource
DataSet = qClients
OnStateChange = Sync
OnDataChange = dsClientsDataChange
OnUpdateData = Sync
left = 552
top = 64
  end

  object qClients: TSQLQuery
IndexName = 'DEFAULT_ORDER'  // what is this, and why can't I
change it?  I tried IndexFieldNames = 'lastname' but that was EVEN
SLOWER
AutoCalcFields = False
Database = FormDatabase.SQLite3Connection
Transaction = FormDatabase.SQLTransaction
ReadOnly = False
SQL.Strings = (
  'select * from clients'
  'order by lastname,firstname,middlename'
)
Params = <>
left = 504
top = 64
  end

-- 
Howard Lee Harkness

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


Re: [Lazarus] SQLite performance problem. Simple query takes too long.

2011-07-28 Thread Howard Lee Harkness
Unfortunately, it has a lot of information that is sensitive (belongs
to a client). I will look at building a database with dummy data. I
can, however, provide the schema, if that would help.

On Thu, Jul 28, 2011 at 2:10 PM, Martin Schreiber  wrote:
> On Thursday 28 July 2011 17:54:03 Howard Lee Harkness wrote:
>> I am doing a conversion of a small database application from
>> PostgreSQL to SQLite.
>>
>> I have gotten the program to work, but it it about 2 orders of
>> magnitude slower than the PostgreSQL version. In particular, a query
>> like
>>
>>     select distinct clients.* from clients where  lastname like
>> 'Hark%' order by lastname, firstname, middlename;
>>
> Can you post the database file at a place where I can download it or send it
> to my Email address if it is not too big?
>
> Martin
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] SQLite performance problem. Simple query takes too long.

2011-07-29 Thread Howard Lee Harkness
I have established that the problem is not in SQLite, but has to be in
my code somewhere. I suspect it is related to the transaction/commit
problem I posted a few days ago, and I plan to track that down today
if I can. I need to finish this application by tomorrow.

2011/7/29 Martin Schreiber :
> Am Donnerstag 28 Juli 2011, 22:01:32 schrieb Howard Lee Harkness:
>> Unfortunately, it has a lot of information that is sensitive (belongs
>> to a client). I will look at building a database with dummy data. I
>> can, however, provide the schema, if that would help.
>>
> I tested with MSEide+MSEgui, it is instant too, see attachment.
> Suggestion: test with a similar simple Lazarus application.
>
> Martin
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] RE : SQLite performance problem. Simple query takes toolong.

2011-07-29 Thread Howard Lee Harkness
QLite3Connection instance and
> TSQLQuery.Transaction to the SQLTransaction instance. Active:= False,
> SQL.Text:=''.
>
> Now to execute an insert query (assuming
> TSQLite3Connection.Connected:=true):
>    SQLQuery.SQL.Text:=sql;
>    SQLQuery.ExecSQL;
>    SQLTransaction.CommitRetaining;
>
> That's it. SQLTransaction.CommitRetaining; does the COMMIT and a BEGIN to
> start a new transaction.
>
> Just to be complete, I'm using lazarus 0.9.31 svn with fpc 2.5.1 svn.
>
> Ludo



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] RE : RE : SQLite performance problem. Simple query takestoolong.

2011-07-29 Thread Howard Lee Harkness
On Fri, Jul 29, 2011 at 1:42 PM, Ludo Brands  wrote:
> I traced through TSqlQuery.Close and there isn't happening a lot, except for
> cleaning up prepared statements and cursors. And that is where your direct
> BEGIN/COMMIT could very well confuse sqlite.
> sqlite3_finalize(fstatement) is used to unprepare a statement. But is
> fstatement still valid after you have restarted a transaction? I doubt it.
> Do replace the ExecuteDirect with a TSqlQuery component. It is only a small
> change and it removes a lot of causes of errors.

Ok, it seems like a reasonable suggestion, so I tried that.

The TSQLQuery object:
  object qDIU: TSQLQuery
IndexName = 'DEFAULT_ORDER'
AutoCalcFields = False
Database = FormDatabase.SQLite3Connection
Transaction = FormDatabase.SQLTransaction
ReadOnly = False
Params = <>
left = 308
top = 48
  end

The updated procedure:
procedure TfrmMain.ExecSQL(sql:string);
begin
// FormDatabase.SQLite3Connection.ExecuteDirect(sql);
// FormDatabase.SQLite3Connection.ExecuteDirect('commit');
// FormDatabase.SQLite3Connection.ExecuteDirect('begin transaction');
   qDIU.SQL.Text:=sql;
   qDIU.ExecSQL;
   FormDatabase.SQLTransaction.CommitRetaining;
end;

I also tracked down one other usage of ExecuteDirect in another form
(not used for this test, but just in case) and applied the same
change.

The result: No improvement. If anything, things got slightly worse.

However, I think maybe I have some insight into what is causing the
problem. It looks like the lookups for the dependent tables are
happening multiple times. Not sure why that would be (I didn't think I
did anything to that part of the code other than change database
engines), but I hope to find out shortly.
-- 
Howard Lee Harkness
(214) 390-4896

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


[Lazarus] RE : SQLite performance problem. Simple query takes too long. (SOLVED)

2011-07-29 Thread Howard Lee Harkness
Ok, I found a fix, although I'm not really sure that I have fixed the
problem in the best way. What I did was to close all of the dependent
queries while doing the incremental search until the user selects a
client entry in the main dbgrid. Now the incremental search is as fast
as it was in PostgreSQL.

Although this dialog did not point directly to a solution, I learned a
lot, which eventually enabled me to find the bottleneck.

If any of you should think of a better way, please let me know.
Otherwise, I think it's good enough to deliver tomorrow. I spoke with
the customer and explained the slight difference in behavior, and he
thinks that is an improvement, because it will help prevent
accidentally entering phone #, address, etc. for the wrong client.

Thanks for the help!

On Fri, Jul 29, 2011 at 2:21 PM, Howard Lee Harkness
 wrote:
> On Fri, Jul 29, 2011 at 1:42 PM, Ludo Brands  wrote:
>> I traced through TSqlQuery.Close and there isn't happening a lot, except for
>> cleaning up prepared statements and cursors. And that is where your direct
>> BEGIN/COMMIT could very well confuse sqlite.
>> sqlite3_finalize(fstatement) is used to unprepare a statement. But is
>> fstatement still valid after you have restarted a transaction? I doubt it.
>> Do replace the ExecuteDirect with a TSqlQuery component. It is only a small
>> change and it removes a lot of causes of errors.
>
> Ok, it seems like a reasonable suggestion, so I tried that.
>
> The TSQLQuery object:
>  object qDIU: TSQLQuery
>    IndexName = 'DEFAULT_ORDER'
>    AutoCalcFields = False
>    Database = FormDatabase.SQLite3Connection
>    Transaction = FormDatabase.SQLTransaction
>    ReadOnly = False
>    Params = <>
>    left = 308
>    top = 48
>  end
>
> The updated procedure:
> procedure TfrmMain.ExecSQL(sql:string);
> begin
> //     FormDatabase.SQLite3Connection.ExecuteDirect(sql);
> //     FormDatabase.SQLite3Connection.ExecuteDirect('commit');
> //     FormDatabase.SQLite3Connection.ExecuteDirect('begin transaction');
>       qDIU.SQL.Text:=sql;
>       qDIU.ExecSQL;
>       FormDatabase.SQLTransaction.CommitRetaining;
> end;
>
> I also tracked down one other usage of ExecuteDirect in another form
> (not used for this test, but just in case) and applied the same
> change.
>
> The result: No improvement. If anything, things got slightly worse.
>
> However, I think maybe I have some insight into what is causing the
> problem. It looks like the lookups for the dependent tables are
> happening multiple times. Not sure why that would be (I didn't think I
> did anything to that part of the code other than change database
> engines), but I hope to find out shortly.
> --
> Howard Lee Harkness
> (214) 390-4896
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] (no subject)

2011-07-31 Thread Howard Page-Clark

On 30/7/11 11:15, Leonardo Rame wrote:

Hi, I would like to drag the mouse over a form, while the mouse is
dragged, FPos X and Y values must change in the direction of the move,
but the mouse cursor must be fixed at the position where the first click
was made.

This code does more or less what I want, but has two problems:

1 - The mouse still moves a little.
2 - The values of FPos.X and FPos.Y doesn't change.




procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
   Y: Integer);
begin
   if ssLeft in shift then
   begin
 Mouse.CursorPos := ClientToScreen(FPos);
 FPos.X := X;
 FPos.Y := Y;
 Invalidate;
   end;
end;


Changing the mouse cursor position interferes with the Invalidate call. 
Try this:


unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 
StdCtrls, windows;


type

  { TForm1 }

  TForm1 = class(TForm)
Label1: TLabel;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: 
Integer);

procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
procedure FormPaint(Sender: TObject);
  private
FPos: TPoint;
FOldCursorPos: TPoint;
FOldCursor: TCursor;
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if ssleft in shift then
  begin
FPos.X := X;
FPos.Y := Y;
FOldCursorPos:= FPos;
FOldCursor := Cursor;
Cursor := crNone;
  end;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if ssLeft in shift then
  begin
//Mouse.CursorPos := ClientToScreen(FPos);
FPos.X := X;
FPos.Y := Y;
Invalidate;
  end;
end;

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Cursor := FOldCursor;
end;

procedure TForm1.FormPaint(Sender: TObject);
var
   HCursor : THandle;
begin
   Label1.Caption := Format('X: %d - Y: %d', [FPos.X, FPos.Y]);
   HCursor := Screen.Cursors[Ord(Screen.Cursor)];
   DrawIconEx(Canvas.Handle,
   FOldCursorPos.X, FOldCursorPos.y, HCursor, 32, 32, 0, 0, DI_NORMAL) ;
end;

end.

It is only a solution for Windows, and it does not remove the 
'permanent' cursor until a second click, but it should get you on the 
right path.


Howard

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


[Lazarus] I thought it was solved -- TQuery.Open very slow.

2011-08-01 Thread Howard Lee Harkness
I thought I had fixed the performance problem, but it is still there.
What I am doing is opening 3 dependent queries after selecting a
record in the main table. It takes 8 or 9 seconds to do the 3 calls to
TQuery.Open. Any clues as to what I might be doing wrong? The sample
queries done from sqlite3.exe return instantaneously, so I am
concluding that I have not set something up correctly in the LCL.

-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] I thought it was solved -- TQuery.Open very slow.

2011-08-01 Thread Howard Lee Harkness
I have a dummy database and complete program I can let you look at if
you would like. Nothing particularly proprietary about the code; it's
a trivial application. The database is the sensitive part, and I have
it dummied out.

I posted the schema a few days ago, and I've added a zipcode table to
that. I had initially thought I had solved the performance problem,
but when I got to the client, and ran it on his machine (which is
about 100x slower than mine). I had not noticed the lag on my machine,
but it was really awful on his.

The whole project is in a 1.6Mb zip, expands to just over 7Mb. Would
you like me to email it directly to you, or post it?

On Mon, Aug 1, 2011 at 1:56 PM, Michael Van Canneyt
 wrote:
>
>
> On Mon, 1 Aug 2011, Howard Lee Harkness wrote:
>
>> I thought I had fixed the performance problem, but it is still there.
>> What I am doing is opening 3 dependent queries after selecting a
>> record in the main table. It takes 8 or 9 seconds to do the 3 calls to
>> TQuery.Open. Any clues as to what I might be doing wrong? The sample
>> queries done from sqlite3.exe return instantaneously, so I am
>> concluding that I have not set something up correctly in the LCL.
>
> Can you provide test data and a sample program ? Without that, it's very
> hard to give recommendations.
>
> The architecture of the sqlite components is not fundamentally different
> from
> the other database, and those do work instantaneously.
>
> Michael.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] I thought it was solved -- TQuery.Open very slow.

2011-08-03 Thread Howard Lee Harkness
I have added some code to only open a query if the corresponding
tabsheet is selected, which I think speeds things up sufficiently.
Still would like to know why a TQuery component would take 2 or 3
seconds to open, even on a slow machine.

Here is the SQL from my address table query:

select * from addresses
where ID = :ID
order by atype,asof

"atype" is a string (home, work, etc.) and "asof" is a date.

The SQL for the other two queries is very similar.

In the synchronization procedure to set the :ID value for each query:

   closeDependentQueries;
   CurrentClientID := qClients.FieldByName('ID').AsInteger;
   qAddresses.Params.ParamByName('ID').Value := CurrentClientID;
   qCases.Params.ParamByName('ID').Value := CurrentClientID;
   qPhones.Params.ParamByName('ID').Value := CurrentClientID;

I have not yet played around with the foreign key stuff, and I'm not
really sure how to enable & use foreign keys in SQLite, anyway.

On Mon, Aug 1, 2011 at 4:21 PM, Howard Lee Harkness
 wrote:
> I have a dummy database and complete program I can let you look at if
> you would like. Nothing particularly proprietary about the code; it's
> a trivial application. The database is the sensitive part, and I have
> it dummied out.
>
> I posted the schema a few days ago, and I've added a zipcode table to
> that. I had initially thought I had solved the performance problem,
> but when I got to the client, and ran it on his machine (which is
> about 100x slower than mine). I had not noticed the lag on my machine,
> but it was really awful on his.
>
> The whole project is in a 1.6Mb zip, expands to just over 7Mb. Would
> you like me to email it directly to you, or post it?
>
> On Mon, Aug 1, 2011 at 1:56 PM, Michael Van Canneyt
>  wrote:
>>
>>
>> On Mon, 1 Aug 2011, Howard Lee Harkness wrote:
>>
>>> I thought I had fixed the performance problem, but it is still there.
>>> What I am doing is opening 3 dependent queries after selecting a
>>> record in the main table. It takes 8 or 9 seconds to do the 3 calls to
>>> TQuery.Open. Any clues as to what I might be doing wrong? The sample
>>> queries done from sqlite3.exe return instantaneously, so I am
>>> concluding that I have not set something up correctly in the LCL.
>>
>> Can you provide test data and a sample program ? Without that, it's very
>> hard to give recommendations.
>>
>> The architecture of the sqlite components is not fundamentally different
>> from
>> the other database, and those do work instantaneously.
>>
>> Michael.
>>
>> --
>> ___
>> Lazarus mailing list
>> Lazarus@lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
>
>
> --
> Howard Lee Harkness
> (214) 390-4896
>



-- 
Howard Lee Harkness
(214) 390-4896

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


[Lazarus] Chain procedure in FPC/Lazarus?

2011-08-03 Thread Howard Lee Harkness
In Delphi, I recall that there is an Exec procedure for calling
another .exe, and a Chain procedure for transferring to another .exe.
I assume that these are also in FPC/Lazarus, but I haven't found any
Lazarus documentation for these calls. Could somebody tell me where to
look?

-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] Chain procedure in FPC/Lazarus?

2011-08-03 Thread Howard Lee Harkness
2011/8/3 "Arí Ricardo Ody" :
> TProcess

That was what I needed. Using that as the search term got me the
relevant documentation.

Thanks!

-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] Chain procedure in FPC/Lazarus?

2011-08-03 Thread Howard Page-Clark

On 03/8/11 8:41, Howard Lee Harkness wrote:

In Delphi, I recall that there is an Exec procedure for calling
another .exe, and a Chain procedure for transferring to another .exe.
I assume that these are also in FPC/Lazarus, but I haven't found any
Lazarus documentation for these calls. Could somebody tell me where to
look?


try
http://wiki.lazarus.freepascal.org/Executing_External_Programs
CreateProcess() is the principal function call.

H.

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


Re: [Lazarus] Chain procedure in FPC/Lazarus?

2011-08-03 Thread Howard Lee Harkness
Thanks! I found it after somebody mentioned TProcess.

On Wed, Aug 3, 2011 at 3:19 PM, Howard Page-Clark  wrote:
> On 03/8/11 8:41, Howard Lee Harkness wrote:
>>
>> In Delphi, I recall that there is an Exec procedure for calling
>> another .exe, and a Chain procedure for transferring to another .exe.
>> I assume that these are also in FPC/Lazarus, but I haven't found any
>> Lazarus documentation for these calls. Could somebody tell me where to
>> look?
>>
> try
> http://wiki.lazarus.freepascal.org/Executing_External_Programs
> CreateProcess() is the principal function call.
>
> H.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
(214) 390-4896

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


[Lazarus] TQuery.Open 100x slower than same code using PostrgreSQL

2011-08-06 Thread Howard Lee Harkness
Now I'm seeing a very slow response to opening the main table, even
with no dependent tables.

I set the SQL in the TQuery, then do an open. It takes 4 to 6 seconds
to populate the TDBGrid. When I was using PostgreSQL with the same
database, it was instant.

  qClients.Close;
  qClients.SQL.Text:='select * from clients where lastname is not NULL
order by lastname,firstname,middlename';
  qClients.Open; // takes 4 to 6 seconds here

There has GOT to be something I'm not understanding. I thought SQLite
was going to speed things up, not slow them down.

On Wed, Aug 3, 2011 at 11:10 AM, Howard Lee Harkness
 wrote:
> I have added some code to only open a query if the corresponding
> tabsheet is selected, which I think speeds things up sufficiently.
> Still would like to know why a TQuery component would take 2 or 3
> seconds to open, even on a slow machine.
>
> Here is the SQL from my address table query:
>
> select * from addresses
> where ID = :ID
> order by atype,asof
>
> "atype" is a string (home, work, etc.) and "asof" is a date.
>
> The SQL for the other two queries is very similar.
>
> In the synchronization procedure to set the :ID value for each query:
>
>   closeDependentQueries;
>   CurrentClientID := qClients.FieldByName('ID').AsInteger;
>   qAddresses.Params.ParamByName('ID').Value := CurrentClientID;
>   qCases.Params.ParamByName('ID').Value := CurrentClientID;
>   qPhones.Params.ParamByName('ID').Value := CurrentClientID;
>
> I have not yet played around with the foreign key stuff, and I'm not
> really sure how to enable & use foreign keys in SQLite, anyway.
>
> On Mon, Aug 1, 2011 at 4:21 PM, Howard Lee Harkness
>  wrote:
>> I have a dummy database and complete program I can let you look at if
>> you would like. Nothing particularly proprietary about the code; it's
>> a trivial application. The database is the sensitive part, and I have
>> it dummied out.
>>
>> I posted the schema a few days ago, and I've added a zipcode table to
>> that. I had initially thought I had solved the performance problem,
>> but when I got to the client, and ran it on his machine (which is
>> about 100x slower than mine). I had not noticed the lag on my machine,
>> but it was really awful on his.
>>
>> The whole project is in a 1.6Mb zip, expands to just over 7Mb. Would
>> you like me to email it directly to you, or post it?
>>
>> On Mon, Aug 1, 2011 at 1:56 PM, Michael Van Canneyt
>>  wrote:
>>>
>>>
>>> On Mon, 1 Aug 2011, Howard Lee Harkness wrote:
>>>
>>>> I thought I had fixed the performance problem, but it is still there.
>>>> What I am doing is opening 3 dependent queries after selecting a
>>>> record in the main table. It takes 8 or 9 seconds to do the 3 calls to
>>>> TQuery.Open. Any clues as to what I might be doing wrong? The sample
>>>> queries done from sqlite3.exe return instantaneously, so I am
>>>> concluding that I have not set something up correctly in the LCL.
>>>
>>> Can you provide test data and a sample program ? Without that, it's very
>>> hard to give recommendations.
>>>
>>> The architecture of the sqlite components is not fundamentally different
>>> from
>>> the other database, and those do work instantaneously.
>>>
>>> Michael.
>>>
>>> --
>>> ___
>>> Lazarus mailing list
>>> Lazarus@lists.lazarus.freepascal.org
>>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>>
>>
>>
>>
>> --
>> Howard Lee Harkness
>> (214) 390-4896
>>
>
>
>
> --
> Howard Lee Harkness
> (214) 390-4896
>



-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] [Feature request] Add PNF image to Package

2011-08-31 Thread Howard Page-Clark

On 31/8/11 3:34, Zaher Dirkey wrote:

Is it possible in the future to have this feature

Add an png file to the package, when compile the package it
automatically convert it to the .lrs file related to this package,
it is useful for adding image icons for our controls.


When you create a new component for a package you can select an icon
(not only png).

Creating an lrs from a png is a one liner on the console/terminal.

Thanks for your replay, but it is more easy for newbe Lazarus users or
for lazy people like me.


I presume you are aware that selecting an icon for a new component in 
the Package Editor causes automatic generation of an appropriate .lrs 
file for the icon, provided the icon has the same name as the new 
component class (ignoring extension), and that it is no bigger than 
24x24 pixels? Lazarus also auto-generates in the Register procedure an 
appropriate {$I componentUnitName_icon.lrs} line as well. So provided 
you are only adding one new component, everything is done for you by the 
IDE, except for designing the icon.
If you want several icons to be registered in one unit for several 
components, then you do have to write a bit of code, and use the 
lazres.exe tool to generate the correct .lrs file yourself.


Howard


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


[Lazarus] typinfo routine gives memory leak

2011-09-20 Thread Howard Page-Clark
The following (button and memo) program loses 276 bytes heap memory that 
are not recovered.


unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Forms, StdCtrls;

type
  TForm1 = class(TForm)
BGetProperties: TButton;
Memo1: TMemo;
procedure BGetPropertiesClick(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

uses Dialogs, typinfo;

{$R *.lfm}

procedure TForm1.BGetPropertiesClick(Sender: TObject);
var ppl: PPropList;
pl: TPropList;
ppi: PPropInfo;
pi: TPropInfo;
begin
  GetPropList(TEdit, ppl);
  pl := ppl^;
  ppi := pl[0];
  pi := ppi^;
  if PropIsType(TEdit, pi.Name, tkAString) then
  ShowMessageFmt('TEdit''s first PropList entry is %s of 
tkAString',[pi.Name]);

end;

end.

Anyone know what I'm doing wrong?

Howard

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


Re: [Lazarus] typinfo routine gives memory leak

2011-09-20 Thread Howard Page-Clark

On 20/9/11 10:02, Martin wrote:

On 20/09/2011 21:59, Howard Page-Clark wrote:

The following (button and memo) program loses 276 bytes heap memory
that are not recovered.


...

procedure TForm1.BGetPropertiesClick(Sender: TObject);
var ppl: PPropList;
pl: TPropList;
ppi: PPropInfo;
pi: TPropInfo;
begin
GetPropList(TEdit, ppl);
pl := ppl^;
ppi := pl[0];
pi := ppi^;
if PropIsType(TEdit, pi.Name, tkAString) then
ShowMessageFmt('TEdit''s first PropList entry is %s of
tkAString',[pi.Name]);
end;

end.

Anyone know what I'm doing wrong?

afaik you need to

FreeMem(ppl);


Many thanks

H.

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


Re: [Lazarus] Problem to rename a form

2011-09-28 Thread Howard Page-Clark

On 28/9/11 1:24, Rafael Tuim Elias wrote:

I found a strange behavior in Lazarus IDE. To reproduce follow that steps:

1 - Create a new project.
2 - Rename Form1 to fmAINmENU
3 - Save all
4 - Try to rename the form to FMainMenu

IDE doesn't permit. The error: This component has already the class TFPrint.

I think it is a little bug.


It's not a bug if the error message is
 "This component has already the class fmAINmENU"

since the IDE rightly disallows having two components with identical 
names (ignoring case). So, yes, the IDE does not check if you are just 
altering the case of the component name from what was originally 
entered. It won't let you do that. Hardly a big deal.


However, the English error message would be better "This component 
already has the class..." (which is English, rather than transliterated 
German).


H





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


[Lazarus] lazde problem with '<' character

2011-10-02 Thread Howard Page-Clark
If you attempt to open the lazarus\docs\xml\rtl\system.xml in lazde it 
chokes on line 9705 pos 31 with an exception:

character '<' not allowed in attribute value

and in the offending line:
 
it is clear that the 'less-than' operator is causing the problem.

Presumably lazde was not used to create this file?
Is there some way to escape characters such as this which have a special 
meaning to an XML file parser?

If not, should I report this as a bug?

Howard

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


Re: [Lazarus] lazde problem with '<' character

2011-10-03 Thread Howard Page-Clark

On 03/10/11 1:14, Mattias Gaertner wrote:

On Sun, 02 Oct 2011 20:57:20 +0100
Howard Page-Clark  wrote:


If you attempt to open the lazarus\docs\xml\rtl\system.xml in lazde it
chokes on line 9705 pos 31 with an exception:
character '<' not allowed in attribute value


I fixed the system.xml


Many thanks

Howard


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


Re: [Lazarus] Does Lazarus have file name and line number macros for inserting into DebugLn/WriteLn statements?

2011-10-06 Thread Howard Page-Clark

On 06/10/11 1:12, Frank Church wrote:



all that remains is the name of the current procedure :)


There is already $ProcedureName() you can use in a code template (see 
Tools->Code Templates).


H


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


[Lazarus] unfortunate typo in ideintf\propedits.pp

2011-10-14 Thread Howard Page-Clark
In the declaration of the class TCustomShortCutGrabBox there is a 
hilarious inadvertent typo at line 1430.
The method was doubtless intended to be named OnShiftCheckBoxClick, but 
a vital 'f' got missed.

Lines 6408 and 6513 need adjusting accordingly too.

Mattias, you made my day!

regards

Howard

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


[Lazarus] FindInFiles dialog size

2011-10-14 Thread Howard Page-Clark
Under Windows (not sure about appearance on Mac or Linuxes) the 
FindInFiles dialog is not big enough to show the "Where" radiobutton group.


The .lfm has

object LazFindInFilesDialog: TLazFindInFilesDialog
  Left = 408
  Height = 400

Height needs to be closer to 500 to display all the contained components 
correctly.


Howard

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


Re: [Lazarus] How to obtain the color of a component?

2011-10-20 Thread Howard Page-Clark

On 20/10/11 4:57, Felipe Monteiro de Carvalho wrote:

Hello,

Is there any easy way to obtain the color of a component taking into
considerating all the factors? aka, propagating ParentColor, resolving
clDefault, etc.

I have my TCDPageControl on top of a form, but for
TCDPageControl.Color I get just clDefault, which turns out to be
black. =( using Parent.GetDefaultColor(dcBrush) also returned black in
Windows...

If there is no easy way maybe we should add one?

I think it is possible since clDefault is TColor($2000) and clBlack 
is TColor($00) there are situations where the most significant bits 
of clDefault are lost and the two colours become identical.
I've found that the Object Inspector's default component editor for 
colours seems at times to initialise colours to $00 whatever the 
component's constructor may have directed.
In these situations I've resorted to overriding the Loaded method to set 
the desired value.


Howard

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


Re: [Lazarus] Lazarus 0.9.30.2RC2 available

2011-10-26 Thread Howard Page-Clark

On 26/10/11 7:39, silvioprog wrote:


The setup to Windows is corrupted too:

http://imagebin.org/180904


Strange, I had no problem with the windows download or installation.

Howard

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


[Lazarus] recent Tools->Example Projects dialog

2011-10-28 Thread Howard Page-Clark
Just for clarity in the code I suggest that \ide\manageexamples.pas 
lines 54 and 55 should have procedures named:

FillDirectoriesPending;
FillProjectsPending;

with a 'P' not a 'B'?

Howard

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


Re: [Lazarus] RunError(53216) in TOpenDialog

2011-11-08 Thread Howard Page-Clark

On 08/11/11 12:30, Anders E. Andersen wrote:


I am using Lazarus 0.9.30.2 on Windows 7 Home premium 64 bit.

When I hover with the mouse over a word document in TOpenDialog I get
the runerror.


I compile and run your project without errors on Win7. This runtime 
error you experience may be related to errors in the Windows registry, 
possibly caused by earlier virus infections or incomplete software 
uninstalls.
I suggest you run a thorough antivirus scan (and also a registry cleaner 
if you have one), and see if that solves the problem.


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


Re: [Lazarus] RunError(53216) in TOpenDialog

2011-11-09 Thread Howard Page-Clark

On 09/11/11 6:21, Anders E. Andersen wrote:


I uninstalled win64 lazarus and installed win32 lazarus and rebuild my
project. It works fine in 32 bit!

Then I uninstalled that and reinstalled 64 bit lazarus and rebuild
again. The program crashes again.


In which case you have uncovered a bug in 64-bit Lazarus (or 64-bit 
FPC). It may have been reported already, but best to log it as an issue 
on Mantis with your example code so that it can be assigned to a 
developer to sort out (if you can't discover and remedy the cause, and 
submit a patch).



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


Re: [Lazarus] Petition to Skype

2011-12-05 Thread Howard Page-Clark

On 05/12/11 8:14, Krzysztof wrote:


I am wondering... maybe create some online petition to Skype?
Corrections are welcome (my English is not good).


I don't know if there is merit in such a submission. But if so, my
suggestions for slightly improved phrasing are as follows:

"This petition is submitted to the Skypekit developers from a community 
of Free Pascal and Lazarus users.
Free Pascal shares an aim of the Skype(kit) project - to run on as many 
platforms as possible.
This professional open source compiler is currently available for 32-bit 
and 64-bit processors such as Intel x86, AMD64/x86_64, PowerPC, 
PowerPC64, Sparc and ARM, and supported operating systems include Linux, 
FreeBSD, Haiku, Mac OS x/Darwin, Win32, Win64, WinCE, OS/2, Netware 
(libc and classic), MorphOS, Amiga and Symbian. The Lazarus IDE adds 
support for interfaces including the Windows API, GTK, QT, Cocoa, Carbon 
and Android.
We are disappointed that such a rich and continuously developing 
environment has been omitted from Skypekit project development, and 
write to ask for support for Free Pascal to be considered and included 
in future.
We believe that Free Pascal developers would extend and enhance Skype 
services, just as C++, Python and Java developers are doing.


Yours sincerely,
the Free Pascal and Lazarus community"

BTW, does FPC/Lazarus currently run under OS/2?

Howard

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


Re: [Lazarus] Check changes on disk with loading

2011-12-11 Thread Howard Page-Clark

On 11/12/11 4:52, Juha Manninen wrote:


Ok, after reading your reply again I got it, and the feature even seems
to work as advertised.
Still,'Check changes on disk while loading' doesn't mean anything. Maybe
it should be:
'Read also file contents when checking if file has changed on disk'


Possible improved phrasing (if I've understood the feature correctly) 
might be

'Check for disk file changes via content rather than timestamp'

Howard


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


[Lazarus] Date format conversion function?

2011-12-21 Thread Howard Lee Harkness
I am using SQLite in a small application, and using TDateEdit to pick
a date. The date is returned in the Text field (I can't find a
DateTime property in this control) in the format 'mm/dd/', and to
use INSERT in SQLite, it wants dates in the format '-mm-dd'. Yes,
I can write a reformatting function, but I would expect one to be
already available somewhere.

I'm having some trouble believing that there is no such function in
Lazarus, but I just can't find it. If somebody here knows where such a
function (or equivalent functionality in a class) may be found, please
enlighten me.

TIA!
-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] Date format conversion function?

2011-12-22 Thread Howard Lee Harkness
On Thu, Dec 22, 2011 at 2:30 AM,   wrote:
>
> See FormatDateTime in sysutils.
>
> And TDateEdit has a Date property which is of type TDateTime.
>
> Michael.
>

I discovered that about thirty minutes after I posted the request.

Thanks!
-- 
Howard Lee Harkness
(214) 390-4896

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


Re: [Lazarus] Combobox styles

2011-12-27 Thread Howard Page-Clark

On 27/12/11 12:57, Hans-Peter Diettrich wrote:

A combobox with csSimple style is not handled properly at design time
(win32). It's impossible to give the control a specific Height, it stays
on the dropdown style equivalent (Height=23).

Is it me, or is this a bug?


I think it's a limitation of the underlying win32 widget.


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


Re: [Lazarus] Cycle vs. Circle errors

2012-01-03 Thread Howard Page-Clark

On 03/1/12 5:43, Mattias Gaertner wrote:


The term "circle" was translated from German graph theory, but the
common words in English graph theory are "cycle" and "cyclic".


I'm not familiar with graph theory and the possibly specialist technical 
meanings given there to words in common use.


However, in everyday English neither of the nouns 'cycle' or 'circle' 
has the meaning 'mutual interdependence' except perhaps as a curious 
extension of the metaphor which works poorly if at all.


Whereas the adjective 'circular' can carry a meaning of 'interdependent' 
or 'dependent on itself'. So a 'circular argument' is flawed in that it 
refers to itself rather than to an independently established 
proposition. But in English you would not normally refer to such a 
circular argument as a 'circle' and expect people (apart perhaps from 
graph theorists?) to appreciate immediately what you meant.


Dependency (or interdependency) is the more descriptive term, which does 
not rely on a strained metaphor - although 'mutual dependency' is rather 
a mouthful.



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


Re: [Lazarus] Cycle vs. Circle errors

2012-01-05 Thread Howard Page-Clark

On 05/1/12 12:39, Mattias Gaertner wrote:


In both cases the important thing is not so much the adjective
(circular, cyclic) but the combination of adjective plus noun, which
/should/ be used consistently in documentation and error messages.


Yes.
And since this is open source, it should also be consistent with
the sources, which means the used structures and algorithms.

I changed it to circular dependencies and endless loops because Google
gave more results.


Thanks for clarifying this. Let's try to use 'circular dependencies' and 
'endless loops' (or 'infinite loops' which is an equivalent phrase) and 
their non-English translations in future comments and documentation, and 
avoid 'cycle', 'circle', 'cyclic' and so on - not so much because they 
are wrong (graph theory quite validly introduced them) but for 
consistency and ease of understanding among Pascallers who don't know 
graph theory (or only know it intuitively).



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


Re: [Lazarus] circular reference etc.

2012-01-05 Thread Howard Page-Clark

On 05/1/12 4:21, etienne.lebl...@free.fr wrote:

in a famous French langage dictionnary there was once upon a time a perfect 
circular reference

étourneau (see) sansonnet

sansonnet (see) étourneau


.. not to mention the numerous programming books which have indexes 
containing entries like


Recursion: see recursion

Infinite Loop: see Loop, Infinite
Loop, Infinite: see Infinite Loop



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


Re: [Lazarus] Code templates syntax

2012-01-10 Thread Howard Page-Clark

On 10/1/12 1:29, Antonio Fortuny wrote:

Hi folks.

Does anyone know where I can find a syntax description and the usage
rules of all keywords which appear in the source code templates ?
And those which do not appear as well ;-)
Basically I did find the file "..\lazarus\ide\lazarus_dci_file.dci" and
it already gives some self explanatory rules.
My purpose is to enriche as much as possible with code snippets that I
use very often


I would say that the Lazarus .dci file you mention is illuminating but 
not definitive, since Lazarus is derivative, based on the Free Pascal 
dialect. For that the most concise description of keywords etc. is the 
published Language Reference Guide documentation available at e. g. 
ftp://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf


Also the language is (slowly) evolving through all the Delphi 
innovations, for-in loop notation, generics etc.





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


Re: [Lazarus] Need help with TValueListEditor

2012-01-14 Thread Howard Page-Clark

On 14/1/12 5:59, Hans-Peter Diettrich wrote:

Where can I find sample code for this control?

I want to initialize the content with key/value pairs in code, track
changes and/or save the content in OnExit when Modified. Here I ran into
any number of quirks and bugs :-(

E.g. the code does not check properly for I<0 in various methods, after
subtracting the number of fixed rows/cols, resulting in list index
exceptions.

When the user edits the fields, Modified seems to be set only when a new
key is added, but not when a value is changed?


Indeed, if you drop a memo and valueListEditor on Form1 and add two 
buttons named btnCopyMemoToValueList and btnCopyValueListToMemo with the 
following event handlers you can see one of the bugs immediately:


procedure TForm1.FormCreate(Sender: TObject);
begin
  ValueListEditor1.Strings.Text :=
  'one=1'+LineEnding+'two=2'+LineEnding+'three=3'+LineEnding+'four=4';

 memo1.Lines.Text :=
'Afghanistan=Kabul'+LineEnding+'Albania=Tirane'+LineEnding+'Algeria=Algiers'+
  LineEnding+'Angola=Luanda'+LineEnding+'Armenia=Yerevan'+LineEnding+
'Australia=Canberra'+LineEnding+'Austria=Vienna'+'Azerbaijan=Baku'+LineEnding;
end;

procedure TForm1.btnCopyMemoToValueListClick(Sender: TObject);
begin
  ValueListEditor1.Strings.Assign(Memo1.Lines);
  ValueListEditor1.Invalidate;
end;

procedure TForm1.btnCopyValueListToMemoClick(Sender: TObject);
begin
  Memo1.Lines.Assign(ValueListEditor1.Strings);
  Memo1.Invalidate;
end;

Perhaps no one has used this component before (I hadn't) to see that it 
is rather buggy?



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


Re: [Lazarus] Need help with TValueListEditor

2012-01-18 Thread Howard Page-Clark

On 18/1/12 5:52, Mattias Gaertner wrote:


Please create a bug report with a small example project (only sources).


Done, issue 21115.

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


Re: [Lazarus] Displaying serial data

2012-01-26 Thread Howard Page-Clark

On 26/1/12 10:28, Koenraad Lelong wrote:


I'm using a memo to contain the serial port data. I add the data to the
last line of the memo, until I get a CR and/or LF character, then I add
a new line in the memo.
That works fine, except when the lines are longer, then the memo starts
to flicker.


Is the memo's DoubleBuffered property set to True? This might help 
(depending on your platform).


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


Re: [Lazarus] TPageControl - how to use it?

2012-01-28 Thread Howard Page-Clark

On 28/1/12 7:50, Bernd wrote:

 I have a TPageControl on my form and at runtime I
want to add a new page with a SynEdit on it.

This is what I have so far:
...
But it does not work.


Try this:

procedure TForm1.AddTab(AFileName: String);
var
  Sheet: TTabSheet;
  Ed: TSynEdit;
begin
  Sheet := TTabSheet.Create(pagecontrol1);
  sheet.Parent := PageControl1;
  Sheet.Caption := 'Unnamed';
  Ed := TSynEdit.Create(Sheet);
  ed.Parent := Sheet;
  ed.BoundsRect := sheet.BoundsRect;
  ed.LineText := 'specimen line';
  PageControl1.ActivePage := Sheet;
end;



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


Re: [Lazarus] TPageControl - how to use it?

2012-01-28 Thread Howard Page-Clark

On 28/1/12 9:00, Mattias Gaertner wrote:

Hint:
You don't need the Delphism "set Parent first" under LCL. The above will
create a lot of updates.

procedure TForm1.AddTab(AFileName: String);
var
   Sheet: TTabSheet;
   Ed: TSynEdit;
begin
   Sheet := TTabSheet.Create(pagecontrol1);
   Sheet.Caption := 'Unnamed';
   Ed := TSynEdit.Create(Sheet);
   ed.Align := alClient; // fill the whole sheet
   ed.LineText := 'specimen line';
   ed.Parent := Sheet;
   PageControl1.ActivePage := Sheet;
   sheet.Parent := PageControl1; // set Parent as last to reduce updates
end;


Thanks for the hint. I would not have known that from reading the wiki - 
I think it is worth documenting there somewhere.


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


Re: [Lazarus] RE : TQuery.Open 100x slower than same code using PostrgreSQL

2012-02-06 Thread Howard Lee Harkness
After several hours (over a period of a couple of months) of battling this
problem, I finally found the cause. I was not looking in the right place.
Turns out that I had a dependent query that were being opened after the
client TQuery. Actually, there were 3 different dependent queries, only one
of which was causing the problem. On my system, I never ran into the
problem, primarily because my testing was not comprehensive enough -- and
the attorney ran into it almost immediately every time he used it (and he
just complained that it was too slow). I finally just recorded *exactly*
what he was doing, and then easily duplicated the problem.

The problem query was the "cases" table, which has a client ID foreign key,
an OID (primary key), a date and a large text field. PostgreSQL did not
have any slowdown at all with this database schema, so I was surprised to
see that SQLite took two orders of magnitude longer to open that same table.

What I did was simply close the case table whenever doing the incremental
search. That works, although it seems to be a bit of a hack.



On Sun, Aug 7, 2011 at 3:08 AM, Ludo Brands  wrote:

> >
> > There has GOT to be something I'm not understanding. I
> > thought SQLite was going to speed things up, not slow them down.
> >
>
> Clearly you are not providing enough information to reproduce the problem.
> So far it has all been guess work for people trying to help. Fe. your
> initial request for help "forgot" to mention that there were several
> dependant queries. If you upload the project we can take a look at it. Data
> aren't needed. Populating with random data is easy. Seen the size of your
> project (I guess this mailing list has attachment size limits) upload it
> somewhere and post the link.
>
> Ludo
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Howard Lee Harkness
(214) 390-4896
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Adding Notes in FPDoc

2012-02-11 Thread Howard Page-Clark

On 11/2/12 3:04, Michael Van Canneyt wrote:


Within the  tag, you can include one or more  tags.


Why so complicated? Can you give a *reasonable* example of the
intended usage of this feature?


Yes. User notes on a website. This website has been in the pipeline for
a long time.


The prospect of a website dedicated to discussion of documentation seems 
to me to be a helpful move forward. This mailing list is not well suited 
to detailed discussions of the numerous issues 'documentation' and 
'help' raise, and use of it for that creates a lot of noise that some 
find irritating.
Nevertheless it is one of the major bullets to be bitten before Lazarus 
can consider getting to the 1.0 stage, and so having an interactive 
arena dedicated to it would be excellent, and I hope would move Lazarus 
docs further towards the goal of being adequate if not good or excellent.
FPC documentation has the advantage of being overseen by a single person 
who has the ability not only to produce and maintain the tools needed to 
write the documentation, but is punctilious in writing the docs and 
keeping shiny new code (however good) out of the FCL until it is 
properly documented. Someone who has poured countless hours into writing 
and correcting the existing docs - making that a priority - alongside 
writing much of the original code. Someone who is also good at 
collaborating with other core developers. Also FPC  does not need to 
document or provide help for a complex IDE that is growing in features 
all the time.
I think the Lazarus team lacks an equivalent core person who combines 
coding expertise with the organisational, administrative and English/XML 
writing skills (and available time to marshal all the 
information/databases/people/wikis and so on) needed to produce good 
quality documentation, and good quality help. This is not to knock 
anyone - goodness knows, each does his best - but simply to point out 
what is true for so many open source collaborative efforts: you have to 
work with the people who offer and stay engaged for more than just the 
short term, and who make the time to contribute enough to make their 
contribution significant.
I hope that a new website might help us bring together the best of what 
is in the current wiki and has been written over the years in these 
mailing lists and the already published Lazarus book. A consolidation 
and editing exercise is needed (in addition to documenting the hitherto 
undocumented parts of the LCL), and I believe there are several people, 
myself included, who are ready to help with this task who have not done 
much towards it so far beyond tidying up the worst bits we stumble over 
in the wiki.



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


Re: [Lazarus] from hfiandor 23 feb 2012 about popup menu

2012-02-22 Thread Howard Page-Clark

On 23/2/12 3:50, Ing. Héctor F. Fiandor Rosario wrote:

Dear colleagues:

i have included a tPopUpMenu in a form and programed as in Delphi, but I
can´t make it visible.


1. You've hijacked an existing thread with an unrelated topic. Please 
start a new thread when raising a new issues.


2. A stripped-down version of your code showing the lines that don't 
achieve the desired effect will help someone here advise you what to do.


3. We presume since your program comes from Delphi that its a Windows 
target, but it always helps others to make this information explicit.


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


Re: [Lazarus] Test

2012-03-02 Thread Howard Page-Clark

On 02/3/12 9:22, Richard Mace wrote:

Please can someone respond, as I don't think my messages are getting
through to the list.


That message appeared OK.

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


[Lazarus] External help dialog

2012-03-03 Thread Howard Page-Clark
The work being done to improve the Help functionality in Lazarus is much 
appreciated. One part of the newer interface that currently seems 
inadequate to me is the naming of the "Macrofy" button 
(Tools¦Options¦Help¦External).


I think it is OK to name the underlying string function Macrofy, as a 
convenient neologism to describe the functionality. However, it does not 
work as a button label, being far too cryptic, and I think the hint 
description "Replace common directories with macros" (or something like 
it) should be part of caption of the control that initiates the macrofying.


Such a long phrase is probably too verbose for a button caption, but the 
present terse "Macrofy" is just too odd (at least in English, perhaps it 
works better in other languages), and it is too short, lacking the 
immediately obvious meaning that the button will effect a replacement of 
directory path names with macro substitutions.


I welcome the functionality, but think it needs to be presented to the 
user less cryptically.


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


Re: [Lazarus] External help dialog

2012-03-04 Thread Howard Page-Clark

On 04/3/12 5:57, Mattias Gaertner wrote:

On Sat, 03 Mar 2012 23:05:32 +
Howard Page-Clark  wrote:


The work being done to improve the Help functionality in Lazarus is much
appreciated. One part of the newer interface that currently seems
inadequate to me is the naming of the "Macrofy" button



I changed it to "use macros".


Thanks. I think this will help new users understand its purpose better.

Howard


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


[Lazarus] minor typo

2012-03-15 Thread Howard Page-Clark
/lazarus/lcl/lclclasses.pp has a minor typo in line 203. The debugln 
string should read

'... circular reference ...'
(not 'circulair').

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


Re: [Lazarus] disable the debugger capturing the OutputDebugString() messages

2010-07-21 Thread Howard Page-Clark

On 21/7/10 1:16, Michael Schnell wrote:

On 07/20/2010 03:28 PM, Michael Van Canneyt wrote:


I suggest you look at the debugserver tool and the dbugintf units in FPC.


Where to find the "dbugsrv executable" ?


lazarus\tools\debugserver\debugserver.lpi

Howard

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


Re: [Lazarus] CHM help snapshot

2010-08-22 Thread Howard Page-Clark

On 22/8/10 7:26, Marco van de Voort wrote:

Hello,

I've generated a new help snapshot. (chm files)

The archive still is at

http://www.stack.nl/~marcov/doc-chm.zip

and contains rtl,fcl,lcl  ,fpdoc,ref,user,prog.chm


Thanks for this. The archive contains .xct, but no .kwd files.
Is this an oversight?

Howard

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


Re: [Lazarus] How to create: TButtonGrid descendant of TCustomDrawGrid ?

2010-08-28 Thread Howard Page-Clark

On 28/8/10 10:31, Peter E Williams wrote:

Hi,

This email is related to my previous post.

I want to create a new component called a TButtonGrid which would be a
descendant of TCustomDrawGrid. Problem is that I don't know how to do
that. Obviously, I would need to make the CustomDraw (???) draw a
TButton.

Does anyone have some example(s) of how to do this, please???


Is this the sort of thing you want?

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, Grids, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;

type
  { TButtonGrid }

  TButtonGrid = class(TStringGrid)
public
  constructor Create(AOwner: TComponent; rowws, colls: cardinal);
  end;

  { TForm1 }

  TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
  private
btnGrid: TButtonGrid;
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TButtonGrid }

constructor TButtonGrid.Create(AOwner: TComponent; rowws, colls: cardinal);
var i, j, k: cardinal;
begin
inherited Create(AOwner);
Parent := TWinControl(AOwner);
Left := 10;
Top := 10;
Width := colls*DefaultColWidth;
Height := rowws*DefaultRowHeight;
ExtendedSelect := False;
FixedCols := 0;
FixedRows := 0;
GridLineWidth := 0;
AutoEdit := False;
BorderStyle := bsNone;
RowCount := rowws;
ColCount := colls;
for j := 0 to colls - 1 do
 with Columns.Add do
   ButtonStyle := cbsButtonColumn;
k := 1;
 for i := 0 to rowws-1 do
  for j := 0 to colls-1 do
  begin
   Cells[j, i] := Format('Btn %d',[k]);
   inc(k);
  end;
end;

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  btnGrid := TButtonGrid.Create(self, 6, 4);
end;

end.

Howard

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


Re: [Lazarus] How to create: TButtonGrid descendant of TCustomDrawGrid ? (ik)

2010-08-29 Thread Howard Page-Clark

On 29/8/10 10:17, Peter E Williams wrote:

On Sun, 29 Aug 2010 10:41:53 +0300, Ido wrote:

From: ik

Hi,

I've created this component. You can find it at:
http://github.com/ik5/linesip-components/blob/master/buttons/untbuttonlist.pas

Ido
http://ik.homelinux.org/



Thanks, Ido, I will use your unit. It saves me from reinventing
it. :-)))

Regards,
PEW  ;-)))
Hobart, Tasmania, Australia


Ido's custom written component is definitely the way to go.

I found that to get it to compile under Windows I had to change two 
identifiers on lines 179 and 180 of his unit from


 GetControlClassDefaultSize.X  Y

to
 GetCOntrolClassDefaultSize.cX .cY

Howard

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


Re: [Lazarus] TDbf tutorials 07 nov 2010

2010-11-07 Thread Howard Page-Clark

On 07/11/10 7:02, hector fiandor wrote:

I am trying to do something with TDbf in my Lazarus 0.9.27 FPC 2.2.3
under my poor experience with Delphi5 Databases, but I can see how a
lack of knowledge I suffer.

I will appreciate very much the suggestions of how to obtain some
literature about TDbf.


The wiki would be a good place to start:
http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial

H

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


Re: [Lazarus] Compile time errors. Error: Duplicate identifier "Fragments" line 21 and AnsiStrings question.

2011-01-08 Thread Howard Page-Clark

On 08/1/11 10:13, Pew (piffle.the.cat) wrote:

Hi Lazarus list,

...

I currently have 2 issues:
1) How do I define fragments_to_eggs_subrange which is an enumerated
portion of green_types.
2) How do I define a constant array of strings //
string_stunned_the_green_message, etc


You want the following:

type
  green_types = ( Fragments, Babies, Adults, Eggs, Group_of_Green_things );

  fragments_to_eggs_subrange = Fragments..Eggs;

const
  GreenTypeStrings : array[green_types] of string =
(' stunned the Fragment', ' stunned the Baby', ' stunned the Adult',
' stunned the Egg', ' stunned the Group of Green Things');

HTH

Howard

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


Re: [Lazarus] Forum under attack

2011-01-12 Thread Howard Page-Clark

On 12/1/11 9:27, Mark Morgan Lloyd wrote:

Felipe Monteiro de Carvalho wrote:

On Tue, Jan 11, 2011 at 10:26 PM, Mark Morgan Lloyd
 wrote:

How about a Capcha that was a coding problem?


Some users do not speak english very well, so they may not understand
the problem that we are trying to express.


But they speak Pascal, otherwise why are they trying to register?

function a(b, c: integer): integer;

function d(c, b): integer;

begin
b:= c + d
end;

begin
a:= d(c, c)
end;

What does a(2, 3) return?


Mark I think you can do better than that!

Assuming you meant to write

function d(c, b: integer): integer; etc.

it is still a nonsense, a function that tries to alter non-var 
parameters and has an undefined result.


It's OK to give newcomers to the forum a slight hurdle before entry, but 
not to offer them this sort of hopeless hoop that can't be jumped 
through, and suggests that the users of the forum can't write valid Pascal!


Howard

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


Re: [Lazarus] ICS on Lazarus?

2011-01-24 Thread Howard Page-Clark

On 24/1/11 5:16, Joshua Lim wrote:

Hi, i've a major project that uses ICS, and I intend to port it to
Lazarus. Has anyone used ICS on Lazarus successfully?


Note - you seem to have hijacked a thread with a different subject, I 
presume by mistake.

The webservices toolkit (WST) available at:

http://wiki.freepascal.org/Web_Service_Toolkit

uses ICS (and other libraries as well) very successfully.

H

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


[Lazarus] Missing SVN resource: sortselectiondlg.lfm

2011-02-08 Thread Howard Page-Clark
Recent (Windows) snapshots have not got a working Edit->Sort Selection 
dialog, because the sortselectiondlg.lfm is missing from the snapshot.

As far as I can see it has dropped out of the SVN repository too.
Anyone able to rectify this?

H

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


[Lazarus] Rebuilding IDE+packages fails

2011-02-10 Thread Howard Page-Clark
With the latest Win32 snapshot (revision 29435) I cannot successfully 
rebuild the IDE even with 'clean all'. Compilation fails saying


Recompiling fcllaz, checksum changed for RegisterFCL
fcllaz.pas(64,35) Fatal: Can't find unit fcllaz used by PackageSystem

with the fcllaz unit opened in the Editor. Is this a bug, or am I using 
the wrong settings?


H

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


Re: [Lazarus] Refactor Menu

2011-03-05 Thread Howard Page-Clark

On 05/3/11 11:19, Juha Manninen wrote:


I have refactored Lazarus main menu

...

More ideas?


A further consideration is how to make locating seldom-used 
functionality accessible easily via the present menu system, without 
resorting to space-wasting GUI elements such as a Ribbon.


Edit, Search and Run all have 20 or more items, of which several have 
subitems.


I often find myself searching for functionality I know is there 
somewhere ... and miss it several times in the long lists.


Is there scope for arranging some items alphabetically, or at least 
having a fundamental rethink about the order and design of the menus and 
their subitem lists as they have grown to the present state, so that a 
menu design can be refined and agreed that will hold for a considerable 
period up to and beyond a 1.0 release, and be a well-thought-through 
standard that does not keep changing (familiarity with a stable and 
logically arranged menu structure saves a lot of frustration), even as 
new functionality is added.


For instance the Search menu has four separator lines (supposedly 
grouping related functionality together?) Yet 'Goto line' is at the top 
of the second section, and 'Goto include directive' is in the middle of 
the fourth section. And if you add the jumptoimplementation package its 
menu item gets tagged on at the end; and none of the four separated 
sections has items that are ordered alphabetically (at least in the 
English IDE).


I'm not wanting to complain, rather to raise the question if now is not 
a good time to take stock of the erratic menu growth and changes over 
the past few years, and as Juha suggests, refactor it constructively.


Howard

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


Re: [Lazarus] Newbie

2011-03-05 Thread Howard Page-Clark

On 05/3/11 6:02, Milan Baša wrote:


stringgrid1.Cells[1,1]:=inttostr(i);
edit1.Text:=inttostr(i);
sleep(1000);
end;



Progressbar is working, statictext is increasing numbers but every other
components are frozen til the time program stops and at this moment i
can see everywhwere number 10.



I see no progress, only result 10.


Add Application.ProcessMessages; e. g. like this

...
edit1.Text:=inttostr(i);
Application.ProcessMessages;
sleep(1000);
...

Howard

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


Re: [Lazarus] Newbie

2011-03-05 Thread Howard Page-Clark

On 05/3/11 7:36, DSK wrote:


Try "for i:=0 to 1" and comment out "//sleep .."


This will fail - he's declared i as shortint

H

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


Re: [Lazarus] Newbie

2011-03-05 Thread Howard Page-Clark

On 05/3/11 9:22, DSK wrote:

Howard,


This will fail - he's declared i as shortint


Dang .. shoulda checked first ... 10,000 shouldn't fail:
Smallint -32768 .. 32767



mea culpa - misread

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


Re: [Lazarus] Refactor Menu

2011-03-06 Thread Howard Page-Clark

On 06/3/11 8:40, Marco van de Voort wrote:
> On Sat, Mar 05, 2011 at 04:26:14PM +0000, Howard Page-Clark wrote:
>> I'm not wanting to complain, rather to raise the question if now is not
>> a good time to take stock of the erratic menu growth and changes over
>> the past few years, and as Juha suggests, refactor it constructively.
>
> The trouble is that the Delphi layout is burned into the minds of 
many after

> 15 years. Deviating too far is unconstructive.
>
Point taken. However, Juha is proposing adding a main menu item which 
Delphi already has (well, not the XE Starter, but the others) and which 
Lazarus currently lacks, i. e. improving compatibility.


Also, the subitems in any given menu are often already quite divergent 
between Delphi and Lazarus. For instance:


D 2010 Edit  XE Starter Edit  Lazarus Edit
--   ---  ---
Undo Undo Undo
Redo Redo Redo
Format Source---  ---
---  Cut  Cut
Cut  Copy Copy
Copy PastePaste
PasteDelete   ---
Delete   Select All   Indent selection
Select All   ---  Unindent selection
---  Align to GridEnclose selection...
Align to GridBring to Front   Comment selection
Bring to Front   Send to Back Uncomment selection
Send to Back  Toggle comment
Align...  Insert $IFDEF
Size...   Sort selection
Scale...  ---
Tab Order...  Uppercase selection
Create Order...   Lowercase selection
Flip Children >   Tabs to spaces in selection
Lock Controls Break lines in selection
  ---
  Select >
  ---
  Insert from Character Map
  Insert text >
  ---
  Complete code
  Extract procedure

After 'Paste' there is no correspondence that is in any way helpful if 
you've memorised Delphi's menu order. So surely if reordering items (or 
moving them to another menu, or renaming them) can be shown to be a 
widely welcomed improvement, I see no reason to refuse consideration 
simply because Delphi's menu differs. It's never been identical, and 
with the superiority of quite a bit of Lazarus' functionality, I think a 
well-considered Lazarus menu structure that takes account of logicality, 
cross-platform considerations and internationalisation issues could show 
Delphi the way, since Lazarus is not constrained by a Windows-only 
history. Though I agree that gratuitous departure from the Delphi 
pattern for its own sake is pointless.


H

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


Re: [Lazarus] trouble with Radiogroup

2011-04-06 Thread Howard Page-Clark

On 06/4/11 12:08, hector fiandor wrote:

hello:

i have a medical app. with TDbf were it is used a lot of RadioGroups and
CheckBox. When call Insert for a new patient, all this RadioGroups and
CheckBox appears "Cheched" as default, but it is preferred to appear as
"unchecked" and lets the doctors to check or not when filling the form.

if this is possible, i will appreciate any help to do it.


Have you have set ItemIndex to your preferred value in the Object 
Inspector (or in initialization code)?

Do you still find display defaults differ from what you have set?

H

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


Re: [Lazarus] clDefault propagation

2011-04-26 Thread Howard Page-Clark

On 26/4/11 8:35, Mark Morgan Lloyd wrote:

I've got a form F, at the top of which is a status bar T. At the bottom
is a panel B containing status bars B1 and B2. The status bars and panel
are all set to clDefault.

On 0.9.28, the status bars are all grey.

On 0.9.30, the top status bar T is grey, while the bottom status bars B1
and B2 inherit their colour from B which in turn inherits it from the
form F (which is, unfortunately, black).

Is this to be expected?


In a forum reply Zeljko recently wrote:
"clDefault is default color of wincontrol provided by widgetset theme.
Look at qt implementation (TQtWidget.Palette).
TQtWidget.Palette is initialized before LCL changed any color to handle 
and it contains default QPalette for

that widget under it's current QStyle.
We decided to introduce clDefault to get all mighty color themes work, 
before that eg. TCustomPanel default color was clBtnFace, but when you 
look that from Qt side , that's wrong since clBackground is correct 
color for TCustomPanel, same for TCustomForm, it was clBtnFace, but 
clForm is color which should be there. To avoid problems with 
ParentColor property (if we change wincontrol default color as ws 
proposed), clDefault is here - default color for all wincontrols is 
clDefault and that's it."


So I think you're seeing the difference between clBtnFace (earlier) and 
clDefault (now).


Howard

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


[Lazarus] Minor typo in rttigrids.pas and objectinspector.pp

2012-04-19 Thread Howard Page-Clark
I've noticed that the property PrefferedSplitterX is misspelled in three 
source files (should be PreferredSplitterX). The corresponding "F" data 
field that holds the value is spelled correctly, so it's clearly an 
inadvertent typo.


Locations are:
lazarus\components\rtticontrols\rttigrids.pas (74,14)
lazarus\debugger\frames\debugger_general_options.pas (274,5)
lazarus\ideintf\objectinspector.pp (488,14) (536,14) (3745,62) (3787,10)


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


Re: [Lazarus] Has there been a known bug in GTK2 where TabVisible property affects the visibility of the tabsheet?

2012-04-25 Thread Howard Page-Clark

On 25/4/12 2:44, Frank Church wrote:


I am running a program developed for Win32 on Linux and I notice that
setting the TabVisible to false on a PageControl make the whole tabsheet
invisible.

Is that a known bug with the GTK2 page control?


TabSheets have two properties (for Delphi compatibility), Visible and 
TabVisible. Visible controls the visibility of items within the client 
area of a TabSheet. TabVisible allows the display (or not) of the 
tabSheet as a whole.



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


Re: [Lazarus] Object inspector hints ?

2012-04-30 Thread Howard Page-Clark

On 30/4/12 9:23, Mattias Gaertner wrote:

On Mon, 30 Apr 2012 10:03:41 +0200 (CEST)
Michael Van Canneyt  wrote:



Hi,

The lazarus code editor shows tooltip hints about identifiers; It gets those
from the sources or even fpdoc.

Is there any reason why the object inspector would not be able to offer the 
same hints ?
Properties and events are also just identifiers after all.


Right click on OI: enable Show hints


There is also the (optional) OI information box which displays limited 
documentation. However, it is often very limited.

e.g.

"TControl.OnClick
Event Handler for mouse click"

which hardly aids a programmer looking for more information, and in fact 
is hardly worth displaying at all.
Would it be difficult to add parameter and parameter type information, 
and function return type such as codetools offers in the Editor?


Howard


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


Re: [Lazarus] Object inspector hints ?

2012-04-30 Thread Howard Page-Clark

On 30/4/12 11:54, Hans-Peter Diettrich wrote:

Howard Page-Clark schrieb:




What's the use of such additional information in OI?

You can let the OI create the event handler for you, no need to bother
with parameters here.


For people who use a stable release all the time, set up according to 
their established preferences, this is true.


I prefer to work mainly with the cutting-edge. And working help for some 
reason is often the first casualty of a new installation.
Since Lazarus does not yet install all help files on all platforms 
ready-to-run, I often find on upgrading or using a daily snapshot that 
help and hints have stopped working for me, and require quite a lot of 
downloads and file copying and setting of help parameters (as URLs, not 
usual directory locations) before the new help installation is rolling 
again. Unaccountably this process sometimes goes quickly and smoothly, 
and at other times takes far too long, and I have to refer to wiki 
articles and mail list archives to try to solve the problem.


OTOH the OI already lists all published events nicely, without need to 
look up the sources. So it is quicker for me (if help is not yet 
working) to drop a component on a form, inspect some information in the 
OI as needed, and perhaps delete the component again if it is not 
actually needed. Obviously for classes that are not on the Component 
Palette this method is not applicable, but often it seems the quickest 
way to get to the information I need. Otherwise I quickly end up with 
loads of source files open in the Editor (which I prefer to avoid 
because it makes it harder to find the few files I am working on; and if 
ever I close a file, I nearly always seem to need it only a few moments 
later).


Howard

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


Re: [Lazarus] Removing read-only files in FileUtil.DeleteDirectory ?

2012-04-30 Thread Howard Page-Clark

On 30/4/12 11:45, Bart wrote:

On 4/29/12, Juha Manninen  wrote:




I would change the declaration to:

function DeleteDirectory(const DirectoryName: string;
  OnlyChilds: boolean; const RemoveReadOnlyFiles: Boolean = False): boolean;


If the suggestion is adopted it needs to be

function DeleteDirectory(const DirectoryName: string;
   OnlyChildren: boolean; ...



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


Re: [Lazarus] Main menu disappeared

2012-06-20 Thread Howard Page-Clark

On 20/6/12 5:50, Timothy Groves wrote:

I am working on a project, and decided for the first time ever to use a
main menu. I set it up, it worked, and then it vanished. It is still
present in the IDE and source code, but it no longer appears when the
app is run.


You could check that the menuItems' Visible properties are all True.
Else post your form.pas and form.lfm here and others may notice 
something amiss. What Lazarus version and what OS do you compile for?



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


[Lazarus] Probable CodeTools error?

2012-07-05 Thread Howard Page-Clark
In recent Lazarus trunk revisions (running under Win 7, 32-bit) I get 
CodeTools errors on units that specify unneeded  units in the uses 
clause (usually Classes or SysUtils).


The Messages window error message includes a negative line number 
something along the lines of


unit1.pp(-1,7) Error: unit not found: Classes

Does anyone else find this?

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


Re: [Lazarus] Probable CodeTools error?

2012-07-05 Thread Howard Page-Clark

On 05/7/12 5:33, Mattias Gaertner wrote:


In recent Lazarus trunk revisions (running under Win 7, 32-bit) I get
CodeTools errors on units that specify unneeded  units in the uses
clause (usually Classes or SysUtils).

The Messages window error message includes a negative line number
something along the lines of

unit1.pp(-1,7) Error: unit not found: Classes

Does anyone else find this?


Maybe you updated your compiler?
Have you tried Tools / Rescan FPC source directory?


Thanks for the prompt response. Indeed I had updated the compiler, and 
rescanning the source directory clears the problem.


Is it possible for the code tools to be aware of an updated compiler and 
warn (or automatically rescan)?


Howard


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


Re: [Lazarus] Probable CodeTools error?

2012-07-05 Thread Howard Page-Clark

On 05/7/12 6:56, Mattias Gaertner wrote:

On Thu, 05 Jul 2012 18:11:00 +0100



It does in many cases, but not in all. Scanning everything every time
would be too slow.


Understood.



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


[Lazarus] Strings Property Editor dialog newline keystroke reminder

2012-07-08 Thread Howard Page-Clark
The object inspector's strings editor has its [OK] button set as the 
default so pressing [Enter] closes the dialog, which is logical.
I usually forget this when trying to enter several lines of text, and so 
close the dialog when trying to enter a new line in the strings memo.


Could the dialog's StatusLabel's caption have a bit of help appended to 
it something on the lines of

'  (Use [Ctrl][Enter] to add a new line)'   ?

Howard

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


  1   2   3   >