Commit f69a4914 authored by stambaughw's avatar stambaughw

Minor drawing and build bug fixes.

* Fixed clipping bug when USE_WX_ZOOM is enabled that causes rats nest
  to be drawn incorrectly.
* Fix ambiguous function error in trigo.cpp when building with MSVS.
* Add instructions for building wxWidgets with graphics context
  enabled (GDI+) using MinGW/MSYS to COMPILING.txt.
* Initial EESchema find dialog work.
* Set modified flag when using PCBNew global deletion dialog to prevent
  closing without warning user of changes.
parent 3e8f7acd
......@@ -64,11 +64,21 @@ there, and then:
make install
----
I think the default is to install into /usr/local/wxMSW-2.8.8. You can probably
pass --prefix=<wxInstallDir> to configure above to change where "make install"
puts everything. We will refer to <wxInstallDir> again below. Without the
--prefix=<wxInstallDir> passed to configure, <wxInstallDir> will likely be
/usr/local/wxMSW-2.8.8
The default install path is /usr/local. Generally speaking MinGW likes header
files in /mingw/include and library link files in /mingw/lib. You can install
path by setting --prefix=/mingw to configure above to change where "make install"
puts everything. We will refer to the --prefix setting as <wxInstallDir> below.
If you are planning to enable the USE_WX_GRAPHICS_CONTEXT option (see options
section below) on Windows using MinGW/MSYS you must build wxWidgets with the
--enable-graphics_ctx switch added to the build configurations above.
Unfortunately it is not quite that simple because MinGW does not define the
Gdi+ header and link library files. First you must download the required Gdi+
development files from
<http://www.miscdebris.net/blog/2009/09/17/adding-gdi-headers-to-mingw-to-compile-wxwidgets-with-wxgraphicscontext-support/>
and unzip them where MinGW is installed.
Verify that wx-config is in your path. Modify your PATH environment variable
if need be so you can run wx-config from a command prompt. You may have to
......@@ -103,7 +113,7 @@ Under Windows, if zlib is not installed, my cmake build will try to use the
wxWidgets zlib build. So, under windows kicad build should work without
zlib install.
If you are using the wxWidget zlib, make sure that the wxWidgets/src/zlib directory is copied
If you are using the wxWidget zlib, make sure that the wxWidgets/src/zlib directory is copied
to ${wxWidgets_ROOT_DIR}/src/zlib
Install CMake
......@@ -202,5 +212,14 @@ These should be set from command line:
KICAD_PYTHON ON/OFF
USE_WX_ZOOM ON/OFF (OPTIONAL)
Experimental coordinate translation code using wxDC instead of custom
Kicad version.
USE_WX_GRAPHICS_CONTEXT ON/OFF (OPTIONAL)
Experimental advanced drawing library code using wxGraphicsContext. It
requires wxWidgets to be built with the --enable-graphics_ctx switch.
See building wxWidgets above.
Note: that it is easy to build only a specific binary such as pcbnew alone:
make pcbnew
......@@ -117,7 +117,8 @@ Use wxDC for coordinate scaling and offsetting fix. (Wayne)
------------------------------------------------------------
W1) Make wxAutoBufferedPaintDC function properly.
W2) Make bitmap grid drawing method function properly.
W2) Make bitmap grid drawing method function properly or figure out a more
efficient method for drawing the grid.
W3) Use one cursor position (preferrably logical (drawing) units) instead
of keeping track of both logical and device cursor positions at the same
......@@ -125,10 +126,6 @@ W3) Use one cursor position (preferrably logical (drawing) units) instead
W4) Figure out why none of the apps render correctly using wxGCDC on Windows.
W5) Add instructions for building wxWidgets with GDI+ using MinGW/MSYS
on Windows so wxGraphicsContext is available without having to use
Visual Studio.
** After (if?) new code accepted as project default: **
W6) Remove all old coordinate scaling and offset code from Kicad.
......
......@@ -262,7 +262,11 @@ static void WinClipAndDrawLine( EDA_Rect* ClipBox, wxDC* DC,
xcliphi += width;
ycliphi += width;
#ifdef USE_WX_ZOOM
if( !ClipBox->Inside( wxPoint( x1, y1 ) ) && !ClipBox->Inside( wxPoint( x2, y2 ) ) )
#else
if( clip_line( x1, y1, x2, y2 ) )
#endif
return;
}
......
......@@ -402,9 +402,9 @@ wxPoint TwoPointVector( wxPoint startPoint, wxPoint endPoint )
double DistanceLinePoint( wxPoint linePointA, wxPoint linePointB, wxPoint referencePoint )
{
return fabs( (linePointB.x - linePointA.x) * (linePointA.y - referencePoint.y) -
(linePointA.x - referencePoint.x ) * (linePointB.y - linePointA.y) )
/ EuclideanNorm( TwoPointVector( linePointA, linePointB ) );
return fabs( (double) ( (linePointB.x - linePointA.x) * (linePointA.y - referencePoint.y) -
(linePointA.x - referencePoint.x ) * (linePointB.y - linePointA.y) )
/ EuclideanNorm( TwoPointVector( linePointA, linePointB ) ) );
}
......
......@@ -23,9 +23,29 @@
#include "kicad_device_context.h"
#include <wx/fdrepdlg.h> // Use the wxFindReplaceDialog events, data, and enums.
#include <boost/foreach.hpp>
/* Define schematic specific find and replace dialog flags based on the enum entries
* in wxFindReplaceFlags. These flags are intended to be used as bit masks in the
* wxFindReplaceData::m_Flags member variable. The varialble is defined as a wxUint32.
*/
enum SchematicFindReplaceFlags
{
/* The last wxFindReplaceFlag enum is wxFR_MATCHCASE. */
/* Search the current sheet only. */
schFR_CURRENT_SHEET_ONLY = wxFR_MATCHCASE << 1,
/* Search for design rule check markers. */
schFR_DRC_MARKERS = wxFR_MATCHCASE << 2,
/* Search for component in all loaded libraries. */
schFR_SEARCH_LIBS_FOR_COMPONENT = wxFR_MATCHCASE << 3
};
/* Variables Locales */
static int s_ItemsCount, s_MarkerCount;
static wxString s_OldStringFound;
......
......@@ -133,6 +133,7 @@ void WinEDA_PcbGlobalDeleteFrame::AcceptPcbDelete( wxCommandEvent& event )
}
m_Parent->DrawPanel->Refresh();
m_Parent->DrawPanel->GetScreen()->SetModify();
EndModal( 1 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment