#include "QueryCfg.h" #include "XBox.h" #include "Runtime.h" void TQueryCfg::Init(int x1, int y1, int aW, int aH, int OwnerX, int OwnerY, u32 aColor) { #define CH 30 //Caption Height unsigned short Left,Right, Top, Bottom, Width, Height, i; Bound.SetBySize(OwnerX + x1, OwnerY + y1, aW, aH); Left = Bound.Left +3; Top = Bound.Top+3; Width = aW - 7; Height = aH - 7; Right = Bound.Right -4; Bottom = Bound.Bottom -4; BoundCaption.SetBySize(Left,Top,Width, CH); Content.Set(Left, Top+CH, Right, Bottom); BoxBoundCfg.Set(Left + 100, Top+56, Right -145, Bottom -60); vEditDescp.Init(BoxBoundCfg.Left +10,BoxBoundCfg.Top + 232,530,34,0,0,1,clTeal); vEditDescp.Str.FromStr("未设定描述信息"); vEditDescp.Pst = vEditDescp.Str.GetEndPst(); vEditDescp.TextColor = clNearBlack; vEditDescp.Selected = 0; vEditDescp.SetMaxLen(32); EditIndex = 0; IsEditing = 0; vtValue[0] = 0; vtValue[1] = 0; vtValue[2] = 0; vtValue[3] = 0; vtValue[4] = 0; vtValue[5] = 0; qType == 0 ; #undef CH } void TQueryCfg::DrawSelf(void) { unsigned int x, y, x2, y2, w, h; VertLineRender(Bound.Left, Bound.Top, Bound.Height -1, 0xFFFFFFFF); VertLineRender(Bound.Right -1, Bound.Top +1, Bound.Height -2, 0xFF808080); VertLineRender(Bound.Right, Bound.Top, Bound.Height, 0xFF404040); HorizLineRender(Bound.Left, Bound.Top, Bound.Width - 1, 0xFFFFFFFF); HorizLineRender(Bound.Left +1, Bound.Bottom -1, Bound.Width - 2, 0xFF808080); HorizLineRender(Bound.Left, Bound.Bottom, Bound.Width, 0xFF404040); x = Bound.Left +2 ; x2 = Bound.Right -2; y = Bound.Top +2; y2 = Bound.Bottom - 2; w = Bound.Width -4; h = Bound.Height - 4; VertLineRender (x, y, h-1, 0xFF808080); HorizLineRender (x, y, w-1, 0xFF808080); VertLineRender (x+1, y+1, h-2, 0xFF404040); HorizLineRender (x+1, y+1, w-2, 0xFF404040); VertLineRender (x2-1, y+1, h-2, 0xFFD4D0C8); HorizLineRender (x+1, y2-1, w-2, 0xFFD4D0C8); VertLineRender (x2, y, h, 0xFFFFFFFF); HorizLineRender (x, y2, w, 0xFFFFFFFF); RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, clFrmFace); RectFillRender(BoundCaption.Left, BoundCaption.Top, BoundCaption.Right, BoundCaption.Bottom, clMaroon); if(qType)TextRender_string24(BoundCaption.Left+6, BoundCaption.Top +3, clNearWhite, clMaroon, "查询->网络配置"); else TextRender_string24(BoundCaption.Left+6, BoundCaption.Top +3, clNearWhite, clMaroon, "查询->本机配置"); } void TQueryCfg::Show(void) { DrawSelf(); if(qType == 0){ ShowThisCfg(); }else if(qType == 1){ ShowNetwork(); } } void TQueryCfg::FullRedraw(int Prm) { if(Prm == 0){ DrawSelf(); if(qType == 0){ ShowThisCfg(); }else if(qType == 1){ ShowNetwork(); } }else if(Prm == 1){ RectFillRender(GuiRedrawDataList[1][0], GuiRedrawDataList[1][1], GuiRedrawDataList[1][2], GuiRedrawDataList[1][3], clFrmFace); if(qType == 0){ ShowThisCfg(); }else if(qType == 1){ ShowNetwork(); } } } void TQueryCfg::DrawThisCfgOutLine() { int aLen, aW; unsigned int aClr,aTClr; aLen = 8; aW = aLen * 12 +12; aClr = clGray; aTClr = clNearBlack; VertLineRender(BoxBoundCfg.Left, BoxBoundCfg.Top+12, BoxBoundCfg.Height-12, aClr); VertLineRender(BoxBoundCfg.Left+1, BoxBoundCfg.Top+12, BoxBoundCfg.Height-12, aClr); VertLineRender(BoxBoundCfg.Right, BoxBoundCfg.Top+12, BoxBoundCfg.Height-12, aClr); VertLineRender(BoxBoundCfg.Right-1,BoxBoundCfg.Top+12, BoxBoundCfg.Height-12, aClr); HorizLineRender(BoxBoundCfg.Left, BoxBoundCfg.Top+12, 6, aClr); HorizLineRender(BoxBoundCfg.Left, BoxBoundCfg.Top+12+1, 6, aClr); HorizLineRender(BoxBoundCfg.Left, BoxBoundCfg.Bottom, BoxBoundCfg.Width, aClr); HorizLineRender(BoxBoundCfg.Left, BoxBoundCfg.Bottom -1, BoxBoundCfg.Width, aClr); HorizLineRender(BoxBoundCfg.Left + aW +6, BoxBoundCfg.Top+12, BoxBoundCfg.Width -6 -aW, aClr); HorizLineRender(BoxBoundCfg.Left + aW +6, BoxBoundCfg.Top+12+1, BoxBoundCfg.Width -6 -aW, aClr); TextRender_string24(BoxBoundCfg.Left + 8, BoxBoundCfg.Top, aTClr, clFrmFace, "本机配置"); } void TQueryCfg::DrawThisEntry() { } void TQueryCfg::ShowThisCfg(void) { int i, x; int MtbCount, CirCount, BusPadCount, DirectPadCount; RectFillRender(BoxBoundCfg.Left, BoxBoundCfg.Top, BoxBoundCfg.Right, BoxBoundCfg.Bottom, clFrmFace); MtbCount = 0; CirCount = 0; BusPadCount = 0; DirectPadCount = 0; for(x=0; x<5; x++){ for(i=0; i<8; i++){ if(MainCtl.fData.Split.ExistTablePort[x*8+i]){ MtbCount++; break; } } } for(i=0; i