Commit 3066c705 authored by stambaughw's avatar stambaughw
Browse files

Implement wxDC coordinate handling and wxGCDC.

* Implement code to allow wxDC to handle coordinate conversions between
  device and drawing units.
* Add build settings to enable wxGCDC for wxGraphicsContext testing.
* Remove wxAUI conditional build cruft as it is now required to build
  Kicad.
* Fix scroll increment size regression to prevent jumping around the
  zoom center position.
* Add find GDI+ cmake module for building on WXMSW when wxGraphicsContext
  is enabled.
parent 3f0a7f8d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
    // Make a Pcb3D_GLCanvas
    m_Canvas = new Pcb3D_GLCanvas( this );

#if defined(KICAD_AUIMANAGER)
    m_auimgr.SetManagedWindow( this );

    wxAuiPaneInfo horiz;
@@ -101,7 +100,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
                      wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );

    m_auimgr.Update();
#endif
}


+0 −4
Original line number Diff line number Diff line
@@ -21,10 +21,6 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()

    m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );

#if !defined(KICAD_AUIMANAGER)
    SetToolBar( (wxToolBar*) m_HToolBar );
#endif

    // Set up toolbar
    m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
                         wxBitmap( import3d_xpm ),
+0 −2
Original line number Diff line number Diff line
@@ -192,10 +192,8 @@ public:
    wxPoint      m_FramePos;
    wxSize       m_FrameSize;

#if defined(KICAD_AUIMANAGER)
    wxAuiManager m_auimgr;
    ~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
#endif

private:
    wxString m_FrameName;       // name used for writing and reading setup
+20 −5
Original line number Diff line number Diff line
@@ -18,10 +18,10 @@ option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")

# these are now mandatorily set to ON, and now done so in CMakeModules/config.h.cmake
#option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
#option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
option(USE_WX_ZOOM "Use wxDC to perform zooming (default OFF).  Warning, this is experimental" )

option(USE_WX_GRAPHICS_CONTEXT
       "Use wxGraphicsContext for rendering (default OFF).  Warning, this is experimental")

# Comment this out if you don't want to build with Python support.
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
@@ -50,6 +50,16 @@ if(KICAD_GOST)
    add_definitions(-DKICAD_GOST)
endif(KICAD_GOST)

if(USE_WX_ZOOM)
    add_definitions(-DUSE_WX_ZOOM)
endif(USE_WX_ZOOM)

if(USE_WX_GRAPHICS_CONTEXT)
    set( USE_WX_ZOOM ON )
    add_definitions(-DUSE_WX_ZOOM)
    add_definitions(-DUSE_WX_GRAPHICS_CONTEXT)
endif(USE_WX_GRAPHICS_CONTEXT)

# Locations for install targets.
set(KICAD_BIN bin
    CACHE PATH "Location of KiCad binaries.")
@@ -135,11 +145,16 @@ include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler.
include(MinGWResourceCompiler)


# Generate build system specific header file.
include(PerformFeatureChecks)
perform_feature_checks()

# Find GDI+ on windows if wxGraphicsContext is available.
if(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
    find_package(GdiPlus)
    check_find_package_result(GDI_PLUS_FOUND "GDI+")
endif(WIN32 AND USE_WX_GRAPHICS_CONTEXT)

# Automagically create version header file.
include(CreateSVNVersionHeader)
create_svn_version_header()
+22 −0
Original line number Diff line number Diff line
# - Try to find Microsoft GDI+ build files.
# Once done this will define
#
#  GDI_PLUS_FOUND - system has GDI+
#  GDI_PLUS_INCLUDE_DIR - the GDI+ include directory
#  GDI_PLUS_LIBRARIES - Link these to use GDI+

if(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)
    set(GDI_PLUS_FIND_QUIETLY TRUE)
endif(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)

find_path(GDI_PLUS_INCLUDE_DIR GdiPlus.h )

find_library(GDI_PLUS_LIBRARIES gdiplus )

# handle the QUIETLY and REQUIRED arguments and set GDI_PLUS_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(GDI_PLUS DEFAULT_MSG GDI_PLUS_LIBRARIES GDI_PLUS_INCLUDE_DIR)

mark_as_advanced(GDI_PLUS_INCLUDE_DIR GDI_PLUS_LIBRARIES)
Loading