JonRobertson
Members-
Content Count
278 -
Joined
-
Last visited
-
Days Won
6
Everything posted by JonRobertson
-
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".
-
Switching off automatic Bookmarks?
JonRobertson replied to PeterPanettone's topic in MMX Code Explorer
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. -
Delphi 12.2 available for download
JonRobertson replied to pyscripter's topic in Delphi IDE and APIs
Then why did you ask? -
Delphi 12.2 available for download
JonRobertson replied to pyscripter's topic in Delphi IDE and APIs
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. -
"Death to WITH" in your Delphi Code
JonRobertson replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Eight chars, if you include spaces. Agreed. -
I was bit by this once when trying to swap the GetIt version with the github version. I switched back to the GetIt version.
-
Delphi 12.1 : Freezed during words search
JonRobertson replied to gioma's topic in Delphi IDE and APIs
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. -
What component I can use to display images in Android ?
JonRobertson replied to William23668's topic in FMX
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. -
PLABEL VCL Labelling, FlowChart and Technical Drawing editor
JonRobertson replied to Alberto Fornés's topic in Delphi Third-Party
That looks impressive. I don't have a need, but I would give them a try if I did. -
"Death to WITH" in your Delphi Code
JonRobertson replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
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. -
Handling TCP send buffer overflow the right way
JonRobertson replied to Dmitry Onoshko's topic in Network, Cloud and Web
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) -
I can't run my simple application with the About item in the About Menu.
JonRobertson replied to Miguel Jr's topic in General Help
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. -
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?
-
Watch me coding in Delphi on YouTube
JonRobertson replied to silvercoder79's topic in Tips / Blogs / Tutorials / Videos
And how to confuse the heck out of the debugger's evaluator. -
ifthen strange return value !
JonRobertson replied to bravesofts's topic in Algorithms, Data Structures and Class Design
Ah, yes. My apologies. That is a valid point. -
ifthen strange return value !
JonRobertson replied to bravesofts's topic in Algorithms, Data Structures and Class Design
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. -
ifthen strange return value !
JonRobertson replied to bravesofts's topic in Algorithms, Data Structures and Class Design
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. -
how to recognize cards drawn from a deck?
JonRobertson replied to David Schwartz's topic in General Help
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.) -
Best option for events with different parameter type in each child class?
JonRobertson replied to Dmitry Onoshko's topic in Algorithms, Data Structures and Class Design
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>); -
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
-
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
-
Looking for some guidance on WM_NCCALCSIZE
JonRobertson replied to JonRobertson's topic in Windows API
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. -
Looking for some guidance on WM_NCCALCSIZE
JonRobertson replied to JonRobertson's topic in Windows API
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. -
Looking for Advice on Improving the Performance of Delphi Applications
JonRobertson replied to Andro12's topic in Tips / Blogs / Tutorials / Videos
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. -
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