Jump to content

Attila Kovacs

Members
  • Content Count

    2015
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Attila Kovacs

  1. If MyTypes is used throughout the whole project, why would you bother it UnitB is using it too. Otherwise take a walk and restructure the whole thing.
  2. Attila Kovacs

    How can I stop a form from being closed

    Form's OnCloseQuery event CanClose parameter
  3. Attila Kovacs

    Enabled := False makes color Glyphs disappear

    Use TImageList, ideally a descendant that can handle SVGs.
  4. Attila Kovacs

    Anyone using Clever Components?

    Yes, I'm using it actively. Don't expect rushed answers; the situation must be complicated, obviously. Otherwise, the components are mature and have been working well in production for years. Is your question technical?
  5. Attila Kovacs

    Cross platform color picker and palette library

    you could add to the top of the color list: clipboard (only if a color code is in the clipboard) no color
  6. Attila Kovacs

    Delphi app using Access database very slow on network drive.

    check this https://www.w3schools.com/asp/prop_rs_cursorlocation.asp or use use a proper dbms https://www.microsoft.com/en-us/download/details.aspx?id=104781
  7. Attila Kovacs

    Moving Line or Block in the IDE editor

    Yesterday I had the feeling I'm missing this feature from the IDE, today I can't remember why, maybe I'll recall it later 🙂 And my rough implementation of the feature: Comments, patches, etc. are welcome. ( f.e. I'm completely ignoring the top and the bottom of the file, and other line endings as 0D 0A, also not sure about utf-8 in the code) Blocks are moving on the basis of the starting and ending line. This is intended. procedure TKeyboardBinding.BindKeyboard(const BindingServices: IOTAKeyBindingServices); begin BindingServices.AddKeyBinding([ShortCut(VK_UP, [ssAlt])], MoveLineOrBlockUp, nil); BindingServices.AddKeyBinding([ShortCut(VK_DOWN, [ssAlt])], MoveLineOrBlockDown, nil); end; procedure TKeyboardBinding.MoveLineOrBlock(ADirection: Integer; const Context: IOTAKeyContext; var BindingResult: TKeyBindingResult); var EditPosition: IOTAEditPosition; EditBlock: IOTAEditBlock; CurrentRow: Integer; CurrentRowEnd: Integer; BlockSize: Integer; IsAutoIndent: Boolean; CodeLine: string; sr, er: Integer; begin EditPosition := Context.EditBuffer.EditPosition; EditBlock := Context.EditBuffer.EditBlock; // Store original cursor row CurrentRow := EditPosition.Row; // Length of the selected block (0 means no block) BlockSize := EditBlock.Size; // Store AutoIndent property IsAutoIndent := Context.EditBuffer.BufferOptions.AutoIndent; // Turn off AutoIndent, if necessary if IsAutoIndent then Context.EditBuffer.BufferOptions.AutoIndent := False; if (EditPosition.Row = 1) and (ADirection = -1) then Exit; if (BlockSize = 0) then begin // Only a single line to move EditPosition.Save; if ADirection = 1 then EditPosition.Move(EditPosition.Row + ADirection, EditPosition.Column); // Move to end of current line EditPosition.MoveEOL; // Get the column position CurrentRowEnd := EditPosition.Column; // Move to beginning of current line EditPosition.MoveBOL; // Get the text of the current line, less the EOL marker CodeLine := EditPosition.Read(CurrentRowEnd + 1); if Ord(CodeLine[Length(CodeLine)]) <> $0A then Exit; EditPosition.Move(EditPosition.Row - 1, EditPosition.Column); // Move to end of current line EditPosition.MoveEOL; // Get the column position CurrentRowEnd := EditPosition.Column; // Move to beginning of current line EditPosition.MoveBOL; // Get the text of the current line, less the EOL marker CodeLine := CodeLine + EditPosition.Read(CurrentRowEnd + 1); if Ord(CodeLine[Length(CodeLine)]) <> $0A then Exit; EditPosition.Delete(Length(CodeLine) - 2); EditPosition.InsertText(CodeLine); // Move cursor to original position EditPosition.Restore; EditPosition.Restore; EditPosition.Move(EditPosition.Row + ADirection, EditPosition.Column); BindingResult := krHandled; end else begin // More than one line selected. Get block text sr := EditBlock.StartingRow; er := EditBlock.EndingRow; if (EditBlock.StartingColumn <> 1) or (EditBlock.EndingColumn <> 1) then begin EditPosition.Move(sr, 1); EditBlock.BeginBlock; EditPosition.Move(er + 1, 1); EditBlock.EndBlock; sr := EditBlock.StartingRow; er := EditBlock.EndingRow; end; CodeLine := EditBlock.Text; EditBlock.Delete; EditPosition.Move(EditPosition.Row + ADirection, 1); // Insert block text EditPosition.InsertText(CodeLine); EditPosition.Move(sr + ADirection, 1); EditBlock.BeginBlock; EditPosition.Move(er + ADirection, 1); EditBlock.EndBlock; BindingResult := krHandled; end; // Restore AutoIndent, if necessary if IsAutoIndent then Context.EditBuffer.BufferOptions.AutoIndent := True; BindingResult := krHandled; end; procedure TKeyboardBinding.MoveLineOrBlockDown(const Context: IOTAKeyContext; KeyCode: TShortCut; var BindingResult: TKeyBindingResult); begin MoveLineOrBlock(1, Context, BindingResult); end; procedure TKeyboardBinding.MoveLineOrBlockUp(const Context: IOTAKeyContext; KeyCode: TShortCut; var BindingResult: TKeyBindingResult); begin MoveLineOrBlock(-1, Context, BindingResult); end;
  8. Attila Kovacs

    Windows PATH length limit?

    That works only if [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 is set
  9. Attila Kovacs

    Windows PATH length limit?

    2048 Just for the record. Nothing to do with your question. For file I/O, the "\\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system. For example, if the file system supports large paths and file names, you can exceed the MAX_PATH limits that are otherwise enforced by the Windows APIs. For more information about the normal maximum path limitation, see the previous section Maximum Path Length Limitation. Because it turns off automatic expansion of the path string, the "\\?\" prefix also allows the use of ".." and "." in the path names, which can be useful if you are attempting to perform operations on a file with these otherwise reserved relative path specifiers as part of the fully qualified path. Many but not all file I/O APIs support "\\?\"; you should look at the reference topic for each API to be sure. Note that Unicode APIs should be used to make sure the "\\?\" prefix allows you to exceed the MAX_PATH.
  10. Attila Kovacs

    Global bookmarks

    That would be cool.
  11. Attila Kovacs

    Delphi Clipboard - WM_CLIPBOARDUPDATE (sent, but no changes)

    MCVE or didn't happen
  12. Attila Kovacs

    FindFirst (Delphi) vs Dir * /s

    if FindFirst('C:\*', faAnyFile, searchResult)=0 then begin yadda yadda yadda: if FindFirst(dirName, faAnyFile, searchResult)=0 then begin yadda yadda yadda, yadda yadda?
  13. Attila Kovacs

    Convert Visual Studio 2012 code to Delphi

    must be a bad weather in the UK
  14. Attila Kovacs

    I'm on the Dark Side... no, really!

    Dark mode is much worse for the eyes. You should adjust the brightness and contrast to relax your pupils.
  15. Attila Kovacs

    Select the entire procedure/function?

    https://youtu.be/SbZXiDE6GO4?t=48
  16. Attila Kovacs

    Thinfinity VirtualUI - cloud-based conversion

    Yeah that's me, and I have a touch screen which I think the problem is. I tried my phone, Chrome on a S23 Ultra, it loads, but the GUI is unusable on that small display.
  17. Attila Kovacs

    Thinfinity VirtualUI - cloud-based conversion

    I've tried both, chrome and IE, the same, (they are actually the same nowadays anyway) I managed to get it working once, but the same error has occurred again. However, it wasn't functioning properly. I couldn't see the entire forms and such... ike there's no HDPI support.
  18. Attila Kovacs

    Thinfinity VirtualUI - cloud-based conversion

    now it's working, no HDPI support?
  19. Attila Kovacs

    Thinfinity VirtualUI - cloud-based conversion

    <o> yes, then I log in and I'm getting an empty site
  20. Attila Kovacs

    Thinfinity VirtualUI - cloud-based conversion

    just an empty page, do I need something on the client side?
  21. Attila Kovacs

    Delphi and "Use only memory safe languages"

    Doesn't matter. It was an example.
  22. Attila Kovacs

    Delphi and "Use only memory safe languages"

    TStringList has 4 other constructors with parameters. This would just pollute the code and cause traffic jams everywhere.
  23. question is, if dfm's are affected too
  24. Report them as false positive, include the exe.
×