Jump to content

corneliusdavid

Members
  • Content Count

    409
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by corneliusdavid


  1. OK, I finally see what you're getting at. I got sidetracked by just the idea of simple editing of text on a mobile device and missed part about the ControlType--sorry. (I had recently experienced frustration when typing a long text and trying to view/edit the whole thing--and that was using the phone's built-in text messaging app--I thought that's where this was going.)

     

    I ran a sample project and switched the ControlType property of the TEdit between Styled and Platform and now see what you've been trying to explain. Yes, the "Platform" control works properly but (and as explained on docwiki) does not respect the z-order. 

     

    So, yeah, it does look like a bug, or incomplete feature implementation, in the styled version of the TEdit.

    • Like 1

  2. 14 hours ago, Der schöne Günther said:

    I don't know about Android, but on iOS you can either scroll by swiping on the space key, or by tap and holding within the text area. It is not a problem at all.

    Have you tried other apps on Android that have a small text edit input to compare how they act? @Lars Fosdaldescribes how it can be done on Android--and yes, that works but I have problems getting it right so more often just backspace or don't even try to scroll. Same thing on iOS.


  3. Right. That's typical on a mobile device--it's not specific to Delphi apps. Basically, you can type forward or backspace to clear it out and type it over. That's why I sometimes hook a Bluetooth keyboard up to my mobile device when I'm writing lots of text--I can use the keyboard arrow keys to navigate past the beginning/end of the visible text.

     

    Have you ever sent a long text message with a phone? It's a pain if you've been typing fast then look at what you've typed and realized there's a misspelled word in the middle and you have to somehow select it and type over without losing it or finger-swipe to go back to the top of the paragraph to make sure you didn't miss anything.

     

    You could set the MaxLength property of the TEdit so the user can't type a bunch of text; or use a TMemo and make it fill up the screen so the user can see all the text they've typed.

     

    Welcome to mobile development!!


  4. Are you referring to the lack of left/right/home/end buttons, or just the standard user interface on a mobile device? 

     

    I've never had problems with TEdit text scrolling on mobile devices--I just hook up a Bluetooth keyboard if I want to be able to move the cursor through the text.


  5. What version of Windows are you running on? Did you see any errors as you were installing Delphi? 

     

    Can you try "step over" instead of trace into and tell is if it can step through code that way?


  6. I get access violations once in a while in rtlXXX.bpl (almost any version of Delphi). I'm used to older computers where if something was broke, you just rebooted and got back to work. I find this works 99% of the time with Delphi. I wish it was better but it's really not terribly disruptive because I can work for hours or even days in multiple VMs on multiple projects before I see it and in less than a minute, I'm back where I left off without losing anything.


  7. First of all, THANK YOU @Remy Lebeaufor your contributions over the years to the Indy project, both in development and in support on this and many other forums.

    23 minutes ago, Stefan Glienke said:

    I consider Indy as a crucial piece of the 3rd party ecosystem for Delphi

    So do I and to learn there's only one main developer on this project who doesn't even have a working IDE at the moment is quite concerning. I wish I had the time/knowledge to help. 

    • Like 1

  8. 4 hours ago, Roger Cigol said:

    Embarcadero recommend installing 11.1 using the same method as 11.0

    Yes, that's been the standard recommendation for a long time but there's been work to standardize the installs so that either .iso or web install will work regardless of the method used for the previous install--perhaps they just haven't removed that warning.

    I don't have a "default" method for installs and, in fact, don't even remember which method I used for which version on which computers. I've never had a problem with the installs (I'm pretty sure I've mixed them up at some point) and am actually puzzled about what's wrong with using a different process for an upgrade than the original install used.


  9. On 3/24/2022 at 9:58 AM, RonaldK said:

    Maybe a .NET update brought this problem.

    Here's what I would try: manually download and install .NET. Since the error messages indicate both 4.0 and 4.7 (from what I gather reading your original post), install both versions. Those installs might include additional files that the standard Delphi install is missing or expects to already be in place. It might work--I don't know, I'm just throwing this out there.


  10. Lots of different reasons why downloads or installs fail (internet, disk errors, network, anti-virus, etc). I downloaded both the .iso and the .exe (web install) onto two different computers. The .iso failed to mount on one of them so I used the web install; the .iso worked fine on a different one. All just depends on the particular arrangement of bits in the ether on a particular day, I guess!


  11. Thinking about the original question here a little more, I think the problem might be related to the OS:

    On 3/14/2022 at 2:35 AM, RonaldK said:

    Windows Server 2019

    I think most developers run Delphi on Windows 10, which would have all the libraries a typical Windows user would need for a variety of applications. But Windows Server is not an end-user operating system so leaves many things out. It may be that a manual install of .NET or related libraries/tools may need to be done in order for Delphi to work properly on Windows Server.


  12. I find refactoring often broken in that it doesn't work but it (to my knowledge) has never crashed Delphi. Out of curiosity, I moved the "refactoride280.bpl" value to a different key, restarted Delphi, and refactoring was no longer in the menu.

     

    Theoretically, that's one .NET package out. However, I noticed there's another one named, "dotnetcoreide280.bpl." That's obviously got something to do with .NET. I tried removing that and now compiling a small cross-platform app in Delphi 11.1 gives me the error, "Object reference not set to an instance of an object." I put the registry key back and it compiles fine.


  13. 4 hours ago, Fr0sT.Brutal said:

    This is good but requires an account for each user. Moreover, in theory there could be some settings that affect pre-connect state

    This is getting off-topic but... I never use the database-level account feature but use one application-level account to connect to the database then provide a login that checks against a user record for authentication. So if your application is built to require database account credentials before connecting, then you're right, the approach I suggested would not work.


  14. 11 minutes ago, Renate Schaaf said:

    I'm doing that, unless I'm too dim to notice

    Create/Free are the calls that allocated/deallocate the memory for an object, an instance of TDoSomething in this case. In your original code, the call to Create in Button1Click but the Free happens in a procedure of TDoSomething--that's where the difference in context is.

     

    12 minutes ago, Renate Schaaf said:

    I just wanted to understand why it doesn't blow up in my face

    The only reason it didn't blow up is because you don't reference the object (the DoSomething var) after the call to Free. Look at my first example code above where I point out where an ERROR could occur--that's what COULD have happened to you.


  15. I don't think I've ever seen a procedure of a class free the instance of the class it's being called from. Everything in me is screaming DON'T DO IT!

     

    This is very bad practice. The object code may still be in memory after the call to Free but it's no longer dedicated to that object and if, per chance, some other operation suddenly uses that available memory, you've got an access violation.

     

    And to make an example that shows the problem of the dangling pointer @Attila Kovacspoint out:

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      var
        DoSomething: TDoSomething := TDoSomething.create;
    
      DoSomething.DoSomething;
    
      if Assigned(DoSomething) then begin
        ShowMessage('DoSomething Freed but dangling reference still exists');
        DoSomething.DoSomething; // <--- ERROR!
      end;
    end;

    It's better to free the memory outside of the class itself in a try-finally block:

    procedure TDoSomething.DoSomething;
    begin
      ShowMessage('Doing something');
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      var
        DoSomething: TDoSomething;
    
      DoSomething := TDoSomething.create;
      try
        DoSomething.DoSomething;
      finally
        DoSomething.Free;
      end;
    end;

    This makes it obvious from the calling procedure (the button click event) that the object is freed which lessens the likelihood of using it again because it's right there in the procedure instead of hidden in the class itself.

    • Like 2
×