//--------------------------------------------------------------------------- #pragma hdrstop #include #include "tchar.h" #include "Define.h" #include "ShortcutDefine.h" //--------------------------------------------------------------------------- // String Table TStringTable FileShortcutTable; TStringTable EditShortcutTable; TStringTable NomalShortcutTable; TStringTable MenuOpenShortcutTable; TStringTable WindowShortcutTable; TStringTable MoveCopyShortcutTable; TStringTable ColorChangeShortcutTable; TStringTable ClearShortcutTable; TStringTable GroupingShortcutTable; TStringTable RepeatShortcutTable; TStringTable DrawShortcutTable; TStringTable ProportionShortcutTable; TStringTable FillShortcutTable; TStringTable VectorShortcutTable; //--------------------------------------------------------------------------- #pragma package(smart_init) //--------------------------------------------------------------------------- int __fastcall CheckTheMenu(int Key) { for (int i=0; i<29; i++) { if (i<5 && Key==StrToInt(FileShortcutTable[i])) return C_FILE; else if (i<3 && Key==StrToInt(EditShortcutTable[i])) return C_EDIT; else if (i<10 && Key==StrToInt(NomalShortcutTable[i])) return C_NOMAL; else if (i<12 && Key==StrToInt(MenuOpenShortcutTable[i])) return C_MENUOPEN; else if (i<12 && Key==StrToInt(WindowShortcutTable[i])) return C_WIN; else if (i<14 && Key==StrToInt(MoveCopyShortcutTable[i])) return C_MOVECOPY; else if (i<5 && Key==StrToInt(ColorChangeShortcutTable[i])) return C_COLOR; else if (i<4 && Key==StrToInt(ClearShortcutTable[i])) return C_CLEAR; else if (i<5 && Key==StrToInt(GroupingShortcutTable[i])) return C_GROUP; else if (i<10 && Key==StrToInt(RepeatShortcutTable[i])) return C_REPEAT; else if (i<7 && Key==StrToInt(DrawShortcutTable[i])) return C_DRAW; else if (i<4 && Key==StrToInt(ProportionShortcutTable[i])) return C_REPRO; else if (i<3 && Key==StrToInt(FillShortcutTable[i])) return C_FILL; else if (i<29 && Key==StrToInt(VectorShortcutTable[i])) return C_VECTOR; } return C_NONE; } //--------------------------------------------------------------------------- void __fastcall MakeStringByNumber(int Key, Char *rString) { String temp, tString; if (Key/100000==1) {tString = "Alt + "; Key-=100000;} if (Key/10000==1) {tString = tString + "Shift + "; Key-=10000;} if (Key/1000==1) {tString = tString + "Ctrl + "; Key-=1000;} Key = Key%1000; if (Key >= 48 && Key <= 57) { // 0 ~ 9 temp = IntToStr(Key-48); } else if (Key >= 65 && Key <=93) { // A ~ Z temp = (Char)Key; } else if (Key >= 112 && Key <= 123) { // F1 ~ F12 temp = ("F" + IntToStr(Key-111)); } else if (Key == 189) { // _ : 189 temp = "\"-\""; } else if (Key == 187) { // = : 187 temp = "\"+\""; } else if (Key == 27) { // Esc temp = "Esc"; } tString = tString + temp; _tcscpy(rString, tString.c_str()); } //---------------------------------------------------------------------------