Jump to content

corneliusdavid

Members
  • Content Count

    409
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by corneliusdavid


  1. If the only reason you're not using the TTimeEdit is because of the tiny up/down arrows on Windows (which I agree are practically useless), then you could build your own compound component out of a couple of combo boxes and buttons all squished together.

     

    But if you're targeting mobile platforms, you might want to see how the TTimeEdit looks on those platforms--they might look quite different. Or you you could use the IFMXPickerServices.


  2. 13 hours ago, RDP1974 said:

    exception "only one datamodule for application"

    @Kas Ob., I got this same error just yesterday--not for creating a TForm but for creating a TDataModule. I thought for sure I could create a data module in addition to the web module used by the ISAPI DLL. Certainly, this is a different issue, right?

     

    @RDP1974, Why would you want a Form in a web module? If you want to display something, it would be returning HTML through a web action. Or, you could create a CGI app and run it from the console to see some output--but that's still not going to allow a TForm.


  3. It looks like it's advertising for his Free Typography course. But actually reading through it, I can't understand why anyone would want ligatures in their coding font. At least he quoted and linked to Matthew Butterick's article--with which several of the commenters (and myself) agree.

     

    For me, I've used Consolas for so long, anything else is uncomfortable.


  4. 5 hours ago, Magnus said:

    What is the correct procedure to upgrade from 11.3 to 12 while keeping settings and add-ons (e.g. install the add-ons in their required release)?

    You don't "upgrade" the IDE, you install 12 in addition to 11.3; later, when 12 is stable and you've moved all your projects over and no longer use 11.3, then uninstall 11.3.

     

    As for the settings, it shouldn't take long to set them up--unless you select every single option to a non-default value. If there's a settings transfer tool, I don't know about it as it was never that much of a bother for me. If you customize all the colors, I'm sure you know about the IDE Theme Editor.

     

    The only time-consuming part is if you have several GetIt packages (e.g. styles or sample projects or libraries). That can take awhile--which is why I wrote AutoGetIt.


  5. While AI is not built-in to Delphi, I recently used ChatGPT to help me write a Delphi function, saving me several hours. I'm sure there's a future IDE plug-in that will incorporate this somehow.

     

    However, I agree that Delphi has fallen behind other tools--and will likely never catch up as the industry is moving faster than the small, incremental enhancements that come with each release.


  6. I've actually wondered about this myself.  Isn't the purpose of the unit test to test what happens if you get invalid parameters? So this test would be expected to fail because invalid parameters (string) were sent in to a function expecting floating point.

     

    However, I suppose it could be argued that a calling a function whose parameters require a floating point, would not even compile in Delphi if sending a string, so a unit test of this sort is pointless?

    • Like 1

  7. Yes, that's always the case: \\server\sharename or \\server\sharename\subfolder.

     

    Note that there doesn't necessarily have to be a folder added on to that as the "sharename" part already points to a folder--the shared folder. Also, for hidden shares, the sharename will end with a "$" (at least on Windows).


  8. @Columbo, I had a few minutes and explored this technique of loading a TImageList dynamically a little more for my own curiosity and wrote a test program. The attached project loads a memory table with some local bitmaps, then as you scroll through the table, it pulls the image out of the table and clears/refreshes the image list which is associated with the page control. It should get you close to what you want.

    ImageListLoadTest.zip


  9. 1 hour ago, Columbo said:

    I need to know how to place these images into the tabs programmatically

    Look at the help for TImageList.Add. There's a code sample that shows how to load a selected image file from disk. You can extend that to your database by either saving out the image to a temporary file or streaming it directly to a TImage.


  10. For controls like TLabel and TEdit, you can use color constants defined in System.UITypes or specify your own as hex numbers; the TColor type is simply a UInt32 in the range -$7FFFFFFF-1..$7FFFFFFF.

     

    For example, both of the following lines set a label's font color to navy:

      Label1.Font.Color := clNavy;
      Label1.Font.Color := TColor($800000);

    The TitleBar is a special case and you have to enable custom properties for it; watch this tutorial video on Creating Custom Title Bars from DelphiCon 2021.


  11. 18 hours ago, msd said:

    if someone has experience with this topic, please share your ideas, experiences, and real stories.

    Not sure how relevant this is or if it answers any of your questions but I switched form UniDAC to FireDAC last year. If I still used the Professional edition of Delphi, I'd still have UniDAC; if I needed Direct Oracle Access, I'd still use UniDAC. There are many other reasons to stay--this is just a short story of why I changed and what it took for my small apps.

    • Thanks 1

  12. On 12/6/2023 at 11:02 AM, Remy Lebeau said:

    Something that is really annoying me since installing 12.0 is when I double-click on a .pas/.cpp file outside of the IDE, and the IDE is not running yet, the IDE is started, but it wastes time loading all of its default packages and layouts, and then opens the .pas/.cpp file, and then finally goes to the Welcome screen instead of the .pas/.cpp file.  Loading the packages, the Structure view, the Palette, etc is all completely unnecessary and the Welcome screen is completely unwelcomed when I just want to view a file

    That's why I changed the default Windows "open" action for .PAS files to just open them up in my text editor. I use Delphi to open projects and source files from within Delphi for programming and compiling but when just viewing something, I use a text editor. Most decent text editors (excluding Windows Notepad, of course) these days have syntax highlighting and while it may not be like what I have in Delphi, it's good enough for just looking at some code real quick.

    • Like 2

  13. On 10/28/2018 at 7:26 AM, osterhaegar said:

    It allows me to select the "Delphi version I use", which I simply can't, because it would be basically "All of them" (OK, everything >= Delphi 7). Maybe this should not be a single setting but a list?

     

    On 10/28/2018 at 7:27 AM, Michael Puff said:

    Choose your main version. The one you work with most.

    That's what I did. Then listed all of them I work with in my signature line. (Not that it really matters, of course, but I feel better more honest for declaring them.)


  14. Just now, David Heffernan said:

    value2, value3, value 4 all have an off by one error. 

    DOH! Corrected:

    value1 := random(250) + 1;
    value2 := random(250) + 251;
    value3 := random(250) + 501;
    value4 := random(250) + 751;

     


  15. So you want 4 random values, one each in the ranges 1-250, 251-500, 501-750, and 751-1000, right:


    Try this:

    value1 := random(250) + 1;
    value2 := random(250) + 250;
    value3 := random(250) + 500;
    value4 := random(250) + 750;

    Each random number is restricted to a 250 range but adding a number to it puts it into different range brackets.

    • Like 1

  16. Personally, I think a space after the comment makes it a little more readable.

    So I would opt for A1, B2, C2.

     

    But more importantly, I think comments should follow code or be on a separate line--I think comments before code on the same line break the vertical continuity of a block of code, causing the statement to be missed when the eye scans down a page.

    Therefore, like baka0815, I would much prefer a line-break option to move the statement to the next line.


  17. 9 hours ago, Lars Fosdal said:

    Who would select to use a closed source backend that doesn't scale

    If you have a large Delphi application with years of history and you want to add a REST server with as little learning curve as possible, RAD Server is fairly simple to get up and running--using existing skills.

     

    Scale? Did you know that RAD Server is deployed only as a module under the most popular web servers, IIS on Windows and Apache on Windows or Linux?  I'm not sure what would scale more than that.

     

    There are many closed-source products on the market that are chosen because they are simpler to use or offer more features than open-source equivalents. I'm not saying RAD Server is the best but it's certainly an option that is worth looking at and will be a good solution for some people. 

×