120 lines
3.2 KiB
C++
120 lines
3.2 KiB
C++
#include "TAuthorizeState.h"
|
|
|
|
void TAuthorizeState::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;
|
|
Caption.Init(Left,Top,Width, CH, 0, 0, clWhite, clMaroon);
|
|
Content.Set(Left, Top+CH, Right, Bottom);
|
|
Color = aColor;
|
|
#undef CH
|
|
|
|
Caption.Border.Color = clGray;
|
|
TMyString::sFromStr("授权状态-本机", Caption.Text);
|
|
Caption.Visible = 1;
|
|
|
|
OnActive = 0;
|
|
|
|
}
|
|
|
|
void TAuthorizeState::RenderBackGround(void)
|
|
{
|
|
RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, Color);
|
|
}
|
|
|
|
void TAuthorizeState::RenderBackGround(unsigned int aClr)
|
|
{
|
|
RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, aClr);
|
|
}
|
|
|
|
void TAuthorizeState::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);
|
|
}
|
|
|
|
void TAuthorizeState::Show(void)
|
|
{
|
|
RenderBackGround();
|
|
DrawSelf();
|
|
Caption.Show();
|
|
ReDrawInf();
|
|
}
|
|
|
|
void TAuthorizeState::FullRedraw(int Prm)
|
|
{
|
|
if(Prm == 0){
|
|
RenderBackGround();
|
|
DrawSelf();
|
|
Caption.Show();
|
|
ReDrawInf();
|
|
}else
|
|
if(Prm == 1){
|
|
RectFillRender(GuiRedrawDataList[1][0], GuiRedrawDataList[1][1], GuiRedrawDataList[1][2], GuiRedrawDataList[1][3], Color);
|
|
ReDrawInf();
|
|
|
|
//if(IsPermission)PmsIntervene4Gui.ReDraw4GuiRecall();
|
|
}
|
|
}
|
|
|
|
//______________________________________________________________________________________________________________________________
|
|
|
|
void TAuthorizeState::ReDrawInf()
|
|
{
|
|
TextRender_string24(40, 86, clNearBlack, "型号: FA001");
|
|
TextRender_string24(40, 110, clNearBlack, "授权形式:");
|
|
|
|
TextRender_string24(100, 144, clNearBlack, "授权到期日期:");
|
|
TextRender_string24(100, 178, clNearBlack, "授权最大回路数量:");
|
|
|
|
TextRender_string24(100, 212, clNearBlack, "授权最大终端数量:");
|
|
}
|
|
|
|
//_____________________________________________________________________________________________________________________________
|
|
|
|
TGuiMsgReturn TAuthorizeState::KeyIn(unsigned char aKey)
|
|
{
|
|
TGuiMsgReturn aMsg = guiMsgNone;
|
|
|
|
switch(aKey){
|
|
case VK_RETURN:
|
|
aMsg = guiMsgReturn;
|
|
break;
|
|
}
|
|
|
|
return aMsg;
|
|
}
|
|
|