-
Content Count
786 -
Joined
-
Last visited
-
Days Won
61
Everything posted by Vincent Parrett
-
Delphi's code formatter vs. GExperts' code formatter
Vincent Parrett replied to dummzeuch's topic in GExperts
I'm just trying to format the code for a project.. the GExperts formatter does a much better job than the built in one (in 10.4 at least) - one thing that bugs me (with both) is how it indents guid attributes on interfaces so ICompiler = interface ['{4A56BA53-6ACD-4A5D-8D55-B921D6CDC8A0}'] becomes ICompiler = interface ['{4A56BA53-6ACD-4A5D-8D55-B921D6CDC8A0}'] There doesn't seem to be any way to control this. Also some comment formatting gets messed up const //options for IACList2 ACLO_NONE = 0; // don't enumerate anything ACLO_CURRENTDIR = 1; // enumerate current directory ACLO_MYCOMPUTER = 2; // enumerate MyComputer ACLO_DESKTOP = 4; // enumerate Desktop Folder ACLO_FAVORITES = 8; // enumerate Favorites Folder ACLO_FILESYSONLY = 16; // enumerate only the file system gets changed to const //options for IACList2 ACLO_NONE = 0; // don't enumerate anything ACLO_CURRENTDIR = 1; // enumerate current directory ACLO_MYCOMPUTER = 2; // enumerate MyComputer ACLO_DESKTOP = 4; // enumerate Desktop Folder ACLO_FAVORITES = 8; // enumerate Favorites Folder ACLO_FILESYSONLY = 16; // enumerate only the file system I turned on Align var/const statements at position 30 and it comes close const //options for IACList2 ACLO_NONE = 0; // don't enumerate anything ACLO_CURRENTDIR = 1; // enumerate current directory ACLO_MYCOMPUTER = 2; // enumerate MyComputer ACLO_DESKTOP = 4; // enumerate Desktop Folder ACLO_FAVORITES = 8; // enumerate Favorites Folder ACLO_FILESYSONLY = 16; // enumerate only the file system use At position will not always work. I tend to use tabs to align them manually after the longest line in the block. So in the original (pre format) version there are tabs before the = and before the // - not sure if this is possible in the formatter without doing some block analysis. -
Anyone know how to detect specific update version in compiler defines. I'm already doing {$IF CompilerVersion >= 25.0} but I need to detect compiling under 10.2.2 vs 10.2.3 etc
-
Detecting update versions in defines
Vincent Parrett replied to Vincent Parrett's topic in RTL and Delphi Object Pascal
Thanks for the input folks. This has all become a moot point as I realised I can't have 10.2.0/10.2.1/10.2.2/10.2.3 installed at the same time, so it's likely I'll just support the latest patch version for each compiler version. That said, @Uwe Raabe shared (privately) how he handles this (tools api change) in MMX, that will allow people to compile the project with older patch versions themselves if needed. -
Detecting update versions in defines
Vincent Parrett replied to Vincent Parrett's topic in RTL and Delphi Object Pascal
Thanks. I have it working, but it does introduce a positioning issue with the include statement, can only be included after the uses clause and that uses clause must include the unit with the identifier. Not a huge deal in my case but could be a bit of a gotcha if you were using that same include file to ifdef the uses clause itself! -
Detecting update versions in defines
Vincent Parrett replied to Vincent Parrett's topic in RTL and Delphi Object Pascal
I suspected as much. It's a change in the tools api I needed to detect, which was added in 10.2.2 . In any case I can't have different patch versions installed to compile against anyway so I guess. -
Anyone knows of a good Delphi library encapsulating Stripe payments?
Vincent Parrett replied to Andrea Raimondi's topic in Delphi Third-Party
404 - did you forget to make the repo public? -
How-to: Post a message to Teams using WebHooks
Vincent Parrett replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Lots of unhappy Atlassian customers https://community.atlassian.com/t5/Atlassian-Cloud-Migration/To-all-Atlassian-server-champions-we-want-to-hear-from-you/qaq-p/1500873 And yes, it seems like Bamboo is just being quietly shelved, they don't mention it anywhere on their roadmaps or cloud migration pages. My guess is bitbucket piplelines is the intended migration path. I'll take this opportunity to offer a different migration option - https://www.finalbuilder.com/continua-ci - currently windows only, but we're working towards linux & mac support (agents first, server later). -
How-to: Post a message to Teams using WebHooks
Vincent Parrett replied to Lars Fosdal's topic in Tips / Blogs / Tutorials / Videos
Yes, this is true for all Atlassian products. We're moving away from Confluence because whilst it has support for producing documentation sites, it has no support for versioning.. unless you buy an expensive plugin - which totally takes over and makes a complete mess of things when you install on existing spaces, and and even worse mess (had to restore from backup) when uninstalling it. TBH, I fell out of love with confluence a long time ago.. we'll probably just switch to some sort of static site generator. They announced yesterday they are moving to cloud only and will retire the server/dc products over the next few years - that's just another reason to stop using their products imho. -
Organizing enums
Vincent Parrett replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
My take is what he really wants in code completion that actually works? It bugs the hell out of me that when I'm typing an assignment statement and the left side is an enum, that code completion offers all sorts of crap that is not relevant. If the type isn't found, tell me that. -
How to detect when control is scrolled into view
Vincent Parrett replied to PiedSoftware's topic in VCL
Are all the cards the same height with the same layout? If so then something like this might be faster - https://github.com/VSoftTechnologies/VSoft.VirtualListView - it's working well for me in the application I'm using it for I pre-calculate the layout for the rows when the control resizes, so the painting is fast. It does take a lot more effort to write the layout and painting code but it's very smooth. The sample app doesn't show the pre-calc idea, you can see that here https://github.com/DelphiPackageManager/DPM/blob/master/Source/IDE/DPM.IDE.EditorViewFrame.pas I wrote this control for a specific purpose, but I have tried to keep it reusable for other things, it might still be a little rough around the edges. -
Terminate/Kill Parallel Async after timeout
Vincent Parrett replied to chmichael's topic in OmniThreadLibrary
Umm, you might want to edit your reply so it doesn't look like I said it! What is the api you are calling? If an api you are calling is blocking, and doesn't take an event handle or have some way of cancelling then you cannot safely kill it. Killing a thread on windows is dangerous, https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread -
Terminate/Kill Parallel Async after timeout
Vincent Parrett replied to chmichael's topic in OmniThreadLibrary
CancellationTokens are what you need. Parallel.Async as a second optional parameter which is an IOmniTaskConfig - you can create that using the Parallel.TaskConfig class function - then you need to create IOmniCancellationToken and pass that into the taskConfig.CancelWith - when you want to cancel the async, call cancellationtoken,Signal. Your procedure can also take an IOmniTask parameter which will give you access to the Cancellation token in your function, so you can gracefully exit eg Parallel.Async( procedure (const task : IOmniTask) begin // Call a Winapi Blocking API which take 5000 ms to complete if task.CancellationToken.IsSignalled then exit. end ); If the blocking api you call takes a handle or array of handles then you can use task.CancellationToken.Handle - eg in calls to WaitForSingleObject or WaitForMultipleObjects HTH -
Hmmm... another new feature in delphi that doesn't actually work properly.. I think I'll give it a miss for now.
-
Where does it put the dll? I installed it but have no idea where the dll lives. Only asking as I wanted to see if both 32 and 64bit were installed, as only a 64bit installer was offered.
-
🤦♂️ Oh FFS - how many versions do we have to wait for properly functioning high dpi support. The fact that these were reported 3 or 4 years ago and have not been addressed is astounding. Surely if you are working on high dpi support you would look at these issues in your own bug tracking system.
-
[Delphi 10.4] Deleting controls/components on Ancient form, Causing AVs on inherited forms!
Vincent Parrett replied to c0d3r's topic in Delphi IDE and APIs
Just random av's, form designer refusing to open etc. So rather than using inheritance we create smaller frames and compose those with other frames. A lot of the time they are composed at runtime rather than design time though, for similar reasons (ide instability). -
[Delphi 10.4] Deleting controls/components on Ancient form, Causing AVs on inherited forms!
Vincent Parrett replied to c0d3r's topic in Delphi IDE and APIs
Ouch! I stopped using form/frame inheritance a long time (ok, my code still has a few legacy instances of this) due to IDE instability. And yes @Der schöne Günther is correct, pay attention to your dfm's when committing changes. I prefer composition over inheritance these days, it's more work initially but in the long run it's just simpler for the IDE to deal with and results in less lost time restarting the IDE. -
Per monitor DPI awareness - how to prevent flickering?
Vincent Parrett replied to luebbe's topic in VCL
I do the same thing when switching themes, but haven't tried this. I wonder how it will go with moving the window from one monitor to the other with different dpi's. At the moment it's terrible, flickers and stops moving for a few seconds. -
BTW, I did try to use it, but it's buggy and doesn't work with TMainMenu.. so useless.
-
TTitlebarpanel is the most arse backwards design in Delphi - and that's saying something since there are many to chose from! TForm has a bunch of properties, that are only relevant when you have a specific control placed on it and hooked up… yet you manage the control from properties on the form not on the control? Having most of the options on the form rather than the panel is odd to say the least, since you tend to interact with the panel, and it’s painful switching between the two due to the object inspector not remembering where you were on the controls, so lots of scrolling, expanding… etc. Also in a real application, the form is quite often covered with panels etc and so have to use the structure view to even select the form. Yet another half baked barely functioning feature added to the vcl - which btw can't be removed (because someone "might" be using it), destined to be hacked at to try and fix it (but never really succeeding), just like vcl themes.
-
Everyone focusing on the sorting algorithm, no one comments on the folly of loading a 100K rows into a TStringGrid 😉
-
https://www.axialis.com/icons/ not cheap when you end up buying multiple sets to get what you need, but other than that there are many websites that do svg's which can be uses with this library - https://github.com/EtheaDev/SVGIconImageList
-
Non Delimited string parsing (registry entries)
Vincent Parrett replied to RTollison's topic in General Help
This is the command line parser we use in FinalBuilder and DUnitX and the package manager I'm working on. https://github.com/VSoftTechnologies/VSoft.CommandLineParser -
On the use of Interposers
Vincent Parrett replied to FPiette's topic in RTL and Delphi Object Pascal
I generally only use interposer classes to fix vcl/rtl issues where I'm using runtime packages.. and then only very carefully - generally in a file that is a folder like VclFixes and where the filename would be something like Vcl.Forms.RSP1234.pas - it's hard to miss that you are using a patch/hack and makes it easier to review when upgrading delphi versions (ie do I still need this file). The other time I have used them is when messing with the IDE and don't have the IDE source code 😉 -
ANN : Continua CI Version 1.9.2 Beta - Continuous Integration Server
Vincent Parrett posted a topic in Delphi Third-Party
We are delighted to announce a new beta release in Continua CI. We have added the following new features: Export and Import: You can now export one or more configurations to a file and import them back from the file into Continua CI. Requeuing Stages: Requeue a failing stage without restarting the build. Multiple Daily Cleanup Rules: Each type of build by-product can now have a different shelf life. https://www.finalbuilder.com/resources/blogs/introducing-continua-ci-version-192-beta Continua CI is a low cost, easy to use Continuous Integration Server which includes first class support for Delphi (using FinalBuilder or MSBuild) and version control integration with Git, Mercurial, Subversion and more. https://www.finalbuilder.com/resources/blogs/building-delphi-projects-with-continua-ci- 1 reply
-
- continuous integration
- automation
-
(and 1 more)
Tagged with: