Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/01/21 in all areas

  1. Lars Fosdal

    Parnassus Bookmarks for Delphi 11 Alexandria?

    When there are reasons, there should be public information - but there is just silence.
  2. The named pipe sits in a thread and when triggered communicates with the main application thread through synchronisation. When the application is closing down, it sends a dummy pipe message which the thread handles and terminates.
  3. FPiette

    WebView2 synchronious calls

    You should think "event driven" and no "synchronous". Put all your code after the ExecuteScript call into another function. Then call that function from the callback. Probably your application will need other changes to become fully event driven without using any "wait loop" hack.
  4. CHackbart

    MacOS NSVisualEffectView implementation

    Yes, and it works surprisingly well. You just have to execute AppendToForm with your Formular and if you do not want to have a border - since FireMonkey still is unable to render the toolbar with a style under osx - you can set this also to borderless. function AppendToForm(const AForm: TForm;const AOpacity: single=1.0;const ABorderLess: Boolean=False): Boolean; var LNSWin: NSWindow; LBlurView: NSVisualEffectView; LView: NSView; LContext: NSView; begin if not TOSVersion.Check(10,10) then begin result := false; exit; end; AForm.Fill.Kind := TBrushKind.Solid; AForm.Fill.Color := 0; LNSWin := WindowHandleToPlatform(AForm.Handle).Wnd; LContext := WindowHandleToPlatform(AForm.Handle).View; LNSWin.setOpaque(false); LNSWin.setAlphaValue(AOpacity); LBlurView := TNSVisualEffectView.Wrap( TNSVisualEffectView.Alloc.initWithFrame( MakeNSRect(0,0, AForm.Width, AForm.Height))); LBlurView.setWantsLayer(true); LBlurView.setBlendingMode(NSVisualEffectBlendingModeBehindWindow); LBlurView.setMaterial(NSVisualEffectViewMaterialFullScreenUI); LBlurView.setState(NSVisualEffectStateActive); LBlurView.setAutoresizingMask(NSViewWidthSizable or NSViewHeightSizable); LView := TNSView.Wrap(LNSWin.contentView); if ABorderLess then begin LNSWin.setStyleMask(NSBorderlessWindowMask or NSResizableWindowMask); LNSWin.setBackgroundColor(TNSColor.Wrap(TNSColor.OCClass.clearColor)); LView.setWantsLayer(true); LView.layer.setMasksToBounds(true); LView.layer.SetCornerRadius(10.0); end; LContext.removeFromSuperview; LView.addSubview(LBlurView); LView.addSubview(LContext); if GlobalUseMetal then WindowHandleToPlatform(AForm.Handle).MTView.layer.setOpaque(false); result := true; end;
  5. I use named pipes so that a starting second instance of my app can send the files and actions (from the command line) to the existing app.
  6. Hallo everyone, has anyone tried the official "DelphiLSP" Plugin for Visual Studio Code (https://marketplace.visualstudio.com/items?itemName=EmbarcaderoTechnologies.delphilsp) yet? Some time ago I have used OmniPascal (http://blog.omnipascal.com/) by Christopher Wosinski and the code completion has already worked better than in Delphi IDE. So I have hope in the official "DelphiLSP", so that I can use Visual Studio Code instead of the Delphi-IDE at least for "just programming", i.e. no Forms etc. Or does the official plugin has the same "code completion"-issues as in the Delphi IDE ?
  7. A very long time ago and what feels like a far off galaxy A very long time ago and what feels like a far off galaxy A very long time ago and what feels like a far off galaxy A very long time ago and what feels like a far off galaxy A very long time ago and what feels like a far off galaxy..... I was part of a small team than wrote accounting software for our UK and international customers. All the prices, totals, decimal quantities, fractional quantities were represented as integers or long integers. The long integers having 15 digits of significance; not a floating point number in sight. All decimal places and fractial separators were implicit until it came to displaying them. No rounding errors crept in. I remember this as an example of a good design choice by the lead developer.
  8. Yaron

    WebView2 synchronious calls

    @FPiette My application has over 100 keyboard macros, many dynamically created UI elements (skinned buttons) and even a TCP/IP control API (used for remote control) that can trigger events that should not be activated while a new media is in the process of loading, I can't simply disable one button, I have to disable 100's of elements and several event triggers that may execute unwanted functionality while waiting for the javascript callback event to trigger. Sure, I can do that, but it would take a lot more work than just having WebView2 return a result synchronously like TWebBrowser is able to do. @Edwin Yip I considered CEF4Delphi, but from my initial investigation, there were several show-stoppers, including the possible illegality of including audio/video codecs required by YouTube in the compiled binary, something I'm not willing to do. With regards to the 120+ MB WebView2 download, it won't be a thing in Windows 11 as WebView2 comes pre-installed on Win11. For Win10, I offer my users a quick setup option to download and install the evergreen version of WebView2 without much hassle.
  9. Lars Fosdal

    Parnassus Bookmarks for Delphi 11 Alexandria?

    I was signed up but didn't have time to watch it - when I tried some of the interesting replays, they were not working. Why don't they do a blog post about it and indicate a timeframe for availability? In a way, it is good that they have HighDPI issues since that means proper dogfooding, but I fear that we will be talking about update 1, and not a December hotfix. Judging from all the HighDPI issues I've seen discussed, the right thing to do would be to break the mold and do it right. The current approach with kludges and workarounds = tech debt++.
  10. Anders Melander

    SudokuHelper - Example for uncoupled design via interfaces

    Ah, yes. I missed that. Easily solved though (I think): var FSingleton: ISingleton = nil; function Singleton: ISingleton; const MagicValue = pointer(1); begin if (FSingleton = nil) then if (TInterlocked.CompareExchange(pointer(FSingleton), MagicValue, nil) = nil) then begin // Create instance and reference interface (RefCount=1) var Instance: ISingleton := TSingleton.Create; // Copy interface pointer value (RefCount=1) pointer(FSingleton) := pointer(Instance); // Clear interface reference without ref counting (RefCount=1) pointer(Instance) := nil; end; // Wait for value to become valid while (pointer(FSingleton) = MagicValuel) do YieldProcessor; Result := FSingleton; end;
  11. It works equally well with VCL.
  12. Dalija Prasnikar

    SudokuHelper - Example for uncoupled design via interfaces

    InterlockedCompareExchangePointer is part of Windows API. AtomicCmpExchange is added to provide cross-platform support. There is also TInterlocked class in System.SyncObjs that implements various static functions for performing interlocked operations, including CompareExchange that basically calls AtomicCmpExchange, but it is more convenient to use for some types.
  13. Dalija Prasnikar

    SudokuHelper - Example for uncoupled design via interfaces

    And how exactly would you do that in this scenario? Not to mention that you are opposing simple full pointer exchange because it is too "clever", and your solution would be bit fiddling. Comfortable, prefer, personally use... those are all the same reasons, just different words. You are reading into words way too much. You don't want to use something because you have subjective reasons. I have no problem with that and I am doing the same in many places. The only reason why am I here objecting, is you saying this is not good pattern and this is not true and it sends wrong message to others that are not familiar with this kind of code. By you saying this is bad code, someone else might avoid such coding pattern because they will wrongly think it is a bad one. The only place where I wouldn't use this pattern is in places where constructed object is extremely heavy and where constructing object that would possibly be immediately discarded would consume plenty of resources or would take a lot of time. I already said why it is good, but I will repeat it. It is lock-free, so the whole operation can be done with single reference (I am not talking about local variables, but broader scope where final reference is declared). There is no additional, separate entity involved. That is reason enough.
  14. hsauro

    Skia versus VCL for plotting points

    Someone asked that I include the timings in the code and while I was at it I folded in the code provided by contributors here. I'll probably add TImage32 at some point as well. https://github.com/hsauro/Mandelbrot There is a new binary release on Github, https://github.com/hsauro/Mandelbrot/releases/tag/1.1
  15. I'd not be surprised if Jamie didn't even know about the DPR file. How would you stumble across it, anyway? Right-clicking the project node and then finding "View Source" among two dozen other entries is not the most intuitive choice. I wish I still remebered how I first found it...
  16. ctrl-v on the project name (xy.exe or .dll etc..) in the project manager at the upper right corner of the IDE. Just saying. Looks like it will open something new for you.
  17. CHackbart

    MacOS NSVisualEffectView implementation

    I managed to get it working. To do so I had to move the main view to the front and set the background color of the layer to transparent. This works also when UseGlobalMetal is enabled.
  18. hsauro

    Getting a package on GetIt

    To answer my own question, submissions can be proposed here: https://getitnow.embarcadero.com/submit/
  19. Lajos Juhász

    Has anyone tried "DelphiLSP" for Visual Studio Code yet?

    I didn't tested Visual Studio Code. It uses the same thing. From Delphi 11 unfortunately only the LSP based code completion is available and it's not good enough (capable only to handle Hello World applications).
  20. Tom F

    Delphi 11 November Patch

    The patch was not suggested on the Welcome screen, nor was it promoted on the default GetIt Package Manager screen. I expected it to be. I found the patch under "Patches and Hotfixes" on the GetIt Package Manager screen. I installed it with no errors. However, I LOST ALL OF MY TOOLBAR CUSTOMIZATIONS. (Yes, I'm shouting.) Years ago I gave up using the Delhi Migration Tool because it also failed to preserve my toolbars. I concluded then that Emb is unable or unwilling to fix whatever problem exists with preserving IDE toolbars during installations. It appears that the same problem exists on this update, although it's possible of course that the loss I experienced was due to some other coincidental factor than installing the patch.
  21. Anders Melander

    Skia versus VCL for plotting points

    I just did: TCanvas.Pixels: 320 mS skia4delphi: 130 mS TBitmap.Scanline: 60 mS
  22. Stefan Glienke

    Bookmarks dead?

    Someone should have invited David Millington or the dev at Embarcadero that is now responsible for those plugins to the Delphi 11 beta so they could have worked on those plugins at the time when many other IDE plugin devs did. /s
  23. Lars Fosdal

    awk-like processor using Delphi code?

    Dictionary and anonymous methods. Link the method to the keyword. Look up via the keyword and execute the code.
  24. Second but without Egyptian begin/end.
×