* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Best practice for a multi-platform worker thread
« Last post by mercurhyo on Today at 02:24:24 pm »
It's hard to be simple and to keep it easy hehehehe. Only Masters can!
 >:D
2
General / Re: Variant issue
« Last post by Thaddy on Today at 02:22:50 pm »
@munair:
Well, that's a hard cast.
But I can solve part of it like this:
Code: Pascal  [Select]
  1. procedure DisplayVarValue(vv: Variant);
  2. begin
  3.   ShowMessage(Format('Value of variant const (int format) = %d', [vv.AsInteger])); // no runtime error
  4. end;
  5.  
  6. procedure DisplayVarVar(var vv: Variant);
  7. begin
  8.   ShowMessage(Format('Value of variant var (int format) = %d', [vv.AsInteger]));  // no runtime error
  9. end;

Variants are mired with trouble and very slow. Do you need them?
3
General / Re: Best practice for a multi-platform worker thread
« Last post by mercurhyo on Today at 02:19:04 pm »
In my solution, an additional thread is used to emulate the message queue.



You can see here: https://github.com/wadman/wthread
Unfortunately, some of the comments are in russian.

AS I mentioned here, WMessages are NOT crossplatform. As I wrote elsewhere, your WThread package is fine on windows/Delphi but have some issues on other platforms. That is even the reason which gave me the need to write my own TPowerThread.
https://forum.lazarus.freepascal.org/index.php/topic,41802.0.html
1) your WThread uses WMessage (not adviced on other platforms but windows)
2) you WThread loves variants, they are SLOW and disturb the gain around multithreading
3) why use a complicated solution when a simplier one can be efficient?
4
General / Re: Recompilation of Lazarus IDE in Lazarus.
« Last post by Martin_fr on Today at 02:03:06 pm »
It is actually ide/lazarus.lpi.

Right, my bad.

Anyway the way to build the IDE, is via the Tools menu.

Afaik the ide/lazarus.lpi is for browsing the sources
5
Mac OS X / Re: TSaveDialog wrong directory
« Last post by Phil on Today at 01:56:00 pm »
I saw that there are some bug issues on the bug tracker on open and save dialogs on carbon and cocoa but they seems to be resolved but not on my fpc 3.0.4 las 1.8.4

All testing on Cocoa should be done with Lazarus trunk code from Subversion repository. Cocoa widgetset code in Lazarus 1.8.4 has not been updated since April 2017.

https://macpgmr.github.io/MacXPlatform/UsingCocoaFromTrunk.html

With Carbon, file a bug report, although I would focus on Cocoa since that's the future.
6
General / Re: POS counts accentuation as characters
« Last post by bytebites on Today at 01:36:04 pm »
Indeed not. 
This works with latest stable version.
Code: Pascal  [Select]
  1. var
  2.   posi:integer;
  3.   caret: TPoint;
  4. begin
  5.     Caret.y:=Memo.CaretPos.y;
  6.     Caret.x:=Memo.CaretPos.x;
  7.     posi:=utf8Pos(' ',Memo.Lines[Caret.y],caret.x);
  8.     If posi<>0 then
  9.     begin
  10.       Caret.x:=posi-1;
  11.       Memo.CaretPos:=Caret;
  12.       Memo.PasteFromClipboard;
  13.     end
  14. end;
7
fpcupdeluxe uses a "sandbox" environment.
LazBuild should work if you just load the sources and build with an installed FPC.
8
Cocoa / Problem drawing on Canvas
« Last post by apeoperaio on Today at 01:09:30 pm »
I noticed a different behaviour when drawing on Canvas between Cocoa and all other widgetsets.
Carbon reacts as win32 and GTK2. Cocoa differently.
Open a new project and OnPaint do:

procedure TForm1.FormPaint(Sender: TObject);
begin
  Canvas.Line(0, 0, Width, Height);
end; 

See attached images, Cocoa does not draw the line properly.
Lazarus 1.8.4 fpc 3.0.4

9
General / Re: Recompilation of Lazarus IDE in Lazarus.
« Last post by JuhaManninen on Today at 01:07:20 pm »
2) There is project in the folde ide:  ide/lazarus.lpk
I don't have this file (installed Lazarus from .exe in Windows 10).
It is actually ide/lazarus.lpi.
10
General / Re: Recompilation of Lazarus IDE in Lazarus.
« Last post by Kurush on Today at 01:02:32 pm »
2) There is project in the folde ide:  ide/lazarus.lpk

I don't have this file (installed Lazarus from .exe in Windows 10).

4) When you add packages, look for their *Dsgn counterparts. They add the content to the component palette.
E.g., there is SynEditDsgn.lpk

Thanks. It seems that it allows solving my problem.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus