150 lines
2.8 KiB
C++
150 lines
2.8 KiB
C++
#include "ThisCtlInf.h"
|
|
#include "DevMask.h"
|
|
|
|
|
|
|
|
void TThisCtlInf::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;
|
|
}
|
|
|
|
void TThisCtlInf::RenderBackGround(void)
|
|
{
|
|
RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, Color);
|
|
}
|
|
|
|
void TThisCtlInf::RenderBackGround(unsigned int aClr)
|
|
{
|
|
RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, aClr);
|
|
}
|
|
|
|
void TThisCtlInf::RenderContent(void)
|
|
{
|
|
#define FixColColor clMedGray
|
|
#define OddColor clNearMoneyGreen
|
|
unsigned int x,y, y2, clr;
|
|
RectFillRender(Content.Left, Content.Top, Content.Right, Content.Bottom, FixColColor);
|
|
}
|
|
|
|
void TThisCtlInf::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);
|
|
|
|
RenderContent();
|
|
}
|
|
|
|
void TThisCtlInf::DrawCaption(void)
|
|
{
|
|
TMyString::sFromStr("±¾»úÓ²¼þÐÅÏ¢", Caption.Text);
|
|
Caption.Show();
|
|
}
|
|
|
|
void TThisCtlInf::Show()
|
|
{
|
|
DrawSelf();
|
|
DrawCaption();
|
|
}
|
|
|
|
void TThisCtlInf::ShowInf()
|
|
{
|
|
|
|
}
|
|
|
|
TGuiMsgReturn TThisCtlInf::KeyIn(unsigned char aKey)
|
|
{
|
|
TGuiMsgReturn aMsg = guiMsgNone;
|
|
if(IsProgram){
|
|
switch(aKey){
|
|
case '0':
|
|
case '1':
|
|
case '2':
|
|
case '3':
|
|
case '4':
|
|
case '5':
|
|
case '6':
|
|
case '7':
|
|
case '8':
|
|
case '9':
|
|
case VK_LEFT:
|
|
case VK_RIGHT:
|
|
case VK_DELETE:
|
|
|
|
break;
|
|
case VK_UP:
|
|
|
|
break;
|
|
case VK_DOWN:
|
|
|
|
break;
|
|
case VK_TAB:
|
|
|
|
break;
|
|
case VK_EXECUTE:
|
|
break;
|
|
case VK_RETURN:
|
|
aMsg = guiMsgReturn;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return aMsg;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|