//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TAppHint.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
TForm1 *Form1;

__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}

// BeginExample: TAppHint
// Property: Forms.TApplication.Hint
// Event: Forms.TApplication.OnHint
// Routine: Controls.GetLongHint

// BeginCode
/*
Note:	It is not actually necessary to write an OnHint
event handler to display hints on the status bar. This can
be accomplished more simply by setting the status bar’s
AutoHint property and SimplePanel property.
This shows how the OnHint event handler is declared as a
public method of the form.
*/

/*
Here is the code to add to the unit file.  It provides the
implementation of the DisplayHint method and assigns it to
the Application in the form’s OnCreate event handler.
Note:	It is not actually necessary to write an OnHint event
handler to display hints on the status bar. This can be
accomplished more simply by setting the status bar’s AutoHint
property.
*/
void __fastcall TForm1::DisplayHint(TObject *Sender)
{
  StatusBar1->SimpleText = GetLongHint(Application->Hint);
}

// Here is the form’s OnCreate event handler.
// It assigns the application’s OnHint event handler at
// runtime because the Application is not available in the
// Object Inspector
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Application->OnHint = DisplayHint;
}
// EndCode
// EndExample: TAppHint
//---------------------------------------------------------------------------
