bool Break(string name, string query __DEBUG_PRM__) { printf("#####-[%s]\r\n", name); fflush(stdout); return true; #ifdef __BX_DEBUG QMessageBox AssertBox(QMessageBox::Warning, "ASSERT BREAK", name, QMessageBox::Yes | QMessageBox::No | QMessageBox::NoToAll); char AssertMessage[1024]; sprintf(AssertMessage, "[QUERY] %s\t\t\r\n" "[METHOD] %s()\t\t\r\n" "[FILE/LINE] %s(%dLn)\t\t\r\n" "[THREAD_ID] %d\t\t\r\n" "\r\n" "(YES is Break, NO is Ignore)\t\t", query, __DEBUG_FUNC__, __DEBUG_FILE__, __DEBUG_LINE__, QThread::currentThreadId()); AssertBox.setInformativeText(AssertMessage); AssertBox.setDefaultButton(QMessageBox::Yes); switch(AssertBox.exec()) { case QMessageBox::Yes: Q_ASSERT(0);////////////////////////////////// break; case QMessageBox::NoToAll: return false; } return true; #else return false; #endif }
void GCDCBoundingBoxTestCase::DrawBitmap() { wxBitmap bitmap; bitmap.Create(12, 12); m_gcdc->DrawBitmap(bitmap, 5, 5); AssertBox(5, 5, 12, 12); }
void GCDCBoundingBoxTestCase::CrossHair() { int w, h; m_gcdc->GetSize(&w, &h); m_gcdc->CrossHair(33, 33); AssertBox(0, 0, w, h); }
void GCDCBoundingBoxTestCase::DrawRectsOnTransformedDC() { m_gcdc->DrawRectangle(10, 15, 50, 30); m_gcdc->SetDeviceOrigin(15, 20); m_gcdc->DrawRectangle(15, 20, 45, 35); m_gcdc->SetDeviceOrigin(5, 10); AssertBox(5, 5, 65, 60); }
void GCDCBoundingBoxTestCase::DrawRotatedText() { wxString text("vertical"); wxCoord w, h; m_gcdc->GetTextExtent(text, &w, &h); m_gcdc->DrawRotatedText(text, 43, 22, -90); AssertBox(43 - h, 22, h, w, 3); }
void GCDCBoundingBoxTestCase::DrawText() { wxString text("H"); wxCoord w, h; m_gcdc->GetTextExtent(text, &w, &h); m_gcdc->DrawText(text, 3, 3); AssertBox(3, 3, w, h, 3); }
void GCDCBoundingBoxTestCase::DrawPolygon() { wxPoint points[3]; points[0] = wxPoint(10, 30); points[1] = wxPoint(20, 10); points[2] = wxPoint(30, 30); m_gcdc->DrawPolygon(3, points, -5, -7); AssertBox(5, 3, 20, 20); }
void GCDCBoundingBoxTestCase::DrawSpline() { wxPoint points[3]; points[0] = wxPoint(10, 30); points[1] = wxPoint(20, 20); points[2] = wxPoint(40, 50); m_gcdc->DrawSpline(3, points); AssertBox(10, 20, 30, 30, 5); }
void GCDCBoundingBoxTestCase::DrawIcon() { wxBitmap bitmap; bitmap.Create(16, 16); wxIcon icon; icon.CopyFromBitmap(bitmap); m_gcdc->DrawIcon(icon, 42, 42); AssertBox(42, 42, 16, 16); }
void GCDCBoundingBoxTestCase::DrawLines() { wxPoint points[4]; points[0] = wxPoint(10, 20); points[1] = wxPoint(20, 10); points[2] = wxPoint(30, 20); points[3] = wxPoint(20, 30); m_gcdc->DrawLines(4, points, 7, 8); AssertBox(17, 18, 20, 20); }
void GCDCBoundingBoxTestCase::Blit() { wxBitmap bitmap; bitmap.Create(20, 20); wxMemoryDC dc(bitmap); m_gcdc->Blit(20, 10, 12, 7, &dc, 0, 0); AssertBox(20, 10, 12, 7); dc.SelectObject(wxNullBitmap); }
void GCDCBoundingBoxTestCase::StretchBlit() { wxBitmap bitmap; bitmap.Create(20, 20); wxMemoryDC dc(bitmap); m_gcdc->StretchBlit(30, 50, 5, 5, &dc, 0, 0, 12, 4); AssertBox(30, 50, 5, 5); dc.SelectObject(wxNullBitmap); }
void GCDCBoundingBoxTestCase::DrawPolyPolygon() { int lenghts[2]; lenghts[0] = 3; lenghts[1] = 3; wxPoint points[6]; points[0] = wxPoint(10, 30); points[1] = wxPoint(20, 10); points[2] = wxPoint(30, 30); points[3] = wxPoint(20, 60); points[4] = wxPoint(30, 40); points[5] = wxPoint(40, 60); m_gcdc->DrawPolyPolygon(2, lenghts, points, 12, 5); AssertBox(22, 15, 30, 50, 4); }
void GCDCBoundingBoxTestCase::DrawTwoRectangles() { m_gcdc->DrawRectangle(10, 15, 50, 30); m_gcdc->DrawRectangle(15, 20, 55, 35); AssertBox(10, 15, 60, 40); }
void GCDCBoundingBoxTestCase::DrawRectangleAndReset() { m_gcdc->DrawRectangle(2, 2, 12, 12); m_gcdc->ResetBoundingBox(); AssertBox(0, 0, 0, 0); }
void GCDCBoundingBoxTestCase::DrawCheckMark() { m_gcdc->DrawCheckMark(32, 24, 16, 16); AssertBox(32, 24, 16, 16); }
void GCDCBoundingBoxTestCase::GradientFillConcentric() { wxRect rect(6, 6, 30, 40); m_gcdc->GradientFillConcentric(rect, *wxWHITE, *wxBLACK, wxPoint(10, 10)); AssertBox(6, 6, 30, 40); }
void GCDCBoundingBoxTestCase::GradientFillLinear() { wxRect rect(16, 16, 30, 40); m_gcdc->GradientFillLinear(rect, *wxWHITE, *wxBLACK, wxNORTH); AssertBox(16, 16, 30, 40); }
void GCDCBoundingBoxTestCase::DrawArc() { m_gcdc->DrawArc(25, 30, 15, 40, 25, 40); // quarter circle AssertBox(15, 30, 10, 10, 3); }
void GCDCBoundingBoxTestCase::DrawEllipticArc() { m_gcdc->DrawEllipticArc(40, 50, 30, 20, 0, 180); // half circle AssertBox(40, 50, 30, 10, 3); }
void GCDCBoundingBoxTestCase::DrawPoint() { m_gcdc->DrawPoint(20, 20); AssertBox(20, 20, 1, 1); }
void GCDCBoundingBoxTestCase::DrawRoundedRectangle() { m_gcdc->DrawRoundedRectangle(27, 27, 12, 12, 2); AssertBox(27, 27, 12, 12); }
void GCDCBoundingBoxTestCase::DrawEllipse() { m_gcdc->DrawEllipse(54, 45, 23, 12); AssertBox(54, 45, 23, 12); }
void GCDCBoundingBoxTestCase::DrawLine() { m_gcdc->DrawLine(10, 10, 20, 15); AssertBox(10, 10, 10, 5); }