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

#include <vcl.h>
#pragma hdrstop

#include "ShortCutToText.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: ShortCutToText
// Routine: Menus.ShortCutToText

// BeginCode
/*
This line creates a shortcut, Ctrl+O, at run time and
assigns it to the Open command on a File menu.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Edit1->Text = ShortCutToText(OpenCommand->ShortCut);}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  OpenCommand->ShortCut =
    ShortCut(Word('O'), TShiftState() << ssCtrl);
}

void __fastcall TForm1::OpenCommandClick(TObject *Sender)
{
  MessageDlg(
	"The Open command has been selected.",
	mtInformation,
	TMsgDlgButtons() << mbOK,
	0);
}
// EndCode
// EndExample: ShortCutToText
//---------------------------------------------------------------------------
