void drawHeightHud(int topx, int topy, float height) { // Draw Big White Background glColor4f(1.0f, 1.0f, 1.0f, 0.7f); // White glRectf(topx, topy, topx+45.0f, topy+195.0f); // Draw Big White Background Border glColor3f(0.0f, 0.0f, 0.0f); // Black drawRectBorder(topx, topy, topx+45.0f, topy+195.0f); // Draw Sensor Background - white to red gradiant glBegin(GL_POLYGON); glColor3f(1.0f, 1.0f, 1.0f); // White glVertex2f(topx+5, topy+5); glVertex2f(topx+20, topy+5); glColor3f(1.0f, 0.0f, 0.0f); // Red glVertex2f(topx+20, topy+185); glVertex2f(topx+5, topy+185); glEnd(); // Draw Sensor Background Border - black glColor3f(0.0f, 0.0f, 0.0f); // Black drawRectBorder(topx+5, topy+5, topx+20, topy+185); // Calculate and place height bar correctly float barLocation; barLocation = ((300-height)/300)*185; glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_LINES); glVertex2f(topx+8, (int)barLocation+topy); glVertex2f(topx+17, (int)barLocation+topy); glEnd(); // Draw values next to bar orthoPrint(topx+25, topy+5+9, "3m"); orthoPrint(topx+25, topy+65+6, "2m"); orthoPrint(topx+25, topy+125+3, "1m"); orthoPrint(topx+25, topy+185, "0m"); }
void drawModelInfo(int botRx, int botRy) { int dMIHeight = 50; int dMIWidth = 100; int col1X = botRx - dMIWidth + 7; int col2X = botRx - dMIWidth + 55; // Draw Big White Background glColor4f(1.0f, 1.0f, 1.0f, 0.7f); // White glRectf(botRx-dMIWidth, botRy-dMIHeight, botRx, botRy); // Draw Big White Background Border glColor3f(0.0f, 0.0f, 0.0f); // Black drawRectBorder(botRx-dMIWidth, botRy-dMIHeight, botRx, botRy); char buffer[20]; orthoPrint(col1X, botRy-dMIHeight+15, "Height:"); sprintf(buffer, "%icm", int(editModelHeight)); orthoPrint(col2X, botRy-dMIHeight+15, buffer); orthoPrint(col1X, botRy-dMIHeight+30, "Width:"); sprintf(buffer, "%icm", int(editModelWidth)); orthoPrint(col2X, botRy-dMIHeight+30, buffer); orthoPrint(col1X, botRy-dMIHeight+45, "Length:"); sprintf(buffer, "%icm", int(editModelLength)); orthoPrint(col2X, botRy-dMIHeight+45, buffer); }
BOOL CFeedbackDialog::OnFeedbackClick() { wstring wstrOtherReason; wstrOtherReason.resize(1024); int char_count = GetDlgItemTextW(IDC_REASON_EDIT, &wstrOtherReason[0], wstrOtherReason.length()); if (char_count <= 0){ //进行响应提示 drawRectBorder(m_otherReasonEditCtrl.m_hWnd, RGB(255, 0, 0)); // m_feedBackBtnCtrl.SetFocus(); m_otherReasonStaticCtrl.ShowWindow(SW_HIDE); SetDlgItemText(IDC_OTHER_REASON_STATIC, L"你还没有输入反馈意见哦..."); have_feedback_num_ = false; m_otherReasonStaticCtrl.ShowWindow(SW_SHOWNORMAL); return TRUE; } have_feedback_num_ = true; std::string eid = YE_UNINSTALL_PREFIX "OtherReasonContent"; std::string content; if (!YGW2A(wstrOtherReason, content, CP_UTF8)) content.clear(); ygdata_report::SendCustomEvent(eid, GetEidDesc(eid), content); EndDialog(IDCLOSE); return TRUE; }
void menu::drawMpBar(float percent) { glColor4f(1,1,1,1); text MP = text((const unsigned char*) "MP",50,screenheight-25,0.2,0.2); glLineWidth(3.0); MP.drawText(); glColor4f(0,0,1,1); drawRectBorder(100,screenheight-45,200,20,3); drawRectInside(100,screenheight-45,200,20,percent); }
LRESULT CFeedbackDialog::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { RECT rect; GetWindowRect(&rect); BitBlt ((HDC)wParam, 0, 0, rect.right - rect.left, rect.bottom - rect.top, m_pDialogBkg->GetHDC(), 0, 0, SRCCOPY); //其他 编辑框背景涂白 //BitBlt ((HDC)wParam, OTHER_REASON_EDIT_POS_X, OTHER_REASON_EDIT_POS_Y, OTHER_REASON_EDIT_SIZE_W, OTHER_REASON_EDIT_SIZE_H, m_pDialogBkg->GetHDC(), 0, 0, WHITENESS); COLORREF color; if (have_feedback_num_){ color = RGB(0xC0, 0xC0, 0xC0); } else{ color = RGB(255, 0, 0); } drawRectBorder(m_otherReasonEditCtrl.m_hWnd, color); return 0; }
void drawKeyboardHelp(int botLx, int botLy) { int dKHeight = 160; int dKWidth = 210; int col1X = botLx + 7; int col2X = botLx + 60; // Draw Big White Background glColor4f(1.0f, 1.0f, 1.0f, 0.7f); // White glRectf(botLx, botLy-dKHeight, botLx+dKWidth, botLy); // Draw Big White Background Border glColor3f(0.0f, 0.0f, 0.0f); // Black drawRectBorder(botLx, botLy-dKHeight, botLx+dKWidth, botLy); // Header glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_LINES); glVertex2f(botLx, botLy-dKHeight+20); glVertex2f(botLx+dKWidth, botLy-dKHeight+20); glEnd(); // Text - Column 1 orthoPrint(col1X, botLy-dKHeight+15, "Key"); orthoPrint(col1X, botLy-dKHeight+34, "ESC"); orthoPrint(col1X, botLy-dKHeight+49, "SPACE"); orthoPrint(col1X, botLy-dKHeight+64, "1"); orthoPrint(col1X, botLy-dKHeight+79, "2"); orthoPrint(col1X, botLy-dKHeight+94, "F"); orthoPrint(col1X, botLy-dKHeight+109, "H"); orthoPrint(col1X, botLy-dKHeight+124, "M"); orthoPrint(col1X, botLy-dKHeight+139, "O"); orthoPrint(col1X, botLy-dKHeight+154, "T"); // Text - Column 2 orthoPrint(col2X, botLy-dKHeight+15, "Action"); orthoPrint(col2X, botLy-dKHeight+34, "Close Program"); orthoPrint(col2X, botLy-dKHeight+49, "Toggle Recording"); orthoPrint(col2X, botLy-dKHeight+64, "Toggle Show Floor Points"); orthoPrint(col2X, botLy-dKHeight+79, "Toggle Show Wall Points"); orthoPrint(col2X, botLy-dKHeight+94, "Toggle Fullscreen"); orthoPrint(col2X, botLy-dKHeight+109, "Toggle Help"); orthoPrint(col2X, botLy-dKHeight+124, "Level Motor Position"); orthoPrint(col2X, botLy-dKHeight+139, "Toggle Overhead Display"); orthoPrint(col2X, botLy-dKHeight+154, "Toggle Top Down Mode"); }
void drawPlacingHelp(int topRx, int topRy) { int dPHHeight = 70; int dPHWidth = 100; // Draw Big White Background glColor4f(1.0f, 1.0f, 1.0f, 0.7f); // White glRectf(topRx-dPHWidth, topRy, topRx, topRy+dPHHeight); // Draw Big White Background Border glColor3f(0.0f, 0.0f, 0.0f); // Black drawRectBorder(topRx-dPHWidth, topRy, topRx, topRy+dPHHeight); // Header orthoPrint(topRx-dPHWidth+7, topRy+15, "- Keys +"); glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_LINES); glVertex2f(topRx-dPHWidth, topRy+20); glVertex2f(topRx, topRy+20); glEnd(); // Text orthoPrint(topRx-dPHWidth+7, topRy+34, "Q Size E"); orthoPrint(topRx-dPHWidth+7, topRy+49, "S Height W"); orthoPrint(topRx-dPHWidth+7, topRy+64, "A Rotation D"); }
LRESULT CFeedbackDialog::OnEnGetFoucs(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled){ drawRectBorder(hWndCtl, RGB(0xC0, 0xC0, 0xC0)); return true; }