Jump to content

dormky

Members
  • Content Count

    111
  • Joined

  • Last visited

Everything posted by dormky

  1. dormky

    How do I tab into a TDBRadioGroup ?

    I have a TDBRadioGroup with 2 options. Unfortunately, when pressing TAB to go from field to field, when it gets to the TDBRadioGroup you can't edit the values via keyboard. I tried space, enter and arrows, all with shift and ctrl. What's the deal here ? Is there no way to actually give the focus to this type of field and edit it via keyboard ? The TabOrder is correct and TabStop is True. Strangely enough, once you've clicked on an option it suddenly becomes available in the TAB navigation, and at the expected order. Not sure what's happening here, is it because there is no default value (none of the options are selected at first) ?
  2. dormky

    How do I tab into a TDBRadioGroup ?

    It's a VARCHAR(1), for the sex. The default value is empty, so none of the values are checked, which makes sense.
  3. I have a build configuration that includes EurekaLog. Since EurekaLogs alone takes 15s of the build process I'd like a debug config where it's not enabled. However I can't find anywhere in the IDE allowing me to duplicate a build configuration. You can export/import options, but not entire build configurations. Is that even something possible ?
  4. Ooooh I just realized you create the new config by right-clicking an existing one, not the "Build Configuration". Very cool, that works too and is much cleaner. Thanks !
  5. > I assume you mean runtime warnings from custom code, and not thousands of compile time warnings? Nope, it's compile time warnings about string casts and the likes. Since a lot of the code is copy-pasted for each slightly different case, the warnings are too so there's really a lot of them ^^ The problem with creating a new configuration is that I lose the settings of the original config. We have things like a custom stack size, so I want to have the exact same config except for the Eurekalog flag and the warnings/hints. I just figured I could edit the .proj directly to make sure the configs are the exact same and it seems to be fine 🙂
  6. Unfortunately, we use the Debug build to compile releases (this is probably the least problematic thing about this project lol), but there's other things I want to change in the config, such as the output of warnings (guess what when you have thousands of warnings the time spent printing it to the debug channel adds up to a lot). Also, we have so many leaks that it's not worth keeping track of at this point. More pressing things to do, somehow.
  7. When the program gets an access violation error, the debugger shows it fine. But when running the exe (the debug exe), it is not shown. I'm using EurekaLog and I suppose there's a setting causing this, but I can't find it. I'm using Delphi 10.3. Thanks !
  8. I'd like to run this query : SELECT * FROM users WHERE id IN (:param) To get a list of the users I need. But I can't figure out how to pass an array of values to a TMyQuery object. How is this supposed to be done ? Thanks !
  9. I'm not sure these answers will handle SQL sanitization properly, is there data on that ? And in any case who builds an sql accessor without giving array types lol
  10. No there isn't, I had to put one with a SHowMessage() in order to see it. The code is in a FormShow call.
  11. I have a thread that uses a timer to do work at fixed intervals and doesn't do anything except that. This means I have nothing to put in the Execute method ; but if I don't the thread never terminates. What am I supposed to do ?
  12. That's not a problem here, the code called by the timer is "fire and forget".
  13. Except that I'm putting the timer in a thread for a reason. If it's on the main thread, it runs the risk of getting delay by other work (namely, heavy drawing). If the timer is delayed, the event is delayed too.
  14. Well, if someone's already made the relevant code to create a timer there's no reason to write one myself.
  15. Well, it seems that no matter what I do, the timer's callback is always executed in the main thread. Anyone have a recommendation for a TTimer equivalent that has its callback executed in the thread it was created in ?
  16. > You need to run your timer related code within the Execute method I would need to have the timer callback set a flag that a loop in the Execute would check ? That seems exceedingly strange. I just want a timer that exists and executes in a thread other then the main thread. The timer's interval is subject to change, and is in a class whose logic should be able to run on both main and other threads, hence why I haven't put the logic in the Execute method directly.
  17. It feels so wasteful to have a method running with something like "while not Terminated do Sleep(10);". Is there not a better way of having the thread idle ?
  18. I've tried to install the https://github.com/CHERTS/newac component, but while it shows up in the Components list and the palette contains all the elements it should, dragging and dropping an element onto a form automatically adds the relevant units to the uses list... but Delphi can't resolve them. What could I have done wrong in the installation for this to happen ? I opened the .dpk file, right-clicked on the .bpl group and clicked Compile, then Install. Everything seemed to be fine until I actually tried it. I tried installing with both the NewAC file and the NewAC_Rio file (I'm on Delphi 10.3.2).
  19. I need to make a metronome. For this purpose I've been trying to use TTimer, but it seems that for every call, it spawns a new thread. How can I prevent this and make it run in the program's main thread ? The problem is that I'm calling a windows API asynchronously, which means the timer's thread ends before the Windows call completes.
  20. dormky

    How can I make TTimer run in the main tread ?

    This is the VCL subforum 😕 And this is async, so disabling the timer in-between would have no effect. And this is a metronome, so I need to be as exact as possible.
  21. dormky

    How can I make TTimer run in the main tread ?

    It breaks down when you go above 1000ms interval, try it with 500ms. You can even see the "Thread start" logs still going after stopping the timer.
  22. dormky

    How can I make TTimer run in the main tread ?

    Ah, nevermind ! It seems that it's the Windows API call making this thread. Now why does calling PlaySound not work when it's called from a TTimer callback, I have no idea.
  23. dormky

    How can I make TTimer run in the main tread ?

    Every call prints "Thread ID start" and "Thread ID Exit" to the debug log.
  24. I have a very, very large record that may cause memory issues for the stack if I use multiples instances of it in a procedure. I'd like to force delphi to allocate it on the heap so this doesn't happen. I need it to stay a record, it can't be a class. I have no problem with doing a bit of manual work in the procedure to get this, it doesn't have to be something baked in the framework and invisible to me as a dev. I'm sure this is possible in a simple way, I just can't find it through Google... Thanks !
  25. Believe me I would love to move away from this pattern, but unfortunately we have decades-old data stored like this, with the whole rest of the program built around it. It's too late ; the only thing I can do now is make it as safe and as readable as possible for future generations, lol.
×