Jump to content

dormky

Members
  • Content Count

    143
  • Joined

  • Last visited

Everything posted by dormky

  1. dormky

    How can I get this code formatting ?

    I agree with the fact that it's not 100% consistent. That's because having end else begin Is not that useful. 3 keywords each on one line is really wasteful.
  2. I have a StringGrid where results get added every second. However, doing StringGrid.RowCount := StringGrid.RowCount + 1; Sets the scroll position back to the top. How do I prevent this ? It leads to horrendous jank in the UI because I need to set the scroll back to the bottom afterwards, leading to the scrollbar (and grid) jumping up and down every second. I'm on Delphi 10.3. Thanks !
  3. dormky

    Augmenting RowCount resets scroll position

    @Stano Yes, but that would just hide the underlying problem 😕. Still, always a good idea to use BeginUpdate & EndUpdate to make UI changes 🙂 @Pat Foley I've never seen an AddRow or equivalent function for StringGrid in Vcl. Plus, "doing it for me" wouldn't actually stop the problem from occuring.
  4. dormky

    Augmenting RowCount resets scroll position

    So this code yields the best result, but requires that the last row keeps getting selected. The problem is that SetRowCount calls ChangeSize, which for some godforsaken makes sure that the anchor (ie, the top left) position is the same as the currently selected row. This means that on the next draw, your grid will "snap" to that currently selected row. This is obviously a completely idiotic implementation, but alas these are the joys of proprietary software. For the code I'm talking about, see Vcl.Grids's TCustomGrid.ChangeSize. Changing the size of something should never change its internal state(especially in such a massive way), but I guess programming standards were somewhat different in the days when this was written. Nice to see we're evolving at least 🙂 StringGrid.RowCount := StringGrid.RowCount + 1; StringGrid.TopRow := StringGrid.RowCount - StringGrid.VisibleRowCount; StringGrid.Row := StringGrid.RowCount - 1; Embarcadero issue number : RSP-42421
  5. I have checkboxes that get initialized in FormCreate. This means that the OnClick callback gets called (SetChecked does that). How can I prevent this ? Either by detecting whether the callbakc is triggered by an actual click or by setting the value without triggering the callback. I'm using checkboxes in this instance but this is of course a general question for other controls too. Thanks !
  6. I'm trying to use TValue.Make with a pointer. Unfortunately, "myPointer as PByte" is apparently not valid Delphi code (E2015 Operator not applicable to this operand type). "myPointer as Integer" and "myPointer" alone aren't valid either. How can I tell Delphi to treat my pointer as just a number ? Basically, I need to do pointer arithmetic so as to give the correct address to TValue.Make.
  7. "myPointer" is of type Pointer.
  8. NativeUInt(Pointer) doesn't work. "NativeUInt(myPointer)" doesn't give the same number as "PByte(myRecord)", despite "myPointer" being the same value as "@myRecord". Strangely, "PNativeUInt(myRecord)" isn't valid but "PByte(myRecord)" is, wtf ?
  9. dormky

    How do I know if the click is an actual user click ?

    Sorry for the delay. Here's how it ended up, using @Uwe Raabe's proposition of setting ClicksDisabled to True : uses Vcl.StdCtrls; type THelperCheckBox = class helper for TCheckBox procedure SetValue(const value: Boolean); end; implementation procedure THelperCheckBox.SetValue(const value: Boolean); begin ClicksDisabled := True; try Checked := value; finally ClicksDisabled := False; end; end; For now I've set it for checkboxes only, but will probably copy/extend it to other components or just TButtonControl. Maybe with runtime checks of the actual class of the instance the method is called on. Thanks everyone.
  10. I have an old 2007 project that needs to be brought up to 10.3. However, I cannot compile the project with 10.3 as it seems it cannot recognize any installed libraries (include VCL itself). What do I need to do to migrate the project ?
  11. Ah, by copying files into a new project I noticed that the search path had some absolute paths pointing to 2007 Delphi, preventing it from being used anywhere other then the original computer... Old projects I swear lol. Weird that Delphi didn't give any warnings and just said Vcl was not found. Thanks for the pointers to other things I hadn't considered though, that will be useful.
  12. dormky

    Backup of files + mysql

    So we have this big client that insists on us providing a backup solution for our own program and database. I told management this is not an issue we should be taking care of (imagine if every software had its own complete backup management system ?) and that the client's IT should just add the relevant paths to their backups. Alas, it is what it is and the compromise seems to be us "advising" a backup solution... So what's a backup solution that would handle backuping the path to our software installation as well as a mysql database ? I have absolutely no knowledge of the market for this, I'm not a sysadmin. Thanks !
  13. dormky

    Backup of files + mysql

    It totally is an incompetent IT service. I've told management that they should just backup the server itself, but apparently that's not sufficient. Mind-boggling stuff.
  14. dormky

    Backup of files + mysql

    Well, there's the client's own IT service (do not ask me why the IT service can't perform this simply backup, it's beyond me) that can access everything. Apparently we need to tell them what to install and how to use it. I'm honestly going to leave this request unanswered and hope people forget about it.
  15. dormky

    Backup of files + mysql

    Yes, the DB is a on a server and used from multiple clients. I'd like to tell them to just use mysqlbackup, but there's an insistence on having everything in one tool... And if we use a tool where we can add a script to run the mysqlbackup ourselves, then we start taking responsibility for things which management doesn't want either --'
  16. Hello, Could someone share a .delphilsp.json (for the DelphiLSP extension) file ? I can't generate one since I have 10.3 installed (superior versions won't start if another one is installed) and I can't migrate to 11 yet. I just need to look at the file structure so I can reproduce it for our own projects and finally stop using RAD Studio for most of the development. Thanks !
  17. dormky

    Generate .delphilsp.json file

    Thank you very much @Stano!
  18. dormky

    IDE Syntax Highlighter using Tree-sitter

    Hey @laes , did you had up publishing this work ? I'd love to have it, working without syntax highlighting is hell.
×