Jump to content

dormky

Members
  • Content Count

    150
  • Joined

  • Last visited

Everything posted by dormky

  1. dormky

    How do I make a TValue for TBytes ?

    Damnit, the debugger is showing the error on the wrong line. I had an invalid typecast, but in the next block of code... Thanks :')
  2. I had two version of RAD Studio installed. 10.3 under license, 11 under free trial. I uninstalled 11, and now 10.3 doesn't work anymore (no debugging). I'd like to re-install it, but can't find the installer anywhere on Embarcadero's website. There's only the free trial.
  3. I'm trying to have the dialogs like MessageDlg be translated. Looking at the code in Vcl.Dialogs, it uses the LoadResString function to get the string for the buttons. It doesn't look like it can handled multiple sources for the same string, but I could be wrong because it would be kind of insane to force dialogs to be in one language only. But this is Delphi, they aren't known for making logical design decisions.
  4. dormky

    BringToFront alternative

    The following code shows that BringToFront does not work. Are there any alternatives I can use to put a control on top of all other controls in a window ? interface uses Vcl.Forms, Vcl.ComCtrls, System.Classes, Vcl.Controls, Vcl.StdCtrls, UUtils, Vcl.ExtCtrls; type TFormMain = class(TForm) PageControlMain: TPageControl; Sheet1: TTabSheet; Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private dynLabel: TLabel; end; var FormMain: TFormMain; implementation {$R *.dfm} procedure TFormMain.Button1Click(Sender: TObject); begin dynLabel.BringToFront(); end; procedure TFormMain.FormCreate(Sender: TObject); begin dynLabel := TLabel.Create(self); dynLabel.Parent := self; dynLabel.Height := 200; dynLabel.Width := 500; dynLabel.Top := 100; dynLabel.Left := 100; dynLabel.Caption := 'BAMKLJDOUZEHFOZEI'; dynLabel.Visible := True; dynLabel.BringToFront(); end;
  5. dormky

    Visually edit a custom component

    Hello, I have a series of 4 numbers describing current atmospheric conditions, currently shown in a TGroupBox with each number in a TEdit. I'd like to encapsulate the behavior related to these numbers (color changes) into a component so I can re-use it in multiple places. I've created a new component based on TGroupBox, but when opening it there's no Design tab, and I don't want to use code to describe the UI as this runs opposite to what is generally done in Delphi (where you use a graphic UI editor). How can I get my custom TGroupBox component in a Design tab so I can edit it (with a .dfm) ?
  6. dormky

    Visually edit a custom component

    Frames look great, thank you for sharing !
  7. dormky

    BringToFront alternative

    The TLabel was just for demonstration purposes, I'd like to be able to do that with all components...
  8. dormky

    BringToFront alternative

    I don't want to change anything about other controls, I just need a control to be on top of all others. Yes, that's why I'm looking for an alternative. Do you know of any component that could work on the same group as my TPageControl here ? I suppose I could use such a component, make it invisible but keep a child control of it visible, if that's possible.
  9. dormky

    MyDAC : Unknown column error

    I have a TMyTable on which I've just added a field called "FileVersion" using right-click on the control, right-click again and "New Field". When I log all the fields in "MyTable.Fields.FieldName", FileVersion does indeed exist. But when setting the table's "Active" property, I get the following error : #42S22Unknown column 'FILEVERSION' in 'field list' I honestly have no idea what I'm supposed to do here ? Looking at other fields in that table, they all look the exact same. They all exist in the exact same places (in the dfm file and the code).
  10. dormky

    GIF not playing in Delphi 10.3

    It doesn't adapt the image size to the control size. Mods, please delete this post 🙂
  11. dormky

    MyDAC : Unknown column error

    It's because with the default connection parameters, it was connecting to the production database. Which of course did not have the added column. Don't ask me why this is done by default at design time, I inherited this project...
  12. dormky

    MyDAC : Unknown column error

    Alright, so it turns out that when compiling with the DEBUG flag, all components keep the csDesigning flag in their ComponentState, leading MyDAC to connect automatically to whatever is set at design time. How can I prevent this ? Apparently SetDesigning cannot be called manually (it's protected) but of course a helper class gets around that easily. Still, I'd rather have a solution that doesn't rely on these kind of shenanigans.
  13. dormky

    MyDAC : Unknown column error

    Every field is shown in all caps in errors ; MySQL doesn't care about that anyway. And yes, I did add it in the database. And I only have one database.
  14. TMyRecord = record myArray: array [0..1] of Integer; end; The Delphi compiler seemingly does not generate runtime type information for "myArray". This seems strange, as : TMyRecord = record myRecord: record myint: Integer; end; end; Here "myRecord" will get RTTI generated, with a name such as "TMyRecord:1". TRttiArrayType exists to represent array types, but seemingly the decision was made to just... not use it ? What's the technical reason behind the refusal to generate RTTI for this case ? It seems everything is there to do it, and the compiler just... doesn't. From an outside perpective, is seems it would be exceedingly easy to implement.
  15. 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) ?
  16. 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.
  17. 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 ?
  18. 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 !
  19. > 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 🙂
  20. 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.
  21. 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 !
  22. 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 !
  23. 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
  24. No there isn't, I had to put one with a SHowMessage() in order to see it. The code is in a FormShow call.
  25. 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 ?
×