Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
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).
2
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.  
3
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.
4
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?
5
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.
6
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.   

7
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.  
8
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.
9
Debugger / Re: FpDebug breakpoint on "begin"
« Last post by Martin_fr on Today at 12:04:18 am »
It isn't that easy... of course not...

There are 2 possible approaches to solve it.

1) In the editor, based on knowledge the editor has
2) In the debugger, based on knowledge the debugger has

Well, mixes may be thinkable, but they are included...

1)  Editor.
The breakpoint can get set, at a time at which the debugger is not yet running, the editor does not have any info if that line will or will not get a blue dot.

- It would require an exchange when the debugger gets started.
- Breakpoints can exist in units currently not open in an editor. For those blue dots aren't loaded (and storage is bound to the editor).

So that is quite some extension. And it must all go through a generic interface that allows any backend to be bound to the IDE.

Given IFDEF and include files and macros and whatnot, finding the kind of line, and the owning procedure and all that will also need a deep dive into code tools. Though that could be omitted, just limiting it to "simple" cases.

2) The debugger
It doesn't have any source. It has to get it from the editor. But then the debugger would not go to codetools, it is not the job of the debugger to go parsing sources.






What I thing should happen

1) Very simple: Allow n lines below (n between 1 and 5 / maybe configurable)
But that could mean it goes into a different procedure. (if an "end" line has no code)

2)
When the debugger can't find line 100
- search for the next known line above, get the function name from the dwarf
- search for the next known line below, get the function name from the dwarf
- if both surrounding lines are in the same function => then use the "next known line below" (as already found).

That can still be limited by "up to max n lines".

The only disadvantage => it does not work, if the breakpoint is above the first known line of a function. E.g on the "procedure foo;" line itself.
Maybe the debugger can still see that the next found line is the first of the procedure, and take it if within a limit X (where X can be less or equal than the previous limit n)

That is
- "relatively simple"
- works for most cases
- can be done in the backend without interaction to the frontend




Backend and frontend both.

If sources are edited, the line movement is tracked "in the blue dots". Lines without them don't know if they moved. So adding a breakpoint there after editing will always be problematic. (That needs separate changes to the tracking...)





In the meantime, it might be possible to allow for "ONE line beneath".

That does only solve a subset of the issue, but it can't go very wrong either.
10
General / Re: Generics - correct syntax
« Last post by jamie on April 19, 2024, 11:58:38 pm »
I don't see any constructors ?

I am sure the object list requires them if anything..

But then again, I could have missed something?
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018