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

#include <vcl.h>
#pragma hdrstop

#include "TCustomFormMenu.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TCustomFormMenu
// Property: Forms.TCustomForm.Menu
// Routine: Menus.NewMenu
// Routine: Menus.NewItem
// Routine: Menus.TextToShortCut

// BeginCode
/*
This code displays a new menu named MyMenu when the user
clicks the button. MyOnExecute must be included in the
definition of the TForm1 class.  Click on the menu item
or type "Ctrl+N" to execute MyOnExecute.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TMenuItem *Item1 = NewItem("New item", TextToShortCut("Ctrl+N"), false, true, MyOnExecute, 0, "Item1");
  Menu = NewMenu(this, "MyMenu", &Item1, 0);
}

void __fastcall TForm1::MyOnExecute(TObject *Sender)
{
  MessageDlg("Item1 has been executed.", mtInformation, TMsgDlgButtons() << mbOK, 0);
}
// EndCode
// EndExample: TCustomFormMenu
//---------------------------------------------------------------------------
