Jump to content

JonRobertson

Members
  • Content Count

    278
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by JonRobertson

  1. JonRobertson

    VCL Componenet badge button

    To create your own, you need to implement drawing the badge on the button. Do you have experience creating visual components in Delphi? In addition to TMS, StyleControls VCL has numerous buttons that have the ability to display a "badge".
  2. JonRobertson

    Switching off automatic Bookmarks?

    I think it is more helpful that they are on by default. Once I noticed them, I went to MMX options to turn them off. I suspect many users wouldn't notice the option was available if they were not on by default.
  3. JonRobertson

    Delphi 12.2 available for download

    Then why did you ask?
  4. JonRobertson

    Delphi 12.2 available for download

    From the "What's new" presentation, it was said that the primary benefit is to extremely large applications (LoC, etc) and that companies with applications that large already used Enterprise or Architect.
  5. JonRobertson

    "Death to WITH" in your Delphi Code

    Eight chars, if you include spaces. Agreed.
  6. JonRobertson

    Use old glyph with tpngobject in 10.4?

    I was bit by this once when trying to swap the GetIt version with the github version. I switched back to the GetIt version.
  7. JonRobertson

    Delphi 12.1 : Freezed during words search

    I reported issues with severe IDE instability over a year ago during a call with my account manager and one of the product managers. The PM suggested that I uninstall each add-in, one at a time, which I should have done before complaining but I hadn't taken the time. Once I uninstalled Navigator and Parallel Debugger, IDE lockups and crashes dropped from a dozen times a day to less than once a month. I've never installed Bookmarks. I suspect the culprit was Parallel Debugger. But I didn't isolate the issue further.
  8. JonRobertson

    What component I can use to display images in Android ?

    I would try placing a TScrollBox on the form, then place three TImage components inside the scrollbox. I suspect there are other ways that may provide more flexibility. I don't have the experience with FMX to suggest a better option.
  9. JonRobertson

    PLABEL VCL Labelling, FlowChart and Technical Drawing editor

    That looks impressive. I don't have a need, but I would give them a try if I did.
  10. JonRobertson

    "Death to WITH" in your Delphi Code

    I've been working in Delphi 7 projects for the past year. Some are being migrated to 11.3+ and some are staying with Delphi 7. I always refactor with statements away by hand, but even that can be tricky. For example, I learned after refactoring several "with dataset do ... while not Eof do ; Next;" constructs, and overlooking one call to Next, that TForm has a public Next method, related to MDI children of a MDI parent. https://docwiki.embarcadero.com/Libraries/Alexandria/en/Vcl.Forms.TForm.Next Hello infinite loop! Now, go away.
  11. JonRobertson

    Handling TCP send buffer overflow the right way

    Thread-per-client does not scale well and likely would not work well for the number of connections that you've mentioned. Take a look at this answer, as well as the Raymond Chen post referenced. Maximum threads limit per process in windows 10? (superuser.com) Does Windows have a limit of 2000 threads per process? (The Old New Thing blog)
  12. If your About Dialog is listed as an auto-created form, you probably want to remove it from that list. This is the dialog in D11 You would select frmAbout and click the > button to move it to Available forms. There is no reason to create the dialog unless the user selects the menu option to view it.
  13. JonRobertson

    Confirm before closing a form

    Did you "put the procedure in the class" by double-clicking the event in the Object Inspector? Or did you manually add it to the class declaration?
  14. JonRobertson

    Watch me coding in Delphi on YouTube

    And how to confuse the heck out of the debugger's evaluator.
  15. Ah, yes. My apologies. That is a valid point.
  16. Did the tone of this conversation lean towards mockery or belittling the person asking the question, or am I mistaken? You are mistaken. I've been coding for 43 years and I don't read assembler. I know what a *few* x86 instructions do. But not enough to look at a disassembled function and determine what the code does. At least, not without spending a LOT of time trying to figure it out.
  17. Assembler of that code will show the truth... but I think that someone that ask such things do not have ability to read assembler. Disassembled code would reveal the code generated by the compiler. But it isn't going to reveal the contents of memory (registers, stack, or heap) prior to the code even executing. As Dalija points out, I could execute it once and the memory was zero at the time and execute it a thousand more times and the memory has values aside from zero.
  18. JonRobertson

    how to recognize cards drawn from a deck?

    You may want to look at ImageEn. Although this is a commercial library, it has been developed for decades, currently maintained, and extremely well supported. It offers several ways to recognize objects in images. One is an integration with Google Vision, TIEGoogleVision. The others require the IEVision add-on: TIEVisionImage.matchTemplate TIEVisionObjectsFinder TIEVisionNNet.detectObjects TIEVisionBlobDetector TIEVisionFaceRecognizer TIEVisionBarCodeScanner I have no affiliation with ImageEn, aside from being a happy customer & user of ImageEn components. (I have no experience with the IEVision components referenced above.)
  19. Perhaps something like this? type TFooMessage = class Foo: Integer; end; TBarMessage = class Bar: Double; end; TCustomProtocol<T> = class(TPersistent) private FMsg: T; FOnMsg: TProc<T>; published property OnMsg: TProc<T> read FOnMsg write FOnMsg; end; TFooProtocol = class(TCustomProtocol<TFooMessage>); TBarProtocol = class(TCustomProtocol<TBarMessage>);
  20. I want to create a window that looks and performs similar to the IDE Insights search results. Using IDE Explorer, I suspect that window is TIDEInsightForm and uses a Virtual TreeView component for the search results. Does anyone know if that is correct? Thanks
  21. I have very little experience with changing UI at the Windows message level. I am hoping someone can explain a behavior that is confusing to me. The purpose of my question is strictly educational. In the attached demo project, WM_NCCALCSIZE attempts to change the form's client area to the entire form, without the caption bar. Decreasing NCCalcSizeParams.rgrc[0].Top by 31 (scaled if needed) does what I expect: Using a value of 30 gives me this: In the second example, Windows does not recognize the caption bar as part of the window. For example, clicking in that area sends the mouse click message to the window under my form. That makes sense to me. What I don't understand is why changing the value that I decrease from .Top from 30 to 31 makes such a difference in whether the painted client area "includes" the caption bar, for lack of a better description. I would expect values between 1 and 30 to gradually hide (?) the caption bar, rather than all or nothing. I also have not figured out how to determine that 31 is the value needed to accomplish the first image. I've tried various system metrics values such as SM_CYCAPTION, SM_CYFIXEDFRAME, and SM_CYDLGFRAME. Even combining SM_CYCAPTION with one of the SM_CY*FRAME values results in a value that is too small. My current interest is in a non-themed or Windows themed application. I have looked at TFormStyleHook.WMNCCalcSize to see how the VCL handles WM_NCCalcSize when themed. But that didn't help me understand the behavior that I'm seeing without themes. Thanks WMNCCalcSize.zip
  22. JonRobertson

    Looking for some guidance on WM_NCCALCSIZE

    Nice. I spent several hours searching for answers over the weekend and did not come across that calculation. I completely overlooked SM_CXPADDEDBORDER. That answers the question of how to determine the value to use. This works for me: procedure TfrmMain.WMNCCalcSize(var Message: TWMNCCalcSize); begin inherited; var captionHeight := GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXPADDEDBORDER); var Scale := RoundTo(CurrentPPI / Screen.DefaultPixelsPerInch, -2); var NCCalcSizeParams := Message.CalcSize_Params; Dec(NCCalcSizeParams.rgrc[0].Top, Round(captionHeight * Scale)); end; Does anyone know why using a value of one less than captionHeight results in the entire caption bar being painted? Thanks again.
  23. JonRobertson

    Looking for some guidance on WM_NCCALCSIZE

    No, I didn't know about that Windows message. So I learned something today. The rcTitleBar.height coming back from WM_GETTITLEBARINFOEX is 23, which is the same value that I get from GetSystemMetrics(SM_CYCAPTION). Unfortunately that is not high enough to get the behavior that I'm expecting. Oddly (to me), the height for the various min/max/close buttons comes back as 24.
  24. Don't blindly accept suggestions for indexes from SQL Server. Those would help that one query but may only help that query. You also have to consider the database write and maintenance cost of each index.
  25. JonRobertson

    Each .py script in a separate window

    Because only the TPyThread type definition was indented. https://en.delphipraxis.net/topic/11903-each-py-script-in-a-separate-window/?do=findComment&comment=93799
×