Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: JEDI error but unit compiles??
« Last post by Thaddy on Today at 09:30:33 pm »
tnx ;D
2
General / Re: JEDI error but unit compiles??
« Last post by DomingoGP on Today at 09:27:06 pm »
Opened issue in bug tracker

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40871

and fixed in trunk commit a326522d9357b4465336a0b93e63e96cf3e3cd77

I have applied the changes proposed by bytebites slightly modified.

Thanks for reporting and for the patch.

3
Btw, it be a nice place to list all the intrinsics https://wiki.freepascal.org/FpDebug-Watches-Intrinsic-Functions
And the backends can have functions to list them.
But then it be nice, to also have some of those from gdb, if only to make use of the button.

On using features: If you need a field from an object, then you can open the object in the inspector => that has a filter (filters field names and data), so you can type "auto" to find any field (and data) containing "auto" => double click the desired one, and add it back as watch.
IMHO useful.
(filter in watches, whenever I find the time....)

Or, work a lot with variants? Configure the "variant backend convertor" https://wiki.freepascal.org/IDE_Window:_Ide_Options_-_Backend_Value_Converter#.22Convert_variant_to_value_type.22

It's documented...
4
Hi ArchChem,

Thanks for letting me know about your OS. On Linux, the font height sign can be different. So here is a version of the test to take it into account (it also fixes the bounding rectangle):
Code: Pascal  [Select][+][-]
  1. uses BGRABitmap, BGRABitmapTypes, BGRAText;
  2.  
  3. {$R *.lfm}
  4.  
  5. { TForm1 }
  6.  
  7. procedure TForm1.FormPaint(Sender: TObject);
  8. var
  9.   ts: TSize;
  10.   style: TTextStyle;
  11.   bmp: TBGRABitmap;
  12.   halfX: integer;
  13. begin
  14.   halfX := ClientWidth div 2;
  15.   with Canvas do
  16.   begin
  17.     Brush.Color := clWhite;
  18.     FillRect(0, 0, halfX, ClientHeight);
  19.     Brush.Style := bsClear;
  20.  
  21.     Font.Color := clBlack;
  22.     Font.Height := 50 * FontFullHeightSign;
  23.     Font.Name := 'Arial';
  24.     ts := TextExtent('Hello world');
  25.     Rectangle(0, 0, ts.cx, ts.cy);
  26.     TextOut(0, 0, 'Hello world');
  27.  
  28.     style := TextStyle;
  29.     style.Wordbreak:= true;
  30.     style.SingleLine:= false;
  31.     TextRect(rect(0, 50, halfX, ClientHeight),
  32.       0, 50, 'Text with'#13#10'Line endings', style);
  33.   end;
  34.  
  35.   bmp := TBGRABitmap.Create(halfX, ClientHeight, BGRAWhite);
  36.   with bmp.CanvasBGRA do
  37.   begin
  38.     Brush.Style := bsClear;
  39.  
  40.     Font.Color := clBlack;
  41.     Font.Height := 50;
  42.     Font.Name := 'Arial';
  43.     ts := TextExtent('Hello world');
  44.     Rectangle(0, 0, ts.cx, ts.cy);
  45.     TextOut(0, 0, 'Hello world');
  46.  
  47.     style := TextStyle;
  48.     style.Wordbreak:= true;
  49.     style.SingleLine:= false;
  50.     TextRect(rect(0, 50, halfX, ClientHeight),
  51.       0, 50, 'Text with'#13#10'Line endings', style);
  52.   end;
  53.  
  54.   bmp.FontName := 'Arial';
  55.   bmp.FontFullHeight:= 50;
  56.   bmp.TextMultiline(0, 200, 'Text with'#13#10'Line endings', CSSBlue,
  57.     btaNatural, tlTop, // alignment
  58.     0.2); // paragraph spacing, in fraction of the font full height
  59.  
  60.   bmp.Draw(Canvas, halfX, 0);
  61.   bmp.Free;
  62. end;

Can you update and test with this code? Note that extra spacing may not appear here as it may depend on the font used. Which one did you use in your program?

Regarding setting the line distance, you can use TextMultiline function and specify the paragraph spacing. However this is applied when encountering end of line characters, not when the text is over the width of the rectangle and wraps. I've added an example in the code above.

Otherwise a feature to specify line spacing in general could be added.

Regards
5
General / Re: how to search in rxmemory table
« Last post by rcmz on Today at 08:45:16 pm »
thx,

I will give it a try,

Does any body have sample code on how to use locate in rxmemory table, i need to search with 2 fields.

TIA
Ramiro
6
Short reply for now... will get into more details when I'm not so "squeezed" for time.

Quote
For instance the trick about "@textvar[0]" to not have every character individually enclosed in single quotes is quite useful
While it might be worth advertising, I wouldn't name it a "trick".

It is normal pascal syntax. You simply watch an expression that returns a "pchar" => so you get to see a pchar. (which is displayed as string)
I agree, "trick" isn't really a good description but, I can't think of a good one at this time.  "options" maybe ?

Maybe you can open a new topic on that (and moderate the topic), and see what others think.
I intend to do that.  Hopefully today or tomorrow.

In general, the debugger has tons of features that are probably seldom used.
I think the real challenge is in figuring out which features are seldom used because they are seldom needed compared to which features are seldom used because they are not common knowledge, e.g, the construct "Ptr[a..b]" is logical but, I didn't know about it and I wouldn't have thought of using it because it's not a valid Pascal statement.  Constructions like that are debugging pearls, extremely useful.

A related but slightly different note, I think that there is a natural fork occurring. By that I mean, FpDebug is really a different debugger than GDB and it will work differently, as a result, I believe that some features are forcefully going to be FpDebug only or GDB only and I think that's natural.   Honestly, at this point, I care very little about GDB.  I realize that's because on Windows FpDebug has gotten quite capable making GDB unnecessary but, that may not be the case on other platforms I don't use.  The point here is, at least on Windows, I think GDB is, in the majority of cases,  legacy stuff.

There are a couple of other things you said I should address, I intend to get to them as soon as reasonably convenient.  There are too many things in my head and some are leaking ;)

I like the new layout of the formatting options... I have about $0.02 worth of comments to mention... next post!

7
LCL / Re: Controlling the behavior - JVCLLaz - JvDBLookUpCombo?
« Last post by wp on Today at 08:29:28 pm »
I have other forms that the JvDBLoopUpCombo isn't displaying the 2nd or 3rd fields in the drop-down to fix these.
As I wrote above, the DisplayWidth specified for a field is interpreted by TJvDBLookupCombo as the width of the same count of 'M' characters. This is required because nowadays fonts have non-uniform character widths; otherwise the column edge would be jagged. Since 'M' is a relatively wide character a DisplayWidth of, say, 10 may appear much wider than you anticipate for your real field values which maybe contain a lot of narrow characters, such as i, l, or r. Please repeat your tests after switching the JvDBLookupCombo's font to Courier or another non-proportional font.

Look at the attached screenshots taken from the project in the JVCL examples folder: The first one, jvdbcombo-default.png, was taken with the Lazarus default font. The second one, jvdbcombo-courier.png, was taken with 'Courier New' for the combo's font. See that now the 1st column width defined by the 'City' field's DisplayWidth of 10 is exactly filled in case of the 10-character string 'Marseilles'.
8
Hey Y'All,

We seem to have a bit of a problem: https://github.com/gcarreno/1brc-ObjectPascal/tree/main/spelunking/roundex

See attached image.

Cheers,
Gus
9
LCL / Re: Dialog ShowModal and an icon within caption bar?
« Last post by ASerge on Today at 08:04:11 pm »
Thanks ASerge; tried  -– true. But, do one see also the causes here? Hm.
TDateTimePicker uses a nested form for the calendar.
The problem is that in Lazarus changes to the border style of a nested form are reflected on the parent form.
There is no such thing in Delphi.
10
General / Re: JEDI error but unit compiles??
« Last post by bytebites on Today at 07:49:17 pm »
You need to fix this piece from /components/jcf2/Parse/BuildParseTree.pas around line 1700.

Code: Pascal  [Select][+][-]
  1. procedure TBuildParseTree.RecogniseArrayConstant;
  2. begin
  3.   // ArrayConstant -> '(' TypedConstant/','... ')'
  4.  
  5.   PushNode(nArrayConstant);
  6.  
  7.   Recognise([ttOpenBracket,ttOpenSquareBracket]);
  8.  
  9.   RecogniseTypedConstant;
  10.   while (fcTokenList.FirstSolidTokenType = ttComma) do
  11.   begin
  12.     Recognise(ttComma);
  13.     RecogniseTypedConstant;
  14.   end;
  15.  
  16.   Recognise([ttCloseBracket,ttCloseSquareBracket]);
  17.  
  18.   PopNode;
  19. end;  
  20.  

Plug this code in
Code: Pascal  [Select][+][-]
  1.   if fcTokenList.FirstSolidTokenType = ttDoubleDot then
  2.   begin
  3.     Recognise(ttDoubleDot);
  4.     RecogniseExpr(False);
  5.   end;
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018