Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Android / Re: Help me - install lazarus lamw in VMware VM
« Last post by Alextp on Today at 07:10:07 pm »
2
Graphics / Re: Drawing on Panel
« Last post by PeterX on Today at 07:07:24 pm »
You use the function Rectangle to do that, but that only draw the edges. You can use FillRectangle instead. Or just Fill to fill everything.
With Brush.Color:= xxx   procedure Rectangle() also fills the Rect.


Now I tried with yellow .. and

Code: Pascal  [Select][+][-]
  1.         // Draws the background
  2.         GUIBitmap.CanvasBGRA.Pen.Color:= clBlack;
  3.         GUIBitmap.CanvasBGRA.Brush.Color:= clYellow;  // clWhite;
  4.         GUIBitmap.CanvasBGRA.Rectangle( 0, 0, Width, Height);
  5.         //GUIBitmap.CanvasBGRA.FloodFill( 0, 0);
  6.  

but no difference, from my point of view, for the example text with BGRA.

( Floodfill does the same, but - no question - without the black border .. )
3
Pas2JS / Re: pas2js download link broken
« Last post by prof7bit on Today at 07:07:00 pm »
This means if I create a new project and it says "Can't find unit system", shoud I report this bug against FPC? Or should I report it against Lazarus because the wizard forgot to add a needed package?
If the cross compiling enviroment is not correct, so you must ask, who is responsible for this ? How have you installed the transpiler ?

Normal, i see the message unit system is not found, if the system is not correct installed or configured. This is not a problem of Lazarus.

I installed Lazarus and FPC with Fpcupdeluxe. So this would mean fpcupdeluxe did something wrong.

the compiler itself seems to be installed, this is the complete error message:
Code: [Select]
Pas2JS Compiler version 2.1.1 [2021/10/16] for Linux x86_64
Info: (132) Message encoding is utf-8
Copyright (c) 2021 Free Pascal team.
Info: (126) Parsing /home/bernd/foldersync/Galaxy10/Work/ps2js/test-01/project1.lpr ...
/home/bernd/foldersync/Galaxy10/Work/ps2js/test-01/project1.lpr(5,5) Error: (3073) can't find unit "System"
Fatal: (118) Compilation aborted

is it possible that it is missing its fpc.cfg?
4
Pas2JS / Re: pas2js download link broken
« Last post by af0815 on Today at 06:59:41 pm »
This means if I create a new project and it says "Can't find unit system", shoud I report this bug against FPC? Or should I report it against Lazarus because the wizard forgot to add a needed package?
If the cross compiling enviroment is not correct, so you must ask, who is responsible for this ? How have you installed the transpiler ?

Normal, i see the message unit system is not found, if the system is not correct installed or configured. This is not a problem of Lazarus.
5
What kind of interface are you talking about? The generic class TFPGMap works with any class type, no interface needed.

Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   fgl;
  7.  
  8. type
  9.   TMyMap = specialize TFPGMap<String, TObject>;
  10.  
  11.   TFoo = class
  12.   public procedure Foo;
  13.   end;
  14.  
  15.   TBar = class
  16.   public procedure Bar;
  17.   end;
  18.  
  19. procedure TFoo.Foo;
  20. begin
  21.   WriteLn('Foo');
  22. end;
  23.  
  24. procedure TBar.Bar;
  25. begin
  26.   WriteLn('Bar');
  27. end;
  28.  
  29. var
  30.   map: TMyMap;
  31. begin
  32.   map := TMyMap.Create;
  33.   map.Add('Foo', TFoo.Create);
  34.   (map['Foo'] as TFoo).Foo;
  35.   (map['Foo'] as TBar).Bar; // Throws exception because it is of type TFoo not TBar
  36. end.  
  37.  
Neither TFoo nor TBar implement any common interface. The only thing that they share is that they both inherit from TObject, but thats true for every class.

You can even go further:
Code: Pascal  [Select][+][-]
  1.   TMyMap = specialize TFPGMap<String, Pointer>;
  2. ...
  3.   (TObject(map['Foo']) as TFoo).Foo;
  4.   (TObject(map['Foo']) as TBar).Bar;
6
General / Re: Operator overloading - are there some tricks
« Last post by Jonas Maebe on Today at 06:40:59 pm »
The only way to be able to overload all operators is to use a wrapper record type.
7
Afterwarp Framework v2.0.0 - SDK (April 12, 2021)
The package includes framework binaries, library files, C/C++ include header files, samples, pre-compiled sample executables, media files, tools and documentation of the API functions.
In this package Delphi and FreePascal/Lazarus headers, high-level framework wrappers, examples and related documentation are provided.

https://afterwarp.io/downloads
8
Beginners / Re: Process Output Read
« Last post by BIT on Today at 06:28:22 pm »
I would say that is because you are importing <Cr><LF> in the middle of the stream as a single entry as it comes in.

I believe the best way to do this would be either parse the incoming first by looking for the Lind Ending group and if found then read that much up to that point as a line and then the delete that part from the incoming and repeat the process of looking for the Line Ending and if found do it again, if not found then stash that part to a local string where it can be combined later with more incoming..

using a string list maybe a better way to do this.
OK! I will add thanks!
9
Android / Help me - install lazarus lamw in VMware VM
« Last post by laguna on Today at 06:09:50 pm »
Hi,
On the my mac, I  installed VMWare Fusion.
with fpcupdate installed FPC version stable
now  which  version of lazarus install? Trunk? or LAMW?
wihch version of SDK and NDK install?

Thanks
Vincenzo
10
LCL / Re: TRect event within a class
« Last post by howardpc on Today at 05:59:38 pm »
I'm trying to create a TrackBar with two sliders.
I thought about how I would implement such a thing, and the attached test program and unit might give you some ideas.
I implemented mouse and keyboard support (but not design support if you want to turn it into a standalone component).


With two sliders there are various behaviours that you can support. In the attached example clicking on the track affects the lower slider if you click to the left of it, and clicking between the sliders causes them to move towards each other. Clicking to the right of the higher slider moves it further right.


Keyboard movement with arrow keys affects the lower slider. To move the upper slider, press Ctrl+arrow key.


I have not implemented working code for the vertical orientation, but left placeholders you can complete if this is what you need. It is almost untested, and only so far on Linux, so I am sure it has bugs. It is offered as a proof of concept.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018