How to do it...

  1. Copy the Do not block main thread! recipe into a new folder.
  2. Open the project and save it as WeatherForecastsEx.dproj.
  3. Change the code, as shown in the following steps.
  4. In the private section of the form declaration, add the following methods:
  private 
    Lang: string; 
    procedure AddFooter(AItems: TAppearanceListViewItems; 
      const LMinInTheDay, LMaxInTheDay: Double); 
    procedure AddHeader(AItems: TAppearanceListViewItems;  
const ADay: String); 
    procedure AddForecastItem(AItems:  
      TAppearanceListViewItems; 
      const AForecastDateTime: TDateTime;  
      const AWeatherDescription: String; 
      const ATempMin, ATempMax: Double); 
  1. Press Ctrl + Shift + C to create the method bodies, and then add the following code:
procedure TMainForm.AddHeader(AItems: ...

Get Delphi Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.