コード例 #1
0
ファイル: symbdraw.cpp プロジェクト: cpavlina/kicad
/*
 * Redraw the graphic shape while moving
 */
static void RedrawWhileMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
                                     bool aErase )
{
    LIB_ITEM* item;

    item = ( (LIB_EDIT_FRAME*) aPanel->GetParent() )->GetDrawItem();

    if( item == NULL )
        return;

    item->SetEraseLastDrawItem( aErase );

    // if item is the reference field, we must add the current unit id
    if( item->Type() == LIB_FIELD_T )
    {
        int         unit = ((LIB_EDIT_FRAME*)aPanel->GetParent())->GetUnit();
        wxString    text = ((LIB_FIELD*)item)->GetFullText( unit );

        item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ),
                    COLOR4D::UNSPECIFIED, g_XorMode, &text,
                    DefaultTransform );
    }
    else
        item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ),
                    COLOR4D::UNSPECIFIED, g_XorMode, NULL,
                    DefaultTransform );
}
コード例 #2
0
ファイル: symbdraw.cpp プロジェクト: cpavlina/kicad
//! @brief Manage mouse events when creating new graphic object or modifying an graphic object.
static void SymbolDisplayDraw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
                               bool aErase )
{
    LIB_ITEM* item = ( (LIB_EDIT_FRAME*) aPanel->GetParent() )->GetDrawItem();

    if( item == NULL )
        return;

    item->SetEraseLastDrawItem( aErase );
    item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ),
                COLOR4D::UNSPECIFIED, g_XorMode, NULL, DefaultTransform );
}