Beispiel #1
0
		void  CSimpleMarketSymbol::DrawGeometryEx(IDisplay* pDisplay, const GPoint* points, const int* polyCounts, size_t polyCount)
		{
			for(size_t part = 0, offset = 0; part < polyCount; part++)
			{
				for(int point = (int)offset; point < (int)offset + polyCounts[part]; point++)
				{
					switch(m_style)
					{
					case SimpleMarkerStyleCircle:
						DrawCircle(points[point], pDisplay->GetGraphics().get());
						break;
					case SimpleMarkerStyleSquare:
						DrawSquare(points[point], pDisplay->GetGraphics().get());
						break;
					case SimpleMarkerStyleCross:
						DrawCross(points[point], pDisplay->GetGraphics().get());
						break;
					case SimpleMarkerStyleX:
						DrawX(points[point], pDisplay->GetGraphics().get());
						break;
					case SimpleMarkerStyleDiamond:
						DrawDiamond(points[point], pDisplay->GetGraphics().get());
						break;
					}
				}
				offset += polyCounts[part];
			}
		}
Beispiel #2
0
void Enemy_EHPDraw(double EBarWari){
	  
	DrawBox(330-2,10-2,630+2,20+2,color[0],TRUE);
	DrawBox(330,10,630,20,color[1],TRUE);
	DrawBox(330,10,EBarWari,20,color[2],TRUE);
	
	DrawGraph(DrawX(1550),35,EBaseGraph,TRUE);

}
void CTicTacView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// 0의 차례이거나 그리드 외부에서 클릭하였거나 비어있지 않은
	// 영역을 클락하면 아무것도 하지 않음
	if( m_nNextChar != EX)
		return;

	int nPos = GetRectID( point);
	if(( nPos == -1) || (m_nGameGrid[nPos] != 0 ))
		return;

	// 그리드에 X를 추가하고 m_nNextChar를 토글
	m_nGameGrid[nPos] = EX;
	m_nNextChar		  = OH;

	// 화면에 X를 표시하고 승패를 알아 낸다.
	CClientDC dc(this);
	DrawX(&dc, nPos);
	CheckForGameOver();
	
	CView::OnLButtonDown(nFlags, point);
}
void CTicTacView::DrawBoard(CDC *pDC)
{
	// tic-tac-toe그리드를 정의하는 선을 그림
	CPen pen(PS_SOLID, 16, RGB(0, 0, 0));
	CPen *pOldPen = pDC->SelectObject(&pen);

	pDC->MoveTo(120, 16);	pDC->LineTo(120, 336);
	pDC->MoveTo(232, 16);	pDC->LineTo(232, 336);
	pDC->MoveTo(16, 120);	pDC->LineTo(336, 120);
	pDC->MoveTo(16, 232);	pDC->LineTo(336, 232);


	// X와 O를 그림
	for( int i=0; i<9; i++)
	{
		if( m_nGameGrid[i] == EX)
			DrawX(pDC, i);
		else if( m_nGameGrid[i] == OH)
			DrawO(pDC, i);
	}
	pDC->SelectObject(pOldPen);
}
Beispiel #5
0
/*
 * EXPORTED FUNCTIONS _________________________________________________________
 *
 */
void PaintStepGraphic(HWND hwnd, STEP_STATE state)
{
    PAINTSTRUCT ps;

    HDC hdc = BeginPaint(hwnd, &ps);
    _ASSERTE(hdc);

    RECT rect;
    GetClientRect(hwnd, &rect);

    InflateRect(&rect, -2, -2);

    // First erase the background
    EraseRect(hdc, rect);

    // Draw an image that corresponds to the state
    switch (state) {
    case SS_STEP_IN_PROGRESS:	
	DrawCircle(hdc, rect, STEP_IN_PROGRESS_COLOR);
	break;

    case SS_STEP_TO_BE_DONE:	
	DrawCircle(hdc, rect, STEP_TO_BE_DONE_COLOR);
	break;

    case SS_STEP_FINISHED:		
	DrawCheckmark(hdc, rect);
	break;

	
    case SS_STEP_FAILED: 
	DrawX(hdc, rect);
	break;
    }
	
    EndPaint(hwnd, &ps);
}
	void CoreDelegateImpl::Draw()
	{
		DrawX();
	}
Beispiel #7
0
void wxTabbedCtrl::OnPaint(wxPaintEvent &) {
    wxPaintDC dc(this);
    wxSize size = GetSize();
    wxBrush back_brush = wxBrush(GetBackgroundColour());
    wxBrush nosel_brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
    wxBrush sel_brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
    wxPen border_pen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
    wxPen sel_pen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT));
    wxPen back_pen = wxPen(GetBackgroundColour());
    wxFont normal_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    wxFont bold_font = normal_font;
    bold_font.SetWeight(wxFONTWEIGHT_BOLD);
    bool mirror = style & wxTB_BOTTOM;
    bool fullborder = !(style & wxNO_BORDER);

    dc.BeginDrawing();

    //background
    dc.SetTextBackground(GetBackgroundColour());
    dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
    dc.SetBrush(back_brush);
    if(fullborder) {
        dc.SetPen(border_pen);
        dc.DrawRectangle(0, 0, size.x, size.y);
    }
    else {
        dc.SetPen(back_pen);
        dc.DrawRectangle(0, 0, size.x, size.y);
        dc.SetPen(border_pen);
        dc.DrawLine(0, mirror ? 0 : size.y-1, size.x, mirror ? 0 : size.y-1);
    }

    int height, width, pom;
    dc.SetFont(bold_font);
    dc.GetTextExtent("Aq", &pom, &height);
    int posx = 3;

    //and tabs
    int i = m_intStartPage;
    for( ; i < GetPageCount(); i++) {
        dc.SetPen(border_pen);
        dc.SetFont((i==GetSelection()) ? bold_font : normal_font);
        dc.SetBrush((i==GetSelection()) ? sel_brush : nosel_brush);
        dc.GetTextExtent(GetPageText(i), &width, &pom);

        int space = padding.x;
        if( ( posx + width+space+padding.x + BUTTON_BAR_SIZE ) > size.x ) {
            break;
        }

        dc.DrawRoundedRectangle(posx, size.y-height-padding.y*2, width+space+padding.x, height+padding.y*2+3, 3);
        dc.DrawText(GetPageText(i), posx+space, size.y-height-padding.y);
        if(i!=GetSelection())
            dc.DrawLine(posx, size.y-1, posx+width+space+padding.x, size.y-1);

        posx += width+space+padding.x;
    }
    m_intLastPage = i - 1;

    //X
    DrawX(hover, dc);
    DrawNext( hover_next, dc );
    DrawPrev( hover_prev, dc );
    DrawMenu( hover_menu, dc );


    dc.EndDrawing();
}
Beispiel #8
0
void wxTabbedCtrl::OnMouse(wxMouseEvent &ev) {
    wxPoint mouse = ev.GetPosition();
    int page = HitTest(ev.GetPosition());
    if(ev.GetEventType()==wxEVT_MOTION) {
        bool xhover = mouse.x >= x_rect.x && mouse.x <= x_rect.x+x_rect.width && mouse.y >= x_rect.y && mouse.y <= x_rect.y+x_rect.height;
        bool nhover = (mouse.x >= Next_rect.x && mouse.x <= Next_rect.x + Next_rect.width && mouse.y >= Next_rect.y && mouse.y <= Next_rect.y + Next_rect.height ) &&
                      ( m_intLastPage < ( GetPageCount() - 1 ) );
        bool phover = (mouse.x >= Prev_rect.x && mouse.x <= Prev_rect.x + Prev_rect.width && mouse.y >= Prev_rect.y && mouse.y <= Prev_rect.y + Prev_rect.height ) &&
                      ( m_intStartPage > 0 );
        bool mhover = (mouse.x >= Menu_rect.x && mouse.x <= Menu_rect.x + Menu_rect.width && mouse.y >= Menu_rect.y && mouse.y <= Menu_rect.y + Menu_rect.height );
        if(hover != xhover) {
            hover = xhover;
            wxClientDC dc(this);
            DrawX(hover, dc);
        }
        else if(hover_next != nhover) {
            hover_next = nhover;
            wxClientDC dc(this);
            DrawNext(hover_next, dc);
        }
        else if(hover_prev != phover) {
            hover_prev = phover;
            wxClientDC dc(this);
            DrawPrev(hover_prev, dc);
        }
        else if ( hover_menu != mhover ) {
            hover_menu = mhover;
            wxClientDC dc(this);
            DrawMenu(hover_menu, dc);
        }
        else {
            wxToolTip * tooltip = GetToolTip();
            if ( page != wxNOT_FOUND ) {
                if ( tipTab != page ) {
                    tipTab = page;
                    tooltip->Enable( true );
                    wxString info;
                    int pg = page + 1;
                    info << pg << " of " << GetPageCount() << " - " << GetPageText( page );
                    tooltip->SetTip( info );
                }
            }
            else {
                tipTab = -1;
                tooltip->Enable( false );
            }
        }
    }
    else if( ev.GetEventType()==wxEVT_LEFT_UP ) {
        if(hover ) {
            wxClientDC dc(this);
            DrawX(false, dc);
            SetVisible( active );
            wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, Menu_Close );
            GetEventHandler()->ProcessEvent( event );
        }
        else if( hover_next ) {
            wxClientDC dc(this);
            DrawNext(false, dc);
            if( GetPageCount() > ( m_intStartPage + 1 ) && ( m_intLastPage + 1 ) < GetPageCount() ) {
                m_intStartPage++;
                Refresh();
            }
        }
        else if( hover_prev ) {
            wxClientDC dc(this);
            DrawPrev(false, dc);
            if( m_intStartPage > 0 ) {
                m_intStartPage--;
                Refresh();
            }
        }
        else if( hover_menu ) {
            hover_menu = false;
            wxClientDC dc(this);
            DrawMenu(false, dc);
            GenerateConextMenu( mouse );
        }
        else {
            if(page != wxNOT_FOUND)
                SetSelection(page);
        }
    }
    else if( ev.GetEventType() == wxEVT_RIGHT_UP && page == wxNOT_FOUND ) {
        GenerateConextMenu( mouse );
    }
}