Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/05/25 in Posts

  1. You keep demonstrating for us that you do not even understand the API. Your original question would have been answered by just looking at the documentation for ShowModal, or by examining the source code to see how the modal loop is implemented. You wouldn't bother to do that, and you feel qualified to make pronouncements on the overall design quality. Maybe let it go.
  2. I suggest you try to design a GUI framework that can everything that the VCL can. Well, not for modal forms. Which makes David's post hard to fathom. It is called when closing modeless forms. Modal and modeless are very different. Again something that you see in the Windows API. It's more like needing different keys to lock your house and your car. Different problems tend to lead to different solutions. The bottom line here is that modal forms run in a dedicated message loop, and modeless forms run in the message loop of their owner. I don't think you appreciate this yet. Writing a raw Win32 program in C in the Petzold style might help you.
  3. Delphi in order to survive must ASAP include the method to close a modalForm or we will die. As a Quick Fix they should include the class helper for all the existing versions: type TFormHelper = class helper for TCustomForm public procedure EndDialog(PModulResult: TModalResult); end; { TFormHelper } procedure TFormHelper.EndDialog(PModulResult: TModalResult); begin modalResult:=PModulResult; end; I can only hope that somebody from Embarcadero will read this thread and will push these changes directly to the TForm not to require a class helper for such an important issue to be fixed. (For years I was using the modalResult to close modal forms without a single issue. This thread made me realize that Delphi is dying because it does not have such a method.)
  4. I think the problem we're sort of debating here is abstraction levels. The last time I looked at any code required to program a Windows Message Loop was maybe 1993 ... I might have spent one day messing with it and just wanted to throw up. Thus, I was familiar enough with it to recognize what a HUGE accomplishment it was that Delphi was able to totally hide it! That said, it took me a while to get comfortable with Modal vs. Modeless forms and the quirks they have at their edges. Over the years, I've seen so much code where the authors of certain forms were NOT really aware of the differences, which is usually when the app's Architect mandated a specific calling sequence for creating and disposing of forms that was likely an attempt to impose some (misplaced) consistency everywhere in the app. This always leads to some strange contortions in certain places in the code. I'm consistent enough in my own use that I pretty much don't worry about it. It's when I have to deal with code written by several different devs who themselves aren't consistent. I've got other beefs about how forms are managed, or mis-managed, by most Delphi devs, but that's more of a religious debate that nobody ever wins. (It's what inspired my CodeRage 9 talk.) Anyway, it seems reasonable that the normal abstraction levels that we're using to create and interact with forms should reflect a consistent implementation under the hood. I doubt 90% of Dephi programmers have ever seen what's involved in the Win Msg Loop, nor should they need to be aware of it. Except for the quirks that David points out. (Or why, although Forms are normal objects, nobody wants to create or use normal properties to move data in and out of them like every other type of object they'd do that for... but I digress.)
  5. I need your attention to my program. I recently was wandering how do I find the class of a component in order to know what it is doing. After all I have more than 3000! Who remember the fine differences be twin them and even if I had only 100. The PE program did not help. So I started writing an investigating program. I came up with this program. For what is worth I put it on my Dropbox for you to download. It will be there for a while. So now can you have an idea how to solve my main curiosity? Going through all the pas files will be crazy and need to search them on the whole computer. Is this my only option ? Wile printing pas files there mite be some errors. See my HELP. My program https://www.dropbox.com/s/ns5ntzpd0kiiolg/Help.zip?dl=0
×