Jump to content

dormky

Members
  • Content Count

    114
  • Joined

  • Last visited

Everything posted by dormky

  1. When my DBGrid's datasource points to a TMyTable, its fixed rows are drawn like this : But when changing to a TClientDataSet, they are drawn like this : What can I do to prevent this change ? Is this a style problem ? Is it a difference in settings between the TClientDataSet and the TMyTable ? I haven't found one that could provoke this but it's the best idea I've got as to why this behavior occurs.
  2. (These are TBitBtns) In the first image, all buttons are enabled. In the second, the bottom two are disabled. It seems that the disabling makes every color except for pure black completely disappear (see the grey at the top of the pencil disappeared too). What can I do to prevent this ? The icon should just be greyed out, not entirely disappear. I don't want to make greyed out glyphs and switch them around for literally every button in the program either. Although if it comes down to it, I guess I could always have a custom button that takes the existing glyph and greys it ? But that sounds finicky and there's probably a better way of solving this. Thanks !
  3. dormky

    Enabled := False makes color Glyphs disappear

    A search for TBitBtn just gave me 1842 results, and that's just the "main" part of the program. Now not all of these buttons have icons of course, but a significant portion does. We're talking at least hundreds of buttons to update and check here. So no it's not every icon, but it's still a whole freaking lot.
  4. dormky

    Enabled := False makes color Glyphs disappear

    Those lines were literally written before I was born. Believe me if I could throw it all away I would but alas that's not realistic. Try to explain to management why we'd need so much time and testing to "make the icons grey" :')
  5. dormky

    Enabled := False makes color Glyphs disappear

    It is a shame that TBitBtn's method of greying out an icon is to make black grey, and every other color white. That is not a good method imo as it leads to problems like this in this post, forcing the developer to put in more work (re-implementing the greying or creating greyed out icons). A UI framework should have correct greying, that's not something up for debate.
  6. dormky

    Enabled := False makes color Glyphs disappear

    Yes, but doing this for every icon in this 1M lines project does not make sense if there is another solution out there. Especially as greyed out an existing image is not complicated in itself, it's just the implementation in TBitBtn that's faulty.
  7. dormky

    Enabled := False makes color Glyphs disappear

    Such a shame. It seems the Images property only exists for TButton. I've tried adding my bitmap to the property but it doesn't seem to work like the Glyph property (double click to edit). How am I supposed to add it ?
  8. dormky

    "for i in" goes in reverse

    Actual insanity.
  9. When I build .dcu files, they often aren't the same size. Does anyone know why that is ? I literally just build two times in a row, and between 5 and 10% of .dcu will have a size difference of a few dozen bytes. I'm trying to apply formatting to the whole project and want to verify that the output is not affected (trust but verify, heh ?) but if building the same thing twice already leads to significant changes this will be quite difficult to achieve... And yes, we have 0 test coverage. Edit : Example with this small file, where 4 bytes are added at around 3/4ths of the file. UConfigEchelle_big.dcu UConfigEchelle_small.dcu
  10. Ah, it might be the debug info indeed for the big changes when formatting. But there's still differences when compiling 2 times in a row, which I can't explain (see attached files in the OP)
  11. Well, I just checked on the effects of formatting on .dcu files and they seem to be affected a lot. Very strange that intermediate compiler files would be affected by formatting. Does delphi output other intermediate files that I could check ?
  12. I'd like to extract a row's data as an object from a TMyQuery, so that I can give it as an argument to a function. But I don't see anything that can achieve that in the doc. For background, this is using MyAccess to grab from a MySQL DB. Typically I'd like to have something like MyQuery.First(); DataObject := MyQuery.CurrentData(); MyQuery.Next(); // DataObject still has the data from the previous row
  13. DataSetHelper does indeed seem to be what I'm looking for ! Too bad I'm almost finished writing the RTTI solution described just above by Lars, which I suppose is what DataSetHelper is doing. Writing it myself was what i wanted to avoid, but alas. Since I've written tests for it I'll use my code, but thanks for coming though anyway 🙂
  14. I'd like to create a TValue that holds a TBytes array. From what I see of TValue's code, it doesn't seem to be designed for such, even by using variants. Alternatively, if I can just get a pointer to the relevant instance field from TRttiField and cast it to a TBytes, that'll work too.
  15. 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 :')
  16. 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.
  17. 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.
  18. 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;
  19. 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) ?
  20. dormky

    Visually edit a custom component

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

    BringToFront alternative

    The TLabel was just for demonstration purposes, I'd like to be able to do that with all components...
  22. 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.
  23. 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).
  24. dormky

    GIF not playing in Delphi 10.3

    It doesn't adapt the image size to the control size. Mods, please delete this post 🙂
  25. 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...
×