Jump to content


Popular Content

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

  1. Carlo Barazzetta

    Looking for SVG support in Delphi?

    News on the latest versions of SVGIconImageList components: The library now also supports the SKIA4Delphi SVG engine, but Image32 remains the best library for SVG rendering for complex files, as you can see in SVGViewerDemo. Cairo support has been removed.
  2. David Heffernan

    Add #13#10 to a string

    As an aside, even in Delphi there is no such need. You can write 'first line'#13#10'second line' And even then, concatenation of literals is performed by the compiler, so the above code would result in the same codegen as 'first line' + #13#10 + 'second line' Finally, it is usually preferable to use sLineBreak rather than #13#10 so that your code is more expressive, and platform independent.
  3. Fr0sT.Brutal

    Do you need an ARM64 compiler for Windows?

    Sure thing. However, backdoor holes left for spying could be revealed by someone else and used with all possible harmful purposes. Contrary, I've never heard of any Russian developers that are "angry at everybody else" and do any harm with their software. They seem to know the difference between business and politics while others seem not. I know several cases when other developers were so angry to put some destructive code into their products to be executed when being run in Russia. Not mentioning numerous companies leaving the market screwing up all their contract liabilities. Back to the topic, the quote you gave shows that rules of the game are maintained. Formalities are valid, nothing to worry about things you don't know 😉
  4. Anders Melander

    Do you need an ARM64 compiler for Windows?

    Since I brought up DevExpress' association with Russia in this thread I think it's only fair that I share the response I just got from DevExpress on the matter. I sent the following to Julian Bucknall (DevExpress CTO) earlier today: and I just got the following response (emphasis mine) from Ray Navasarkian (DevExpress CEO): So I guess that puts that topic to rest for my part. I too would have liked a roadmap and I can't quite understand why they can't produce something, but apparently that's just the way it is. Indeed!
  5. The complete results can be found here: https://survey.stackoverflow.co/2022/ Some Delphi related excerpts: In the Programming Languages category Delphi is listed 7th In the Integrated Development Environment Delphi is listed 3rd The Median Yearly Salary raised from $46,704 in 2021 to $63,984 in 2022
  6. On a positive note: 11,156 dreaded Python while only 797 dreaded Delphi... From that we can conclude that Python is almost 14 times more unpopular than Delphi! Woohoo!
  7. Anders Melander

    ANN: Better Translation Manager released

    Excellent question 🙂 First of all I would recommend that you use the TField.DisplayLabel property instead of the column Caption property unless you have a good reason not to. If you use TField.DisplayLabel then all columns that are bound to that field will automatically use that value as their caption and as a bonus you will only have to translate that value one place. The reason you're not seeing the Caption property of the TcxGrid*Column components is that the value isn't stored in the DFM and BTM can only see the properties that are stored in the DFM... Now, why isn't it stored? Well, the value has most likely been omitted from the DFM because it's the same as the FieldName. If you look at the TcxCustomGridTableItem.Caption property you will see that it has a stored directive. The stored directive controls if the property is stored in the DFM. In this case it will be stored if you have specified an explicit value and this value is different from the default value. So what is the default value? In this case the default value comes from the DisplayLabel property of the TDataSet field you have bound the column to. Again, if you haven't specified an explicit TField.DisplayLabel then the value of DefaultLabel defaults to TField.FieldName, in which case that value is also omitted from the DFM. Now you might think that the solution is to just specify an explicit Caption or DisplayLabel and that will probably work in most cases. However it will not work in the cases where this value is the same as the FieldName, because then the default rule will again cause it to be omitted from the DFM since it isn't needed. The solution is to "synthesize" the properties that have been omitted. By synthesize them I mean inject the "missing" properties into the translation project as if they were present in the DFM. If you go into the BTM settings there's an option to have BTM synthesize missing properties for you: The way it works is that when BTM reads the forms of the source application (e.g. during an Update), it runs the synthesize rules against each component that it find in the form. If a rule determines that a property is missing then a property is injected into the project with the specified name and value. I believe the above screenshot shows the default rule (preinstalled, but disabled by default): Type mask: ^T([A-Z][a-z]+)+Field$ A regular expression matching a component type. In this case the expression will match the different TField components (TIntegerField, TStringField, etc). Property name: DisplayLabel A property name. If this property is missing then it will be created in the translation project. Property value: @FieldName The value to assign the property. This can be an explicit value or the value of another property. In this case the @ specifies that we want the value of another property, namely the FieldName property. So let's say your application had a DFM with the following: ... object MyQuery: TFDQuery SQL.Strings = ('select name from users') object MyQueryUserName: TStringField FieldName = 'name' Size = 50 end end ... with the synthesize rules enabled BTM would import the above as if it looked like this: ... object MyQuery: TFDQuery SQL.Strings = ('select name from users') object MyQueryUserName: TStringField FieldName = 'name' DisplayLabel = 'name' Size = 50 end end ... Synthesized properties can be identified in the grid by their color (I believe the light green is the default - it can be customized): One thing to be aware of is that the synthesize option currently is an application level setting. This means that if you only enable it on one system and then update the project on another then the synthesized properties will be marked "Unused" which means that they will be removed if you Purge the project. I'll be fixing that "real soon now". If you run BTM in portable mode and include the portable config file in your version control (which I would recommend), then the above should not become a problem. Speaking from experience :-/ If you prefer to do the translation on the TcxGrid*Column level then you can use the following rule: Type mask: ^TcxGrid[a-zA-Z]*Column$ Property name: Caption Property value: @DataBinding.FieldName It seems there is a minor bug with adding synthesize rules so after adding the rule you should restart BTM and everything should be fine. I'll look into that. Fixed (but not yet built and uploaded).
  8. Sherlock

    Add #13#10 to a string

    In Python a \n usually does the trick. As per your example: caption = 'First line \n second line' Note that there is no need to concatenate the string.
  9. Anders Melander

    Do you need an ARM64 compiler for Windows?

    From our POW there are primarily two reason to pay maintenance on a product (any product): If you need access to the latest version regularly, the yearly subscription fee is cheaper than paying for a new license each time. Support the supplier financially so they are able to keep the product alive. Since DevExpress seems to have done "the right thing" here, we're not about to punish them for that. Yes, we can expect lower output from them for a while while they get a new team up to speed, but unless development complete stalls, for an extended period of time, we can live with that. With regard to the mentioned limit on support I think it's entirely reasonable. That was not our problem. Our problem was more pertaining to the perceived increasingly non-committal responses we got when we raised issues regarding deficiencies in the products. Now that I know the state of things it makes much better sense.
  10. Lars Fosdal

    Do you need an ARM64 compiler for Windows?

    It is called off-topic 😛
  11. TheDelphiCoder

    Formatting method

    @Sonjli You could also just add the new paramater(s) in either the declaration or the implementation of the method. Then hit STRG + ALT + Shift + P and the other one will be updated to the just made changes!
  12. SwiftExpat

    TDataModule OnDestroy event never triggered?

    I thought about this one quite hard today, a bit of fun learning, and here is my suggestion. FMX has the following mapped: procedure TPlatformCocoa.Terminate; begin FRunning := False; FTerminating := True; TMessageManager.DefaultManager.SendMessage(nil, TApplicationTerminatingMessage.Create); NSApp.terminate(nil); end; So in my app I implemented it as this , similar to what they recommend for android. unit dmDestroyMe; interface uses System.SysUtils, System.Classes, System.Messaging; type TDestroyVersion = class public VersionString: string; constructor Create; destructor Destroy; override; end; TDestroyMeDM = class(TDataModule) procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); private FVersion1, FVersion2: TDestroyVersion; v1, v2: string; msgSubId: integer; procedure ApplicationTerminatingHandler(const Sender: TObject; const Msg: TMessage); public { Public declarations } end; var DestroyMeDM: TDestroyMeDM; implementation {%CLASSGROUP 'FMX.Controls.TControl'} {$R *.dfm} { TDestroyVersion } uses FMX.Forms; constructor TDestroyVersion.Create; begin VersionString := ''; end; destructor TDestroyVersion.Destroy; begin VersionString := ''; inherited; end; procedure TDestroyMeDM.ApplicationTerminatingHandler(const Sender: TObject; const Msg: TMessage); begin v1 := ''; Fversion1.Free; v2 := ''; end; procedure TDestroyMeDM.DataModuleCreate(Sender: TObject); begin v1 := ''; v2 := ''; FVersion1 := TDestroyVersion.Create; FVersion2 := TDestroyVersion.Create; msgSubId := TMessageManager.DefaultManager.SubscribeToMessage(TApplicationTerminatingMessage, ApplicationTerminatingHandler); end; procedure TDestroyMeDM.DataModuleDestroy(Sender: TObject); begin FVersion2.Free; TMessageManager.DefaultManager.Unsubscribe(TApplicationTerminatingMessage, msgSubId, true); end; end. I will keep looking for the QP issue, but honestly this is one they expect you to implement. I just did not have the experience when I saw this the first time around. DestroyMe.zip
  13. I'm suspecting you installed the trial then uninstalled and installed the CE, perhaps using an existing license--or some other scenario that confused the installer. It should not be possible--and Embarcdero does not intend--for there to be any way to use the CE of both Delphi and C++Builder at the same time. See their CE FAQ, specifically this one: So what I would suggest is uninstall all remnants of Delphi and/or C++Builder and reinstall Delphi CE and be sure to enter a new CE license. If you already did this, you'll have to call Embarcadero for support.
  14. RonaldK

    Do you need an ARM64 compiler for Windows?

    It's probably more about the Embarcadero development team. Isn't the Idera development model made up of freelance developers? Aren't they mostly based in Ukraine and Russia? Perhaps this development model currently has serious problems.
  15. Serge_G


    This is an error I had sometimes when using an FDQuery on a Form and the related FDConnection in a DataModule. I do not hide from you that this has the gift of annoying me, especially when I use the visual designer of LiveBindings and my DataModule is in the list of uses
  16. Carlo Barazzetta

    Looking for SVG support in Delphi?

    I've published an article about SVGIconImageList and IconFontsImageList:https://ethea.it/icons_in_delphi/