Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Steve Trefethen Steve's RSS Feed Subscribe or via email
What's this?
Contact me Send mail to the author(s)
About Me
View my LinkedIn profile

Add to Google
Subscribe with Bloglines
MCP Microsoft Certified Professional

Falafel Software
ActiveFocus Project Management Solution by Falafel Software
Online or OnSite TestComplete Training
Blogroll
Recent Comments
My Online Tools
Stats
Total Posts: 441
This Year: 46
This Month: 2
This Week: 0
Comments: 1526
Tags
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
 Monday, April 02, 2007

VCL and RTL enhancements since Delphi 7 (D7)

Posted @ 11:47AM by Steve Trefethen

Categories: Delphi | RTL | VCL

Tags:  |  | 

Nick Hodges put together a list of changes to the VCL since D7 and I thought I'd pitch in and help expand since it only includes a few of the high level items. I'll try and avoid duplicating items Nick's list (no guarantees). This is by no means an exhausive list and does not include bug fixes nor does it mention cases where we've made numerous methods virtual/protected to better enable descendant classes.
  • New TDragObject properties AlwaysShowDragImages and RightClickCancels
  • New TDragDockObject properties EraseDockRect and EraseWhenMoving
  • New classes TCustomControlAction, TControlAction, TCustomTransparentControl, TColorListBox, TTrayIcon
  • Many new methods on TControlActionLink for binding to additional properties on TControls
  • New Control States: csDesignerHide, csPanning, csRecreating, csAligning
  • New Control Styles: csPannable (mousewheel support), csAlignWithMargins
  • New events published throughout VCL: OnMouseActivate, OnMouseEnter and OnMouseLeave now with reliable enter/leave detection
  • New events on TWinControl OnAlignInsertBefore and OnAlignPosition for use with alCustom alignment style
  • New TWinControl property MouseInClient
  • New TDragImageList property DragHotSpot
  • New TDockZone property ChildControl
  • TDockTree has many new methods for better mouse support
  • Improved double buffered painting performance
  • Updated appearance with gradient painting support for TControlBar
  • New events on TControlBar BeginBandMove/EndBandMove
  • New properties on TControlBar CornerEdge, DrawingStyle, GradientDirection, GradientStartColor and GradientEndColor
  • New property on TColorBox: OnGetColors
  • New properties on TCustomForm: PopupMode, PopupParent
  • New properties on TScreen: CursorCount, FocusedForm, SaveFocusedList, PrimaryMonitor
  • New properties on TApplication: ActionUpdateDelay, ActiveFormHandle, MainFormHandle, MainFormOnTaskbar, ModalLevel, ModalPopupMode, PopupControlWnd
  • New events on TApplication: OnGetActiveFormHandle, OnGetMainFormHandle
  • Improved drawing support meaning less flicker for many controls throughout VCL
  • Constants for standard web colors added to Graphics.pas
  • RGB conversion routines for working with web colors/color names
  • New Pen Styles: psUserStyle, psAlternate
  • New property on TFont: Orientation
  • Enumerator support on numerous classes throughout VCL for use with "for...in"
  • New property on TOleControl: ServiceQuery
  • New action: TBrowseForFolder
  • New property on TLabel: EllispsisPosition
  • New property on TComboBox: AutoCompleteDelay
  • New property on TListBox: AutoCompleteDelay
  • New properties/events on TTabSet: Images, ShrinkToFit, TabPosition, OnGetImageIndex
  • Numerous ActionBand menu enhancements
To elaborate on Nick's FastCode mention there is the following on the RTL side:
  • New high performance memory manager
  • FastCode routines:
    • Move
    • _FillChar
    • _LStrCmp
    • Pos
    • __lldiv
    • UpperCase
    • LowerCase
    • CompareStr
    • CompareMem
    • CompareText
    • StrLen
    • StrCopy
    • StrComp

  • Numerous inlined routines throughout the RTL
[Update: Mar 2, 2007] Fixed typo.
 Thursday, February 08, 2007

Delphi IDE and RTL/VCL performance improvements

Posted @ 11:12PM by Steve Trefethen

Categories: Delphi | Performance | RTL | VCL

Tags:  |  |  | 

Lately, there's been a lot of effort put into improving the Delphi IDE's UX and I wanted to comment briefly that in the past week alone we've made some great progress. For example, there have been recent improvements in:

  • IDE flicker (now nearly flicker free)
  • Desktop switching performance
  • GDI resource management
  • Moving controls on the form designer via the keyboard
  • Form designer grid repaint issues
  • Compiler time stamp access (thanks to Andreas Hausladen)
  • VCL control painting (thanks to Pierre le Riche)
  • VCL control data handling performance
  • FastCode routines added to the RTL (btw, a huge thanks to the whole FastCode crew who contribute to this great project benefiting us all)
One of the best things about a number of these fixes is that they're in the RTL/VCL so your applications will benefit as well. Btw, several of them came from QC so it definitely pays off to get your bugs logged. Anyway, we're cranking away and there's more to come but I'm pleased with the progress and thought it was worth mentioning.
 Sunday, December 24, 2006

Delphi color conversion routines in GraphUtil.pas

Posted @ 9:48PM by Steve Trefethen

Categories: Delphi | RTL

Tags:  | 

I read Zarko Gajic's delphi.about.com and he frequently publishes interesting articles related to Delphi. He does a great job supplying the Delphi community with a constant stream of useful programming tips. His latest post Convert Delphi's TColor to HTML Color Value has a great tip about converting color values. After reading this post it dawned on me that I've never mentioned the routines we've added to the Delphi RTL for converting colors. We also added TColor values for all of the named web colors.

You can find all of these routines in GraphUtil.pas.

{ Converts a TColor to a Web color constant like #FFFFFF }
function ColorToWebColorStr(Color: TColor): string;

{ Converts a TColor to a Web color name, returns a Web color value if the color is not a match. }
function ColorToWebColorName(Color: TColor): string;
function WebColorToRGB(WebColor: Integer): Integer;
function RGBToWebColorStr(RGB: Integer): string;
function RGBToWebColorName(RGB: Integer): string;

{ Converts a Web color name to its TColor equivalent, returns clNone if no match }
function WebColorNameToColor(WebColorName: string): TColor;

{ Converts a web style color string (#FFFFFF or FFFFFF) to a TColor }
function WebColorStrToColor(WebColor: string): TColor;

 Monday, May 01, 2006

ISAPI Thread Pool for use in Delphi WebBroker applications

Posted @ 8:59AM by Steve Trefethen

Categories: Delphi | RTL

Tags:  | 

Quoted:
"...but our perception and wall-clock timing tells us there is at least a 300% increase in speed, if not more."
-Dan Miser
DistribuCon
I don't recall mentioning the ISAPIThreadPool unit here and recently Allen pointed out a Borland public newsgroup post where a customer was talking about the dramatic performance difference between his PHP application and his Delphi Webbroker application. In the post he mentioned:
to have high speed I have pooled connections using a threadvar, every IIS thread has one datamodule with opened connection
If I understand this correctly the above is unnecessary and instead this developer should leverage the ISAPIThreadPool unit available with Delphi as well as from CodeCentral. The ISAPIThreadPool unit leverages the technologies discussed in the following documents (also mentioned in the source code): A few key points:
  • ISAPIThreadPool.pas should be included in your webbroker DPR at the end of the uses clause as it reimplements GetExtensionVersion, HttpExtensionProc and TerminateExtension.
  • This unit is only useful for applications running on Microsoft's web server (IIS).

Dan Miser has also mentioned this unit on his blog. Thanks Dan!