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

#include <vcl.h>
#pragma hdrstop

#include "AutoPopup.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: AutoPopup
// Property: Menus.TPopupMenu.AutoPopup
// Method: Menus.TPopupMenu.Popup

// BeginCode
/*
This example uses a pop-up menu. When the user presses the
mouse button, the pop-up menu appears where the user
clicked the mouse:
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  PopupMenu1->AutoPopup = false;
}

void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y)
{
  PopupMenu1->Popup(Left + X, Top + Y);
}
// EndCode
// EndExample: AutoPopup

void __fastcall TForm1::Hereis1Click(TObject *Sender)
{
  ListBox1->Items->Add("'Here is' popup menu");
}

void __fastcall TForm1::menu1Click(TObject *Sender)
{
  ListBox1->Items->Add("'menu' popup menu");
}

void __fastcall TForm1::popup1Click(TObject *Sender)
{
  ListBox1->Items->Add("'popup' popup menu");
}

void __fastcall TForm1::your1Click(TObject *Sender)
{
  ListBox1->Items->Add("'your' popup menu");
}
//---------------------------------------------------------------------------
