{ ------------------------------------------------------------- }
{ Purpose : Next Standard 6                                     }
{ By      : Bojan Nikolic                                       }
{ For     : BergSoft                                            }
{ ------------------------------------------------------------- }
{ Copyright (C) BergSoft.net 2015. All Rights Reserved.         }
{ ------------------------------------------------------------- }
{$I NxSuite6.inc}

unit NxNotifications6;

interface

uses
  { Standard }
  Classes, Types, Messages, Windows, Graphics, ExtCtrls,
  { Controls }
  Controls, StdCtrls,
  {$IFDEF UI_TYPES}UITypes,{$ENDIF}
  SysUtils;

type
  { Types }
  TPropertiesArray = array of string;

  { Register notifications }
  procedure ScaleNotification(Sender: TObject; Properties: TPropertiesArray);
//procedure StyleNotification(Sender: TObject);

  procedure ScaleSubscribers;

var
  { Global vars }
  AutoScale: Boolean = False;

implementation

type
  { TNxScallingInfo }

  TNxScallingInfo = class
  private
    FSender: TObject;
    FProperties: TPropertiesArray;
  public
    constructor Create(Sender: TObject; Properties: TPropertiesArray);
  end;

var
  ScaleNotifyList: TList;

procedure ClearNotifications;
var
  i: Integer;
  Ref: TNxScallingInfo;
begin
  for i := 0 to Pred(ScaleNotifyList.Count) do
  begin
    Ref := TNxScallingInfo(ScaleNotifyList[i]);
    FreeAndNil(Ref);
  end;
  FreeAndNil(ScaleNotifyList);
end;

procedure ScaleNotification(Sender: TObject; Properties: TPropertiesArray);
var
  Info: TNxScallingInfo;
begin
  if ScaleNotifyList = nil then ScaleNotifyList := TList.Create;
  Info := TNxScallingInfo.Create(Sender, Properties);
  ScaleNotifyList.Add(Info);
end;

procedure ScaleSubscribers;
begin

end;

{ TNxScallingInfo }

constructor TNxScallingInfo.Create(Sender: TObject; Properties: TPropertiesArray);
begin
  FSender := Sender;
  FProperties := Properties;
end;

initialization

finalization

if Assigned(ScaleNotifyList)
  then ClearNotifications;

end.
