//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma link "RichView"
#pragma link "RVScroll"
#pragma link "RVStyle"
#pragma link "RVTable"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  rv->AddNLWTag("Virtual Greengrocery",0,1,0);
  rv->AddNLWTag("",0,1,0);
  TRVTableItemInfo*table = new TRVTableItemInfo(2,2,rv->RVData);
  table->BorderColor = clSilver;
  table->BorderStyle = rvtbColor;
  table->BorderWidth = 2;

  table->Cells[0][0]->Clear();
  table->Cells[1][0]->Clear();
  table->Cells[0][1]->Clear();
  table->Cells[1][1]->Clear();
  table->Cells[0][0]->AddNLWTag("Select fruits:",0,0,0);
  table->Cells[1][0]->AddNLWTag("Select vegetables:",0,0,0);
  table->Cells[0][0]->BestWidth = 200;
  table->Cells[0][1]->BestWidth = 120;
  table->CellPadding = 5;
  table->ParaNo = 1;

  TRVComboItemInfo*item = new TRVComboItemInfo(rv->RVData, 1, "");
  item->MinWidth = 100;
  item->Items->Add("apple");
  item->Items->Add("banana");
  item->Items->Add("pear");
  table->Cells[0][1]->AddItem("", item);

  item = new TRVComboItemInfo(rv->RVData, 1, "");
  item->Items->Add("cucumber");
  item->Items->Add("tomato");
  item->MinWidth = 100;
  table->Cells[1][1]->AddItem("", item);
  rv->AddItem("", table);
  rv->AddNLWTag("(click the gray square to select)",0,1,0);
  rv->Format();
}
//---------------------------------------------------------------------------