Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/06/22 in all areas

  1. Please see these earlier posts on SynEdit history: SynEdit preferred version? - Delphi Third-Party - Delphi-PRAXiS [en] (delphipraxis.net) Turbo SynEdit & Font Ligatures - VCL - Delphi-PRAXiS [en] (delphipraxis.net) DirectWrite and Unicode support One of the major flaws of SynEdit was the poor handling of Unicode. A major update has been committed to the TurboPack fork, that employs DirectWrite for text painting and fixes Unicode support. SynEdit should now be on a par with, if not better than, the best editors around with respect to Unicode handling. For example: Chinese is properly spaced and surrogate pairs and color emojis are fully supported: Bidirectional text editing is fully supported as well: WordWrap has been re-written and is now based on DirectWrite as well. This last update also includes other enhancements as for example an option to alpha blend the selection, another option for selection to cover just selected text instead of full lines, as in VS code and other editors, and horizontal mouse wheel scrolling: Other recent improvements: The undo/redo system was buggy and a mess, getting in the way of implementing new features. I has been reimplemented from scratch. The gutter has been reimplemented from scratch and is now flexible and extensible. A track changes bar like in Visual Studio has been added and unlike Delphi's it saves and restores line state correctly on undo/redo. The code base has been refactored cleaned-up, and partially documented, yet, and despite of the new features, it is thousands of lines shorter than the original. But a lot more can be done in this area. See here for the full list of enhancements in the the TurboPack fork. Backward compatibility Turbopack Synedit remains compatible with earlier versions of Synedit, but you do need to reinstall Synedit, load forms that use SynEdit ignoring error messages and save them again for the new properties to take effect. The use of DirectWrite though means that Windows XP is no longer supported. The TurboPack SynEdit fork supports Delphi versions Berlin or later. Future plans The next big planned feature is multi-selection and multi-cursor editing. Support the project Most of the bugs remaining in the issue tracker are C++Builder related. Also, the C++ packages have not been updated yet. We are actively seeking contributions on the C++Builder side of things (package updates, bug fixes). Of course you can also support the project by submitting bug reports and pull requests. Or, by implementing new features (e.g. minimap, Sync Edit like in Delphi, Delphi or VS-code like templates etc.) Note: Many thanks to @MarkShark for his great contributions to the SynEdit project.
  2. aehimself

    best way to structure an application

    No need for a launcher, a single .EXE can do it - at least on Windows. Windows allows to rename the executable even if your application is running. So the steps are... - Download the updated .exe, and save it e.g. .exe.new - Rename the current application (Application.ExeName) to .exe.old - Rename the updated file .exe.new -> .exe - Launch the .exe and immediately quit - It's a good practice to wait for the previous process to actually die before doing any actual work, like reading settings up, etc. - Upon startup check and delete any .exe.old files I'm using this method and it works like a charm.
  3. Remy Lebeau

    Memo get real-time output

    That is because you are not writing to the Memo while the reading loop is running. You are writing to the Memo only after the loop is finished. Change the code to write the current Buffer to the Memo after each successful read. And don't use the Memo.Text property to do that update, either. That will be very inefficient. A better way to append text to the end of a Memo is to use its SelText property instead, eg: procedure GetDosOutput(Output: TMemo; CommandLine: string; Work: string); var ... begin ... repeat WasOK := ReadFile(StdOutPipeRead, Buffer, 255, BytesRead, nil); if WasOK and (BytesRead > 0) then begin Buffer[BytesRead] := #0; Output.SelStart := Output.GetTextLen; Output.SelLength := 0; Output.SelText := Buffer; end; until (not WasOK) or (BytesRead = 0); ... end; procedure TForm7.Button1Click(Sender: TObject); begin GetDosOutput(Memo1, 'python mtk payload', ExtractFilePath(application.ExeName) + 'bin\'); end; If you don't want to pass in the TMemo directly, you could pass in a TStream instead, and then write a custom TStream descendant that overwrites the virtual Write() method to append to the Memo, eg: procedure GetDosOutput(Output: TStream; CommandLine: string; Work: string); var ... begin ... repeat WasOK := ReadFile(StdOutPipeRead, Buffer, 255, BytesRead, nil); if WasOK and (BytesRead > 0) then Output.WriteBuffer(Buffer, BytesRead); until (not WasOK) or (BytesRead = 0); ... end; type TMemoAppendStream = class(TStream) private FMemo: TMemo; public constructor Create(AMemo: TMemo); function Write(const Buffer; Count: Longint): Longint; override; end; constructor TMemoAppendStream.Create(AMemo: TMemo); begin inherited Create; FMemo := AMemo; end; function TMemoAppendStream.Write(const Buffer; Count: Longint): Longint; var BufferStr: AnsiString; begin Result := Count; SetString(BufferStr, PAnsiChar(@Buffer), Count); FMemo.SelStart := FMemo.GetTextLen; FMemo.SelLength := 0; FMemo.SelText := BufferStr; end; procedure TForm7.Button1Click(Sender: TObject); var Strm: TMemoAppendStream; begin Strm := TMemoAppendStream.Create(Memo1); try GetDosOutput(Strm, 'python mtk payload', ExtractFilePath(application.ExeName) + 'bin\'); finally Strm.Free; end; end;
  4. Something that has been annoying me for awhile. When posting a code snippet and choosing the Pascal syntax highlighter, backslashes are treated as C/C++ escape sequences, which throws off the coloring. The actual Pascal language doesn't treat backslash as an escape character. Can this be fixed?
  5. As you discovered, it is being added during the build process. The value for exported is not in any configuration files so presumably it is hard-coded. The "easiest" way to fix this is to edit the generated AndroidManifest.xml, add it to the deployment and disable the one that Delphi would normally deploy. Of course this means having to repeat the process if you make any changes that affect the manifest. ..or you could use Delphi 11, where the problem has been fixed.
  6. David Schwartz

    best way to structure an application

    TMS Web Update https://www.tmssoftware.com/site/wupdate.asp
  7. qubits

    Memo get real-time output

    quick test, worked straight away with elegant changes recommened .. no python, but gave me a dir listing.. ufrmMain.pas
  8. Kryvich

    Delphi 5 - VirtualTreeView

    An external MM can help catch double free errors. Try FastMM4 by Pierre le Riche. Declared support for Delphi 4 (or later)
  9. Alexander Elagin

    Delphi 5 - VirtualTreeView

    VTSourceOnly.4.2.30.zip : https://drive.google.com/file/d/19VQ2v-_Zef26zZB3U1go1MmHS_k8uWaC/view?usp=sharing VirtualTreeviewSetup.4.8.7.exe: https://drive.google.com/file/d/1bMgUg15T0ho5yUv1gVxh4NUhzuyJocxl/view?usp=sharing
  10. The Windows imaging Component contains a wealth of useful features for manipulating images in different formats. Delphi partially encapsulates this functionality into the TWICImage class of Vcl.Graphics which is a TGraphics descendent. The following code resizes pf32bit bitmaps with transparency using TWICImage, at a much better quality than can be achieved with StretchDraw for example or anything else I have tried.. Uses Winapi.Wincodec, Vcl.Graphics; procedure ResizeBitmap(Bitmap: TBitmap; const NewWidth, NewHeight: integer); var Factory: IWICImagingFactory; Scaler: IWICBitmapScaler; Source : TWICImage; begin Bitmap.AlphaFormat := afDefined; Source := TWICImage.Create; try Factory := TWICImage.ImagingFactory; Source.Assign(Bitmap); Factory.CreateBitmapScaler(Scaler); Scaler.Initialize(Source.Handle, NewWidth, NewHeight, WICBitmapInterpolationModeHighQualityCubic); Source.Handle := IWICBitmap(Scaler); Bitmap.Assign(Source); Scaler := nil; Factory := nil; finally Source.Free; end; end; Some key points: Setting the AlphaFormat to alDefined is crucial for maintaining the transparency. If you do not release the ImageFactory before you destroy the TWICImage you will get access violations next time you call this procedure. (Have a look at TWICImage .Destroy).
×