KiCad PCB EDA Suite
eeredraw.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #include <fctsys.h>
31 #include <gr_basic.h>
32 #include <class_drawpanel.h>
33 #include <schframe.h>
34 #include <general.h>
35 
36 
37 void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, COLOR4D Color )
38 {
39  BASE_SCREEN* screen = panel->GetScreen();
40 
41  if( !screen->m_IsPrinting ) /* Draw but do not print the Dangling Symbol */
42  {
43  GRRect( panel->GetClipBox(), DC,
46  0, Color );
47  }
48 }
49 
50 
51 /*
52  * Redraws only the active window which is assumed to be whole visible.
53  */
54 void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
55 {
56  if( GetScreen() == NULL )
57  return;
58 
59  m_canvas->DrawBackGround( DC );
60 
62 
63  DrawWorkSheet( DC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,
64  GetScreen()->GetFileName() );
65 
66 #ifdef USE_WX_OVERLAY
67  if( IsShown() )
68  {
69  m_overlay.Reset();
70  wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC );
71  overlaydc.Clear();
72  /* TODO: Investigate why toolbars are affected - to be searched in wxWidgets */
73  m_mainToolBar->Refresh();
74  m_drawToolBar->Refresh();
75  m_optionsToolBar->Refresh();
76  }
77 #endif
78 
79  if( m_canvas->IsMouseCaptured() )
80  m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
81 
82  m_canvas->DrawCrossHair( DC );
83 
84  // Display the sheet filename, and the sheet path, for non root sheets
85  UpdateTitle();
86 }
#define DANGLING_SYMBOL_SIZE
Definition: general.h:43
void DrawCrossHair(wxDC *aDC, COLOR4D aColor=COLOR4D::WHITE)
Function DrawCrossHair draws the user cross hair.
Definition: draw_panel.cpp:216
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
void UpdateTitle()
Function UpdateTitle sets the main window title bar text.
Definition: schframe.cpp:1365
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: schframe.cpp:520
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1077
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:125
bool IsMouseCaptured() const
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase)
Function CallMouseCapture calls the mouse capture callback.
void Draw(EDA_DRAW_PANEL *aCanvas, wxDC *aDC, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED)
Function Draw draws all the items in the screen to aCanvas.
Definition: sch_screen.cpp:558
EDA_RECT * GetClipBox()
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:122
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:135
void RedrawActiveWindow(wxDC *DC, bool EraseBg) override
Definition: eeredraw.cpp:54
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
#define GR_DEFAULT_DRAWMODE
Definition: general.h:70
BASE_SCREEN * GetScreen()
Definition: draw_panel.cpp:188
void DrawBackGround(wxDC *DC)
Function DrawBackGround.
Definition: draw_panel.cpp:666
void DrawWorkSheet(wxDC *aDC, BASE_SCREEN *aScreen, int aLineWidth, double aScale, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Function DrawWorkSheet Draws on screen the page layout with the frame and the basic inscriptions...
Definition: worksheet.cpp:77
void DrawDanglingSymbol(EDA_DRAW_PANEL *panel, wxDC *DC, const wxPoint &pos, COLOR4D Color)
Definition: eeredraw.cpp:37
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39