Скачиваний:
19
Добавлен:
01.05.2014
Размер:
1.52 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit3.h"
#include "Main.h"
#include "ChildWin.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
AnsiString gap;
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
	: TForm(Owner)
{
	gap = "                                                                                                  ";
}
//---------------------------------------------------------------------------

void __fastcall TForm3::FormCreate(TObject *Sender)
{
	RichEdit1->Lines->Clear();

	getShortCuts(MainForm->ActionList1);

    TfrmMDIChild *frm = dynamic_cast<TfrmMDIChild*>(MainForm->ActiveMDIChild);
	if (frm)
    	getShortCuts(frm->ActionList1);
}
//---------------------------------------------------------------------------

void __fastcall TForm3::getShortCuts(TActionList* actl)
{
	for (int i = 0; i < actl->ActionCount; i++) {
		TAction *act = dynamic_cast<TAction*>(actl->Actions[i]);
        AnsiString str = ShortCutToText(act->ShortCut);
        if (str != "") {
    	    AnsiString sth = act->Hint + gap;
            sth.Delete(35, sth.Length()-35);
        	RichEdit1->Lines->Add(sth + "\t" + str);
        }
    }
}
//---------------------------------------------------------------------------
Соседние файлы в папке Sources