Jump to content

Alexander Elagin

Members
  • Content Count

    198
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Alexander Elagin


  1. I usually use a simple class with a counter and two methods, like BeginWait and EndWait. The first one increments the counter and sets the cursor to crHourglass if the counter was 0, the second one decrements the counter if it is positive and reverts the cursor back to crDefault when the counter is 0. Of course, with the obligatory try..finally to make sure that each BeginWait has a matching EndWait and with critical sections if multithreaded.

    • Like 3

  2. I'd use the DevExpress controls anyway, nothing can beat them in the VCL design. Just a single dxLayoutControl with manually added custom groups and maybe a few cxPageControls placed into it if necessary (and ActionList+dxBarManager+cxStatusBar etc for the toolbars) can easily handle this layout, and the latest versions are significally faster than the initial releases of the said control. The design phase may look tedious but once everything is ready and locked where necessary there will be no problems in maintaining/extending/modifying the UI.

    • Like 1
    • Thanks 1

  3. 33 minutes ago, Uwe Raabe said:

    According to a comment in code this is most likely done on purpose. So you might be forced to change that after the installation. It should stay that way when you upgrade MMX (besides the fact that settings transfer is not working ion the current beta).

    OK, understood. I think that these shortcuts, Ctrl-Alt-C (copy entity) and Ctrl-Alt-V (paste entity) were initailly selected as logical extensions to common Ctrl-C and Ctrl-V, but the IDE has better use for them.


  4. 1 minute ago, PeterPanettone said:

    What about the VM files? AFAIR VMWare Workstation has a habit of storing them SOMEWHERE deeply nested in DIFFERENT directories on the C:\ Partition.

    No, VMware workstation stores all files for one virtual machine (vmx, vmxf, vmdk, nvram) in a single directory which you can freely move around. The next time you open this machine it will simply ask if it was copied or moved (to update uuid if necessary).


  5. 15 minutes ago, Arnaud Bouchez said:

    An empty string is stored as a nil pointer, and there is never some allocated memory with a length prefix of 0. When the length reaches 0, the string is always unallocated by the RTL.

    ... unless the string is a ShortString, which was the default and only string type in Turbo Pascal days ;-). Yes, I am that old. Then having predefined constants for the empty string and pointer made sense. Since the introduction of AnsiString/UnicodeString, all these constants became useless and are kept in the RTL due to sentimental reasons, I think. And the IsNullOrEmpty is a C#ism which does not belong to the Pascal world and makes no sense at all.


  6. 2 hours ago, Rollo62 said:

    The description hier doesn't really give a clue what null should really mean:

    This will be maybe useful in a later version

    It looks like a dumb copy of the .net String.IsNullOrEmpty method

    public static bool IsNullOrEmpty (string value);

    which, according to the Microsoft docs, " Indicates whether the specified string is null or an empty string (""). "

    What it has to do with the Delphi string implementation and why was it implemented? I do not know.


  7. BTW, strictly speaking, the EmptyStr in SysUtils is not a constant. It is declared as an initialized variable. I think this goes back to either Borland Pascal 6 or Delphi 1 when empty string and nil pointer were two different things, and the compiler/linker had to allocate precious memory to store each constant. If one had many empty string references in the code, using a predefined one saved some valuable space. Today, of course, this is totally irrelevant, that's why the documentation says "Empty string and null string pointer. These constants (sic!) are provided for backwards compatibility only."

     


  8. 1 hour ago, Darian Miller said:

    Now there's a marketing line for FMX

    ...that returns us to the ultimate question: why FmxLinux and not CrossVCL? 😉 Let FMX live in the mobile world and VCL rule the desktop. Lazarus team managed to make LCL (which is a VCL replica) work in many desktop environments, CrossVCL already exists, so I still wonder why FmxLinux was preferred by EMB. Only because it was advertised as the next big cross-platform thing which was meant to replace VCL when it first came out? CLX, another cross-platform Delphi library which was meant to replace VCL, is long forgotten, yet VCL lives.


  9. As for the IDE quality and usability, nothing can beat Delphi 3 and Delphi 7. From the newer versions I'd pick XE (the last Win32-only version, pretty stable and fast) and 10.1 (Win32 + Win64, more or less stable and good-looking). I tried 10.2 and 10.3 but stayed at 10.1. My opinion on 10.3 is simple - it is a skinned snail-paced bug-ridden abomination. Were it not for the Linux compiler returned to the classic memory management, I'd never again touch it.


  10. 25 minutes ago, Arnaud Bouchez said:

    it stopped when EMB bought DXScene - I really felt it was some kind of theft at that time.

    I felt the same when AnyDAC, now FireDAC, was sold to EMB (or whatever was its name back then) when I just paid its renewal for another year. Needless to say I never got my money back nor got access to FireDAC which I avoid since then because of such attitude. Luckily, DevArt (UniDAC) offered a great alternative. I just hope that FmxLinux and CrossVCL will remain property of KSDev.

    • Like 3

  11. I stumbled upon AES problems a month ago (using a two decades old code which worked ok) when it suddenly appeared that SizeOf(LongWord)=8 on Linux. I solved my problem by explicitly replacing LongWord -> UInt32, PLongWord -> PUInt32, array -> packed array and probably AnsiString -> RawByteString and something like this (I don't have the code at hand). At least these changes in the code helped to produce equal results in both Win32 and Linux64 versions. I do not know the internals of the Eidos implementation but probably the required changes are also minimal.

    • Thanks 1

  12. From the same Atanas Popov's article:

    "Our objective is to make staying on Update Subscription a “no brainer.” "

    Currently staying on Update Subscription is a nightmare. While with any other software product it is usually a matter of pressing a "Renew" link on a web page and entering card detail, the last time I tried to renew the Delphi subscription it was a ten days long process with a busy email exchange and even a phone call (!). Not to mention that the renewal price is not published anywhere and the renewal itself involves asking for a quote. Looks like Emb is not interested in Update Subscription customers, too. If only I was wise enough to avoid using custom attributes, generics and anon functions in the code, I'd happily move my 2M+ lines core codebase to Lazarus, but alas currently this is not possible. But lesson learnt.

    • Sad 4

  13. 33 minutes ago, Arnaud Bouchez said:

    I prefer very much the FPC stability, and attempt to never break existing code - some Delphi people consider(ed) it conservative, but I find it refreshing.

    I just spent two days debugging an innocently looking piece of code which works correctly when compliled with Delphi Win32, Delphi Win64, FPC Win64, FPC Linux64... but not with Delphi Linux64. The reason was that the Delphi Linux64 compiler for some obscure reason has SizeOf(LongWord)=8... Well, I had to look at the Delphi 10.3.1 help file, which has the following sentence: "Platform-independent integer types always have the same size, regardless of what platform you use. Platform-independent integer types include ShortInt, SmallInt, LongInt, Integer, Int64, Byte, Word, LongWord, Cardinal, and UInt64." Damn. Then I scrolled the help ten lines up and... "The platform-dependent integer types are transformed to fit the bit size of the current compiler platform. The platform-dependent integer types are NativeInt, NativeUInt, LongInt, and LongWord". Confusing, isn't it? The FPC at least is consistent.

    • Confused 2
×