Jump to content

pyscripter

Members
  • Content Count

    920
  • Joined

  • Last visited

  • Days Won

    56

pyscripter last won the day on December 6

pyscripter had the most liked content!

Community Reputation

694 Excellent

7 Followers

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Would that work with any TArray as well?
  2. Spring4d does provide you with access to the array of values using IArrayAccess, but what you ask is not spring4d specific. It applies to any array of records. e.g. type TMyRec = record StrField: string; end; TMyRecArray = TArray<TMyRec>; To modify the values you need iterate using an index var RecArr: TMyRecArray for var I := 0 to Length(RecArr) - 1 do RecArray[I].StrField := ... Unfortunately you cannot do: for var Rec in RecArr do Rec.StrField := ... // <- compiler error: You cannot modify a for loop variable. and in any case what you get in Rec above is a copy of the record not the original one. I agree it would be cool to have an iterator that gives access to the underlying element.
  3. pyscripter

    Naming abbreviations for controls

    I don't think this is anything to go by, but Embarcadero is sometimes using a suffix instead of a prefix! e.g. Vcl.CustomizeDialog.dfm object CaptionOptionsGrp: TGroupBox object ApplyToAllChk: TCheckBox object CaptionOptionsCombo: TComboBox This looks to me worse than using a prefix. But anything is better than keeping the default names (Button1, Button2, .. Button105 etc.)
  4. pyscripter

    ISet<T> in spring4D

    Inheritance Tree: IEnumerable<T> IReadOnlyCollection<T> ICollection<T> ISet<T> IEnumerable<T> has many functions including Contains: function Contains(const value: T): Boolean; overload; function Contains(const value: T; const comparer: IEqualityComparer<T>): Boolean; overload; function Contains(const value: T; const comparer: TEqualityComparison<T>): Boolean; overload;
  5. If you don't expect to have many duplicates then a dictionary with TArray for values is more time and memory efficient. I am using such a structure in SynEdit: SynEdit/Source/SynEditMiscClasses.pas at master · pyscripter/SynEdit.
  6. pyscripter

    Panning in Vcl Controls

    You probably have noticed that when you press the middle mouse button in the Delphi IDE the editor goes into panning mode, that allows you to scroll by moving the mouse. Many of the Vcl.Controls are panning enabled including the Memos, Grids, ContolLists, TabControls, Treeviews and others. For a complete list just search for csPannable in the Delphi Vcl source code folder. They use the exact same code that the IDE uses and behave in exactly the same way. However, what you may not know (I did not), is that to enable panning you need to include in your project the Vcl.IMouse unit. Vcl also makes it easy to add panning to your custom controls. All it takes is to add the csPannable control style. So SynEdit now has the same panning support as the Delphi IDE. However, I have discovered two bugs related to Vcl panning: Memory leak when you use Vcl.IMouse - RAD Studio Service - Jira Service Management The Panning Window is not DPI scaled - RAD Studio Service - Jira Service Management Both are easy to fix, so hopefully Embarcadero will provide fixes soon enough! In the meantime, it is easy to work around the memory leak and hopefully live with the second one, which also affects the Delphi IDE.
  7. pyscripter

    Modify bitmap of FMX Image object

    Unlike DelphiVcl, DelphiFMX does not wrap Canvas. Both DelphiVcl and DelphiFmx are maintained by Embarcadero. There is a reported issue regarding BeginScene, but you may want to submit a broader one about Canvas support.
  8. pyscripter

    ssh tunnel with ssh-pascal

    I committed a change trying to fix this. Could you please try once more.
  9. This is not correct. When P4D is used in an extension module it uses LoadDllInExtensionModule which just uses the dll loaded in the python process. It does not load or initialize the python dll. The calling process does that. So you can have more than one Delphi generated pyd files without issues.
  10. pyscripter

    ssh tunnel with ssh-pascal

    In the latest commit, multiple connections are handled in separate threads. So, Multiple Connections on LocalForward · Issue #11 · pyscripter/Ssh-Pascal is fixed. Seems to work fine, but could you please test it?
  11. pyscripter

    ssh tunnel with ssh-pascal

    @dummzeuch Please see my latest commit. TSshTunnel.ForwardLocalPort has been refactored and can now handle multiple connections sequentially. So your use case may be working. Could you please test. I will also see whether the connections can be handled in parallel. Is there a use case for that? Can you have multiple connections simultaneously on the same port?
  12. pyscripter

    ssh tunnel with ssh-pascal

    @dummzeuchI have updated the build scripts and the binaries which do not need OpenSSL. Could you please try the new binaries and see whether you still get the error you mentioned? These binaries work well with ssh-agent password-less authentication, whilst the Php ones don't. Also would it be possible to post a test project that requires multiple connections, so that I can have a go at fixing the issue?
  13. pyscripter

    ssh tunnel with ssh-pascal

    Probably not. When you add commits to the same branch, the commits are added to the PR. If you want to have separate PRs you need different branches for each change. Anyway your changes have been merged and you are listed as a contributor.
  14. pyscripter

    ssh tunnel with ssh-pascal

    @dummzeuch I think handling connections sequentially should be quite easy, without resorting to multiple threads. Once one is closed you wait for the next one. Please bear in mind, that there are limitations when using libssh2 from multiple threads: Points 1 and 3 are the same, since the crypto functions are initialized by libssh2_init. Ssh_pascal handles this in a thread safe manner. The second point, I think means that you either have a session per thread or you protect with a lock, access to the same session and its channels,
  15. pyscripter

    ssh tunnel with ssh-pascal

    A Pull Request implementing an alternative design that resolves this issue would be much appreciated.
×