/*---------------------------------------------------------------------- DrawSkewingArrows Draw/Clear the four arrows arround the objet that indicate the skewing direction. *----------------------------------------------------------------------*/ void AmayaTransformEvtHandler::DrawSkewingArrows() { InitDrawing (5, 1, 0); glEnable(GL_COLOR_LOGIC_OP); #ifdef _WINDOWS glLogicOp(GL_COPY_INVERTED); #else /* _WINDOWS */ glLogicOp(GL_XOR); #endif /* _WINDOWS */ glColor4ub (127, 127, 127, 0); /* ----3----- | | 1 2 | | ----4----- */ /* 1 */ DrawArrow (FrameId, 1, 5, left2 - CURSOR_SIZE/2, (top2+bottom2)/2 - CURSOR_SIZE, CURSOR_SIZE, 2*CURSOR_SIZE, 90, 3, 0); /* 2 */ DrawArrow (FrameId, 1, 5, right2 - CURSOR_SIZE/2, (top2+bottom2)/2 - CURSOR_SIZE, CURSOR_SIZE, 2*CURSOR_SIZE, 90, 3, 0); /* 3 */ DrawArrow (FrameId, 1, 5, (left2+right2)/2 - CURSOR_SIZE, top2 - CURSOR_SIZE/2, 2*CURSOR_SIZE, CURSOR_SIZE, 0, 3, 0); /* 4 */ DrawArrow (FrameId, 1, 5, (left2+right2)/2 - CURSOR_SIZE, bottom2 - CURSOR_SIZE/2, 2*CURSOR_SIZE, CURSOR_SIZE, 0, 3, 0); glDisable(GL_COLOR_LOGIC_OP); #ifdef _WINDOWS GL_Swap (FrameId); #endif /* WINDOWS */ }
void Graphics::render(AIController *aiController) { if (!initialized) { error->log(GRAPHICS, IMPORTANT, "Render function called without graphics initialization\n"); return; } glColor3f(0,1,0); // Uncomment to render AI debug info Kinematic k = aiController->agent->getKinematic(); render(aiController->path.knots); Vec3f closest = aiController->path.closestPoint(aiController->target); glColor3f(0,1,0); DrawArrow(k.pos, aiController->target - k.pos); DrawArrow(aiController->target, closest - aiController->target); if (aiController->seeObstacle) { glColor3f(1,0,0); DrawArrow(k.pos, aiController->antiTarget - k.pos); } }
void CCJKShapeLine::DrawArrow(QPainter *painter, const QLineF &line) { CJK_D(CCJKShapeLine); double angle = ::acos(line.dx() / line.length()); if (line.dy() >= 0) angle = (CJKPi * 2) - angle; if (d->arrowBeginType != ArrowNone) { qreal arrowSize = d->pen.width() + d->arrowBeginSize; QPointF arrowP1; QPointF arrowP2; arrowP1 = line.p1() + QPointF(sin(angle + CJKPi / 3) * arrowSize, cos(angle + CJKPi / 3) * arrowSize); arrowP2 = line.p1() + QPointF(sin(angle + CJKPi - CJKPi / 3) * arrowSize, cos(angle + CJKPi - CJKPi / 3) * arrowSize); DrawArrow(painter, d->arrowBeginType, line.p1(), arrowP1, arrowP2, arrowSize); } if (d->arrowEndType != ArrowNone) { qreal arrowSize = d->pen.width() + d->arrowEndSize; QPointF arrowP1; QPointF arrowP2; arrowP1 = line.p2() - QPointF(sin(angle + CJKPi / 3) * arrowSize, cos(angle + CJKPi / 3) * arrowSize); arrowP2 = line.p2() - QPointF(sin(angle + CJKPi - CJKPi / 3) * arrowSize, cos(angle + CJKPi - CJKPi / 3) * arrowSize); DrawArrow(painter, d->arrowEndType, line.p2(), arrowP1, arrowP2, arrowSize); } }
virtual void Render() { // Draw the axes outside th3e client area GG::Pt begin(ClientUpperLeft().x - AXIS_WIDTH/2, ClientLowerRight().y + AXIS_HEIGHT/2); GG::Pt x_end(ClientLowerRight().x, begin.y); GG::Pt y_end(begin.x, ClientUpperLeft().y); DrawArrow(begin, x_end); DrawArrow(begin, y_end); }
//+++-S-cf------------------------------------------------------------------- // NAME: DrawArrow() // DESC: Draw arrow // PARAMETERS: CHART_HPAINT hp, // int pos, // bool over // RETURN: None //----------------------------------------------------------------------E-+++ void wxLegend::DrawArrow( CHART_HPAINT hp, int pos, bool over ) { //----------------------------------------------------------------------- // Get actual configuration //----------------------------------------------------------------------- wxBrush oldBrush = hp->GetBrush(); wxPen oldPen = hp->GetPen(); //----------------------------------------------------------------------- // if mouse over use different colours //----------------------------------------------------------------------- if (over) { hp->SetBrush( *wxBLACK_BRUSH ); hp->SetPen( *wxBLACK_PEN ); } else { hp->SetBrush( *wxGREY_BRUSH ); hp->SetPen( *wxBLACK_PEN ); } if ( pos == ARROW_DOWN ) { //------------------------------------------------------------------- // If mouse position has change than redraw arrow //------------------------------------------------------------------- if (m_ArrowDown.m_sel != over) { DrawArrow(hp, m_ArrowDown.m_x, m_ArrowDown.m_y, 8, pos, over); } } if ( pos == ARROW_UP ) { //------------------------------------------------------------------- // If mouse position has change than redraw arrow //------------------------------------------------------------------- if (m_ArrowUp.m_sel != over) { DrawArrow(hp, m_ArrowUp.m_x, m_ArrowUp.m_y, 8, pos, over); } } //----------------------------------------------------------------------- // Set old colours //----------------------------------------------------------------------- hp->SetBrush( oldBrush ); hp->SetPen( oldPen ); }
void Clock::Draw(BView *view, int32) { BScreen screen; BBitmap buffer(view->Bounds(), screen.ColorSpace(), true); BView offscreen(view->Bounds(), NULL, 0, 0); buffer.AddChild(&offscreen); buffer.Lock(); int n; float a,R; float width = view->Bounds().Width(); float height = view->Bounds().Height(); float zoom = (height/1024) * 0.85; time(&tmptodaytime); TodayTime = localtime(&tmptodaytime); todaysecond = TodayTime->tm_sec; todayminute = TodayTime->tm_min + (todaysecond/60.0); todayhour = TodayTime->tm_hour + (todayminute/60.0); rgb_color bg_color = {0,0,0}; offscreen.SetHighColor(bg_color); offscreen.SetLowColor(bg_color); offscreen.FillRect(offscreen.Bounds()); offscreen.SetHighColor(200,200,200); for(n=0,a=0,R=510*zoom;n<60;n++,a+=(2*M_PI)/60) { float x = width/2 + R * cos(a); float y = height/2 + R * sin(a); DrawBlock(&offscreen,x,y,a,14*zoom); } offscreen.SetHighColor(255,255,255); for(n=0,a=0,R=500*zoom;n<12;n++,a+=(2*M_PI)/12) { float x = width/2 + R * cos(a); float y = height/2 + R * sin(a); DrawBlock(&offscreen,x,y,a,32*zoom); } offscreen.SetHighColor(255,255,255); DrawArrow(&offscreen, width/2,height/2, ( ((2*M_PI)/60) * todayminute) - (M_PI/2), 220*zoom, 1, 8*zoom); DrawArrow(&offscreen, width/2,height/2, ( ((2*M_PI)/12) * todayhour) - (M_PI/2), 140*zoom, 1, 14*zoom); offscreen.FillEllipse(BPoint(width/2,height/2),24*zoom,24*zoom); offscreen.SetHighColor(250,20,20); DrawArrow(&offscreen, width/2,height/2, ( ((2*M_PI)/60) * todaysecond) - (M_PI/2), 240*zoom, 1, 4*zoom); offscreen.FillEllipse(BPoint(width/2,height/2),20*zoom,20*zoom); offscreen.Sync(); buffer.Unlock(); view->DrawBitmap(&buffer); buffer.RemoveChild(&offscreen); }
void DrawDebugArrow(const Vector3Df& from, const Vector3Df& to) { float currentAlpha = g_CurrentColor.a; glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); g_CurrentColor.a = 0.5f; DrawArrow(from, to); glEnable(GL_DEPTH_TEST); g_CurrentColor.a = currentAlpha; DrawArrow(from, to); }
void centerAxleLoadPrepare(void) { const uint16_t WHEEL_RADIUS = 25; const uint16_t WHEEL_HEIGHT = 30; const uint16_t POS_X1 = 245; const uint16_t POS_Y1_2 = 165; const uint16_t POS_X2 = 555; const uint16_t POS_X3 = POS_X1; const uint16_t POS_X6 = POS_X2; const uint16_t POS_X4 = POS_X3 + (WHEEL_RADIUS*2); const uint16_t POS_X5 = POS_X6 - (WHEEL_RADIUS*2); const uint16_t POS_Y3 = 280; // ___ ___ // | | | | // | 1 |-----------------| 2 | // |___| |___| // // ___ ___ ___ ___ // | | | | | | // | 3 | 4 |---------| 5 | 6 | // |___|___| |___|___| ClearCenterLayers(); XGdcDrawDimension(&g_stcMyGDC_DrvCTX, GDC_16BPP_FORMAT, L2ADR0, WIN_WIDTH, WIN_HEIGHT); XGdcSetAttrLine(&g_stcMyGDC_DrvCTX, GDC_LINE_WIDTH, 3); XGdcColor(&g_stcMyGDC_DrvCTX, GDC_YELLOW16); // DrawLine(POS_X1+WHEEL_RADIUS, POS_Y1_2+(WHEEL_HEIGHT/2), POS_X2-WHEEL_RADIUS, POS_Y1_2+(WHEEL_HEIGHT/2)); DrawLine(POS_X4+WHEEL_RADIUS, POS_Y3+(WHEEL_HEIGHT/2), POS_X5-WHEEL_RADIUS, POS_Y3+(WHEEL_HEIGHT/2)); // MyGDC_DrawBitmap16(L2ADR0, POS_X1 - (WHEEL_BITMAP_WIDTH/2), POS_Y1_2+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); // MyGDC_DrawBitmap16(L2ADR0, POS_X2 - (WHEEL_BITMAP_WIDTH/2), POS_Y1_2+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); // XGdcSetAlpha(&g_stcMyGDC_DrvCTX, 10); MyGDC_DrawBitmap16(L2ADR0, POS_X3 - (WHEEL_BITMAP_WIDTH/2), POS_Y3+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); MyGDC_DrawBitmap16(L2ADR0, POS_X4 - (WHEEL_BITMAP_WIDTH/2), POS_Y3+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); MyGDC_DrawBitmap16(L2ADR0, POS_X5 - (WHEEL_BITMAP_WIDTH/2), POS_Y3+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); MyGDC_DrawBitmap16(L2ADR0, POS_X6 - (WHEEL_BITMAP_WIDTH/2), POS_Y3+(WHEEL_HEIGHT/2) - (WHEEL_BITMAP_HEIGHT / 2), WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); XGdcColor(&g_stcMyGDC_DrvCTX, GDC_WHITE16); DrawArrow(WIN_WIDTH / 2, POS_Y1_2+(WHEEL_HEIGHT/2), 0); DrawArrow(WIN_WIDTH / 2, POS_Y3+(WHEEL_HEIGHT/2), 0); Text_DrawText("12.3", FALSE, WIN_WIDTH / 2, 107, FONT_ALIGN_CENTER, FONT_ARIAL36, L2ADR0, MYGDC_COL555(28,28,28)); Text_DrawText("25.9", FALSE, WIN_WIDTH / 2, 219, FONT_ALIGN_CENTER, FONT_ARIAL36, L2ADR0, MYGDC_COL555(28,28,28)); TransferDisplayList(&g_stcMyGDC_DrvCTX); XGdcCancelDisplayList(&g_stcMyGDC_DrvCTX); XGdcDrawDimension(&g_stcMyGDC_DrvCTX, GDC_16BPP_FORMAT, TEX_1_ADR, 128, 128); XGdcBltDraw16(&g_stcMyGDC_DrvCTX, 0, 0, WHEEL_BITMAP_WIDTH, WHEEL_BITMAP_HEIGHT, Bitmap_au16Wheel); }
//+++-S-cf------------------------------------------------------------------- // NAME: Draw() // DESC: Draw legend // PARAMETERS: CHART_HPAINT hp, // CHART_HRECT hr // RETURN: None //----------------------------------------------------------------------E-+++ void wxLegend::Draw( CHART_HPAINT hp, CHART_HRECT hr ) { int iPages = NumPages(); int iLines = iPages > 0 ? ROWS_PAGE : GetCount(); wxCoord h; //h = (ROWS_PAGE * ROW_SIZE < hr->h) ? ROWS_PAGE * ROW_SIZE : hr->h; h = (iLines * ROW_SIZE < hr->h) ? iLines * ROW_SIZE : hr->h; wxCoord x, y; x = (wxCoord)( 5 + hr->x ); y = (wxCoord)( 5 + hr->y ); //----------------------------------------------------------------------- // draw arrows //----------------------------------------------------------------------- if ( iPages > 0 ) { hp->SetBrush( *wxGREY_BRUSH ); hp->SetPen( *wxBLACK_PEN ); DrawArrow( hp, x+hr->w/2, y, 8, ARROW_UP, false ); hp->DrawLine( x+15, y+10, x+hr->w-15, y+10); DrawArrow( hp, x+hr->w/2, y + 20, 8, ARROW_DOWN, false ); } //----------------------------------------------------------------------- // draw shadow //----------------------------------------------------------------------- y += 30; hp->SetBrush( *wxGREY_BRUSH ); hp->SetPen( *wxTRANSPARENT_PEN ); hp->DrawRectangle( x +5, y +5, hr->w - 10, h ); //----------------------------------------------------------------------- // draw legend window //----------------------------------------------------------------------- hp->SetBrush( *wxWHITE_BRUSH ); hp->SetPen( *wxBLACK_PEN ); hp->DrawRectangle( x, y, hr->w - 10, h ); //----------------------------------------------------------------------- // write labels //----------------------------------------------------------------------- WriteLabel( hp, x+3, y+3, m_Page ); }
void wxStdRenderer::DrawScrollbarArrow(wxDC& dc, wxDirection dir, const wxRect& rect, int flags) { DrawArrow(dc, dir, rect, flags); }
void WindArrowRenderer::Draw(Canvas &canvas, const Angle screen_angle, const SpeedVector wind, const PixelPoint pos, const PixelRect rc, WindArrowStyle arrow_style) { // Draw arrow (and tail) const unsigned length = uround(Quadruple(wind.norm)); DrawArrow(canvas, pos, wind.bearing - screen_angle, length, arrow_style); // Draw wind speed label StaticString<12> buffer; buffer.Format(_T("%i"), iround(Units::ToUserWindSpeed(wind.norm))); canvas.SetTextColor(COLOR_BLACK); canvas.Select(*look.font); const unsigned offset = uround(M_SQRT2 * wind.norm); BulkPixelPoint label[] = { { 18, -26 - int(offset) }, }; PolygonRotateShift(label, ARRAY_SIZE(label), pos, wind.bearing - screen_angle); TextInBoxMode style; style.align = TextInBoxMode::Alignment::CENTER; style.vertical_position = TextInBoxMode::VerticalPosition::CENTERED; style.shape = LabelShape::OUTLINED; TextInBox(canvas, buffer, label[0].x, label[0].y, style, rc); }
void ScreenshotEditWidget::paintEvent(QPaintEvent* event) { Q_UNUSED(event); QPainter painter(this); painter.drawPixmap(ui->screenshotDisplayWidget->x(), ui->screenshotDisplayWidget->y(), _source->width(), _source->height(), _newPixmap); painter.fillRect(ui->colorDisplayWidget->x(), ui->colorDisplayWidget->y(), ui->colorDisplayWidget->width(), ui->colorDisplayWidget->height(), _color); painter.drawRect(ui->screenshotDisplayWidget->x(), ui->screenshotDisplayWidget->y(), ui->screenshotDisplayWidget->width(), ui->screenshotDisplayWidget->height()); if (_toolActive) { QPen pen; pen.setColor(_color); pen.setWidth(3); painter.setPen(pen); if (_selectedTool == ST_Rectangle) { painter.drawRect(ui->screenshotDisplayWidget->x() + _startToolPosition.x(), ui->screenshotDisplayWidget->y() + _startToolPosition.y(), _lastToolPosition.x() - _startToolPosition.x(), _lastToolPosition.y() - _startToolPosition.y()); } else if (_selectedTool == ST_Arrow) { DrawArrow(painter, ui->screenshotDisplayWidget->x() + _startToolPosition.x(), ui->screenshotDisplayWidget->y() + _startToolPosition.y(), ui->screenshotDisplayWidget->x() + _lastToolPosition.x(), ui->screenshotDisplayWidget->y() + _lastToolPosition.y()); } } }
void ScreenshotEditWidget::mouseReleaseEvent(QMouseEvent* event) { if (event->button() != Qt::RightButton && event->button() != Qt::MidButton && _toolActive == true) { QPainter painter(&_newPixmap); QPen pen; pen.setColor(_color); pen.setWidth(3); painter.setPen(pen); if (_selectedTool == ST_Rectangle) { painter.drawRect(_startToolPosition.x(), _startToolPosition.y(), _lastToolPosition.x() - _startToolPosition.x(), _lastToolPosition.y() - _startToolPosition.y()); } else if (_selectedTool == ST_Arrow) { DrawArrow(painter, _startToolPosition.x(), _startToolPosition.y(), _lastToolPosition.x(), _lastToolPosition.y()); } } _toolActive = false; update(); }
void LoseLife(char *reason) { //Draw cracked screen - but draw all the rest of the world & hud first CloseGraphics(); OpenGraphics(); DrawWorld(&world, cameraPos, cameraAngle); DrawHUD(); DrawArrow(cameraAngle.y); DrawRadarDots(true); DrawRadarArm(sweepAngle * sweepStepCount++); DrawRadarDots(false); //finally! DrawCrackedScreen(); SetTextColor(RED); DrawText(25,40,reason); if (--lives<=0) { SetTextColor(GREEN); DrawText(30,55,"GAME OVER!"); } Show(); PlaySound(SOUND_EXPLOSION); //dead? if (lives<=0) { Sleep(2000); //Reset back to splash screen ResetTimer(); mode=0; Splash(); } else { // Hit but still going InitialiseWorld(); } }
/*ARGSUSED*/ static void Arm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; XmArrowButtonCallbackStruct call_value; (void) XmProcessTraversal((Widget) aw, XmTRAVERSE_CURRENT); aw->arrowbutton.selected = True; aw->arrowbutton.armTimeStamp = event->xbutton.time; /* see MultiActivate */ DrawArrow(aw, aw->primitive.bottom_shadow_GC, aw->primitive.top_shadow_GC, NULL); if (aw->arrowbutton.arm_callback) { XFlush(XtDisplay(aw)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) aw, aw->arrowbutton.arm_callback, &call_value); } }
//根据Menu内容来绘制菜单内容 void DrawXlibMenu(XlibMenu * menu) { FcitxSkin *sc = &menu->owner->skin; FcitxClassicUI *classicui = menu->owner; Display* dpy = classicui->dpy; GC gc = XCreateGC(dpy, menu->menuWindow, 0, NULL); int i = 0; int fontheight; int iPosY = 0; int dpi = sc->skinFont.respectDPI? menu->owner->dpi: 0; FCITX_UNUSED(dpi); fontheight = FontHeight(menu->owner->menuFont, sc->skinFont.menuFontSize, dpi); SkinImage *background = LoadImage(sc, sc->skinMenu.backImg, false); GetMenuSize(menu); EnlargeCairoSurface(&menu->menu_cs, menu->width, menu->height); if (background) { cairo_t* cr = cairo_create(menu->menu_cs); DrawResizableBackground(cr, background->image, menu->height, menu->width, sc->skinMenu.marginLeft, sc->skinMenu.marginTop, sc->skinMenu.marginRight, sc->skinMenu.marginBottom, sc->skinMenu.fillV, sc->skinMenu.fillH ); cairo_destroy(cr); } iPosY = sc->skinMenu.marginTop; for (i = 0; i < utarray_len(&menu->menushell->shell); i++) { if (GetMenuItem(menu->menushell, i)->type == MENUTYPE_SIMPLE || GetMenuItem(menu->menushell, i)->type == MENUTYPE_SUBMENU) { DisplayText(menu, i, iPosY, fontheight); if (menu->menushell->mark == i) MenuMark(menu, iPosY, i); if (GetMenuItem(menu->menushell, i)->type == MENUTYPE_SUBMENU) DrawArrow(menu, iPosY); iPosY = iPosY + 6 + fontheight; } else if (GetMenuItem(menu->menushell, i)->type == MENUTYPE_DIVLINE) { DrawDivLine(menu, iPosY); iPosY += 5; } } XResizeWindow(dpy, menu->menuWindow, menu->width, menu->height); _CAIRO_SETSIZE(menu->menu_x_cs, menu->width, menu->height); cairo_t* c = cairo_create(menu->menu_x_cs); cairo_set_operator(c, CAIRO_OPERATOR_SOURCE); cairo_set_source_surface(c, menu->menu_cs, 0, 0); cairo_rectangle(c, 0, 0, menu->width, menu->height); cairo_clip(c); cairo_paint(c); cairo_destroy(c); cairo_surface_flush(menu->menu_x_cs); XFreeGC(dpy, gc); }
// Draw this arrow using Arrow::k_activeColor if selectedIdentifier // matches this arrow's identifier. If this arrow isn't selected // it's drawn using Arrow::k_passiveColor. void Arrow::Draw(const uint32 selectedIdentifier) const { b2Vec2 position; DrawArrow(selectedIdentifier == m_identifier ? Arrow::k_activeColor : Arrow::k_passiveColor, m_angle, CalculateScale(), *CalculateViewportPosition(&position)); }
void NaDbOneAxis::DefineDisplay() { glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisable(GL_DEPTH_TEST); glColor3ub(itsRed, itsGreen, itsBlue); DrawArrow(itsAxis); }
void CComboBoxExt::DrawCombo(enTypeShow enShow,CGDI* pDC) { CRect m_rcClient; CRect m_rcDropDown; GetClientRect(&m_rcClient); CGradient M(CSize(m_rcClient.Width(),m_rcClient.Height())); M.PrepareVertical(pDC); M.Draw(pDC,0,0,0,0,m_rcClient.Width(),m_rcClient.Height(),SRCCOPY); m_rcClient.bottom-=2; m_rcClient.DeflateRect(1,1); if (enShow==CM_NORMAL) pDC->Draw3dRect(&m_rcClient,CDrawLayer::GetRGBColorWhite(),CDrawLayer::GetRGBColorWhite()); else // && !XP pDC->Draw3dRect(&m_rcClient,CDrawLayer::GetRGBMenu(),CDrawLayer::GetRGBMenu()); //debemos pintar el borde del boton drawDwon m_rcClient.DeflateRect(1,1); m_rcClient.left=m_rcClient.right-m_iWidthDrowDown; m_rcClient.DeflateRect(1,1); if (enShow!=CM_NORMAL) pDC->Draw3dRect(&m_rcClient,CDrawLayer::GetRGBFondoXP(),CDrawLayer::GetRGBFondoXP()); m_rcClient.InflateRect(0,1); if (enShow==CM_NORMAL) { //el boton no esta seleccionado m_rcClient.left += 2; m_rcClient.right+= 2; DrawArrow(pDC,m_rcClient); } else { m_rcClient.InflateRect(1,1); CBrush cblu; cblu.CreateSolidBrush(enShow == CM_ONFOCUS? CDrawLayer::GetRGBFondoXP():CDrawLayer::GetRGBPressBXP()); pDC->FillRect(&m_rcClient,&cblu); m_rcClient.right += 1; pDC->Draw3dRect(&m_rcClient,CDrawLayer::GetRGBMenu(),CDrawLayer::GetRGBMenu()); DrawArrow(pDC,m_rcClient); cblu.DeleteObject(); } }
Adesk::Boolean GasPumpGEDraw::subWorldDraw( AcGiWorldDraw* mode ) { assertReadEnabled () ; AcGeVector3d v = m_endPt - m_startPt; v.normalize(); // 绘制箭头 DrawArrow( mode, m_startPt - v * 0.5 * m_radius, m_angle, 2*0.8660254037844386 * m_radius, 1.5 * m_radius * 0.9 ); DrawCircle( mode, m_startPt, m_radius, false ); AcGePoint3d spt,ept; spt = m_startPt - v * 0.5 * m_radius + v * 1.5 * m_radius * 0.9; ept = m_startPt - v * 0.5 * m_radius + v * 1.5 * m_radius; DrawArrow( mode, spt, m_angle, 2*0.8660254037844386 * m_radius * 0.09, 1.5 * m_radius * 0.1 ); update(); return Adesk::kTrue; }
static void Redisplay( Widget wid, XEvent *event, Region region ) { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; int iwidth, iheight; XtExposeProc expose; iwidth = (int) aw->core.width - 2 * aw->primitive.highlight_thickness; iheight = (int) aw->core.height - 2 * aw->primitive.highlight_thickness; /* Draw the arrow */ if ((iwidth > 0) && (iheight > 0)) { if (aw->primitive.shadow_thickness > 0) XmeDrawShadows(XtDisplay (aw), XtWindow (aw), aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, aw->primitive.highlight_thickness, aw->primitive.highlight_thickness, aw->core.width - 2 * aw->primitive.highlight_thickness, aw->core.height - 2 * aw->primitive.highlight_thickness, aw->primitive.shadow_thickness, XmSHADOW_OUT); if (aw->arrowbutton.selected && XtIsSensitive(wid)) DrawArrow(aw, aw->primitive.bottom_shadow_GC, aw->primitive.top_shadow_GC, aw->arrowbutton.arrow_GC); else DrawArrow(aw, aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, (XtIsSensitive(wid) ? aw->arrowbutton.arrow_GC : aw->arrowbutton.insensitive_GC)); } /* Envelop our superclass expose method */ _XmProcessLock(); expose = xmPrimitiveClassRec.core_class.expose; _XmProcessUnlock(); (*(expose)) ((Widget) aw, event, region); }
//*************************************************************************** void CGuiHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC); CRect rcitem = lpDrawItemStruct->rcItem; UINT uState = lpDrawItemStruct->itemState; int nItemID = lpDrawItemStruct->itemID; CBrush m_brush; CString m_caption; CSize siImg=CSize(0,0); TCHAR caption[256]; IMAGEINFO pImageInfo; int OldMode=pDC->SetBkMode(TRANSPARENT); m_brush.CreateSysColorBrush(COLOR_3DFACE); pDC->FillRect(rcitem,&m_brush); HDITEM hdi; hdi.mask = HDI_TEXT | HDI_FORMAT|HDI_IMAGE| HDI_ORDER; hdi.pszText = caption; hdi.cchTextMax = 255; GetItem( nItemID, &hdi ); //--------------------------------------------------------- //se mueve la imagen para dar la sensacion //de seleccion del item //--------------------------------------------------------- if (uState == ODS_SELECTED) { rcitem.left+=1; rcitem.top+=1; } if (m_nNumbottomSelect==nItemID) { DrawArrow(pDC,rcitem,m_bSentido); rcitem.right-=12; } if (hdi.iImage > -1) { m_img.GetImageInfo(hdi.iImage,&pImageInfo); CRect rcima =pImageInfo.rcImage; siImg=CSize(rcima.Width(),rcima.Height()); CPoint pti(rcitem.left+2,rcitem.top+1); m_img.Draw(pDC, hdi.iImage, pti, ILD_TRANSPARENT); } if (lstrlen(caption) > 0) { CRect m_rctext=rcitem; m_rctext.left+=siImg.cx+4; m_rctext.bottom-=2; DrawTextExt(caption,pDC,&m_rctext,DT_SINGLELINE|DT_BOTTOM); } pDC->SetBkMode(OldMode); }
void DrawForce(NxActor* actor, NxVec3& forceVec, const NxVec3& color) { // Draw only if the force is large enough NxReal force = forceVec.magnitude(); if (force < 0.1f) return; forceVec = 3*forceVec/force; NxVec3 pos = actor->getCMassGlobalPosition(); DrawArrow(pos, pos + forceVec, color); }
void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, CFX_Matrix* pMatrix) { DrawBtn(pGraphics, pRect, eState, pMatrix); InitializeArrowColorData(); DrawArrow(pGraphics, pRect, eDict, m_pColorData->clrSign[eState - 1], pMatrix); }
void DrawBothArrows(cairo_t* cr, nux::color::RedGreenBlue const& rgb, int width, int height) { int const arrow_width = 5; int const arrow_height = 3; float const trans_height = 8.5; float const offset_x = 0.5; // Top cairo_save(cr); cairo_translate(cr, width/2 + offset_x, trans_height); cairo_rotate(cr, G_PI); DrawArrow(cr, rgb, offset_x, 0, arrow_width, arrow_height); cairo_restore(cr); // Bottom cairo_save(cr); cairo_translate(cr, width/2 + offset_x, height - trans_height); cairo_rotate(cr, 0); DrawArrow(cr, rgb, -offset_x, 0, arrow_width, arrow_height); cairo_restore(cr); }
/***************************************************************************** * Function - Redraw * DESCRIPTION: * Redraws this element. If it fails (for some reason) the * method returns false. *****************************************************************************/ bool ScrollBar::Redraw() { bool return_value; if (IsVisible()) { // Draw the scrollbar const U16 y2 = (mShowArrows ? GetWidth() - 1 : 1); const U16 slider_area_height = GetSliderAreaSize() - mSliderSize + (mShowArrows ? - 2 : -4); U16 pos = 0; if ((mMaxPos - mMinPos) > 0) { pos = y2 + 1 + (((U32)slider_area_height) * mCurPos / (mMaxPos - mMinPos)); mpSliderFrame->SetClientArea(2, pos, GetWidth() - 3, pos + mSliderSize - 1); mpSliderFrame->SetVisible(); } else { mpSliderFrame->SetVisible(false); } Frame::Redraw(); if (mShowArrows) { int width = GetWidth() - 1; int height = width - 2; DrawArrow(1, height + 1, height, width, true); DrawArrow(1, GetHeight() - 2 - height, height, width, false); } return_value = true; } else { return_value = false; Frame::Redraw(); } return return_value; }
void CHSScrollBar::Draw( CDC* pDC ) { if (m_rect.IsRectEmpty()) { return; } pDC->FillSolidRect(&m_rect, m_clrBK); DrawBorder(pDC); DrawArrow(pDC); DrawBlock(pDC); }
void DropDownList::Refresh(PaintEventArgs&& e) { const auto cs(GetCursorState()); if(FetchContainerPtr(lbContent)) csCurrent = CursorState::Pressed; Button::Refresh(std::move(e)); csCurrent = cs; // XXX: Conversion to 'SPos' might be implementation-defined. DrawArrow(e.Target, e.ClipArea, Rect(e.Location.X + SPos(GetWidth()) - 16, e.Location.Y, Size(16, GetHeight())), 4, RDeg270, ForeColor); }
void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, CFX_Matrix* pMatrix) { DrawBtn(pGraphics, pRect, eState, pMatrix); if (!CFWL_ArrowData::IsInstance()) { CFWL_ArrowData::GetInstance()->SetColorData(FWL_GetThemeColor(m_dwThemeID)); } CFWL_ArrowData::CColorData* pColorData = CFWL_ArrowData::GetInstance()->m_pColorData; DrawArrow(pGraphics, pRect, eDict, pColorData->clrSign[eState - 1], pMatrix); }
//*************************************************************************** BOOL CHeaderView::DrawItem(HDITEM hdi,CGDI* pDC) { CRect rcitem; CSize siImg=CSize(0,0); IMAGEINFO pImageInfo; int OldMode=pDC->SetBkMode(TRANSPARENT); GetItemRect(hdi.iOrder, rcitem); HFONT m_fontOldBold; HFONT m_fontOld; (void)m_fontOldBold; (void)m_fontOld; //--------------------------------------------------------- //se mueve la imagen para dar la sensacion //de seleccion del item //--------------------------------------------------------- if (m_nNumbottomSelect==hdi.iOrder) { DrawArrow(pDC,rcitem,m_bSentido); rcitem.right-=12; } if (hdi.iImage > -1) { m_img.GetImageInfo(hdi.iImage,&pImageInfo); CRect rcima =pImageInfo.rcImage; siImg=CSize(rcima.Width(),rcima.Height()); CPoint pti(rcitem.left+2,rcitem.top+1); m_img.Draw( hdi.iImage,pDC->m_hDC, pti, ILD_TRANSPARENT); } if (hdi.cchTextMax > 0) { CRect m_rctext=rcitem; m_rctext.left+=siImg.cx+4; m_rctext.bottom-=2; if (m_bMouserOver && m_selected==hdi.iOrder) m_fontOldBold=pDC->SelectFont(m_cfontBold); else m_fontOld=pDC->SelectFont(m_cfontNormal); DrawTextExt(hdi.pszText,pDC,&rcitem); } pDC->SetBkMode(OldMode); return TRUE; }