Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Third party / Re: InstallAware Using Lazarus IDE
« Last post by dbannon on Today at 02:45:38 am »
....
Right now it's plain impossible to install official Lazarus releases on most Linux environments, unless you're using FPCUPDLX.
Sorry, thats plain silly.
I run a set of seven virtual and real machines to build and test my app before release. Yesterday, I decided I needed to use Lazarus 3.2 instead of 3.0 so, quick tweak of my bash script, installed Lazarus 3.2 on four quite different Linux systems in about 5 minutes each. They all had FPC323 snapshot and each worked as expected.

(My script grabs a local Lazarus source zip or, if necessary downloads one, puts it in an appropriate place, build lazarus, sets up a config dir, trivial !)

Quote
Again, it is exactly the same for Apple Silicon native macOS installations -
I don't have Apple Silicon hardware but have no problem building Lazarus on a intel based Mac and cross compiling.

Quote
I honestly can't see the harm in having a consistent installation process, with official support for AMD64 and aarch64 targets on both Linux and macOS. It'll only serve to make Lazarus more accessible for greater adoption. With Delphi just at #11 on this year's Tiobe index, the timing is really perfect for an upgrade of the installation (and by implication, the user experience).
...
Help me understand how this is a bad thing?

Even within Linux, different binary install models are more or less compulsory. End users who want a binary install expect the familiar install model for their platform. Deb users want a deb, rpm users want an rpm, packman....

One single look and feel installer would be unfamiliar to every possible user. Its like saying we can make a car that runs on water, or a boat that runs on land, possible and has been done. But in both cases, they do a terrible job at everything !
...
Davo
2
General / Re: Generics - correct syntax
« Last post by Blaazen on Today at 01:57:40 am »
It's this (line 58 of https://github.com/james-mcjohnson/VulkanLibraryForFreePascal/blob/master/vulkan_vk_xml_to_pas.pas)

Code: Pascal  [Select][+][-]
  1. { TCreateChildList }
  2.  
  3.   generic TCreateChildList<T> = class(specialize TFPGObjectList<T>)
  4.     function CreateChild(Level: Integer = -1): T;
  5.     function GetListing(IncludeLastDelimiter: Boolean; aDelimiter: String; NoCRLF: Boolean = False): String;
  6.     function FindIdentifier(aIdentifier: String): T;
  7.     function FindIdentifierIndex(aIdentifier: String): Integer;
  8.     procedure MoveIdentifierBefore(aIdentifier1, aIdentifier2: String);
  9.   end;
  10.  
  11.   TComment = class;
  12.   TExtension = class;
  13.  
  14.   { TListObj }
  15.  
  16.   TListObj = class
  17.     private
  18.       FLevel: Integer;
  19.     public
  20.       Identifier: String;
  21.       CommentInternal: String;
  22.       AcceptLateComment: Boolean;
  23.       PreComment, PostComment: TComment;
  24.       function GetPreComment: String;
  25.       function GetPostComment(curlen: Integer): String;
  26.       function SpaceOutPostComment(curlen: Integer; CommentText: String): String;
  27.       function GetListing(Delimiter: String; NoCRLF: Boolean = False): String;
  28.       function GetInfo(Delimiter: String): String; virtual;
  29.       function GetExtraInfo: String; virtual;
  30.   end;
  31.  
  32.   TPointerDepth = class(TListObj)
  33.     NeededPointerDepth: Integer;
  34.   end;
  35.   TPointerDepthList = specialize TCreateChildList<TPointerDepth>;

EDIT: @jamie
  Your code  also needs
Code: Pascal  [Select][+][-]
  1. generic TCreateChildList<T: class> = class(specialize TFPGObjectList<T>);
with FPC 3.3.1
3
Other / Re: Forum slow
« Last post by TRon on Today at 01:16:26 am »
I experience the same problem of slowness.

10 to 15 seconds to popup the login page.
25-30 seconds to actually login.
10-20 seconds for a preview of a post I am editing
around 5-10 seconds for a refresh of a page.
Clicking on a forum link takes about 15-20 seconds.
etc.etc,

and it has been for me this way the last couple of days (2/3).
4
Graphics / Re: Demoscene The Champs Cracktro
« Last post by Gigatron on Today at 01:05:16 am »
Hi, very good job, thank you for the copper bars ;

Now just a nice bitmap scroller for the the champs cracktro, not yet included to the cracktro but usefull for anyone
to learn bitmap scrolling text under 100 lines of code ;



Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGRABitmap, BGRABitmapTypes, BGRAVirtualScreen;
  10.  
  11. const
  12.  
  13.     ascii : Array [0..58] of integer = (26,37,99,99,99,99,99,41,42,43,99,99,44,99,38,99,27,28,29,30,31,32,33,34,35,36,40,99,99,99,99,39,99,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
  14.  
  15.  
  16. var
  17.   CharImage: TBGRABitmap;
  18.   ScrollSpeed: integer = 2;
  19.   ScrollCounter: integer = 1;
  20.   CharWidth : integer = 16;
  21.   CharHeight :  integer = 22;
  22.   CharsPerLine : integer = 700;
  23.   ScrollText2: String = '                                           YEAH OF COURSE !!!  ))))) THE CHAMPS (((((  PRESENT : SIDEWINDER CRACKED BY DELTA FORCE    THE BEST SALUTE GO TO : HOTLINE HIGH QUALITY CRACKINGS DELTA FORCE AND TRISTAR(THE BEST GET BETTER !!!)    THE SPECIAL GREETINGS IN ALPHABETICAL ORDER GO TO : AXXESS ANTITRAX BFBS BLIZZARDS BS1 BST CCW ERNIE FREE NETWORK GENERAL INDY IBB KNIGHT HAWKS MEGAFORCE NEW AGE MR.NEWLOOK NORTHERN LIGHTS POWERXTREME RANDOM ACCESS RED SECTOR SKYLINE TLC TOM VISITOR WIZARDS AND ALL THE OTHERS WE KNOW....   COMMING SOON MORE AND MORE NEW PRG FROM THE UNATTAINABLE   ))))) THE CHAMPS ((((( IN 1988 !!!!!                                                                         ';
  24.  
  25. type
  26.  
  27.   { TForm1 }
  28.  
  29.   TForm1 = class(TForm)
  30.     BGRAVirtualScreen1: TBGRAVirtualScreen;
  31.     Timer1: TTimer;
  32.     procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  33.     procedure FormCreate(Sender: TObject);
  34.     procedure Timer1Timer(Sender: TObject);
  35.   private
  36.  
  37.   public
  38.  
  39.   end;
  40.  
  41.  
  42. var
  43.   Form1: TForm1;
  44.  
  45. implementation
  46.  
  47. {$R *.lfm}
  48.  
  49. { TForm1 }
  50.  
  51. procedure TForm1.FormCreate(Sender: TObject);
  52.  
  53. begin
  54.  
  55.   CharImage := TBGRABitmap.Create('font.png');
  56.  
  57. end;
  58.  
  59. procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  60. var
  61.    I,   Chr: Integer;
  62.    CharX, CharY: Integer;
  63.    ScrollOffset: Integer;
  64.  
  65. begin
  66.   Bitmap.Fill(BGRAPixelTransparent);
  67.   ScrollOffset :=  ScrollCounter ;
  68.  
  69.    for I := 0 to Length(ScrollText2) do
  70.     begin
  71.        Chr := Ord(ScrollText2[I]);
  72.        CharX := ((I - 1) mod CharsPerLine) * CharWidth - ScrollOffset  ;
  73.        CharY := ((I - 1) div CharsPerLine) * CharHeight  ;
  74.        Bitmap.PutImagePart(CharX ,240+CharY , CharImage, Rect(0, 24*ascii[chr-32] , 15, 24*ascii[chr-32]+CharHeight), dmDrawWithTransparency);
  75.     end;
  76.  
  77.      ScrollCounter := ScrollCounter + ScrollSpeed;
  78.  
  79.      if ScrollCounter >= CharWidth then
  80.  
  81.    begin
  82.     ScrollCounter := ScrollCounter - CharWidth;
  83.     ScrollText2 := Copy(ScrollText2,2, Length(ScrollText2) - 1) + ScrollText2[1];
  84.   end;
  85.  
  86. end;
  87.  
  88. procedure TForm1.Timer1Timer(Sender: TObject);
  89. begin
  90.  
  91.      BGRAVirtualScreen1.RedrawBitmap;
  92. end;
  93.  
  94. end.
  95.  
5
Other / Forum slow
« Last post by 440bx on Today at 12:50:43 am »
There's been a noticeable slow down in forum responsiveness in the last 4 to 6 hours.

Anyone else noticed this by any chance ? (I haven't experience any slow down on other websites... this suggest it might be something Lazarus forum specific.)

Comments/observations welcome.

ETA:

Just as I post this, the response time seems to be noticeably better.
6
Options / Re: How to use the Event Log?
« Last post by n7800 on Today at 12:47:25 am »
But I have a GUI application for which I don't know how the Application instance is created

If an object is not created by this unit, then it is created in one of the used units. There are only three units connected: Interfaces, Forms and unit1. And since Application is declared in the Forms unit (just press [Alt+Up]), you can see its creation in its initialization section:

lcl/forms.pp

how I can provide a custom class:

I've seen this way to "create" your own application class:

ide/lazbuild.lpr

However, I'm not sure if this is a good way, especially for a graphical application. Perhaps some kind of compilation directive -dOwnAppClass would be useful for the Forms unit so that the user can create the class manually?
7
Editor / v3.99 code completion question
« Last post by 440bx on Today at 12:45:55 am »
Please refer to the screenshot.

In line 3136, the editor changed "char" to "Char".  I'd like the editor to not change anything I type (even if it's wrong... I'll fix it myself) but, I couldn't find the setting that tells the editor to leave my code alone.

In line 3137, the editor suggests "ArrayStringToPPchar" and no matter what I type next it puts that "ArrayStringToPPchar" string in there.  I'd like the editor to put whatever it is suggesting only if I press "enter" or possibly "tab" and _nothing_ for any other key.  Right now, it puts that string in there no matter what I type.

Thank you for your help.
8
Debugger / Re: FpDebug breakpoint on "begin"
« Last post by 440bx on Today at 12:36:23 am »
I got my hands full... I'll wait until you've committed the solution you've chosen.   

9
Debugger / Re: FpDebug breakpoint on "begin"
« Last post by Martin_fr on Today at 12:10:31 am »
Not tested, but this patch should hopefully do the "one line" (and if you can spot the "1", you can make it more)

Code: Diff  [Select][+][-]
  1. diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp
  2. index 2008434e26..e4b28951a8 100644
  3. --- a/components/fpdebug/fpdbgclasses.pp
  4. +++ b/components/fpdebug/fpdbgclasses.pp
  5. @@ -739,7 +739,7 @@   TDbgInstance = class(TObject)
  6.      function GetOSDbgClasses: TOSDbgClasses;
  7.      function GetPointerSize: Integer;
  8.  
  9. -    function  GetLineAddresses(AFileName: String; ALine: Cardinal; var AResultList: TDBGPtrArray): Boolean;
  10. +    function  GetLineAddresses(AFileName: String; ALine: Cardinal; var AResultList: TDBGPtrArray; AMaxFindLineBelow: integer = 0): Boolean;
  11.      function FindProcSymbol(const AName: String; AIgnoreCase: Boolean = False): TFpSymbol; overload;
  12.      function FindProcSymbol(AAdress: TDbgPtr): TFpSymbol; overload;
  13.    protected
  14. @@ -941,7 +941,7 @@   TDbgProcess = class(TDbgInstance)
  15.      function  FindSymbolScope(AThreadId, AStackFrame: Integer): TFpDbgSymbolScope;
  16.      function  FindProcStartEndPC(const AAdress: TDbgPtr; out AStartPC, AEndPC: TDBGPtr): boolean;
  17.  
  18. -    function  GetLineAddresses(AFileName: String; ALine: Cardinal; var AResultList: TDBGPtrArray; ASymInstance: TDbgInstance = nil): Boolean;
  19. +    function  GetLineAddresses(AFileName: String; ALine: Cardinal; var AResultList: TDBGPtrArray; ASymInstance: TDbgInstance = nil; AMaxFindLineBelow: integer = 0): Boolean;
  20.      //function  ContextFromProc(AThreadId, AStackFrame: Integer; AProcSym: TFpSymbol): TFpDbgLocationContext; inline; deprecated 'use TFpDbgSimpleLocationContext.Create';
  21.      function  GetLib(const AHandle: THandle; out ALib: TDbgLibrary): Boolean;
  22.      property  LibMap: TLibraryMap read FLibMap;
  23. @@ -2198,12 +2198,20 @@ destructor TDbgInstance.Destroy;
  24.    inherited;
  25.  end;
  26.  
  27. -function TDbgInstance.GetLineAddresses(AFileName: String; ALine: Cardinal; var AResultList: TDBGPtrArray): Boolean;
  28. +function TDbgInstance.GetLineAddresses(AFileName: String; ALine: Cardinal;
  29. +  var AResultList: TDBGPtrArray; AMaxFindLineBelow: integer): Boolean;
  30.  var
  31.    FoundLine: Integer;
  32.  begin
  33. -  if Assigned(DbgInfo) and DbgInfo.HasInfo then
  34. -    Result := DbgInfo.GetLineAddresses(AFileName, ALine, AResultList, fsNone, @FoundLine, @FLastLineAddressesFoundFile)
  35. +  if Assigned(DbgInfo) and DbgInfo.HasInfo then begin
  36. +    if AMaxFindLineBelow > 0 then begin
  37. +      Result := DbgInfo.GetLineAddresses(AFileName, ALine, AResultList, fsNext, @FoundLine, @FLastLineAddressesFoundFile);
  38. +      if Result then
  39. +        Result := (FoundLine >= ALine) and (FoundLine <= ALine + AMaxFindLineBelow);
  40. +    end
  41. +    else
  42. +      Result := DbgInfo.GetLineAddresses(AFileName, ALine, AResultList, fsNone, @FoundLine, @FLastLineAddressesFoundFile);
  43. +  end
  44.    else
  45.      Result := False;
  46.  end;
  47. @@ -2596,24 +2604,24 @@ function TDbgProcess.FindProcStartEndPC(const AAdress: TDbgPtr; out AStartPC,
  48.  end;
  49.  
  50.  function TDbgProcess.GetLineAddresses(AFileName: String; ALine: Cardinal;
  51. -  var AResultList: TDBGPtrArray; ASymInstance: TDbgInstance): Boolean;
  52. +  var AResultList: TDBGPtrArray; ASymInstance: TDbgInstance; AMaxFindLineBelow: integer): Boolean;
  53.  var
  54.    Lib: TDbgLibrary;
  55.  begin
  56.    if ASymInstance <> nil then begin
  57.      if ASymInstance = self then begin
  58. -      Result := inherited GetLineAddresses(AFileName, ALine, AResultList);
  59. +      Result := inherited GetLineAddresses(AFileName, ALine, AResultList, AMaxFindLineBelow);
  60.      end
  61.      else begin
  62. -      Result := ASymInstance.GetLineAddresses(AFileName, ALine, AResultList);
  63. +      Result := ASymInstance.GetLineAddresses(AFileName, ALine, AResultList, AMaxFindLineBelow);
  64.        FLastLineAddressesFoundFile := ASymInstance.FLastLineAddressesFoundFile;
  65.      end;
  66.      exit;
  67.    end;
  68.  
  69. -  Result := inherited GetLineAddresses(AFileName, ALine, AResultList);
  70. +  Result := inherited GetLineAddresses(AFileName, ALine, AResultList, AMaxFindLineBelow);
  71.    for Lib in FLibMap do begin
  72. -    if Lib.GetLineAddresses(AFileName, ALine, AResultList) then
  73. +    if Lib.GetLineAddresses(AFileName, ALine, AResultList, AMaxFindLineBelow) then
  74.        Result := True;
  75.      if Lib.FLastLineAddressesFoundFile then
  76.        FLastLineAddressesFoundFile := True;
  77. @@ -4187,7 +4195,7 @@ constructor TFpInternalBreakpointAtFileLine.Create(const AProcess: TDbgProcess;
  78.    FSymInstance := ASymInstance;
  79.  
  80.    addr := nil;
  81. -  AProcess.GetLineAddresses(AFileName, ALine, addr, ASymInstance);
  82. +  AProcess.GetLineAddresses(AFileName, ALine, addr, ASymInstance, 1);
  83.    FFoundFileWithoutLine := AProcess.FLastLineAddressesFoundFile and (Length(addr) = 0);
  84.    inherited Create(AProcess, addr, AnEnabled);
  85.  end;
  86.  
10
General / Re: Generics - correct syntax
« Last post by jamie on Today at 12:09:16 am »
Code: Pascal  [Select][+][-]
  1.   generic TCreateChildList<T> = class(specialize TFPGObjectList<T>);
  2.   TmyType = Specialize TcreateChildList<Tbutton>;
  3. var
  4.   Form1: TForm1;
  5.   Test:TmyType;
  6.  
  7. implementation
  8.  
  9. {$R *.lfm}
  10.  
  11. { TForm1 }
  12.  
  13. procedure TForm1.Button1Click(Sender: TObject);
  14. begin
  15.   Test := TmyType.Create(True);
  16.   //...
  17.   Test.free;
  18. end;                                          
  19.  

Works for me.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018