* * *

Recent Posts

Pages: [1] 2 3 ... 10
General / Re: Accented letters in a TStringlist
« Last post by GetMem on Today at 07:10:20 am »
Try something like this:
Code: Pascal  [Select]
  1. uses LConvEncoding;
  3. function LoadFromFile(const AFileName: String): String;
  4. var
  5.   Ms: TMemoryStream;
  6.   Str: String;
  7. begin
  8.   Ms := TMemoryStream.Create;
  9.   try
  10.     Ms.LoadFromFile(AFileName);
  11.     Ms.Position := 0;
  12.     SetLength(Str, Ms.Size);
  13.     Ms.Read(Pointer(Str)^, Ms.Size);
  14.     Result := ConvertEncoding(Str, GuessEncoding(Str), EncodingUTF8, True);
  15.   finally
  16.     Ms.Free;
  17.   end;
  18. end;
  20. procedure TForm1.Button1Click(Sender: TObject);
  21. begin
  22.   Memo1.Text := LoadFromFile('test.txt');
  23. end;        
General / Re: Accented letters in a TStringlist
« Last post by ptvs on Today at 06:51:35 am »
If the file is not a large one, try this:
Code: Pascal  [Select]
  1.   InputData.Text := AnsiToUtf8(InputData.Text);
Hi GetMem,

Thanks for the quick reply! The thing that threw me off is that the TPicture dialog box has no qualm chowing the picture I loaded.

Alright then, bmp it is. Thanks a bunch!
General / Re: Drawing y = ax + b line in paintbox
« Last post by GetMem on Today at 06:41:51 am »
Now it works perfectly.
Really? I don't believe you  :D
Code: Pascal  [Select]
  1. If a = 0 then begin; //<--remove ";"
  2.   Paintbox1.Canvas.Line(0,bt,600,bt);
  3. end
  4. Else begin
  5.   Paintbox1.Canvas.Line(0,300*at + bt,600,-300*at + bt);
  6. end;
General / Re: Laz 1.8.2 No memory left
« Last post by af0815 on Today at 06:37:50 am »
armandobaza, the best way is to compile the fpc by yourself. The line to insert is descript in the bugreport Bug 0031517 (see my post of the code in this thread one page before)

The line to insert in the code of the pp.pas is now near line 170.  pp.pas is in the <fpc-sources>/compiler

This patch is ONLY for WIN32 (and meaningless for WIN64 and the other plattforms)

Code: Pascal  [Select]
  1. { Don't care about minstacksize or maxstacksize not beeing supported by current OS }
  2. {$WARN 2077 OFF}
  3. {$WARN 2078 OFF}
  5. {$ifdef win32}
  6.   { 256 MB stack }
  7.   { under windows the stack can't grow }
  8.   {$MAXSTACKSIZE 256000000}
  9.   {$setpeflags $20}  // <------------------------------------here, this line is inserted
  10. {$else win32}
  11.   {$ifdef win64}

Are you able to build fpc from the sources ? If not, look for fpcupdeluxe. It is a swiss-army-knife for building fpc&lazarus.

Hi EganSolo,

I'm afraid only BMPs are supported, this is true for more recent version of VTV. I assume you only wish a simplistic background like a gradient or something similar, otherwise the node text won't be visible. The trick is to create a bmp with small width(10x700, 21 kB -tiny) and VTV will replicate it as in the attached image.
Hi guys,

Laz 1.8.2 on Win 10 with version of VirtualTreeView and 0.6.1 of lclextensions.

Hopefully, this one is simple: I've loaded a picture into the background property of a VirtualStringTree. I've set toShowBackground to true in the paint options but the image does not show.

The image has the following properties:
Type: jpeg
Size : 10.4 kb
Dimensions: 265 x 685
DPI : 92

The virtual tree string dimensions are 262 x 621.

I hope I'm missing something really trivial.

Any pointer would help


Your app should not store things in the app bundle. Bad idea. Period.

in fact, I don't, and not intend to, store anything inside the app bundle folder. as I mentioned, I want my program to be portable (such as ready-to-run on an USB drive), meaning that people unzip, and run without needing installation. I want to store the output of the program "along side" with the app, something like

Code: Pascal  [Select]
  1. AppUnzipFolder/
  2.   |-- myapp   (binary)
  3.   |-- myapp.app/
  4.   |       |-Contents
  5.   |               |-MacOS
  6.   |               |- ...
  7.   |-- Output
  8.          |- output1

as you see, I do not put my output file inside myapp.app, but I just want to find out the folder containing the app, and create an Output folder.

You should create the folder in one of the locations that macOS provides, typically under ~/Library/Application Support. Create your folder there using your app's bundle ID as the folder name.


I did some search earlier, and found that GetUserDir or GetAppConfigDir may be an alternative, but still, making my software portable and self-contained is a feature I would love to keep.

You may be doing other things that non-Mac developers often try to drag in from the Windows or Linux worlds. A good way to root out these bad practices is just to go through the exercise of sandboxing your app. You may be surprised at how ill-disciplined your app is. But don't worry, in many cases these problems are easy to fix once you're spent a few minutes reading Apple's docs and learning about programming best practices on macOS. Here's a Pascal-oriented article on sandboxing that will help you get started:


again, I still don't think having an installation-free and portable package design (such as USB storage based) is an "ill-disciplined" idea. I consider it as a feature, and if there are mechanisms that I can use in lazarus to keep this feature, I will be happy.
General / Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Last post by armandoboza on Today at 02:39:20 am »
avra, could you attach the changed ppc386.exe file for me to test?
Here it is: http://anonfile.com/69IdS2dcb2/ppc386.7z

Thanks Avra, but it did not work.

I am using Lazarus 1.8.2 + fpc 3.0.4, is this ppc386.exe you attached to this version?
General / Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Last post by avra on Today at 01:35:16 am »
avra, could you attach the changed ppc386.exe file for me to test?
Here it is: http://anonfile.com/69IdS2dcb2/ppc386.7z
Pages: [1] 2 3 ... 10


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