#include "TMenu.h" #include "gvalue.h" #include "gType.h" #include "GraphLow.h" #include "GraphBase.h" #include "GlobalString.h" #include "ImageData.h" #define Icon16_Up 1 #define Icon16_Down 2 #define MainShowFont 24 #define SubShowFont 24 #define SubShowHeight 32 #define SubTextLeft 24 static const unsigned char SavePassWord[32] = "9910232250266023\0"; /* const char StrMainMenuName[28] = {"系统设置"}; const char StrMainMenu[8][20] = { "设备注册", "设备定义", "联动公式", "网络设置", "工作模式", "密码设置", "其他设置", "清除故障从机" }; const char StrSubMenuItem[48][40] = { //0 "设备追加注册", "全部更新注册", "板卡更新注册", "手动增加设备", "手动减少设备", //5 "总线设备定义", "手动盘定义", "多线盘定义", "广播/电话盘定义", "联网控制器定义", "自定义设备类型", "回路注释定义", "工程名称", //13 "新建联动公式", "修改联动公式", "删除联动公式", //16 "本机地址设置", "通讯板设置", //18 "调试模式设置", "广播同步设置", "预警功能设置", "火警输出设置", "接地检查设置", "显示盘静音设置", "控制器静音设置", "声光报警器反馈设置", //26 "权限I级密码设置", "权限II级密码设置", "权限III级密码设置", "权限IV级密码设置-最高", "气体密码设置", //31 "定点调试", "数字化设备调试", "修改设备编码", "重码检测", "探测器污染补偿", "探测器清洗修正", "REV0", "REV1", "REV2", "REV3" //41 }; */ const char StrMainMenuName[28] = {"系统设置"}; const char StrMainMenu[12][36]={ //"1.操作权限登录", "1.本机", "2.历史事件", "3.工程", "4.回路", "5.手动控制盘", "6.联动", "7.局域网", "8.数据传输", "9.高级设计", "*,--------", "*,--------" }; const char StrMainMenuEn[12][36]={ //"1.操作权限登录", "1.Local Machine", "2.Histroy Message", "3.Project", "4.Loop", "5.App Keypad Boards", "6.Linkage", "7.LAN", "8.Data Transfer", "9.Data Setting", "*,--------", "*,--------" }; //const xxxx MenuActionList_0[4] ={ActLoginII, ActLoginIII, ActLoginIV, Null0}; //const char StrSubMenu_0 [SubItemCount_0] [32]={ //"权限登录", 1111_ 1=allow 0=NotAllow S=BySet // "1110_1.II级权限登录", // "1110_2.III级权限登录", // "1110_3.退出登录", //}; //const xxxx MenuActionList_1[12] ={ActQueDevice, ActQueRegAddr, ActQueMaskDevice, ActQueConfig, ActQueInterLink, ActQueInterLink4Pad, ActQueNetwork, Null1}; const char StrSubMenu_0 [SubItemCount_0] [SubItemTextLen]={ //"查询信息", 1111_ 1=allow 0=NotAllow S=BySet /*"S110_1.注册信息", "S110_2.设备状态", "S110_3.屏蔽部件", "S110_4.注释信息", "S110_5.本机配置", "S110_6.网络配置", "S110_7.联动编程", "S110_8.总线盘编程", "S110_9.多线盘配置信息",*/ "1110_1.硬件", "1110_2.电源", "1110_3.打印机", "0110_4.日期时间", "1110_5.密码", "1110_6.屏保", "1110_7.语言/Language" }; const char StrSubMenu_0_En [SubItemCount_0] [SubItemTextLen]={ //"查询信息", 1111_ 1=allow 0=NotAllow S=BySet /*"S110_1.注册信息", "S110_2.设备状态", "S110_3.屏蔽部件", "S110_4.注释信息", "S110_5.本机配置", "S110_6.网络配置", "S110_7.联动编程", "S110_8.总线盘编程", "S110_9.多线盘配置信息",*/ "1110_1.Hardware", "1110_2.Power Suppy Info", "1110_3.Printer", "0110_4.Date and time", "1110_5.Password", "1110_6.Screen Saver", "1110_7.Language/语言" }; //const xxxx MenuActionList_2[12] ={ActQueMsgAll, ActQueMsgAlarm, ActQueMsgInterLink, ActQueMsgFault, ActQueMsgOperator, ActQueMsgMonitor, Null2}; const char StrSubMenu_1 [SubItemCount_1] [SubItemTextLen]={ //"查询历史记录", 1111_ 1=allow 0=NotAllow S=BySet /*"S110_1.全部事件", "S110_2.火警事件", "S110_3.联动事件", "S110_4.故障事件", "S110_5.操作事件", "S110_6.监管事件", "S110_7.打印事件"*/ "1110_1.全部事件", "1110_2.报警事件", "1110_3.联动事件", "1110_4.监管事件", "1110_5.故障事件", "1110_6.操作事件", "1110_7.打印事件" }; const char StrSubMenu_1_En [SubItemCount_1] [SubItemTextLen]={ //"查询历史记录", 1111_ 1=allow 0=NotAllow S=BySet /*"S110_1.全部事件", "S110_2.火警事件", "S110_3.联动事件", "S110_4.故障事件", "S110_5.操作事件", "S110_6.监管事件", "S110_7.打印事件"*/ "1110_1.All", "1110_2.Alarm", "1110_3.Linkage", "1110_4.Supervision", "1110_5.Fault", "1110_6.Operation", "1110_7.Print" }; //const xxxx MenuActionList_3[12] ={ActQueValue, ActQueMsgAlarm, ActQueMsgInterLink, ActQueMsgFault, ActQueMsgOperator, ActQueMsgMonitor, Null3}; const char StrSubMenu_2 [SubItemCount_2] [SubItemTextLen]={ //"通用设置", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.工程信息", "1110_2.维保提醒", "1110_3.运行模式", "1110_4.系统授权", "1110_5.设计数量", "1110_6.按回路查询模块输出检线", //"1110_6.批量设置模块输出检线", "1110_7.按回路查询烟感灵敏度", //"1110_7.批量设置烟感灵敏度", "1110_8.按回路查询声光", //"1110_8.批量设置声光", "1110_9.层显信息下载", }; const char StrSubMenu_2_En [SubItemCount_2] [SubItemTextLen]={ //"通用设置", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.Information", "1110_2.Maintenance", "1110_3.Operating State", "1110_4.System Authorized", "1110_5.Designed Numbers", "1110_6.Output Line Inspection", "1110_7.Smoke Det Sensitivity", "1110_8.Acoustooptic Parameter", "1110_9.Floor Display KeyPad Cfg", }; //const xxxx MenuActionList_4[12] ={ActDeviceSetup, guiQueMsgAlarm, guiQueMsgInterLink, guiQueMsgFault, guiQueMsgOperator, guiQueMsgMonitor, Null4}; const char StrSubMenu_3 [SubItemCount_3] [SubItemTextLen]={ //"系统调试", 1111_ 1=allow 0=NotAllow S=BySet /*"0010_1.探测器模拟曲线", "0010_2.回路设备运行状态", "0010_3.回路设备实时数据", "0010_4.回路设备在线配置", "0010_5.回路设备运行电压", "0010_6.回路设备手动启动", "0S10_7.回路设备状态", "0010_8.回路重号检测", "0010_9.设备地址变更", "0010_0.模拟运行与操作"*/ "1110_1.注册数据", "1110_2.状态总览", "1110_3.部件数据", "1110_4.部件控制", "1110_5.自动注册", "1110_6.手动注册", "1110_7.部件屏蔽", "1110_8.重码检测", "1110_9.部件分类数量", "1110_0.注释编辑" }; const char StrSubMenu_3_En [SubItemCount_3] [SubItemTextLen]={ //"系统调试", 1111_ 1=allow 0=NotAllow S=BySet /*"0010_1.探测器模拟曲线", "0010_2.回路设备运行状态", "0010_3.回路设备实时数据", "0010_4.回路设备在线配置", "0010_5.回路设备运行电压", "0010_6.回路设备手动启动", "0S10_7.回路设备状态", "0010_8.回路重号检测", "0010_9.设备地址变更", "0010_0.模拟运行与操作"*/ "1110_1.Registration Information", "1110_2.Overview", "1110_3.Device Information", "1110_4.Device Control", "1110_5.Auto Register", "1110_6.Manual Register", "1110_7.Device Blocking", "1110_8.Duplicate Addr Check", "1110_9.Device Types Count", "1110_0.Device Annotation" }; const char StrSubMenu_4 [SubItemCount_4] [SubItemTextLen]={ //"系统设置", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.手动控制盘信息", "1110_2.多线盘配置", "1110_3.总线盘配置" }; const char StrSubMenu_4_En [SubItemCount_4] [SubItemTextLen]={ //"系统设置", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.App Keypad Boards Info", "1110_2.Direct Keypad Boards Cfg", "1110_3.Bus Keypad Boards Cfg" }; const char StrSubMenu_5 [SubItemCount_5] [SubItemTextLen]={ //"系统安装", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.编程查询", "1110_2.编程输入", "1110_3.广播控制", "1110_4.手/自动控制状态", "1110_5.联动设备控制总线FECBUS", "1110_6.分区编辑", "1110_7.二次码编辑(按回路)", "1110_8.二次码编辑(按分区)" }; const char StrSubMenu_5_En [SubItemCount_5] [SubItemTextLen]={ //"系统安装", 1111_ 1=allow 0=NotAllow S=BySet "1110_1.Linkage Expressions List", "1110_2.Linkage Expressions Edit", "1110_3.Broadcast Config", "1110_4.Manual-Auto Switch", "1110_5.FECBus Setting", "1110_6.Zone Setting", "1110_7.Aux ID Setting(Loop)", "1110_8.Aux ID Setting(Zone)" }; const char StrSubMenu_6 [SubItemCount_6] [SubItemTextLen]={ //"网络设置" 1111_ 1=allow 0=NotAllow S=BySet "1110 1.组网信息", "1110_2.本机模式与注册", "1110_3.网络屏蔽", "1110_4.消防控制室图形显示装置" }; const char StrSubMenu_6_En [SubItemCount_6] [SubItemTextLen]={ //"网络设置" 1111_ 1=allow 0=NotAllow S=BySet "1110 1.Network Information", "1110_2.Local Setting", "1110_3.Network ID Mask", "1110_4.Graphic Display Setting" }; const char StrSubMenu_7 [SubItemCount_7] [SubItemTextLen]={ //本机 1=allow 0=NotAllow S=BySet "1110_1.在线调试", "0010_2.U盘传输", "0010_3.蓝牙连接", "0010_4.WIFI连接", "0010_5.传输装置", "0010_6.固件升级", }; const char StrSubMenu_7_En [SubItemCount_7] [SubItemTextLen]={ //本机 1=allow 0=NotAllow S=BySet "1110_1.Online Test", "0010_2.USB Disk Config", "0010_3.Blue Tooth", "0010_4.WIFI Setting", "0010_5.Transmission Setting", "0010_6.Firmware Upgrade", }; const char StrSubMenu_8 [SubItemCount_8] [SubItemTextLen]={ //高级设置 "0010_1.清除注册数据", "0010_2.清除联动编程", "0010_3.清除注释信息", "0010_4.恢复出厂设置" }; const char StrSubMenu_8_En [SubItemCount_8] [SubItemTextLen]={ //高级设置 "1110_1.Clear Registered Data", "1110_2.Clear Linkage Expressions", "1110_3.Clear All Descriptions", "1110_4.Restore Factory Setting" }; const char StrSubMenu_9 [SubItemCount_9] [SubItemTextLen]={ //"出厂设置, 隐藏", "0010_1.生产过程检验信息", "0010_2.清除全部配置信息", "0010_3.清除全部历史事件", }; const unsigned char SubMenuItem_Count[12] = { SubItemCount_0, SubItemCount_1, SubItemCount_2, SubItemCount_3, SubItemCount_4, SubItemCount_5, SubItemCount_6, SubItemCount_7, SubItemCount_8, SubItemCount_9, SubItemCount_0, SubItemCount_0 }; const char *const pPermissionText[MainItemCount] ={ &StrSubMenu_0[0][0], &StrSubMenu_1[0][0], &StrSubMenu_2[0][0], &StrSubMenu_3[0][0], &StrSubMenu_4[0][0], &StrSubMenu_5[0][0], &StrSubMenu_6[0][0], &StrSubMenu_7[0][0], &StrSubMenu_8[0][0], }; const unsigned short Main_Top[12] = { 56, 102, 148, 194, 240, 286, 332, 378, }; const unsigned short Main_Bottom[12] = { 98, 144, 190, 236, 282, 328, 374, 420, }; const unsigned short Sub_Top[16] = { // 320 / 8 / = 40, 56, 92, 128, 164, 200, 236, 272, 308, 344, 380 }; const unsigned short Sub_Bottom[16] = { // 320 / 8 / = 40, 88, 124, 160, 196, 232, 268, 304, 340, 376, 412 }; void TMenu::Init(int x1, int y1, int x2, int y2) { unsigned int i,j,x; //0 level BorderWidth = 2; BorderColor = 0x00343242; MainBound.Set(x1,y1,299,y2); SubBound.Set(300,y1,x2,y2); BevelOuter = bvRaised; if(BevelOuter == bvRaised){ MainContent.Set(x1 +1, y1 +1, 297, y2-2); SubContent.Set(301, y1 +1, 797, y2-2); }else{ MainContent.Set(x1 +2, y1 +2, 297, y2-2); SubContent.Set(301, y1 +2, 797, y2-2); } MainFontSize = 24; SubFontSize = 24; MainIndexOnTop = 0; SelectedMainIndex = 0; SelectedSubIndex = 0; LastMainIndex =0xFF; LastSubIndex =0xFF; ActiveLevel = 0; NeedRedraw =0; Active = 0; OnAction = 0; IsHasActive2 = 0; LoadText(); LoadPermission(0); } void TMenu::LoadText(void) { unsigned int i; //1 level for(i=0; iRender(16,Icon16_Up , MainFixLeft, MainTFixTop); IconList->Render(16,Icon16_Down, MainFixLeft, MainBFixTop); } }else{ RectFillRender(MainFixLeft, MainTFixTop, MainFixRight, MainTFixBottom, clFrmFace); RectFillRender(MainFixLeft, MainBFixTop, MainFixRight, MainBFixBottom, clFrmFace); } aIdx = MainIndexOnTop; for(i=0; i< MainShowCount; i++){ RectFillRender(MainIconLeft, Main_Top[i], MainIconRight, Main_Bottom[i], clFrmFace); if(SelectedMainIndex == aIdx){ VertLineRender(MainLeft, Main_Top[i], MainHeight-1, 0xFF808080); HorizLineRender(MainLeft, Main_Top[i], MainWidth-1, 0xFF808080); VertLineRender(MainLeft+1, Main_Top[i]+1, MainHeight-2, 0xFF404040); HorizLineRender(MainLeft+1, Main_Top[i]+1, MainWidth-2, 0xFF404040); VertLineRender(MainRight-1, Main_Top[i]+1, MainHeight-2, 0xFFD4D0C8); HorizLineRender(MainLeft+1, Main_Bottom[i]-1, MainWidth-2, 0xFFD4D0C8); VertLineRender(MainRight, Main_Top[i], MainHeight, 0xFFFFFFFF); HorizLineRender(MainLeft, Main_Bottom[i], MainWidth, 0xFFFFFFFF); if(ActiveLevel == 0){ if(IconList != nullptr)IconList->Render(24, 0, MainIconLeft ,Main_Top[i]+10); RectFillRender(MainConLeft, Main_Top[i]+2, MainConRight, Main_Bottom[i]-2, clMaroon); }else{ if(IconList != nullptr)IconList->Render(24, 9, MainIconLeft ,Main_Top[i]+10); RectFillRender(MainConLeft, Main_Top[i]+2, MainConRight, Main_Bottom[i]-2, clNearTeal); } TextRender_string24(MainConLeft+16, Main_Top[i]+12, MENU_SELECTED_TEXT_CLR, MainItemList[aIdx].fName); }else{ RectFillRender(MainLeft, Main_Top[i], MainRight, Main_Bottom[i], MENU_BG_COLOR); RectFillRender(MainIconLeft ,Main_Top[i]+10, MainIconRight, Main_Bottom[i], clFrmFace); TextRender_string24(MainLeft+10, Main_Top[i]+9, MENU_TEXT_CLR, MainItemList[aIdx].fName); } aIdx++; } } void TMenu::SubDraw(void) { #define SubShowCount 10 #define Sub_Sel_EN_BG_CLR clSkyBlue #define Sub_Sel_DIS_BG_CLR clLtGray #define Sub_EN_BG_CLR clTeal #define Sub_DIS_BG_CLR clOlive #define Sub_TEXT_Sel_EN_CLR clNearWhite #define Sub_TEXT_Sel_DIS_CLR clGray #define Sub_TEXT_EN_CLR clNearBlack #define Sub_TEXT_DIS_CLR clGray #define Sub_Static_CLR clGray #define Sub_Static_Text_CLR clOlive #define SubLeft 340 #define SubRight 780 #define SubIconLeft 308 #define SubIconRight 332 #define SubFixLeft 312 #define SubFixRight 328 #define SubTFixTop 40 #define SubTFixBottom 56 #define SubBFixTop 422 #define SubBFixBottom 438 #define SubSelRectLeft 332 #define SubSelRectRight 782 int i; unsigned int Tidx, Mid,Sid; unsigned int Lstart, Lend, aClr; if( (ActiveLevel != 0) && (ActiveLevel != 1) )ActiveLevel = 0; for(i=0; iRender(16,Icon16_Up , SubFixLeft, SubTFixTop); IconList->Render(16,Icon16_Down, SubFixLeft, SubBFixTop); } }else{ RectFillRender(SubFixLeft, SubTFixTop, SubFixRight, SubTFixBottom, clFrmFace); RectFillRender(SubFixLeft, SubBFixTop, SubFixRight, SubBFixBottom, clFrmFace); } Lstart = (SubShowCount - SubMenuItem_Count[SelectedMainIndex]) / 2; //sp = 0; Tidx = 0; Lstart = 0; for(i=Lstart; iRender(24,dIcon24_Allow1, SubIconLeft, Sub_Top[i]+6); RectFillRender(SubLeft, Sub_Top[i], SubRight, Sub_Bottom[i], aClr); TextRender_string24(SubLeft+6, Sub_Top[i]+6, clWhite, &SubItemList[SelectedMainIndex][Tidx].fName[5]); }else{ if(IconList != nullptr) IconList->Render(24,dIcon24_NotAllow1, SubIconLeft, Sub_Top[i]+6); RectFillRender(SubLeft, Sub_Top[i], SubRight, Sub_Bottom[i], aClr); TextRender_string24(SubLeft+6, Sub_Top[i]+6, clWhite, &SubItemList[SelectedMainIndex][Tidx].fName[5]); } }else{ if(SubItemList[SelectedMainIndex][Tidx].Enable){ if(IconList != nullptr) IconList->Render(24,dIcon24_Allow1, SubIconLeft, Sub_Top[i]+6); RectFillRender(SubLeft, Sub_Top[i], SubRight, Sub_Bottom[i], clTeal); TextRender_string24(SubLeft+6, Sub_Top[i]+6, clNearBlack, &SubItemList[SelectedMainIndex][Tidx].fName[5]); }else{ if(IconList != nullptr) IconList->Render(24,dIcon24_NotAllow1, SubIconLeft, Sub_Top[i]+6); RectFillRender(SubLeft, Sub_Top[i], SubRight, Sub_Bottom[i], clTeal); TextRender_string24(SubLeft+6, Sub_Top[i]+6, clNearBlack, &SubItemList[SelectedMainIndex][Tidx].fName[5]); } } Lend = Lstart + Tidx; Tidx++; }else{ break; } } /*if(Lstart >0){ if(SelectedMainIndex > 0){ //get prv MainIndex Mid = SelectedMainIndex - 1; Sid = SubMenuItem_Count[Mid] -1; for(i=Lstart-1; i>-1; i--){ if(Sid>0){ RectFillRender(SubLeft + 40, Sub_Top[i], SubRight, Sub_Bottom[i], clGray); TextRender_string24(SubLeft + 46, Sub_Top[i]+6, clNearBlack, &SubItemList[Mid][Sid].fName[5]); Sid--; } } } } if(Lend < SubShowCount){ if(SelectedMainIndex < (MainItemCount - 1)){ //get Next MainIndex Mid = SelectedMainIndex + 1; Sid = 0; for(i=Lend+1; i 3)return; Permisson = aPms; if( (aPms <1) || (aPms >3) ){ Permisson = 1; } BitX = Permisson -1; if(1){ for(j=0; jGuiLoginIIIShow(); PmsIntervene4Gui.Show4Gui(200, 200, 400, 140, 2); }else if(aPms == 3){ //aPanel->GuiLoginIIIShow(); PmsIntervene4Gui.Show4Gui(200, 200, 400, 140, 3); } } void TMenu::GoAction() { if(SelectedMainIndex == 0){ ActList_0 = static_cast(SelectedSubIndex); if(ActList_0_Call(ActList_0)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 1){ ActList_1 = static_cast(SelectedSubIndex); if(ActList_1_Call(ActList_1)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 2){ ActList_2 = static_cast(SelectedSubIndex); if(ActList_2_Call(ActList_2)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 3){ ActList_3 = static_cast(SelectedSubIndex); if(ActList_3_Call(ActList_3)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 4){ ActList_4 = static_cast(SelectedSubIndex); if(ActList_4_Call(ActList_4)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 5){ ActList_5 = static_cast(SelectedSubIndex); if(ActList_5_Call(ActList_5)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 6){ ActList_6 = static_cast(SelectedSubIndex); if(ActList_6_Call(ActList_6)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 7){ ActList_7 = static_cast(SelectedSubIndex); if(ActList_7_Call(ActList_7)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 8){ ActList_8 = static_cast(SelectedSubIndex); if(ActList_8_Call(ActList_8)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }else if(SelectedMainIndex == 9){ ActList_9 = static_cast(SelectedSubIndex); if(ActList_9_Call(ActList_9)){ ActiveLevel = 2; OnAction = 1; IsHasActive2 = 1; } }/*else if(SelectedMainIndex == 10){ ActList_10 = static_cast(SelectedSubIndex); if(ActList_10_Call(ActList_10)){ ActiveLevel = 2; } }*/ } void TMenu::CheckPermission() { int NeedPms; const char *p; char aPmsChar[4]; unsigned int OffsetCnt; unsigned int aVal; aVal = SelectedSubIndex; OffsetCnt = aVal * SubItemTextLen; p = pPermissionText[SelectedMainIndex]; p += OffsetCnt; aPmsChar[0] = static_cast(*p++); aPmsChar[1] = static_cast(*p++); aPmsChar[2] = static_cast(*p++); aPmsChar[3] = static_cast(*p++); if(aPmsChar[0] == '1'){ NeedPms = 1; }else if(aPmsChar[1] == '1'){ NeedPms = 2; }else if(aPmsChar[2] == '1'){ NeedPms = 3; }else{ NeedPms = 4; } if(SystemPermission < NeedPms){ if(NeedPms == 2){ IsBlockPermission = 1; PmsIntervene4Gui.Show4Gui(200, 200, 400, 140, 2); NeedingPermission = 2; }else if(NeedPms == 3){ IsBlockPermission = 1; PmsIntervene4Gui.Show4Gui(200, 200, 400, 140, 3); NeedingPermission = 3; } } } void TMenu::CheckSystemPermissionII() { unsigned int Len,i, Cok, Cing; Len = aPanel->Edit[0].Str.GetLength(); if(Len <6)return; if(Len >12)return; Cok = 0; Cing = 1; if(Len == CtlCenter.PassWordII.Len){ for(i=0; iEdit[0].Str.Text[i] != CtlCenter.PassWordII.Content[i]){ Cing = 0; } } if(Cing){ Cok = 1; if( (NeedingPermission >1) && (NeedingPermission < 4) ){ SystemPermission = NeedingPermission; }else{ SystemPermission = 2; } SystemPermissionTick = 0; } } } void TMenu::CheckSystemPermissionIII() { unsigned int Len,i, Cok, Cing; Len = aPanel->Edit[0].Str.GetLength(); if(Len == 16){ Cok =0; for(i=0; i<16; i++){ if(SavePassWord[i] == aPanel->Edit[0].Str.Text[i])Cok++; } if(Cok == 16){ SystemPermission = 3; SystemPermissionTick = 0; } return; } if(Len <6)return; if(Len >12)return; Cok = 0; Cing = 1; if(Len == CtlCenter.PassWordIII.Len){ for(i=0; iEdit[0].Str.Text[i] != CtlCenter.PassWordIII.Content[i]){ Cing = 0; } } if(Cing){ Cok = 1; if( (NeedingPermission >1) && (NeedingPermission < 4) ){ SystemPermission = NeedingPermission; }else{ SystemPermission = 3; } SystemPermissionTick = 0; } } } TGuiMsgReturn TMenu::KeyIn(unsigned char aKey) { TGuiMsgReturn aMsg = guiMsgNone; TGuiMsgReturn PmsRtnMsg; unsigned char aNum, NewInx; if(IsBlockPermission){ PmsRtnMsg = PmsIntervene4Gui.KeyIn(aKey); if(PmsRtnMsg == guiMsgOkAndReturn){ //Enter And Run Go IsBlockPermission = 0; SystemPermissionTick = 0; MainMenu.LoadPermission(SystemPermission); GoAction(); }else if(PmsRtnMsg == guiMsgReturn){ //Not Enter Redraw IsBlockPermission = 0; NeedFullRedraw = 1; } Check4ReDraw(); return guiMsgNone; } /*if(IsBlockPermission){ if(VK_RETURN == aKey){ IsBlockPermission =0; NeedFullRedraw = 1; }else{ if(NeedingPermission == 2){ aMsg = aPanel->GuiLoginII_KeyIn(aKey); aPanel->Edit[0].Show(); if(aMsg == guiMsgOkAndReturn){ CheckSystemPermissionII(); CheckSystemPermissionIII(); if(SystemPermission >= 2){ SystemPermissionTick = 0; IsBlockPermission =0; MainMenu.LoadPermission(SystemPermission); GoAction(); }else{ aPanel->GuiLoginPasswdErrShow(); } } }else if(NeedingPermission == 3){ aMsg = aPanel->GuiLoginIII_KeyIn(aKey); aPanel->Edit[0].Show(); if(aMsg == guiMsgOkAndReturn){ CheckSystemPermissionIII(); if(SystemPermission >= 3){ SystemPermissionTick = 0; IsBlockPermission =0; MainMenu.LoadPermission(SystemPermission); GoAction(); }else{ aPanel->GuiLoginPasswdErrShow(); } } } } Check4ReDraw(); return guiMsgNone; }*/ if(ActiveLevel == 0){ switch(aKey){ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if(aKey == '0'){ aNum = aKey - '0' + 10; }else{ aNum = aKey - '0'; } NewInx = aNum -1; if(NewInx < MainItemCount){ if(SelectedMainIndex == NewInx){ SelectedSubIndex = 0; ActiveLevel = 1; IsHasActive2 = 0; }else{ SelectedMainIndex = NewInx; if(SelectedMainIndex < 8){ MainIndexOnTop = 0; }else{ MainIndexOnTop = 1; } } SelectedSubIndex = 0; NeedRedraw = 1; } break; } }else if(ActiveLevel == 1){ switch(aKey){ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if(aKey == '0'){ aNum = aKey - '0' + 10; }else{ aNum = aKey - '0'; } NewInx = aNum -1; if(NewInx < SubMenuItem_Count[SelectedMainIndex]){ if(SelectedSubIndex == NewInx){ CheckPermission(); if(IsBlockPermission == 0) GoAction(); }else{ SelectedSubIndex = NewInx; NeedRedraw = 1; } } break; } } if(ActiveLevel == 2){ if(SelectedMainIndex == 0){ ActList_0 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_0_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 1){ ActList_1 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_1_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 2){ ActList_2 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_2_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 3){ ActList_3 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_3_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 4){ ActList_4 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_4_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 5){ ActList_5 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_5_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 6){ ActList_6 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_6_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 7){ ActList_7 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_7_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 8){ ActList_8 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_8_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }else if(SelectedMainIndex == 9){ ActList_9 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_9_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; OnAction = 0; } }/*else if(SelectedMainIndex == 10){ ActList_10 = static_cast(SelectedSubIndex); if(guiMsgReturn == ActList_10_ToDo(aKey)){ ActiveLevel = 1; NeedFullRedraw = 1; } }*/ Check4ReDraw(); return aMsg; } if(VK_LEFT == aKey){ if(ActiveLevel == 1){ ActiveLevel = 0; NeedRedraw = 1; } }else if(VK_RIGHT == aKey){ if(ActiveLevel == 0){ ActiveLevel = 1; NeedRedraw = 1; } }else if(VK_UP == aKey){ if(ActiveLevel == 0){ if(SelectedMainIndex > 0){ SelectedMainIndex--; SelectedSubIndex = 0; NeedRedraw = 1; if(SelectedMainIndex < MainIndexOnTop){ MainIndexOnTop--; } } }else if(ActiveLevel == 1){ if(SelectedSubIndex > 0){ SelectedSubIndex--; NeedRedraw = 1; }else{ if(SelectedMainIndex > 0){ SelectedMainIndex--; SelectedSubIndex = SubMenuItem_Count[SelectedMainIndex] - 1; NeedRedraw = 1; if(SelectedMainIndex < MainIndexOnTop){ MainIndexOnTop--; } } } } }else if(VK_DOWN == aKey){ if(ActiveLevel == 0){ if( SelectedMainIndex < (MainItemCount - 1) ){ SelectedMainIndex++; SelectedSubIndex = 0; NeedRedraw = 1; if(SelectedMainIndex > (MainIndexOnTop + MainShowCount - 1)){ MainIndexOnTop++; } } }else if(ActiveLevel == 1){ if( SelectedSubIndex < (SubMenuItem_Count[SelectedMainIndex]-1) ){ SelectedSubIndex++; NeedRedraw = 1; }else{ if(SelectedMainIndex < (MainItemCount - 1)){ SelectedMainIndex++; SelectedSubIndex = 0; NeedRedraw = 1; if(SelectedMainIndex > (MainIndexOnTop + MainShowCount - 1)){ MainIndexOnTop++; } } } } }else if(VK_RETURN == aKey){ if(ActiveLevel == 0){ IsBlockPermission = 0; Active = 0; OnAction = 0; aMsg = guiMsgReturn; }else if(ActiveLevel == 1){ IsBlockPermission = 0; ActiveLevel = 0; NeedRedraw = 1; OnAction = 0; }else if(ActiveLevel == 2){ }else{ NeedRedraw = 1; } }else if(VK_MENU == aKey){ //NeedRedraw = 1; }else if(VK_EXECUTE == aKey){ if(ActiveLevel == 0){ ActiveLevel = 1; NeedRedraw = 1; }else if(ActiveLevel == 1){ CheckPermission(); if(IsBlockPermission == 0) GoAction(); } } Check4ReDraw(); return aMsg; } void TMenu::Hide() { IsBlockPermission = 0; Active = 0; OnAction = 0; if(IsHasActive2){ IsHasActive2 = 0; ExtReqExit(); } ActiveLevel = 0; } void TMenu::FullRedrawFrm(int Prm) { if(SelectedMainIndex == 0){ ActList_0 = static_cast(SelectedSubIndex); if(ActList_0_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 1){ ActList_1 = static_cast(SelectedSubIndex); if(ActList_1_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 2){ ActList_2 = static_cast(SelectedSubIndex); if(ActList_2_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 3){ ActList_3 = static_cast(SelectedSubIndex); if(ActList_3_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 4){ ActList_4 = static_cast(SelectedSubIndex); if(ActList_4_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 5){ ActList_5 = static_cast(SelectedSubIndex); if(ActList_5_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 6){ ActList_6 = static_cast(SelectedSubIndex); if(ActList_6_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 7){ ActList_7 = static_cast(SelectedSubIndex); if(ActList_7_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 8){ ActList_8 = static_cast(SelectedSubIndex); if(ActList_8_RedrawCallBack(Prm)){ } }else if(SelectedMainIndex == 9){ ActList_9 = static_cast(SelectedSubIndex); if(ActList_9_RedrawCallBack(Prm)){ } } } void TMenu::ExtReqExit() { if(SelectedMainIndex == 0){ ActList_0 = static_cast(SelectedSubIndex); if(ActList_0_CallBack(ActList_0)){ } }else if(SelectedMainIndex == 1){ ActList_1 = static_cast(SelectedSubIndex); if(ActList_1_CallBack(ActList_1)){ } }else if(SelectedMainIndex == 2){ ActList_2 = static_cast(SelectedSubIndex); if(ActList_2_CallBack(ActList_2)){ } }else if(SelectedMainIndex == 3){ ActList_3 = static_cast(SelectedSubIndex); if(ActList_3_CallBack(ActList_3)){ } }else if(SelectedMainIndex == 4){ ActList_4 = static_cast(SelectedSubIndex); if(ActList_4_CallBack(ActList_4)){ } }else if(SelectedMainIndex == 5){ ActList_5 = static_cast(SelectedSubIndex); if(ActList_5_CallBack(ActList_5)){ } }else if(SelectedMainIndex == 6){ ActList_6 = static_cast(SelectedSubIndex); if(ActList_6_CallBack(ActList_6)){ } }else if(SelectedMainIndex == 7){ ActList_7 = static_cast(SelectedSubIndex); if(ActList_7_CallBack(ActList_7)){ } }else if(SelectedMainIndex == 8){ ActList_8 = static_cast(SelectedSubIndex); if(ActList_8_CallBack(ActList_8)){ } }else if(SelectedMainIndex == 9){ ActList_9 = static_cast(SelectedSubIndex); if(ActList_9_CallBack(ActList_9)){ } } }