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

#include <vcl.h>
#pragma hdrstop

#include "SimplePanel.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: SimplePanel
// Property: ComCtrls.TCustomStatusBar.SimplePanel
// Property: ComCtrls.TCustomStatusBar.SimpleText
// Method: Classes.TStrings.Add

// BeginCode
/*
This example adds text to a TRichEdit and to a StatusBar.
This example requires no additional controls. All controls are
created dynamically within the form's OnCreate event handler.
Note: Be sure to add ComCtrls to your uses clause to support 
TRichEdit.
*/

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TStatusBar *status = new TStatusBar(this); // The owner will clean this up.
  // Display the StatusBar control on the surface
  // of the form.
  status->Parent = this;
  // Allow a single line of text -- no panels.
  status->SimplePanel = true;
  // Provide sample text.
  // Create a new instance of TRichEdit, set its
  // properties, and display on the form.
  TRichEdit *rich = new TRichEdit(this);  // The owner will clean this up.
  // Display the RichEdit control on the surface
  // of the form.
  rich->Parent = this;
  // The RichText control takes all space left
  // over from the StatusBar.
  rich->Align = alClient;
  // Add 50 lines to the RichText
  for (int i = 1; i <= 50; i++)
	rich->Lines->Add(AnsiString("This is line ") + IntToStr(i));
  rich->SelStart = 0; // set text cursor to first character
  status->SimpleText = IntToStr(rich->Lines->Count) + " Lines loaded";
}
// EndCode
// EndExample: SimplePanel
//---------------------------------------------------------------------------
