1. Home
  2. Computing & Technology
  3. Delphi Programming

New OOP Features in Delphi

Delphi programming language is packed with features to help you make robust OOP style applications. If you are still using Delphi 7 (and prior) you might be missing some really nice language constructs.

Dive into new advanced features!

Delphi Programming Spotlight10

Zarko's Delphi Programming Blog

A Custom Message Dialog with Standard Windows Icons

Thursday December 23, 2010
in Delphi TIPS :: I needed to create my own customized "MessageDlg" message box with custom buttons, but I still wanted to have access to those spiffy icons that appear when you specify "mtInformation, mtConfirmation..." as the MessageDlg message type. After searching all over for icons on the web (and not finding anything suitable), I dug around in the Windows SDK help and cam across the LoadIcon API function.

Read the full article to learn how to Create a Custom Message Dialog with Standard Windows Icons

Related:

Holiday Greetings With Windows Regions - Stars

Tuesday December 21, 2010
in Forms and Shapes :: Rectangles are boring. Here's an article describing windows regions and explaining how to use them to produce a star-shaped form. Stars display "Happy Christmas" in various languages.

Read the full article to learn how to Create Star Shaped Forms

Related:

Is NOT Having a Default Value For a Property a BUG?

Monday December 20, 2010
in Do Properties Dream Of Default Values? :: In the Do Properties Dream Of Default Values? post I have asked you "Do all properties of an object have a default value?".

The results so far (some 2 weeks after the poll has been posted) are, at least for me, strange:

48% answered "YES"
37% answered "NO"
13% answered "I do not know"

I guess the problem here, if there is a problem, is what is meant by a "default property value"?

Picture a class you can instantiate to have an object. The object exposes properties and methods. Never mind the language the class was developed in. Be it Delphi, C++, .Net or whatever. But do mind the fact that you can use it (the class) from Delphi.

For me, the meaning of "default value" is the following: When I first read (get) the value of the property, after instantiating the object, what I receive (from the object) is for me the default value of the property..

Let's say there's a boolean property "OpenInDefaultProgram" for an object that has a method "Save". Let's say the object can "export" your report in various formats: doc, pdf, txt, rtf ... Once the report has been generated and saved, the value of the "OpenInDefaultProgram" determines should the associated application for the selected file type be started (and document loaded).

No, the Save method does not have a parameter "openInDefaultProgram" - it relies on the value of the "OpenInDefaultProgram" property.

Back to "property default value and does every property have a default value" ... if, when I read the OpenInDefaultProgram, sometimes I receive false and sometimes I receive true - this for me is a BUG.

Of course, never mind the type of the property be it string, int, enumeration or whatever.

For me, there's always a "default" value for a property - but if it is not consistent (always the same "get" value) - it's a bug. Would you agree?

Formatting a File Size in Bytes for Display - Convert Bytes to Delphi String (KB, MB, GB)

Friday December 17, 2010
in Delphi TIPS :: When working with files from Delphi you might want to display the size of a file to the user in a Explorer-like format where the file size is not displayed in bytes - but the display depends on the size of the actual file.

Read the full article to learn how to Format a File Size in Bytes for Display

Related:

Discuss in my Forum

About.com Special Features

Pick the Perfect Computing Gift

What fun is Christmas without a new toy? We have suggestions at every price point. More

Extras to Make 'em Smile

Five stocking stuffers any computer user would love to wake up to. More

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2010 About.com, a part of The New York Times Company.

All rights reserved.