Jump to content


Popular Content

Showing content with the highest reputation since 07/17/22 in Posts

  1. Vincent Parrett

    Are the jcl and jvcl libraries still alive?

    Why is this too complicated for people? Pull requests make a lot more sense for open source projects, as they make doing code reviews etc simple - where as with direct commit access there is always more risk that something get's broken, or that the committer takes the project in a different direction than what the project owner wants. I always tell people, before contributing to a project 1) create an issue and discuss with the other contributors/owners - then when everyone is on the same page 2) create a pull request 3) owner and other contributors review and approve/merge. Usually after step 1, if I do not have the time to implement it myself, I tag the issue as "PR Invited" meaning the issue is well understood and deemed worthy of implementation - and a PR that implements the feature/fix etc will have a good chance of being accepted. Sadly most of the time people ask/want but are not prepared to help/contribute. Github is not the barrier.
  2. shineworld

    First Python + DelphiVCL Program

    Good, after a long time stressing this forum, especially the Python4Delphi channel, with lots of rookie requests, I got to a good point with the development of my first Python program. Until a few months ago I had always ignored Python and its possibilities as Delphi has always been a tool with which I create all my works and I have never thought of anything else. When Python4Delphi and DelphiVCL showed up I wondered if I could do something interesting with both and I must admit that although Python was completely new land to me, the fact of sticking with Delphi anyway took away any doubt. .. I had to try. Basically, the program is pure Python (after being compiled with Cython), an embedded version, with the addition of DelphiVCL (I've never used FMX so it's better to start from the VCL that I know very well) and some Python modules made in Delphi where I put the more delicate parts and in use real threads and not "crippled" threads by the GIL. I anticipate, it is nothing transcendental, but as a first Python project, I am satisfied with it. Description of video In this short video, we can see the execution of an external program written in Python for the holding of print markers necessary to calculate the zero machining, the rotation of the piece on the work table, and all the scaling needed to compensate for the error of model printing between CAD and plotter printer. The Python program interacts directly with the CNC that moves the XYZ axes for the final cut through an API Client (cnc_api_client_core in PyPi) to the CNC control software API Server, retrieving information and sending direct commands to the CNC System. Image capture is done using a proprietary IP Camera equipped with LED lighting. The Python program is executed through an embedded version of the language prepared with all the necessary tools and allows two UI, vertical and horizontal, to adapt to all types of monitors. NOTE: The below CNC Control Software is 100% made with Delphi 🙂 Many Thanks to forum people for the support!
  3. omnibrain

    Are the jcl and jvcl libraries still alive?

    But when you are only a handful of trusted contributors you don't have to use the Github workflow but can have them merging (perhaps with rebase and smashing) locally and then have them push the changed branches to Github. And if you work this way with your trusted contributors you can still be open for external contributors with the Github Fork-Merge-Request-Workflow. That's really the best of both worlds. We have to face, that Delphi itself is obscure enough for younger developers. Clinging to outdated tools, hosting options and workflows nobody learns anymore isn't going to help.
  4. Remy Lebeau

    When execute, this error appears

    Yeah, like not using a TEdit for date/time input in the first place. Use a UI control that is specifically designed for date/time input (ie, TDateTimePicker, TDatePicker, TTimePicker). Same with integers, for instance (ie, TSpinEdit).
  5. Uwe Raabe

    TMemo instead of TLabel

    procedure GetString(param1: string; param2:string; myLabel: TLabel); overload; Begin myLabel.caption := GetDescription(); End; procedure GetString(param1: string; param2:string; myMemo: TMemo); overload; Begin myMemo.lines.Add(GetDescription()); End;
  6. Vincent Parrett

    Are the jcl and jvcl libraries still alive?

    Yeah I know, pretty sure I was one of them. I've used a lot of version control systems over the years in my day job and git is certainly not my favourite - like it or not it has won the version control wars (for now). FWIW inhouse we use Mercurial (with tortoisehg) - which while similar to git, is simpler - with real error messages! I chose to learn enough git to get by, and with good tools like Fork I get by ok. The days of developers only needing to know one version control systems are long gone, just like the days of only needing to know one programming language.
  7. MarkShark


    I've used: SVGIconImageList also: Image32 Good stuff!
  8. The IDE uses separate layouts/desktops for editing and debugging. You have to adjust the debug layout to your requirements, save it under a name of your own, and then make that the default debug layout.
  9. On the other hand, depending on the situation, it would probably be better not to perform the calculation at all if the input is invalid, in which case TryStrToFloat() would make more sense if you want to avoid the exception and skip the calculation at the same time.
  10. I still think it is likely a bug in the program, not in Windows itself. Like if the program had opened the StorageDevicePolicies key for some unrelated purpose, and then accidentally used that opened HKEY handle as a base when writing its settings to its own subkey rather than using the predefined base HKLM handle.
  11. PeterBelow


    Records are value types, so adding a record to a TDictionary<recordtype> adds a copy of the record to the internal storage, and Remove then clears up that copies memory. So there are no leaks, but adding a record and getting it back later always makes a full copy of the record, which can be a bit hard on performance.
  12. I can reproduct it using the "GetIt package installer": When installing a package which requires an IDE restart (i.e. "Bookmarks" or "Navigator"), or when installing the latest patches, I always get the exception. See attached video. GExperts Crash.mp4
  13. Fr0sT.Brutal

    Are the jcl and jvcl libraries still alive?

    Disagree. I have all my projects in Git (most of them are pretty small as they represent different util collections/libs) and contributed much to multiple Git projects with one or several developers. Nothing complex. Fork the project, pull it, make changes, commit them, push them, press "Make Pull request" button. Owner has convenient UI of reviewing changes - either divided to commits or consolidated. If everything is OK he just presses "Merge" button and that's all. Also nothing prevents several devs from direct committing & pushing a-la SVN. And how contributions are implemented in SVN? Dumb and fragile diff files? Yeah, they indeed are much simpler to review *irony*
  14. Stano

    You know something about it

    Sorry, google translator You can do a lot with Delphi IDE. I use one delphi subuser with different sets of installed components. Run command: "C:\Program Files (x86)\Embarcadero\Studio\21.0\bin\bds.exe" -pDelphi -rMyEnvironmentXYZ ensure that a brand new branch ../Embarcadero/MyEnvironmentXYZ is created instead of ../Embarcadero/BDS/22.0 in the registries. It's almost as if you installed a new delphi, normally the introductory wizard will start which theme you want to use, the IDE is completely reset almost like after a clean installation without any additional settings, you don't have any additional experts installed or any external components. Next, I will set it up so that all packages and their dcp and other compiled files are stored somewhere in Document/MyIDEworkspaces/MyEnvironmentXYZ. You have to play with it for a while and learn how to set everything up. Next, I copy the components that I want to use in the given XYZ environment to Document/MyIDEworkspaces/MyEnvironmentXYZ/daco/daco, and even after installation, all compiled files are placed in these directories. Next, I just zip the Document/MyIDEworkspaces/MojeProstredieXYZ directory and export the branch ../Embarcadero/MyEnvironmentXYZ from the registers, and after reinstalling the entire Widnows/delphi, you can easily transfer it to another computer if you have the same version of Delphi. I've been using it for years because I sometimes need to recompile old projects years later and it works like a charm. I think it's safer than trusting some tool, but I'm not saying that the migration tool shouldn't work. But exactly when I need to restore an environment after 12 years, it's better if I know exactly step by step how I did it, than if some tool did it for me, which I then lose and can't find...
  15. David Heffernan

    Dynamic Linking in Delphi

    Dynamic linking won't solve your licensing problems. Synedit, the subject of your last question, has a dual GPL/MPL license. Dynamic linking doesn't allow you to evade the licence requirements. Why do you feel that you can't adhere to the requirements of the MPL? Incidentally there was no need to make a new question to ask the same as you did in your previous question. Perhaps you didn't like the answers you got but sometimes the answer to a question isn't the one you want to hear.
  16. Remy Lebeau

    When execute, this error appears

    If you are converting the Text of the "né" control to a TDate/TDateTime using StrToDate(), consider using TryStrToDate() instead. That would avoid the EConvertError being raised. Just make sure you pay attention to its return value to know if the conversion was successful or not. Personally, I would use a TDateTimePicker or TDatePicker instead. For instance, TDateTimePicker as a built-in CheckBox that can be used to indicate whether a date has been entered.
  17. Vincent Parrett

    Are the jcl and jvcl libraries still alive?

    I'm too cheap, Fork is $50, gitraken is a subscription tool.
  18. System.Rtti contains a lesser known, but powerful class TMethodImplementation, which is basically hidden and used in TVirtualMethodInterceptor. Outside this use, it cannot be created directly and it can only be accessed by TRttiMethod.CreateImplementation. I recently discovered that Spring4d extends its use through a helper for TRttiInvokableType, so it can be used with standalone procedures and functions as well as with events. Here is a small console app showing how it can be used: program MethodImplementationTest; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.TypInfo, System.Rtti, Spring; type TSimpleProc = function(I: Integer): Integer; procedure ImplCallback(UserData: Pointer; const Args: TArray<TValue>; out Result: TValue); begin WriteLn('From Implementation'); Result := Args[0].AsInteger * 2; end; var Proc: TSimpleProc; begin ReportMemoryLeaksOnShutdown := True; try var RTTIContext := TRttiContext.Create; var RTTIType := RTTIContext.GetType(TypeInfo(TSimpleProc)); var ProcImplementation := (RTTIType as TRttiInvokableType).CreateImplementation(nil, ImplCallback); Proc := TSimpleProc(ProcImplementation.CodeAddress); WriteLn(Proc(2)); ProcImplementation.Free; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; ReadLn; end. Output: From Implementation 4 Simple and easy. Spring4D is full of gems. I wish the above functionality was part of the standard library. I can think of many uses: Python4Delphi contains a unit MethodCallback which uses complex assembly to convert methods into stubs that can be used with external C libraries. It could be rewritten using TMethodImplementation, without assembly code. Also in Python4Delphi, the implementation of Delphi events using python code could be very much simplified and generalized using TMethodImplementation. You can create Delphi functions, procedures and methods, event handlers on the fly that are implemented by python code. Similarly functionality can be provided with other scripting languages.
  19. vfbb


    Also Skia4Delphi (FMX & VCL). If it's just VCL, SVGIconImageList is the one that has better integration with Delphi controls because it has a TSVGIconImageCollection and TSVGIconVirtualImageList.
  20. Stefan Glienke

    TMethodImplementation and its uses

    FWIW I only use this to make my multicast events work on platforms where I don't have exactly that: handcrafted assembly code to do the parameter passing. And these run hundreds of times faster than using RTTI. You can turn on using RTTI instead of the asm code in Spring.Events Here is a simple benchmark result: asm (win32) Event invokes/ms: 14925 rtti Event invokes/ms: 205 I have already started digging more into the TMethodImplementation class to optimize its use for those platforms where I don't have the handcrafted asm. There are also libraries that avoid the overhead of the Delphi RTTI to do dynamic invocation by handling all the low level details: https://github.com/d-mozulyov/Tiny.Library#rtti but that requires doing the parameter passing via some stubs written in c asm
  21. David Heffernan

    Package SynEdit library as Dll

    Don't. Best option is to compile it directly into each project. Next best is to compile into a Delphi package. Direct inclusion is much more simple.
  22. @de la Mancha- you asked and got a relevant answer from someone known for doing heavy math with Delphi. No reason to be rude.
  23. Fr0sT.Brutal

    Are the jcl and jvcl libraries still alive?

    Absolutely! That's why I say "disagree" instead of "you're wrong" 😉 Anyway the complexity of Git is overestimated (especially for most usual operations). Contrary, after getting used to Git I was confused by SVN. All these awkward branches, strictly straight commit history, online-only pushing - things I never knew using Git
  24. timfrost

    sending text between applications (10)

    Grijjy have a wrapper for the ZeroMQ Majordomo protocol at https://github.com/grijjy/DelphiZeroMQ. There's a lot of reading to do if you want to learn all about ZeroMQ, but Grijjy supply a simple Client, Worker and Broker to start from, which work 'out-of-the-box'. The advantage to using a Broker app is that you do not have to sniff around to discover everyone's IP address; each party registers their name and role with the broker and then the broker ensures that messages can be sent to and from each named entity. You can also combine this with Grijjy's 'protocol buffers' to send almost any type of data that the sender and recipient apps agree upon. I have started to explore this myself and have not yet discovered any major snags.
  25. dummzeuch

    Format source with tabs

    Yes. I never even thought about using tabs because they usually are a pain in the lower back everywhere.