Tag Archives: user-interface

Coding a Game of Memory in Delphi – The User Interface

Delphi Memory game in actionIn my previous post, Coding a Game of Memory in Delphi – OOP Model, I’ve been developing the model, aka the back end, for the Memory (Match Up, Concentration, …) game. The idea was to separate the game logic from the user interface (aka the front end). As a result a few classes were introduced: TPlayer, TField and, of course, the main class/object TMemoryGame implementing all the code required to run the game.

Having only the model does not help us much if we actually want to play the game. Therefore, this time, we go into building the user interface in Delphi.

Since the TMemoryGame class is framework agnostic (and not platform specific), it is up for you to decide if you would like to do a classic Windows VCL application, a FireMonkey Android mobile game or something that works on a Mac. To make it quick and simple, I’ll go old-style VCL school.
Continue reading

Generic Solution to Coloring the Focused Entry Control in Delphi Applications

Coloring Focused Entry Control
Looking for the best approach to change the background color (and other properties) of the focused data entry control in a Delphi (VCL) application?

By (Windows) design, the control on a data entry form which has the input focus is not drawn (/highlighted) differently from other controls (i.e. those without the input focus). In case of the TEdit (or TMemo and alike) control, only the blinking insertion point is displayed.

To provide visually more attractive user-friendly interfaces for your Delphi applications, you could decide to change the background color (and maybe some other properties) of the currently selected control – the one that has the input focus. Of course, this would include restoring to the original background color when the focus shifts to another control.
Continue reading