本文整理汇总了C++中GRSetDrawMode函数的典型用法代码示例。如果您正苦于以下问题:C++ GRSetDrawMode函数的具体用法?C++ GRSetDrawMode怎么用?C++ GRSetDrawMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GRSetDrawMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GRSetDrawMode
void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
GR_DRAWMODE aDrawMode, COLOR4D aColor )
{
wxPoint pos = m_pos + aOffset;
if( aColor == COLOR4D::UNSPECIFIED ) // Use normal drawing function
{
// https://bugs.launchpad.net/kicad/+bug/1529163
// "Moving images in eeschema on OS X uses
// wrong position and shows image flipped"
//
// Original fix was to only GRSetDrawMode if aColor >= 0, but this made
// moving SCH_BITMAP work poorly on other platforms.
#ifndef __WXMAC__
GRSetDrawMode( aDC, aDrawMode );
#endif
m_image->DrawBitmap( aPanel, aDC, pos );
}
else // draws bounding box only (used to move items)
{
GRSetDrawMode( aDC, aDrawMode );
// To draw the rect, pos is the upper left corner position
wxSize size = m_image->GetSize();
pos.x -= size.x / 2;
pos.y -= size.y / 2;
GRRect( aPanel->GetClipBox(), aDC, pos.x, pos.y,
pos.x + size.x, pos.y + size.y, 0, aColor );
}
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:30,代码来源:sch_bitmap.cpp
示例2: DrawMovingBlockOutlines
static void DrawMovingBlockOutlines(WinEDA_DrawPanel * panel, wxDC * DC,
bool erase )
/************************************************************************/
/* Retrace le contour du block de recherche de structures
L'ensemble du block suit le curseur
*/
{
DrawBlockStruct * PtBlock;
DrawPickedStruct *PickedList;
BASE_SCREEN * screen = panel->m_Parent->GetScreen();
PtBlock = &panel->GetScreen()->BlockLocate;
GRSetDrawMode(DC, g_XorMode);
/* Effacement ancien cadre */
if( erase && PtBlock->m_BlockDrawStruct)
{
PtBlock->Offset(PtBlock->m_MoveVector);
PtBlock->Draw(panel, DC);
PtBlock->Offset( -PtBlock->m_MoveVector.x, -PtBlock->m_MoveVector.y);
/* Effacement ancien affichage */
if(PtBlock->m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE)
{
PickedList = (DrawPickedStruct *) PtBlock->m_BlockDrawStruct;
while (PickedList)
{
DrawStructsInGhost(panel, DC, PickedList->m_PickedStruct, PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y);
PickedList = (DrawPickedStruct *)PickedList->Pnext;
}
}
else DrawStructsInGhost(panel, DC, PtBlock->m_BlockDrawStruct, PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y);
}
/* Redessin nouvel affichage */
PtBlock->m_MoveVector.x = screen->m_Curseur.x - PtBlock->m_BlockLastCursorPosition.x;
PtBlock->m_MoveVector.y = screen->m_Curseur.y - PtBlock->m_BlockLastCursorPosition.y;
GRSetDrawMode(DC, g_XorMode);
PtBlock->Offset(PtBlock->m_MoveVector);
PtBlock->Draw(panel, DC);
PtBlock->Offset( -PtBlock->m_MoveVector.x, -PtBlock->m_MoveVector.y);
if(PtBlock->m_BlockDrawStruct )
{
if(PtBlock->m_BlockDrawStruct->m_StructType == DRAW_PICK_ITEM_STRUCT_TYPE)
{
PickedList = (DrawPickedStruct *) PtBlock->m_BlockDrawStruct;
while (PickedList)
{
DrawStructsInGhost(panel, DC, PickedList->m_PickedStruct, PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y);
PickedList = (DrawPickedStruct *)PickedList->Pnext;
}
}
else DrawStructsInGhost(panel, DC, PtBlock->m_BlockDrawStruct, PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y);
}
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:58,代码来源:block.cpp
示例3: wxT
void WinEDA_LibeditFrame::EditField(wxDC * DC, LibDrawField *Field)
/******************************************************************/
{
wxString Text;
int color;
wxString title = wxT("Text:");
if( Field == NULL) return;
switch (Field->m_FieldId)
{
case REFERENCE:
title = wxT("Reference:");
color = ReturnLayerColor(LAYER_REFERENCEPART);
break;
case VALUE:
title = wxT("Value:");
color = ReturnLayerColor(LAYER_VALUEPART);
break;
default:
color = ReturnLayerColor(LAYER_FIELDS);
break;
}
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
Text = Field->m_Text;
Get_Message(title,Text, this);
Text.Replace( wxT(" ") , wxT("_") );
GRSetDrawMode(DC, g_XorMode);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
if( ! Text.IsEmpty() )
{
SaveCopyInUndoList();
Field->m_Text = Text;
}
else DisplayError(this, _("No new text: no change") );
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
m_CurrentScreen->SetModify();
if ( Field->m_FieldId == VALUE ) ReCreateHToolbar();
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:58,代码来源:libfield.cpp
示例4: GetBoard
/* Draw PCB_TARGET object: 2 segments + 1 circle
* The circle radius is half the radius of the target
* 2 lines have length the diameter of the target
*/
void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
const wxPoint& offset )
{
int radius, ox, oy, width;
int dx1, dx2, dy1, dy2;
ox = m_Pos.x + offset.x;
oy = m_Pos.y + offset.y;
BOARD * brd = GetBoard( );
if( brd->IsLayerVisible( m_Layer ) == false )
return;
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
GRSetDrawMode( DC, mode_color );
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
bool filled = displ_opts ? displ_opts->m_DisplayDrawItemsFill : FILLED;
width = m_Width;
radius = m_Size / 3;
if( GetShape() ) // shape X
radius = m_Size / 2;
if( filled )
GRCircle( panel->GetClipBox(), DC, ox, oy, radius, width, gcolor );
else
{
GRCircle( panel->GetClipBox(), DC, ox, oy, radius + (width / 2), gcolor );
GRCircle( panel->GetClipBox(), DC, ox, oy, radius - (width / 2), gcolor );
}
radius = m_Size / 2;
dx1 = radius;
dy1 = 0;
dx2 = 0;
dy2 = radius;
if( GetShape() ) // shape X
{
dx1 = dy1 = radius;
dx2 = dx1;
dy2 = -dy1;
}
if( filled )
{
GRLine( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRLine( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
}
else
{
GRCSegm( panel->GetClipBox(), DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor );
GRCSegm( panel->GetClipBox(), DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor );
}
}
开发者ID:cpavlina,项目名称:kicad,代码行数:64,代码来源:class_pcb_target.cpp
示例5: GRSetDrawMode
void EDA_DRAW_PANEL::DrawBackGround( wxDC* DC )
{
GRSetDrawMode( DC, GR_COPY );
if( GetParent()->IsGridVisible() )
DrawGrid( DC );
// Draw axis
if( GetParent()->GetShowAxis() )
{
COLOR4D axis_color = COLOR4D( BLUE );
wxSize pageSize = GetParent()->GetPageSizeIU();
// Draw the Y axis
GRLine( &m_ClipBox, DC, 0, -pageSize.y, 0, pageSize.y, 0, axis_color );
// Draw the X axis
GRLine( &m_ClipBox, DC, -pageSize.x, 0, pageSize.x, 0, 0, axis_color );
}
if( GetParent()->GetShowOriginAxis() )
DrawAuxiliaryAxis( DC, GR_COPY );
if( GetParent()->GetShowGridAxis() )
DrawGridAxis( DC, GR_COPY, GetParent()->GetGridOrigin() );
}
开发者ID:Lotharyx,项目名称:kicad-source-mirror,代码行数:26,代码来源:eda_draw_panel.cpp
示例6: GetLayerColor
void SCH_BUS_ENTRY_BASE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
GR_DRAWMODE aDrawMode, COLOR4D aColor )
{
COLOR4D color;
EDA_RECT* clipbox = aPanel->GetClipBox();
if( aColor != COLOR4D::UNSPECIFIED )
color = aColor;
else
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
GRSetDrawMode( aDC, aDrawMode );
GRLine( clipbox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
m_End().x + aOffset.x, m_End().y + aOffset.y, GetPenSize(), color );
// Draw pin targets if part is being dragged
bool dragging = aPanel->GetScreen()->GetCurItem() == this && aPanel->IsMouseCaptured();
if( m_isDanglingStart || dragging )
{
GRCircle( clipbox, aDC, m_pos.x + aOffset.x, m_pos.y + aOffset.y,
TARGET_BUSENTRY_RADIUS, 0, color );
}
if( m_isDanglingEnd || dragging )
{
GRCircle( clipbox, aDC, m_End().x + aOffset.x, m_End().y + aOffset.y,
TARGET_BUSENTRY_RADIUS, 0, color );
}
}
开发者ID:cpavlina,项目名称:kicad,代码行数:32,代码来源:sch_bus_entry.cpp
示例7: Polyline_in_Ghost
static void Polyline_in_Ghost(WinEDA_DrawPanel * panel, wxDC * DC, bool erase)
/*****************************************************************************/
/* Dessin du du Polyline Fantome lors des deplacements du curseur
*/
{
DrawPolylineStruct * NewPoly =
(DrawPolylineStruct *)panel->m_Parent->GetScreen()->m_CurrentItem;
int color;
wxPoint endpos;
endpos = panel->m_Parent->GetScreen()->m_Curseur;
color = ReturnLayerColor(NewPoly->m_Layer);
GRSetDrawMode(DC, XOR_MODE);
if( g_HVLines )
{
/* Coerce the line to vertical or horizontal one: */
if (ABS(endpos.x - NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 2]) <
ABS(endpos.y - NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 1]))
endpos.x = NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 2];
else
endpos.y = NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 1];
}
NewPoly->m_NumOfPoints++;
if( erase )
RedrawOneStruct(panel,DC, NewPoly, XOR_MODE, color);
NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 2] = endpos.x;
NewPoly->m_Points[NewPoly->m_NumOfPoints * 2 - 1] = endpos.y;
RedrawOneStruct(panel,DC, NewPoly, XOR_MODE, color);
NewPoly->m_NumOfPoints--;
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:34,代码来源:eecreate.cpp
示例8: GRSetDrawMode
void WinEDA_BasePcbFrame::trace_ratsnest_pad(wxDC * DC)
/*******************************************************/
/*
affiche le "chevelu" d'un pad lors des trace de segments de piste
*/
{
int * pt_coord;
int ii;
int refX, refY;
if((m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0) return;
if( nb_local_chevelu == 0 ) return;
if ( local_liste_chevelu == NULL ) return;
pt_coord = (int*) local_liste_chevelu;
refX = *pt_coord; pt_coord++;
refY = *pt_coord; pt_coord++;
GRSetDrawMode(DC, GR_XOR);
for( ii = 0; ii < nb_local_chevelu; ii++)
{
if ( ii >= g_MaxLinksShowed ) break;
GRLine(&DrawPanel->m_ClipBox, DC, refX, refY, *pt_coord, *(pt_coord+1), YELLOW);
pt_coord += 2;
}
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:26,代码来源:ratsnest.cpp
示例9: GetParent
void EDA_DRAW_PANEL::DrawGridAxis( wxDC* aDC, GR_DRAWMODE aDrawMode, const wxPoint& aGridOrigin )
{
if( !GetParent()->GetShowGridAxis() || ( !aGridOrigin.x && !aGridOrigin.y ) )
return;
COLOR4D color = GetParent()->GetGridColor();
GRSetDrawMode( aDC, aDrawMode );
#if DRAW_AXIS_AS_LINES
wxSize pageSize = GetParent()->GetPageSizeIU();
// Draw the Y axis
GRLine( &m_ClipBox, aDC, aGridOrigin.x, -pageSize.y,
aGridOrigin.x, pageSize.y, 0, color );
// Draw the X axis
GRLine( &m_ClipBox, aDC, -pageSize.x, aGridOrigin.y,
pageSize.x, aGridOrigin.y, 0, color );
#else
int radius = aDC->DeviceToLogicalXRel( AXIS_SIZE_IN_PIXELS );
int linewidth = aDC->DeviceToLogicalXRel( 1 );
GRSetColorPen( aDC, GetParent()->GetGridColor(), linewidth );
GRLine( &m_ClipBox, aDC, aGridOrigin.x-radius, aGridOrigin.y-radius,
aGridOrigin.x+radius, aGridOrigin.y+radius, 0, color );
// Draw the X shape
GRLine( &m_ClipBox, aDC, aGridOrigin.x+radius, aGridOrigin.y-radius,
aGridOrigin.x-radius, aGridOrigin.y+radius, 0, color );
GRCircle( &m_ClipBox, aDC, aGridOrigin, radius, linewidth, color );
#endif
}
开发者ID:Lotharyx,项目名称:kicad-source-mirror,代码行数:34,代码来源:eda_draw_panel.cpp
示例10: GetParent
void EDA_DRAW_PANEL::DrawAuxiliaryAxis( wxDC* aDC, GR_DRAWMODE aDrawMode )
{
wxPoint origin = GetParent()->GetAuxOrigin();
if( origin == wxPoint( 0, 0 ) )
return;
EDA_COLOR_T color = DARKRED;
wxSize pageSize = GetParent()->GetPageSizeIU();
GRSetDrawMode( aDC, aDrawMode );
// Draw the Y axis
GRDashedLine( &m_ClipBox, aDC,
origin.x,
-pageSize.y,
origin.x,
pageSize.y,
0, color );
// Draw the X axis
GRDashedLine( &m_ClipBox, aDC,
-pageSize.x,
origin.y,
pageSize.x,
origin.y,
0, color );
}
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:28,代码来源:draw_panel.cpp
示例11: GetScreen
void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{
PCB_SCREEN* screen = GetScreen();
if( !GetBoard() || !screen )
return;
GRSetDrawMode( DC, GR_COPY );
m_canvas->DrawBackGround( DC );
DrawWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString );
// Redraw the footprints
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
module->Draw( m_canvas, DC, GR_OR | GR_ALLOW_HIGHCONTRAST );
#ifdef USE_WX_OVERLAY
if( IsShown() )
{
m_overlay.Reset();
wxDCOverlay overlaydc( m_overlay, (wxWindowDC*) DC );
overlaydc.Clear();
}
#endif
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
// Redraw the cursor
m_canvas->DrawCrossHair( DC );
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:33,代码来源:pcb_legacy_draw_utils.cpp
示例12: GetDefaultLineThickness
void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,
GR_DRAWMODE DrawMode, EDA_COLOR_T Color )
{
EDA_COLOR_T color;
int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;
linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );
if( Color >= 0 )
color = Color;
else
color = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode );
wxPoint text_offset = aOffset + GetSchematicTextOffset();
EXCHG( linewidth, m_Thickness ); // Set the minimum width
EDA_TEXT::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );
EXCHG( linewidth, m_Thickness ); // set initial value
if( m_isDangling )
DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color );
// Enable these line to draw the bounding box (debug tests purposes only)
#if 0
{
EDA_RECT BoundaryBox = GetBoundingBox();
GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );
}
#endif
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:31,代码来源:sch_text.cpp
示例13: GRSetDrawMode
void BASE_SCREEN::Trace_Curseur(WinEDA_DrawPanel * panel, wxDC * DC)
/*******************************************************************/
/*
Trace Le curseur sur la zone PCB , se deplacant sur la grille
*/
{
int color = WHITE;
GRSetDrawMode(DC, GR_XOR);
if( g_CursorShape == 1 ) /* Trace d'un reticule */
{
int dx = panel->m_ClipBox.GetWidth() * GetZoom();
int dy = panel->m_ClipBox.GetHeight() * GetZoom();
GRLine(&panel->m_ClipBox, DC, m_Curseur.x - dx, m_Curseur.y,
m_Curseur.x + dx, m_Curseur.y, color); // axe Y
GRLine(&panel->m_ClipBox, DC, m_Curseur.x, m_Curseur.y - dx,
m_Curseur.x, m_Curseur.y + dy, color); // axe X
}
else
{
int len = CURSOR_SIZE * GetZoom();
GRLine(&panel->m_ClipBox, DC, m_Curseur.x - len, m_Curseur.y,
m_Curseur.x + len, m_Curseur.y, color);
GRLine(&panel->m_ClipBox, DC, m_Curseur.x, m_Curseur.y - len,
m_Curseur.x, m_Curseur.y + len, color);
}
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:28,代码来源:base_screen.cpp
示例14: DrawAndSizingBlockOutlines
void DrawAndSizingBlockOutlines(WinEDA_DrawPanel * panel, wxDC * DC, bool erase )
/********************************************************************************/
/* Redraw the outlines of the block which shows the search area for block commands
The first point of the rectangle showing the area is initialised
by InitBlockLocateDatas().
The other point of the rectangle is the mouse cursor
*/
{
DrawBlockStruct * PtBlock;
PtBlock = &panel->GetScreen()->BlockLocate;
PtBlock->m_MoveVector = wxPoint(0,0);
GRSetDrawMode(DC, g_XorMode);
/* Effacement ancien cadre */
if( erase ) PtBlock->Draw(panel, DC);
PtBlock->m_BlockLastCursorPosition = panel->GetScreen()->m_Curseur;
PtBlock->SetEnd(panel->GetScreen()->m_Curseur);
PtBlock->Draw(panel, DC);
if ( PtBlock->m_State == STATE_BLOCK_INIT )
{
if ( PtBlock->GetWidth() || PtBlock->GetHeight() )
/* 2ieme point existant: le rectangle n'est pas de surface nulle */
PtBlock->m_State = STATE_BLOCK_END;
}
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:31,代码来源:block_commande.cpp
示例15: GetScreen
void WinEDA_PcbFrame::RedrawActiveWindow(wxDC * DC, bool EraseBg)
/****************************************************************/
/* Trace le PCB, et les elements complementaires ( axes, grille .. )
pour l'ecran actif et ses sous ecran
*/
{
PCB_SCREEN * Screen = GetScreen();
if ( ! m_Pcb || ! Screen ) return;
ActiveScreen = GetScreen();
GRSetDrawMode(DC, GR_COPY);
if ( EraseBg ) DrawPanel->EraseScreen(DC);
DrawPanel->DrawBackGround(DC);
Trace_Pcb(DC, GR_OR);
TraceWorkSheet(DC, GetScreen());
Affiche_Status_Box();
/* Reaffichage des curseurs */
for( Screen = GetScreen(); Screen != NULL; Screen = Screen->Next() )
{
if( m_CurrentScreen->ManageCurseur )
m_CurrentScreen->ManageCurseur(DrawPanel, DC, FALSE);
Screen->Trace_Curseur(DrawPanel, DC);
}
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:29,代码来源:tracepcb.cpp
示例16: switch
void WinEDA_LibeditFrame::RotateField(wxDC * DC, LibDrawField *Field)
/********************************************************************/
/* Routine de modification de l'orientation ( Horiz ou Vert. ) du champ.
si un champ est en cours d'edition, modif de celui ci.
sinon Modif du champ pointe par la souris
*/
{
int color;
if( Field == NULL) return;
m_CurrentScreen->SetModify();
switch (Field->m_FieldId)
{
case REFERENCE:
color = ReturnLayerColor(LAYER_REFERENCEPART);
break;
case VALUE:
color = ReturnLayerColor(LAYER_VALUEPART);
break;
default:
color = ReturnLayerColor(LAYER_FIELDS);
break;
}
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
GRSetDrawMode(DC, g_XorMode);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
if( Field->m_Orient) Field->m_Orient = 0;
else Field->m_Orient = 1;
if( Field->m_Flags == 0 ) GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:47,代码来源:libfield.cpp
示例17: GRSetDrawMode
void WinEDA_DrawPanel::EraseScreen(wxDC * DC)
/*********************************************/
{
GRSetDrawMode(DC, GR_COPY);
GRSFilledRect(&m_ClipBox, DC, m_ClipBox.GetX(), m_ClipBox.GetY(),
m_ClipBox.GetRight(), m_ClipBox.GetBottom(),
g_DrawBgColor, g_DrawBgColor);
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:8,代码来源:drawpanel.cpp
示例18: GetBoard
void SEGZONE::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
if( displ_opts->m_DisplayZonesMode != 0 )
return;
BOARD * brd = GetBoard( );
EDA_COLOR_T color = brd->GetLayerColor(m_Layer);
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
return;
#ifdef USE_WX_OVERLAY
// If dragged not draw in OnPaint otherwise remains impressed in wxOverlay
if( (m_Flags & IS_DRAGGED) && aDC->IsKindOf(wxCLASSINFO(wxPaintDC)))
return;
#endif
if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts->m_ContrastModeDisplay )
{
LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
if( !IsOnLayer( curr_layer ) )
ColorTurnToDarkDarkGray( &color );
}
if( aDrawMode & GR_HIGHLIGHT )
ColorChangeHighlightFlag( &color, !(aDrawMode & GR_AND) );
ColorApplyHighlightFlag( &color );
SetAlpha( &color, 150 );
GRSetDrawMode( aDC, aDrawMode );
int l_trace = m_Width / 2;
if( aDC->LogicalToDeviceXRel( l_trace ) <= MIN_DRAW_WIDTH )
{
GRLine( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, 0, color );
return;
}
if( !displ_opts->m_DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
{
GRCSegm( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, m_Width, color );
}
else
{
GRFillCSegm( panel->GetClipBox(), aDC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y,
m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color );
}
// No clearance or netnames for zones
}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:58,代码来源:class_track.cpp
示例19: GetBoard
void SEGZONE::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
auto displ_opts = (PCB_DISPLAY_OPTIONS*)( panel->GetDisplayOptions() );
if( displ_opts->m_DisplayZonesMode != 0 )
return;
BOARD* brd = GetBoard();
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
return;
#ifdef USE_WX_OVERLAY
// If dragged not draw in OnPaint otherwise remains impressed in wxOverlay
if( (m_Flags & IS_DRAGGED) && aDC->IsKindOf(wxCLASSINFO(wxPaintDC)))
return;
#endif
if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts->m_ContrastModeDisplay )
{
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
if( !IsOnLayer( curr_layer ) )
color = COLOR4D( DARKDARKGRAY );
}
if( ( aDrawMode & GR_HIGHLIGHT ) && !( aDrawMode & GR_AND ) )
color.SetToLegacyHighlightColor();
color.a = 0.588;
GRSetDrawMode( aDC, aDrawMode );
// Draw track as line if width <= 1pixel:
if( aDC->LogicalToDeviceXRel( m_Width ) <= 1 )
{
GRLine( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, m_Width, color );
return;
}
if( !displ_opts->m_DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
{
GRCSegm( panel->GetClipBox(), aDC, m_Start + aOffset, m_End + aOffset, m_Width, color );
}
else
{
GRFillCSegm( panel->GetClipBox(), aDC, m_Start.x + aOffset.x,
m_Start.y + aOffset.y,
m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color );
}
// No clearance or netnames for zones
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:57,代码来源:class_track.cpp
示例20: DisplayRoutingMatrix
/* DEBUG Function: displays the routing matrix */
void DisplayRoutingMatrix( EDA_DRAW_PANEL* panel, wxDC* DC )
{
int dcell0;
EDA_COLOR_T color;
int maxi = 600 / RoutingMatrix.m_Ncols;
maxi = ( maxi * 3 ) / 4;
if( !maxi )
maxi = 1;
GRSetDrawMode( DC, GR_COPY );
for( int col = 0; col < RoutingMatrix.m_Ncols; col++ )
{
for( int row = 0; row < RoutingMatrix.m_Nrows; row++ )
{
color = BLACK;
dcell0 = RoutingMatrix.GetCell( row, col, BOTTOM );
if( dcell0 & HOLE )
color = GREEN;
#if 0
int dcell1 = 0;
if( RoutingMatrix.m_RoutingLayersCount )
dcell1 = GetCell( row, col, TOP );
if( dcell1 & HOLE )
color = RED;
dcell0 |= dcell1;
#endif
if( !color && ( dcell0 & VIA_IMPOSSIBLE ) )
color = BLUE;
if( dcell0 & CELL_is_EDGE )
color = YELLOW;
else if( dcell0 & CELL_is_ZONE )
color = YELLOW;
#define DRAW_OFFSET_X -20
#define DRAW_OFFSET_Y 20
// if( color )
{
for( int i = 0; i < maxi; i++ )
for( int j = 0; j < maxi; j++ )
GRPutPixel( panel->GetClipBox(), DC,
( col * maxi ) + i + DRAW_OFFSET_X,
( row * maxi ) + j + DRAW_OFFSET_Y, color );
}
}
}
}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:57,代码来源:autorout.cpp
注:本文中的GRSetDrawMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论