Jump to content

Anders Melander

Members
  • Content Count

    2856
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Anders Melander

  1. Anders Melander

    Better Translator Manager - Custom component

    Reproduced. I'll investigate now.
  2. Anders Melander

    Better Translator Manager - Custom component

    No, you're right; They cannot. Assuming this means that you cannot purge them, can you zip the translation project (just the xlat file) and post it as a DM to me.
  3. Anders Melander

    Better Translator Manager - Custom component

    That's "obsolete" items. Items that existed in a prior version of your application but which have been deleted since they were first imported. That usually happens when you delete components or units. You can't really hide them (that's a missing feature) but you can delete them: Or you can just mark them "Don't translate" and hide them that way. The reason they aren't just deleted automatically is that their translations (if they have any) can be reused by other items. For example, if you rename a component, then the translation-to-component link is broken but by comparing the source texts, BTM can move the link to the new component so the translation isn't lost. The Recover action does this. The translations of obsolete items are also still used as translation suggestions.
  4. Anders Melander

    Better Translator Manager - Custom component

    If you are not actually using that string anywhere then it's probably being eliminated by the linker. Resourcestrings are only ever loaded from STRINGTABLE resources and the STRINGTABLE resources (and the .drc file) are produced by the linker based on the units linked into the application. If you add a ShowMessage(aa) to the above example then I bet the resourcestring will appear. Regardless, I think we can conclude that this isn't a BTM problem.
  5. Anders Melander

    Better Translator Manager - Custom component

    Can you see the resourcestring in the .drc file? [edit] Btw, have you remembered to update the translation project after these changes? If you don't update the translation project it will only contain the strings that were in your project when you created the translation project.
  6. Anders Melander

    Better Translator Manager - Custom component

    That's the newest release; It's from December 2022. I don't know where you you got the year 2019 from. Nothing special needs to be done. If the resourcestring is implemented in unit XXX and you drop a component from XXX onto a form in unit YYY of project ZZZ, then the IDE will include unit XXX in unit YYY's uses clause and when you compile ZZZ, the resourcestring will appear in the ZZZ.drc file (it's a text file) located the sample place as ZZZ.exe. If you don't have ZZZ.drc then you need to configure your project to produce that file (see the project linker options) - but BTM should complain if it can't find the file.
  7. Anders Melander

    Better Translator Manager - Custom component

    All resourcestrings, regardless of the unit they come from, are listed under the Resourcestrings module node.
  8. Anders Melander

    Better Translator Manager - Custom component

    I'm still not sure what you're saying - or asking. You hide rows by filtering them out: Hover over the Status column header, click the button that appears in the header. Select the statuses that should be visible. Like in my screenshots. That's not really a question, but anyway: If your component strings appear in the string grid, then they can be translated; All resourcestrings and published component string (and string list) properties can be translated.
  9. Anders Melander

    Better Translator Manager - Custom component

    I'm not really sure if this is what you're asking for but you can indicate which modules to translate and which to ignore by right-clicking and changing their status: and then you can filter on the status: You can do the exact same in the string grid:
  10. I doubt that it's DevExpress that's slowing your project load down. I always have it installed and do not have any problems with it. It's more likely the livebindings design-time support that's the culprit (at least it used to be a common cause of slow downs). Try disabling the livebindings design time packages and see if that helps. The attached .reg file does that for Delphi 10.3, 10.4, and 11.x You may need to reinstall DevExpress afterward as I believe some of their packages have dependencies on the livebindings packages. disable delphi livebindings.reg
  11. Why would that make a difference? The whole directory/tree would need to be scanned anyway, even if he's only interested in the image files. [edit] Oh, I guess you mean select files based on the filename as opposed to the file content. I would probably go for an in-memory database (e.g. SQLite or even just a TFDMemTable) for the index but store the files on disk (but don't put all files in a single folder - that will suck). That said, if you have 50K files averaging 30Kb each, that's only 1,5 Gb total (+ overhead) so you could actually fit the whole thing in memory.
  12. Anders Melander

    TFruit class moved to component

    Ray Lischner. He wrote 3 Delphi books, AFAIR, none of them about component design. I've got "Delphi in a Nutshell" (basically just a reference book) and "Hidden Paths of Delphi 3" (about the old open tools API). Both had horrible binding and fell apart right away.
  13. Anders Melander

    Trap TFDConnection error on data module create etc?

    It was aimed at SQLite but it was not meant as a dis. As long as the limitations and risks are taken into account it's a fine embedded database engine. I haven't used it in a while but I have just read through the technical documentation and I can see that a lot has been done with regard to reliability since then. Still, after having read the docs I couldn't help but feel that there were problem areas that were brushed over or simply left out.
  14. Anders Melander

    Trap TFDConnection error on data module create etc?

    ...and the ability to not corrupt the database if the application crashes.
  15. Anders Melander

    TFruit class moved to component

    You (mostly) just need to derive your class from TComponent: type TFruit = class(TComponent) private FColor: string; protected public constructor Create(AOwner: TComponent); override; published property Color: string read FColor write FColor; end; ...and then you also need to register your component: procedure Register; begin RegisterComponents('Cool Stuff', [TFruit]); end; I suggest you read the documentation.
  16. Anders Melander

    [Delphi] Looking for a Delphi Profiler in 2023

    That isn't really a profiler.
  17. Anders Melander

    Trap TFDConnection error on data module create etc?

    Create the TFDConnection in code (e.g. in the DM constructor). Open the connection after the DM has been created. For complex applications, I use a design where the application startup is divided into stages. The stage progression is centrally controlled and broadcast to all interested parties. Something like this: // The following could be in the .dpr file type TRunStageBoot = bsInit..bsReady; TRunStageShutdown = bsShutdown..bsShutdown; begin // Broadcast startup progression for var Stage := Low(TRunStageBoot) to High(TRunStageBoot) do RunStageNotify(Stage); Application.Run; // Broadcast shutdown progression for var Stage := Low(TRunStageShutdown) to High(TRunStageShutdown) do RunStageNotify(Stage); end. ...and the run stage management: type TRunStage = ( bsInit, // Whatever needs to run before the DMs are created. E.g. load config. bsCreateModules, // Create DMs bsConnectDatabase, // Connect to database bsLoadDatabaseSchema, // Validate and update database schema bsLogin, // Perform application login bsInitUI, // Create main UI (e.g. mainform) bsReady, // Show UI bsShutdown // Application shutdown ); IRunStageSubscriber = interface {...GUID...} procedure RunStageNotify(Stage: TRunStage); end; TRunStageDelegate = reference to procedure(Stage: TRunStage); procedure RunStageNotify(Stage: TRunStage); procedure RegisterRunStageHandler(Delegate: TRunStageDelegate); overload; procedure RegisterRunStageHandler(const Subscriber: IRunStageSubscriber); overload; // ...similar for unsubscribe... implementation var // Create on demand in RegisterRunStageHandler. Free in finalization. RunStageSubscribers: TList<IRunStageSubscriber>; RunStageDelegates: TList<TRunStageDelegate>; procedure RegisterRunStageHandler(Delegate: TRunStageDelegate); begin RunStageDelegates.Add(Delegate); end; procedure RegisterRunStageHandler(const Subscriber: IRunStageSubscriber); begin RunStageSubscribers.Add(Subscriber); end; procedure RunStageNotify(Stage: TRunStage); begin for var Subscriber in RunStageSubscribers do Subscriber.RunStageNotify(Stage); for var Delegate in RunStageDelegates do Delegate(Stage); end; ... ...and the DM with the connection would then look something like this: type TDataModuleDatabase = class(TDataModule, IRunStageSubscriber) private FConnection: TFDConnection; private // IRunStageSubscriber procedure RunStageNotify(Stage: TRunStage); public constructor Create(AOwner: TComponent); override; end; var DataModuleDatabase: TDataModuleDatabase; implementation constructor TDataModuleDatabase.Create(AOwner: TComponent); begin inherited; FConnection := TFDConnection.Create(Self); // Setup params on connection ... // Register so we will be notified when the connection should be opened RegisterRunStageHandler(Self); end; procedure TDataModuleDatabase.RunStageNotify(Stage: TRunStage); begin case Stage of bsConnectDatabase: FConnection.Open; end; end; procedure RunStageNotify(Stage: TRunStage); begin case Stage of bsCreateModules: DataModuleDatabase := TDataModuleDatabase.Create(Application); end; end; initialization // Register so we will be notified when the DM should be created RegisterRunStageHandler(RunStageNotify); end;
  18. Anders Melander

    Profiler for Delphi

    Did you read the page linked to? First paragraph states: [edit] I guess you don't know what the PDB file is for. The PDB file is used by the profiler to map the addresses in the application being profiled to source files, function names, and line numbers. Without that information, the profiler would only be able to show you the raw addresses. Download and install VTune. Download map2pdb, extract the exe, and save it somewhere of your choice. For example c:\tools\map2pdb\map2pdb.exe Add a menu item in the Delphi IDE via Tools -> Configure Tools... The parameters in the above are: -debug -v -pause -bind:$EXENAME $PATH($EXENAME)$NAMEONLY($EXENAME).map -include:0001 Make sure the compiler are generating a full map file: Compile your project. Execute the map2pdb tool action. Launch VTune and create a profiler project for your exe. Profile the project in VTune. Profit!
  19. Anders Melander

    Profiler for Delphi

  20. Anders Melander

    VCL Handling of dpi changes - poor performance

    At least you no longer have this problem... Eh?
  21. Anders Melander

    Problem writing to memo on main form from thread

    Replace application.processmessages with form1.TestMemo.Update ...and then Google "avoid application.processmessages", "never use application.processmessages", "don't use application.processmessages", etc.
  22. Anders Melander

    Turbo SynEdit & Font Ligatures

    The trigger is the presence of the "⁄" character anywhere in the text. It's the Unicode "Fraction Slash". It can be reproduced with the GDI ExtTextOut function, which is how I accidentally discovered it. I suspect that this is actually a bug in GDI because as far as I can tell there's nothing in the font tables that should require that character to be present before ligatures are applied. It could also be a bug in the font that triggers a bug in GDI; There are a lot of bugs in Cascadia and Fira. Normally, in an OpenType shaper, the fraction slash triggers hardcoded logic ("hardcoded" as in "logic not defined in the OpenType tables") that converts numeric fractions from the form 1/2 to ½ but that requires the 'frac' feature to be enabled which it isn't by default.
  23. Anders Melander

    Turbo SynEdit & Font Ligatures

    Unless you've discovered the magic key to unlock it:
  24. Anders Melander

    Replacement for TBits?

    Marketing. I don't think they originally intended it as such but since it at best doesn't hurt performance, that's what it became. Yes, it does. Maybe now would be a good time to read up on what virtual memory is. You don't have to allocate beyond physical memory before virtual memory comes into play. You just have to allocate beyond the process' working set. The working set is the part of your process' virtual memory that is backed by physical memory. The working set can grow and shrink depending on memory access and global resource pressure but there's always an upper and lower limit. Of course, it's a bit more complicated than that (there are more layers than what I have described) but that's the basic overview. In general, I would recommend that one doesn't try to outsmart things one doesn't fully understand. Be it threading, memory management, or women 🙂
  25. No. The order is undefined. For example, if you evaluate the expression (A and B and C ) the evaluation order might very well be BCA. Only boolean short circuit evaluation has a defined order.
×