Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/02/21 in all areas

  1. Marco showed a preview of some of what's new in Delphi 11 yesterday - you can read his blog with screenshots, or watch the video replay, here. I'm also giving a talk today on Usability and Design, in general but also referring to the IDE and some decisions we made there. If you've ever wanted to see an internal mockup of things we did not do, this is the one to watch -- but also, I hope the talk in general will be helpful for anyone who wants to have good design in their app. Join this or the other (really good!) talks today and tomorrow here!
  2. Hi everyone, Following fast on my last post, I thought I'd also share another development I've started - a Console Manager for the Delphi IDE. This is a tool that allows you to spin up a cmd.exe or powershell.exe within a dockable form, localised within the Delphi IDE. Features: - It is aware of the active project, so it will open up in the directory in which the dproj is located. It is still very alpha as in it just streams stdout/stdin, and not totally pleasant on the eye, but ok for an alpha POC. - I've got a little slider that allows you to zoom in/out. - (planning) The ability to have lists of commands / saved environments that could be applied to a newly created session. This is a POC, and still have some more work to do as I want to embrace the new pseudo console api which was introduced with the new Windows Terminal drive along with the VT emulation which would support colour, repositioning of the cursor, etc. I have not released this publicly yet, but attached is a short video demonstrating how it works. If you are interested in accessing it, please send me a mail: conrad.vermeulen@gmail.com. Let me know about what IDEs versions you may be interested in. I think I can do XE8 onwards. I'll provide more information when it is officially released. Regards, Conrad
  3. 1. Sign your files. Windows Defender heuristics are much more forgiving if an executable file has a valid digital signature. 2. Submit false positive detection: https://www.microsoft.com/en-us/wdsi/filesubmission
  4. Alexander Sviridenkov

    HTML Office Library: Font Browser Demo

    New compiled demo showing font management capabilities of HTML Office Library. it can: Open TTF or WOFF font. Extract embedded fonts of any type from PDF file. Save extracted font as TTF or WOFF. Show font glyphs. Show glyph control points. Copy glyph as SVG. 100 lines of Delphi code. Everything is cross platform (Win, Mac, Linux, iOS, Android) https://delphihtmlcomponents.com/FontBrowser.zip
  5. Fr0sT.Brutal

    Get Parent process Current directory

    "Current directory" is a per-process property that could be set to anything when a process is launched and later changed to anything by the process itself. By default (if not set by the CreateProcess parameters) it is inherited by launched processes. So. If your "Photoshop" really changes CDir to the path of currently opened file (which is weird IMHO) and doesn't specify CDir in the CreateProcess call, you can just invoke GetCurrentDirectory and chill. If it doesn't, all you've got to do is to suppose things with non-100% probability and dive into the abyss of dirty hacks. F.i., you can list handles of files opened by the parent process and find the full path but this requires elevated privileges and there's a chance that two files with the same name are opened at the same time.
  6. just a note when signing files - it may be obvious, but also ensure that any relevant metadata in versioninfo matches the digital signature. e.g. don't use an abbreviation in one place and not the other....the AV guys like metadata to match exactly. Most vendors have a url where you can upload a sample for review where upon acceptance the app will be whitelisted. It is annoying to have to do this however. I have the false positives kicking in while I'm writing unit tests from time to time. the test app gets deleted before it has a chance to run. ;( And then making what may be a seemingly irrelevant change gets it to work again.
  7. chkaufmann

    TPopupMenu with group headers

    Thanks for all hints. I created a subclass of TMenuItem and did an override of the AdvancedDrawItem method. In addition I set Enabled=False. Themes are not support, but I don't have that anyway in my application. But so far it looks fine: procedure TMenuGroupItem.AdvancedDrawItem(ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState; TopLevel: Boolean); begin ACanvas.Brush.Color := TColors.Silver.Lighten(50); ACanvas.FillRect(ARect); ACanvas.Font.Color := TColors.SysWindowText; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); end; Christian
  8. From an old blog post from Allen Bauer (https://blog.therealoracleatdelphi.com/2009/09/: " All eligible class constructors and class destructors are invoked in sequence with unit initialization and finalization, respectively. If a given class constructor or destructor is eligible to be invoked (ie. it was linked into your application), it will run immediately before the initialization section for the unit in which the class is implemented. The class destructors will be invoked immediately after the finalization section for the unit in which the class is implemented. Class constructors in a given unit are generally invoked in the same order of declaration, except in cases described below. Class destructors are invoked in reverse order from the class constructors. For an ancestor class declared in the same unit, its class constructor will be invoked before the descendant class constructor and the class destructor is invoked after the descendant class destructor. If the implementation of given class constructor references another class in the same unit with a class constructor, the referenced class’ class constructor will be invoked before the current class’ class constructor. If the references are cyclic (ie. they reference each other in their class constructors), then they are invoked in reverse order of declaration. This means that there can be cases where a class constructor can reference an “unconstructed” class. Ancestor classes from external units used in the interface section are guaranteed to already have their class constructors run prior to any class constructors on descendant classes within the current unit. Unit cycles can break down the deterministic nature of the above rules in the same manner as unit initialization and finalization. However, for a given unit, it is guaranteed that all the class constructors declared within in it will have already run immediately before the initialization section runs. Congruent to this rule is that it is guaranteed that all the class destructors will run immediately after the finalization section. Dynamically loaded packages, using LoadPackage. Because there is no way to know exactly which classes are going to be used, just like there is no way to know which units are going to be used, all class constructors and destructors along with all unit initialization and finalizations are invoked according to the above rules. Other rules about their use are: You do not have to declare a class destructor if you declare a class constructor, and vice versa. They cannot be virtual, dynamic or message. They cannot be explicitly called. They cannot have any parameters. They do not have to be called Create and Destroy. (ie. Init and Fini are equally valid names). With this implementation, it was easier to leverage the same table that the compiler creates for unit initialization and finalization. It satisfies this requirement: “Called automatically to initialize the class before the first instance is created or any static members are referenced.” Issues with cycles are also clearly warned against in VB.NET and C#: “Avoid circular references in Shared … since it is generally impossible to determine the order in which classes containing such references are loaded.” Another benefit is that since it is running during the initialization/finalization phases, any threading implications are no different than the existing rules regarding unit initialization and finalization." What we don't know is, if the compiler behavoiur has changed since then.
  9. Uwe Raabe

    IDE changes monitor when debug run

    As there seem to be people with different expectations, it would be best to make that configurable: Selecting Layout doesn't remember which monitor a form is on
  10. Andrea Magni

    How to make a component available to all platforms

    A nice hack from @Dalija Prasnikar here: https://stackoverflow.com/questions/27486939/is-there-simpler-way-of-saying-that-delphi-component-control-is-supported-on-all HTH
  11. pyscripter

    How to make a component available to all platforms

    From the documentation: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/64-bit_Windows_Application_Development. The RAD Studio build system automatically embeds an RC_DATA resource in the Win32 package binary named PLATFORMTARGETS, which is a bitmask of the pidXXX constants in System.Classes.pas and reflects the package project's targeted platforms. The IDE reads this resource when the package is loaded and uses the resource data to decide, for example, whether or not to disable the component(s) in the palette when an unsupported platform is active. Targeting multiple platforms with a component package implies a contract between the component developer and the IDE. The IDE assumes that if a component package project targets multiple platforms and the developer distributes the Win32 run-time package to customers (and all the associated compilable and linkable files), the developer will also distribute all the necessary compilable, linkable, and run-time bits for the other targeted platforms as well. Individual components can use the ComponentPlatformsAttribute class attribute to override the data in PLATFORMTARGETS, using a bitmask of the same constants in the Classes unit. For example: type [ComponentPlatformsAttribute(pidWin32 or pidWin64)] // Only supported on Win32 and Win64 TMyComponent = class(TComponent) private ... end; So to get the components to be usable with other plagorms, all you need to do is before you compile the Design package to add the other platform to it. They won't be used but just being there makes the build system to include the appropriate resource flagging the package as usable for the platforms. I have tested this and it works!
  12. *facepalm* is it really so hard to run init sections in the order of unit appearance?
  13. This issue is as old as generics are: https://quality.embarcadero.com/browse/RSP-10506
×