I had the pleasure of building a custom page control last weekend. We are currently updating the style of the SmartInspect Console and wanted to replace the standard Windows page control in it. The standard control lacks a flat style and looks especially cumbersome under Windows 2000. After testing some controls from TMS and other third party vendors and not being satisfied with those controls, we decided to build our own. The result can be seen here:
It doesn’t look too shabby I think and it only took me two days. I normally don’t build controls myself but while I developed the page control, I noticed how essential a logging tool like SmartInspect is for this task. It was impossible to debug the drawing routines and calculation of the tab widths with Delphi’s built-in debugger. The reason is quite simple: whenever the control draws itself and the IDE stops at a breakpoint, the control has to redraw itself again when it’s activated. This leads to an endless loop between the IDE and the drawing routine.
To solve this problem, I used the LogBitmap and LogCanvas methods of SmartInspect to log the different drawing states. This solved the debugging issue neatly since I was able to view every drawing step separately. I could then even use the Delphi debugger because I didn’t have to rely on viewing the drawn control in my test application but could see the output with SmartInspect.
Help us improve this page!
What problem are you trying to solve?