?? vscreen_realtime.c
字號:
GUI_DrawGraph(_aTemp2, GUI_COUNTOF(_aTemp2), 26, ySize - 121);
}
/*********************************************************************
*
* _LabelGraph
*/
static void _LabelGraph(void) {
GUI_RECT Rect;
int x, y, xSize, ySize;
WM_GetClientRect(&Rect);
xSize = Rect.x1;
ySize = Rect.y1;
GUI_SetBkColor(_ColorBackGround);
GUI_Clear();
GUI_SetColor(_ColorLabel);
GUI_SetPenSize(1);
GUI_ClearRect(0, (ySize - 21) - ySize, (xSize - 1), (ySize - 1));
GUI_DrawRect(25, 0, xSize, ySize - 20);
GUI_SetFont(&GUI_Font6x8);
for (x = 0; x < (xSize - 20); x += 40) {
int xPos = x + 25;
GUI_DrawVLine(xPos, (ySize - 20), (ySize - 14));
GUI_DispDecAt(x / 40, xPos - 2, (ySize - 9), 1);
}
for (y = 0; y < ySize - 20; y += 20) {
int yPos = ySize - 20 - y;
GUI_DrawHLine(yPos, 20, 25);
GUI_GotoXY(1, yPos - 4);
GUI_DispDecSpace(_TempMin + y, 3);
}
}
/*********************************************************************
*
* _SetProgbarValue
*/
static void _SetProgbarValue(int Id, I16 Value) {
char acBuffer[6] = {" "};
WM_HWIN hItem;
hItem = WM_GetDialogItem(_hDialogMain, Id);
PROGBAR_SetValue(hItem, 100 - Value);
Value = 100 - Value + _TempMin;
acBuffer[2] = '0' + Value % 10;
acBuffer[1] = (Value >= 10) ? '0' + (Value % 100) / 10 : ' ';
acBuffer[0] = (Value >= 100) ? '0' + Value / 100 : ' ';
PROGBAR_SetText(hItem, acBuffer);
}
/*********************************************************************
*
* _cbDialogIntro
*
* Purpose:
* Callback routine of DialogIntro
*/
static void _cbDialogIntro(WM_MESSAGE * pMsg) {
WM_HWIN hDlg;
GUI_RECT Rect;
int Id, i, ySizeText, yPos = 40;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetClientRect(&Rect);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Virtual screens", 160, 5);
GUI_SetFont(&GUI_Font13B_ASCII);
GUI_DrawBitmap(&_bmLogoBitmap, (Rect.x1 - _bmLogoBitmap.XSize) / 2, yPos);
ySizeText = GUI_GetFontSizeY();
yPos += _bmLogoBitmap.YSize + 15;
for (i = 0; i < GUI_COUNTOF(_apDialogIntro); i++) {
GUI_DispStringHCenterAt(_apDialogIntro[i], Rect.x1 / 2, yPos);
yPos += ySizeText;
}
break;
case WM_NOTIFY_PARENT:
if (pMsg->Data.v == WM_NOTIFICATION_RELEASED) {
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
if (Id == GUI_ID_BUTTON0) {
GUI_EndDialog(hDlg, 0);
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
/*********************************************************************
*
* _cbDialogColor
*
* Purpose:
* Callback routine of DialogColor
*/
static void _cbDialogColor(WM_MESSAGE * pMsg) {
GUI_COLOR Color;
int i;
int NCode, Id;
WM_HWIN hDlg, hItem;
hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
/* Draw RGB values */
GUI_SetColor(_aColorSep[0]);
GUI_FillRect(180, 60, 199, 79);
GUI_SetColor(_aColorSep[1] << 8);
GUI_FillRect(180, 90, 199, 109);
GUI_SetColor(((U32)_aColorSep[2]) << 16);
GUI_FillRect(180, 120, 199, 139);
/* Draw resulting color */
GUI_SetColor(_aColorSep[0] | (((U32)_aColorSep[1]) << 8) | (((U32)_aColorSep[2]) << 16));
GUI_FillRect(205, 60, 285, 139);
return;
case WM_INIT_DIALOG:
_ColorIndex = 0;
for (i = 0; i < 3; i++) {
hItem = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + i);
_aColorSep[i] = (_ColorBackGround & (0xff << (i * 8))) >> (i * 8);
SLIDER_SetRange(hItem, 0, 255);
SLIDER_SetValue(hItem, _aColorSep[i]);
/* Init EDIT-widgets */
hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT0 + i);
EDIT_SetDecMode(hItem, _aColorSep[i], 0, 255, 0, 0);
}
/* Init dropdown widgets */
hItem = WM_GetDialogItem(hDlg, GUI_ID_DROPDOWN0);
DROPDOWN_SetAutoScroll(hItem, 1);
DROPDOWN_AddString(hItem, "Background");
DROPDOWN_AddString(hItem, "Grid");
DROPDOWN_AddString(hItem, "Label");
DROPDOWN_AddString(hItem, "Temperature 1");
DROPDOWN_AddString(hItem, "Temperature 2");
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode) {
case WM_NOTIFICATION_RELEASED: /* React only if released */
if (Id == GUI_ID_OK) { /* OK Button */
_SaveCurrentColor();
_UpdateTextColors(_hDialogMain);
hItem = WM_GetClientWindow(WM_GetDialogItem(_hDialogMain, ID_TEMPERATURE));
WM_InvalidateWindow(hItem);
WM_SetFocus(WM_GetDialogItem(_hDialogMain, ID_TEMPERATURE));
GUI_SetOrg(0, 0);
}
break;
case WM_NOTIFICATION_SEL_CHANGED:
_SaveCurrentColor();
if (Id == GUI_ID_DROPDOWN0) {
for (i = 0; i < 3; i++) {
hItem = WM_GetDialogItem(hDlg, GUI_ID_DROPDOWN0);
_ColorIndex = DROPDOWN_GetSel(hItem);
hItem = WM_GetDialogItem(hDlg, GUI_ID_SLIDER0 + i);
switch (_ColorIndex) {
case 0: Color = _ColorBackGround; break;
case 1: Color = _ColorGrid; break;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -