Multi-Line Captions for TLabel, TPanel and Buttons. Delphi VCL and FireMonkey

Implement multi-line captions in Delphi for TPanel, Tlabel and buttons (TButton, TSpeedButton, TBitBtn)

This is native Delphi code.  You don’t need to hack the form’s text file

VCL and FireMonkey source code is included

multi_line_controls

Continue reading “Multi-Line Captions for TLabel, TPanel and Buttons. Delphi VCL and FireMonkey”

Using a reserved word as an identifier (variable name, class name etc) in Delphi

AKA Silly Delphi Party Tricks #1

Is it possible to use a reserved word as an identifier ?
For example – I want to name my variable or class “BEGIN” because, ummm, well I dont know just because.

Yes you can.  Simply prefix the the name with an ampersand “&” escape character like this

var
   &begin  : integer;  // begin is a reserved word
begin
   &begin  := 123;
end;

Continue reading “Using a reserved word as an identifier (variable name, class name etc) in Delphi”

Conditional compilatation to detect VCL or FireMonkey in a Delphi Form

This shows how to detect if your application is using FireMonkey (FMX) or VCL when using conditional compilation within a Delphi form unit.

UPDATE – a better solution has been provided by a Rudy Velthuis.  I recommend to use that instead of my original post.  Ive provided examples based on his feedback.  Thanks Rudy

Continue reading “Conditional compilatation to detect VCL or FireMonkey in a Delphi Form”

List of Delphi controls on a form – Tree hierarchy and flat list (FireMonkey)

Get a list of all controls in your Delphi FireMonkey (FMX) form .

Examples included a flat list and a hierarchical “tree” list

Continue reading “List of Delphi controls on a form – Tree hierarchy and flat list (FireMonkey)”

Change Delphi control values without change events firing (VCL and FMX)

Change a Delphi field value without the change events firing (OnChange)

Sometimes you want to change the value of a Delphi control without its change event firing.

For example, when your application starts up and you are initializing control values.  The rest of the application isn’t setup yet so you might not want the control change event firing and executing other code.

Ill show you how to do it with just one line of code using my custom unit for VCL and Firemonkey

changeeventsdisable1

Continue reading “Change Delphi control values without change events firing (VCL and FMX)”

Converting Delphi Angles between Degrees, Radians and X/Y

If you need to convert angles in Delphi between degrees (0 – 360), radians and X/Y coordinates you have come to the right place.  Ill show you how to do it in just one line of code, two if you count the USES entry

angle_conversions

Continue reading “Converting Delphi Angles between Degrees, Radians and X/Y”