Commit 3066c705 authored by stambaughw's avatar stambaughw

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
...@@ -78,7 +78,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, ...@@ -78,7 +78,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
// Make a Pcb3D_GLCanvas // Make a Pcb3D_GLCanvas
m_Canvas = new Pcb3D_GLCanvas( this ); m_Canvas = new Pcb3D_GLCanvas( this );
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -101,7 +100,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, ...@@ -101,7 +100,6 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
......
...@@ -21,10 +21,6 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar() ...@@ -21,10 +21,6 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*) m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString, m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
wxBitmap( import3d_xpm ), wxBitmap( import3d_xpm ),
......
...@@ -192,10 +192,8 @@ public: ...@@ -192,10 +192,8 @@ public:
wxPoint m_FramePos; wxPoint m_FramePos;
wxSize m_FrameSize; wxSize m_FrameSize;
#if defined(KICAD_AUIMANAGER)
wxAuiManager m_auimgr; wxAuiManager m_auimgr;
~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); }; ~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
#endif
private: private:
wxString m_FrameName; // name used for writing and reading setup wxString m_FrameName; // name used for writing and reading setup
......
...@@ -18,10 +18,10 @@ option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON) ...@@ -18,10 +18,10 @@ option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)") 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)") 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(USE_WX_ZOOM "Use wxDC to perform zooming (default OFF). Warning, this is experimental" )
#option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
#option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
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. # Comment this out if you don't want to build with Python support.
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)") # OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
...@@ -50,6 +50,16 @@ if(KICAD_GOST) ...@@ -50,6 +50,16 @@ if(KICAD_GOST)
add_definitions(-DKICAD_GOST) add_definitions(-DKICAD_GOST)
endif(KICAD_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. # Locations for install targets.
set(KICAD_BIN bin set(KICAD_BIN bin
CACHE PATH "Location of KiCad binaries.") CACHE PATH "Location of KiCad binaries.")
...@@ -124,7 +134,7 @@ check_find_package_result(OPENGL_FOUND "OpenGL") ...@@ -124,7 +134,7 @@ check_find_package_result(OPENGL_FOUND "OpenGL")
if(APPLE) if(APPLE)
find_package(wxWidgets COMPONENTS gl adv html core net base QUIET) find_package(wxWidgets COMPONENTS gl adv html core net base QUIET)
else(APPLE) else(APPLE)
find_package(wxWidgets COMPONENTS gl aui adv html core net base QUIET) find_package(wxWidgets COMPONENTS gl aui adv html core net base QUIET)
endif(APPLE) endif(APPLE)
check_find_package_result(wxWidgets_FOUND "wxWidgets") check_find_package_result(wxWidgets_FOUND "wxWidgets")
...@@ -135,11 +145,16 @@ include(${wxWidgets_USE_FILE}) ...@@ -135,11 +145,16 @@ include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler. # Include MinGW resource compiler.
include(MinGWResourceCompiler) include(MinGWResourceCompiler)
# Generate build system specific header file. # Generate build system specific header file.
include(PerformFeatureChecks) include(PerformFeatureChecks)
perform_feature_checks() 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. # Automagically create version header file.
include(CreateSVNVersionHeader) include(CreateSVNVersionHeader)
create_svn_version_header() create_svn_version_header()
......
# - 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)
...@@ -49,13 +49,10 @@ ...@@ -49,13 +49,10 @@
#define strnicmp _strnicmp #define strnicmp _strnicmp
#endif #endif
#if 1 /* Warning!!! Using wxDC for zooming is experimental. */
// now mandatory, not configurable #cmakedefine USE_WX_ZOOM 1
#define KICAD_AUIMANAGER 1
#define KICAD_AUITOOLBAR 1 /* Warning!!! Using wxGraphicContext for rendering is experimental. */
#else #cmakedefine USE_WX_GRAPHICS_CONTEXT 1
#cmakedefine KICAD_AUIMANAGER 1
#cmakedefine KICAD_AUITOOLBAR 1
#endif
#endif /* __CONFIG_H__ */ #endif /* __CONFIG_H__ */
...@@ -26,6 +26,11 @@ Common ...@@ -26,6 +26,11 @@ Common
* Integer/long/double input boxes should handle comma and dot separated values, * Integer/long/double input boxes should handle comma and dot separated values,
not only comma. not only comma.
Wayne:
C1) Fix mouse wheel scrolling (ctrl + Mouse wheel) and (Shift + mouse wheel)
to move more than a single scroll increment.
CvPCB CvPCB
----- -----
* Preview of the already assigned footprint. * Preview of the already assigned footprint.
...@@ -36,6 +41,11 @@ EESchema ...@@ -36,6 +41,11 @@ EESchema
* Use collector classes. * Use collector classes.
* Drag and drop between two EESchema windows. * Drag and drop between two EESchema windows.
Wayne:
E1) Relpace find dialog with wxFormBuilder version using a modeless dialog
and event driven design similar to wxFindReplaceDialog implementation.
GerbView GerbView
-------- --------
* Need work as good as gerbv from gEDA * Need work as good as gerbv from gEDA
...@@ -119,3 +129,30 @@ L9) On board load, ReFill() is called, this should also update the Render ...@@ -119,3 +129,30 @@ L9) On board load, ReFill() is called, this should also update the Render
checkboxes and colors. Will need to extend the widget API. checkboxes and colors. Will need to extend the widget API.
L10)still thinking about background colors, easier now without wxformbuilder. L10)still thinking about background colors, easier now without wxformbuilder.
Use wxDC for coordinate scaling and offsetting fix. (Wayne)
------------------------------------------------------------
W1) Make wxAutoBufferedPaintDC function properly.
W2) Make bitmap grid drawing method function properly.
W3) Use one cursor position (preferrably logical (drawing) units) instead
of keeping track of both logical and device cursor positions at the same
time.
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.
W7) Remove conditional compilation pragmas and dead code paths.
W8) Remove redundant drawing helper functions from gr_basic.cpp.
W9) Remove all global variables used by old drawing code.
...@@ -104,9 +104,9 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) ...@@ -104,9 +104,9 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
wxPoint curpos = ScreenPos; wxPoint curpos = ScreenPos;
Unscale( curpos ); Unscale( curpos );
//#ifndef WX_ZOOM #ifndef USE_WX_ZOOM
curpos += m_DrawOrg; curpos += m_DrawOrg;
//#endif #endif
return curpos; return curpos;
} }
...@@ -143,7 +143,7 @@ void BASE_SCREEN::SetScalingFactor(double aScale ) ...@@ -143,7 +143,7 @@ void BASE_SCREEN::SetScalingFactor(double aScale )
*/ */
int BASE_SCREEN::Scale( int coord ) int BASE_SCREEN::Scale( int coord )
{ {
#ifdef WX_ZOOM #ifdef USE_WX_ZOOM
return coord; return coord;
#else #else
if( !m_ZoomScalar || !m_Zoom ) if( !m_ZoomScalar || !m_Zoom )
...@@ -156,7 +156,7 @@ int BASE_SCREEN::Scale( int coord ) ...@@ -156,7 +156,7 @@ int BASE_SCREEN::Scale( int coord )
double BASE_SCREEN::Scale( double coord ) double BASE_SCREEN::Scale( double coord )
{ {
#ifdef WX_ZOOM #ifdef USE_WX_ZOOM
return coord; return coord;
#else #else
if( !m_Zoom ) if( !m_Zoom )
...@@ -179,7 +179,7 @@ void BASE_SCREEN::Scale( wxPoint& pt ) ...@@ -179,7 +179,7 @@ void BASE_SCREEN::Scale( wxPoint& pt )
void BASE_SCREEN::Scale( wxRealPoint& pt ) void BASE_SCREEN::Scale( wxRealPoint& pt )
{ {
#ifdef WX_ZOOM #ifdef USE_WX_ZOOM
// No change // No change
#else #else
if( !m_ZoomScalar || !m_Zoom ) if( !m_ZoomScalar || !m_Zoom )
...@@ -206,7 +206,7 @@ void BASE_SCREEN::Scale( wxSize& sz ) ...@@ -206,7 +206,7 @@ void BASE_SCREEN::Scale( wxSize& sz )
*/ */
int BASE_SCREEN::Unscale( int coord ) int BASE_SCREEN::Unscale( int coord )
{ {
#ifdef WX_ZOOM #ifdef USE_WX_ZOOM
return coord; return coord;
#else #else
if( !m_Zoom || !m_ZoomScalar ) if( !m_Zoom || !m_ZoomScalar )
......
...@@ -427,7 +427,13 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -427,7 +427,13 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
/* Draw text anchor, if allowed */ /* Draw text anchor, if allowed */
if( aAnchor_color != UNSPECIFIED_COLOR ) if( aAnchor_color != UNSPECIFIED_COLOR )
{ {
#if USE_WX_ZOOM
int anchor_size = aDC->DeviceToLogicalXRel( 2 );
#else
int anchor_size = aPanel->GetScreen()->Unscale( 2 ); int anchor_size = aPanel->GetScreen()->Unscale( 2 );
#endif
aAnchor_color = (EDA_Colors) ( aAnchor_color & MASKCOLOR ); aAnchor_color = (EDA_Colors) ( aAnchor_color & MASKCOLOR );
int cX = aPos.x + aOffset.x; int cX = aPos.x + aOffset.x;
......
...@@ -101,6 +101,7 @@ void BLOCK_SELECTOR::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -101,6 +101,7 @@ void BLOCK_SELECTOR::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
int aDrawMode, int aDrawMode,
int aColor ) int aColor )
{ {
int w = aPanel->GetScreen()->Scale( GetWidth() ); int w = aPanel->GetScreen()->Scale( GetWidth() );
int h = aPanel->GetScreen()->Scale( GetHeight() ); int h = aPanel->GetScreen()->Scale( GetHeight() );
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "class_base_screen.h" #include "class_base_screen.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "confirm.h" #include "confirm.h"
#include "kicad_device_context.h"
#include <wx/fontdlg.h> #include <wx/fontdlg.h>
...@@ -114,9 +115,7 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame() ...@@ -114,9 +115,7 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame()
if( m_CurrentScreen != NULL ) if( m_CurrentScreen != NULL )
delete m_CurrentScreen; delete m_CurrentScreen;
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit(); m_auimgr.UnInit();
#endif
} }
...@@ -299,10 +298,8 @@ void WinEDA_DrawFrame::SetToolbars() ...@@ -299,10 +298,8 @@ void WinEDA_DrawFrame::SetToolbars()
{ {
DisplayUnitsMsg(); DisplayUnitsMsg();
#if defined(KICAD_AUIMANAGER)
if( m_auimgr.GetManagedWindow() ) if( m_auimgr.GetManagedWindow() )
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
...@@ -344,61 +341,6 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv ) ...@@ -344,61 +341,6 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
{ {
m_FrameSize = GetClientSize( ); m_FrameSize = GetClientSize( );
#if !defined(KICAD_AUIMANAGER)
wxSize clientSize = m_FrameSize;
wxPoint clientPosition;
int default_value = -1;
// Ugly fix for a problem found in recent linux version
// where default value is broken
#ifdef __WXGTK__
if( GetToolBar() ) // use main tool bar dimension as default value
default_value = GetToolBar()->GetSize().y;
#endif
clientSize.y -= m_MsgFrameHeight;
if( MsgPanel ) // Resize the message panel.
{
MsgPanel->SetSize( 0, clientSize.y, clientSize.x, m_MsgFrameHeight );
}
if( m_AuxiliaryToolBar && m_AuxiliaryToolBar->IsShown() ) // Resize the auxilary horizontal tool bar.
{
m_AuxiliaryToolBar->SetSize( clientSize.x, default_value);
m_AuxiliaryToolBar->Move( 0, 0 );
clientSize.y -= m_AuxiliaryToolBar->GetDimension();
clientPosition.y = m_AuxiliaryToolBar->GetDimension();
}
if( m_VToolBar && m_VToolBar->IsShown() ) // Resize the main right vertical tool bar.
{
m_VToolBar->SetSize(default_value, clientSize.y );
clientSize.x -= m_VToolBar->GetDimension();
m_VToolBar->Move( clientSize.x, clientPosition.y );
}
if( m_AuxVToolBar && m_AuxVToolBar->IsShown() ) // Resize the auxiliary right vertical toolbar.
{
m_AuxVToolBar->SetSize( default_value, clientSize.y );
clientSize.x -= m_AuxVToolBar->GetDimension();
m_AuxVToolBar->Move( clientSize.x, clientPosition.y );
}
if( m_OptionsToolBar && m_OptionsToolBar->IsShown() ) // Resize the main left vertical tool bar.
{
m_OptionsToolBar->SetSize( default_value, clientSize.y );
clientSize.x -= m_OptionsToolBar->GetDimension( );
m_OptionsToolBar->Move( 0, clientPosition.y );
clientPosition.x += m_OptionsToolBar->GetDimension( );
}
if( DrawPanel )
{
DrawPanel->SetSize( clientPosition.x, clientPosition.y,
clientSize.x, clientSize.y );
}
#endif
SizeEv.Skip(); SizeEv.Skip();
} }
...@@ -500,101 +442,97 @@ int WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC ) ...@@ -500,101 +442,97 @@ int WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC )
void WinEDA_DrawFrame::AdjustScrollBars() void WinEDA_DrawFrame::AdjustScrollBars()
{ {
int xUnit, yUnit; int pixelsPerUnitX, pixelsPerUnitY, unitsX, unitsY, posX, posY;
wxSize draw_size, panel_size; wxSize drawingSize, clientSize;
wxSize scrollbar_number;
wxPoint scrollbar_pos;
BASE_SCREEN* screen = GetBaseScreen(); BASE_SCREEN* screen = GetBaseScreen();
if( screen == NULL || DrawPanel == NULL ) if( screen == NULL || DrawPanel == NULL )
return; return;
// The drawing size is twice the current page size. // The drawing size is twice the current page size.
draw_size = screen->ReturnPageSize() * 2; drawingSize = screen->ReturnPageSize() * 2;
// Calculate the portion of the drawing that can be displayed in the // Calculate the portion of the drawing that can be displayed in the
// client area at the current zoom level. // client area at the current zoom level.
panel_size = DrawPanel->GetClientSize(); clientSize = DrawPanel->GetClientSize();
screen->Unscale( panel_size );
#ifdef USE_WX_ZOOM
INSTALL_DC( dc, DrawPanel );
clientSize.x = dc.DeviceToLogicalXRel( clientSize.x );
clientSize.y = dc.DeviceToLogicalYRel( clientSize.y );
#else
screen->Unscale( clientSize );
#endif
/* Adjust drawing size when zooming way out to prevent centering around /* Adjust drawing size when zooming way out to prevent centering around
* cursor problems. */ * cursor problems. */
if( panel_size.x > draw_size.x || panel_size.y > draw_size.y ) if( clientSize.x > drawingSize.x || clientSize.y > drawingSize.y )
draw_size = panel_size; drawingSize = clientSize;
draw_size += panel_size / 2; drawingSize += clientSize / 2;
if( screen->m_Center ) if( screen->m_Center )
{ {
screen->m_DrawOrg.x = -draw_size.x / 2; screen->m_DrawOrg.x = -drawingSize.x / 2;
screen->m_DrawOrg.y = -draw_size.y / 2; screen->m_DrawOrg.y = -drawingSize.y / 2;
} }
else else
{ {
screen->m_DrawOrg.x = -panel_size.x / 2; screen->m_DrawOrg.x = -clientSize.x / 2;
screen->m_DrawOrg.y = -panel_size.y / 2; screen->m_DrawOrg.y = -clientSize.y / 2;
} }
#ifndef WX_ZOOM /* Always set scrollbar pixels per unit to 1 unless you want the zoom
* around cursor to jump around. This reported problem occurs when the
* zoom point is not on a pixel per unit increment. If you set the
* pixels per unit to 10, you have potential for the zoom point to
* jump around +/-5 pixels from the nearest grid point.
*/
pixelsPerUnitX = pixelsPerUnitY = 1;
// Calculate the number of scroll bar units for the given zoom level. */ // Calculate the number of scroll bar units for the given zoom level. */
scrollbar_number.x = #ifdef USE_WX_ZOOM
wxRound( (double) draw_size.x / unitsX = dc.LogicalToDeviceXRel( drawingSize.x );
(double) screen->Unscale( screen->m_ZoomScalar ) ); unitsY = dc.LogicalToDeviceYRel( drawingSize.y );
scrollbar_number.y = #else
wxRound( (double) draw_size.y / unitsX = screen->Scale( drawingSize.x );
(double) screen->Unscale( screen->m_ZoomScalar ) ); unitsY = screen->Scale( drawingSize.y );
#endif
xUnit = yUnit = screen->m_ZoomScalar;
if( xUnit <= 1 )
xUnit = 1;
if( yUnit <= 1 )
yUnit = 1;
xUnit = screen->Unscale( xUnit );
yUnit = screen->Unscale( yUnit );
// Calculate the position, place the cursor at the center of screen. // Calculate the position, place the cursor at the center of screen.
scrollbar_pos = screen->m_Curseur - screen->m_DrawOrg; posX = screen->m_Curseur.x - screen->m_DrawOrg.x;
posY = screen->m_Curseur.y - screen->m_DrawOrg.y;
posX -= clientSize.x / 2;
posY -= clientSize.y / 2;
scrollbar_pos.x -= panel_size.x / 2; if( posX <= 0 )
scrollbar_pos.y -= panel_size.y / 2; posX = 0;
if( posY <= 0 )
posY = 0;
if( scrollbar_pos.x <= 0 ) #ifdef USE_WX_ZOOM
scrollbar_pos.x = 0; posX = dc.LogicalToDeviceXRel( posX );
if( scrollbar_pos.y <= 0 ) posY = dc.LogicalToDeviceYRel( posY );
scrollbar_pos.y = 0; #else
posX = screen->Scale( posX );
posY = screen->Scale( posY );
#endif
screen->m_ScrollbarPos = wxPoint( posX, posY );
screen->m_ScrollbarNumber = wxSize( unitsX, unitsY );
scrollbar_pos.x = wxRound( (double) scrollbar_pos.x / (double) xUnit ); #if 0
scrollbar_pos.y = wxRound( (double) scrollbar_pos.y / (double) yUnit ); wxLogDebug( wxT( "SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
screen->m_ScrollbarPos = scrollbar_pos; pixelsPerUnitX, pixelsPerUnitY, unitsX, unitsY, posX, posY );
screen->m_ScrollbarNumber = scrollbar_number; #endif
DrawPanel->SetScrollbars( screen->m_ZoomScalar, DrawPanel->SetScrollbars( pixelsPerUnitX,
screen->m_ZoomScalar, pixelsPerUnitY,
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.x,
screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.x,
screen->m_ScrollbarPos.y, TRUE ); screen->m_ScrollbarPos.y, TRUE );
#else
int x, y, scroll_x, scroll_y;
double scale_x, scale_y;
DrawPanel DC( this );
x = DC.LogicalToDeviceXRel( draw_size.GetWidth() );
y = DC.LogicalToDeviceYRel( draw_size.GetHeight() );
scrollbar_pos = screen->m_Curseur - screen->m_DrawOrg;
scrollbar_pos.x -= panel_size.x / 2;
scrollbar_pos.y -= panel_size.y / 2;
scroll_x = DC.LogicalToDeviceXRel( scrollbar_pos.x );
scroll_y = DC.LogicalToDeviceYRel( scrollbar_pos.y );
wxLogDebug( wxT( "SetScrollbars(1, 1, %d, %d, %d, %d)" ),
x, y, scroll_x, scroll_y );
DrawPanel->SetScrollbars( 1, 1, x, y, scroll_x, scroll_y );
#endif
} }
......
This diff is collapsed.
...@@ -89,7 +89,7 @@ static void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, ...@@ -89,7 +89,7 @@ static void GRSRect( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1,
static inline int USCALE( us arg, us num, us den ) static inline int USCALE( us arg, us num, us den )
{ {
#ifndef WX_ZOOM #ifndef USE_WX_ZOOM
int ii; int ii;
ii = (int) ( ( (float) arg * num ) / den ); ii = (int) ( ( (float) arg * num ) / den );
return ii; return ii;
...@@ -110,7 +110,7 @@ static int inline ZoomValue( int val ) ...@@ -110,7 +110,7 @@ static int inline ZoomValue( int val )
/****************************************/ /****************************************/
int GRMapX( int x ) int GRMapX( int x )
{ {
#ifndef WX_ZOOM #ifndef USE_WX_ZOOM
int coord = x - ActiveScreen->m_DrawOrg.x; int coord = x - ActiveScreen->m_DrawOrg.x;
coord = ZoomValue( coord ); coord = ZoomValue( coord );
coord -= ActiveScreen->m_StartVisu.x; coord -= ActiveScreen->m_StartVisu.x;
...@@ -123,7 +123,7 @@ int GRMapX( int x ) ...@@ -123,7 +123,7 @@ int GRMapX( int x )
int GRMapY( int y ) int GRMapY( int y )
{ {
#ifndef WX_ZOOM #ifndef USE_WX_ZOOM
int coord = y - ActiveScreen->m_DrawOrg.y; int coord = y - ActiveScreen->m_DrawOrg.y;
coord = ZoomValue( coord ); coord = ZoomValue( coord );
coord -= ActiveScreen->m_StartVisu.y; coord -= ActiveScreen->m_StartVisu.y;
...@@ -373,28 +373,24 @@ void GRSetDrawMode( wxDC* DC, int draw_mode ) ...@@ -373,28 +373,24 @@ void GRSetDrawMode( wxDC* DC, int draw_mode )
{ {
if( draw_mode & GR_OR ) if( draw_mode & GR_OR )
#if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) ) #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
DC->SetLogicalFunction( wxCOPY );
#elif defined( USE_WX_GRAPHICS_CONTEXT )
DC->SetLogicalFunction( wxCOPY ); DC->SetLogicalFunction( wxCOPY );
#else #else
DC->SetLogicalFunction( wxOR ); DC->SetLogicalFunction( wxOR );
#endif #endif
else if( draw_mode & GR_XOR ) else if( draw_mode & GR_XOR )
#if defined( USE_WX_GRAPHICS_CONTEXT )
DC->SetLogicalFunction( wxCOPY );
#else
DC->SetLogicalFunction( wxXOR ); DC->SetLogicalFunction( wxXOR );
#endif
else if( draw_mode & GR_NXOR ) else if( draw_mode & GR_NXOR )
#if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) ) #if defined(__WXMAC__) && (wxMAC_USE_CORE_GRAPHICS || wxCHECK_VERSION( 2, 9, 0 ) )
DC->SetLogicalFunction( wxXOR ); DC->SetLogicalFunction( wxXOR );
#elif defined( USE_WX_GRAPHICS_CONTEXT )
DC->SetLogicalFunction( wxCOPY );
#else #else
DC->SetLogicalFunction( wxEQUIV ); DC->SetLogicalFunction( wxEQUIV );
#endif #endif
else else
......
...@@ -12,15 +12,10 @@ ...@@ -12,15 +12,10 @@
WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent, WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent,
wxWindowID id, bool horizontal ): wxWindowID id, bool horizontal ):
#if defined(KICAD_AUITOOLBAR)
wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize, wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | ( ( horizontal ) ? wxAUI_TB_DEFAULT_STYLE | ( ( horizontal ) ?
wxAUI_TB_HORZ_LAYOUT : wxAUI_TB_HORZ_LAYOUT :
wxAUI_TB_VERTICAL ) ) wxAUI_TB_VERTICAL ) )
#else
wxToolBar( parent, id, wxPoint( -1,-1 ), wxSize( -1,-1 ),
horizontal ? wxTB_HORIZONTAL : wxTB_VERTICAL )
#endif
{ {
m_Parent = parent; m_Parent = parent;
m_Ident = type; m_Ident = type;
......
...@@ -35,7 +35,7 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse ) ...@@ -35,7 +35,7 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
* TODO: see exactly how the mouse creates problems when moving during refresh * TODO: see exactly how the mouse creates problems when moving during refresh
* use Refresh() and update() do not change problems * use Refresh() and update() do not change problems
*/ */
INSTALL_DC(dc,DrawPanel); INSTALL_DC( dc, DrawPanel );
DrawPanel->ReDraw( &dc ); DrawPanel->ReDraw( &dc );
/* Move the mouse cursor to the on grid graphic cursor position */ /* Move the mouse cursor to the on grid graphic cursor position */
......
...@@ -72,7 +72,8 @@ if(APPLE) ...@@ -72,7 +72,8 @@ if(APPLE)
set_target_properties(${CVPCB_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(${CVPCB_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif(APPLE) endif(APPLE)
target_link_libraries(${CVPCB_NAME} 3d-viewer common pcbcommon polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES}) target_link_libraries(${CVPCB_NAME} 3d-viewer common pcbcommon polygon bitmaps kbool
${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
install(TARGETS ${CVPCB_NAME} install(TARGETS ${CVPCB_NAME}
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
......
...@@ -74,7 +74,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( WinEDA_CvpcbFrame* father, ...@@ -74,7 +74,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( WinEDA_CvpcbFrame* father,
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateVToolbar(); ReCreateVToolbar();
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -105,7 +104,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( WinEDA_CvpcbFrame* father, ...@@ -105,7 +104,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( WinEDA_CvpcbFrame* father,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#endif
Show( TRUE ); Show( TRUE );
} }
...@@ -219,7 +218,14 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -219,7 +218,14 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* DC, wxPoint Mouse )
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
delta = GetScreen()->GetGridSize(); delta = GetScreen()->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( wxRound( delta.x ) );
delta.y = DC->LogicalToDeviceYRel( wxRound( delta.y ) );
Mouse = DrawPanel->CalcUnscrolledPosition( Mouse );
#else
GetScreen()->Scale( delta ); GetScreen()->Scale( delta );
#endif
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
......
...@@ -157,27 +157,6 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, ...@@ -157,27 +157,6 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
BuildCmpListBox(); BuildCmpListBox();
BuildFOOTPRINTS_LISTBOX(); BuildFOOTPRINTS_LISTBOX();
#if !defined(KICAD_AUIMANAGER)
/* Create size constraints of the component list window display. */
wxLayoutConstraints* linkpos = new wxLayoutConstraints;
linkpos->top.SameAs( this, wxTop );
linkpos->bottom.SameAs( this, wxBottom );
linkpos->left.SameAs( this, wxLeft );
linkpos->width.PercentOf( this, wxWidth, 66 );
if( m_ListCmp )
m_ListCmp->SetConstraints( linkpos );
/* Create size constraints for the footprint display window. */
linkpos = new wxLayoutConstraints;
linkpos->top.SameAs( m_ListCmp, wxTop );
linkpos->bottom.SameAs( m_ListCmp, wxBottom );
linkpos->right.SameAs( this, wxRight );
linkpos->left.SameAs( m_ListCmp, wxRight );
if( m_FootprintList )
m_FootprintList->SetConstraints( linkpos );
#endif
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -204,7 +183,6 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, ...@@ -204,7 +183,6 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) ); Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
...@@ -219,9 +197,7 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame() ...@@ -219,9 +197,7 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
config->Write( wxT( FILTERFOOTPRINTKEY ), state ); config->Write( wxT( FILTERFOOTPRINTKEY ), state );
} }
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit(); m_auimgr.UnInit();
#endif
} }
......
...@@ -22,10 +22,6 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -22,10 +22,6 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar *)m_HToolBar );
#endif
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
wxBitmap( open_xpm ), wxBitmap( open_xpm ),
_( "Open a net list file" ) ); _( "Open a net list file" ) );
......
...@@ -154,7 +154,7 @@ if(APPLE) ...@@ -154,7 +154,7 @@ if(APPLE)
set_target_properties(eeschema PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(eeschema PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif(APPLE) endif(APPLE)
target_link_libraries(eeschema common bitmaps ${wxWidgets_LIBRARIES}) target_link_libraries(eeschema common bitmaps ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
install(TARGETS eeschema install(TARGETS eeschema
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
......
...@@ -267,7 +267,11 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc, ...@@ -267,7 +267,11 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc,
/* Enable this to draw the anchor of the component. */ /* Enable this to draw the anchor of the component. */
#if 0 #if 0
#ifdef USE_WX_ZOOM
int len = aDc->DeviceToLogicalXRel( 3 );
#else
int len = aPanel->GetScreen()->Unscale( 3 ); int len = aPanel->GetScreen()->Unscale( 3 );
#endif
GRLine( &aPanel->m_ClipBox, aDc, aOffset.x, aOffset.y - len, aOffset.x, GRLine( &aPanel->m_ClipBox, aDc, aOffset.x, aOffset.y - len, aOffset.x,
aOffset.y + len, 0, aColor ); aOffset.y + len, 0, aColor );
GRLine( &aPanel->m_ClipBox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len, GRLine( &aPanel->m_ClipBox, aDc, aOffset.x - len, aOffset.y, aOffset.x + len,
......
...@@ -230,7 +230,14 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, ...@@ -230,7 +230,14 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC,
oldpos = screen->m_Curseur; oldpos = screen->m_Curseur;
delta = screen->GetGridSize(); delta = screen->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( wxRound( delta.x ) );
delta.y = DC->LogicalToDeviceYRel( wxRound( delta.y ) );
MousePositionInPixels = DrawPanel->CalcUnscrolledPosition( MousePositionInPixels );
#else
screen->Scale( delta ); screen->Scale( delta );
#endif
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
...@@ -324,7 +331,14 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, ...@@ -324,7 +331,14 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC,
oldpos = screen->m_Curseur; oldpos = screen->m_Curseur;
delta = screen->GetGridSize(); delta = screen->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( wxRound( delta.x ) );
delta.y = DC->LogicalToDeviceYRel( wxRound( delta.y ) );
MousePositionInPixels = DrawPanel->CalcUnscrolledPosition( MousePositionInPixels );
#else
screen->Scale( delta ); screen->Scale( delta );
#endif
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
...@@ -417,7 +431,14 @@ void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, ...@@ -417,7 +431,14 @@ void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC,
oldpos = screen->m_Curseur; oldpos = screen->m_Curseur;
delta = screen->GetGridSize(); delta = screen->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( wxRound( delta.x ) );
delta.y = DC->LogicalToDeviceYRel( wxRound( delta.y ) );
MousePositionInPixels = DrawPanel->CalcUnscrolledPosition( MousePositionInPixels );
#else
screen->Scale( delta ); screen->Scale( delta );
#endif
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
......
...@@ -192,10 +192,15 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -192,10 +192,15 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
DisplayCmpDoc(); DisplayCmpDoc();
UpdateAliasSelectList(); UpdateAliasSelectList();
UpdatePartSelectList(); UpdatePartSelectList();
#ifdef USE_WX_GRAPHICS_CONTEXT
GetScreen()->SetZoom( BestZoom() );
#else
Zoom_Automatique( false ); Zoom_Automatique( false );
#endif
Show( true ); Show( true );
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -224,7 +229,6 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father, ...@@ -224,7 +229,6 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
m_auimgr.AddPane( MsgPanel, m_auimgr.AddPane( MsgPanel,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
......
...@@ -194,7 +194,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -194,7 +194,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_HIGH ); m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_HIGH );
m_pageSetupData.GetPrintData().SetOrientation( wxLANDSCAPE ); m_pageSetupData.GetPrintData().SetOrientation( wxLANDSCAPE );
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -231,7 +230,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, ...@@ -231,7 +230,6 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
...@@ -409,7 +407,7 @@ int WinEDA_SchematicFrame::BestZoom() ...@@ -409,7 +407,7 @@ int WinEDA_SchematicFrame::BestZoom()
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
zoom = MAX( (double) dx / (double) size.x, zoom = MAX( (double) dx / (double) size.x,
(double) dy / (double) size.y ); (double) dy / (double) size.y );
GetScreen()->m_Curseur.x = dx / 2; GetScreen()->m_Curseur.x = dx / 2;
GetScreen()->m_Curseur.y = dy / 2; GetScreen()->m_Curseur.y = dy / 2;
......
...@@ -94,9 +94,7 @@ void WinEDA_LibeditFrame::ReCreateHToolbar() ...@@ -94,9 +94,7 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
return; return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_LIB, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_LIB, wxEmptyString,
wxBitmap( save_library_xpm ), wxBitmap( save_library_xpm ),
......
...@@ -25,10 +25,6 @@ void WinEDA_SchematicFrame::ReCreateHToolbar() ...@@ -25,10 +25,6 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
wxString msg; wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_xpm ), m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_xpm ),
_( "New schematic project" ) ); _( "New schematic project" ) );
......
...@@ -28,10 +28,6 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar() ...@@ -28,10 +28,6 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR,
true ); true );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_LIBVIEW_SELECT_LIB, wxEmptyString, m_HToolBar->AddTool( ID_LIBVIEW_SELECT_LIB, wxEmptyString,
wxBitmap( library_xpm ), wxBitmap( library_xpm ),
......
...@@ -170,10 +170,15 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -170,10 +170,15 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
if( DrawPanel ) if( DrawPanel )
DrawPanel->SetAcceleratorTable( table ); DrawPanel->SetAcceleratorTable( table );
#ifdef USE_WX_GRAPHICS_CONTEXT
GetScreen()->SetZoom( BestZoom() );
#else
Zoom_Automatique( false ); Zoom_Automatique( false );
#endif
Show( TRUE ); Show( TRUE );
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -225,12 +230,6 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -225,12 +230,6 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
pane.MinSize(wxSize(m_CmpListSize.x, -1)); pane.MinSize(wxSize(m_CmpListSize.x, -1));
m_auimgr.Update(); m_auimgr.Update();
#else
m_CmpListWindow->SetSize(m_CmpListSize);
if( m_LibListWindow )
m_LibListWindow->SetSize(m_LibListSize);
#endif
} }
...@@ -262,29 +261,6 @@ void WinEDA_ViewlibFrame::OnSashDrag( wxSashEvent& event ) ...@@ -262,29 +261,6 @@ void WinEDA_ViewlibFrame::OnSashDrag( wxSashEvent& event )
m_LibListSize.y = GetClientSize().y - m_MsgFrameHeight; m_LibListSize.y = GetClientSize().y - m_MsgFrameHeight;
m_CmpListSize.y = m_LibListSize.y; m_CmpListSize.y = m_LibListSize.y;
#ifndef KICAD_AUIMANAGER
switch( event.GetId() )
{
case ID_LIBVIEW_LIBWINDOW:
if( m_LibListWindow )
{
m_LibListSize.x = event.GetDragRect().width;
m_LibListWindow->SetSize( m_LibListSize );
m_CmpListWindow->SetPosition( wxPoint( m_LibListSize.x, 0 ) );
m_CmpListWindow->SetSize( m_CmpListSize );
}
break;
case ID_LIBVIEW_CMPWINDOW:
m_CmpListSize.x = event.GetDragRect().width;
m_CmpListWindow->SetSize( m_CmpListSize );
break;
}
// Now, we must recalculate the position and size of subwindows
wxSizeEvent SizeEv;
OnSize( SizeEv );
#else
switch( event.GetId() ) switch( event.GetId() )
{ {
case ID_LIBVIEW_LIBWINDOW: case ID_LIBVIEW_LIBWINDOW:
...@@ -306,57 +282,15 @@ void WinEDA_ViewlibFrame::OnSashDrag( wxSashEvent& event ) ...@@ -306,57 +282,15 @@ void WinEDA_ViewlibFrame::OnSashDrag( wxSashEvent& event )
} }
break; break;
} }
#endif
} }
void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv ) void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv )
{ {
#ifndef KICAD_AUIMANAGER
wxSize clientsize = GetClientSize();
m_FrameSize = clientsize;
clientsize.y -= m_MsgFrameHeight;
if( MsgPanel )
{
MsgPanel->SetSize( 0, clientsize.y, clientsize.x, m_MsgFrameHeight );
}
if( DrawPanel )
{
int xpos = m_LibListSize.x + m_CmpListSize.x;
DrawPanel->SetSize( xpos, 0,
clientsize.x - xpos, clientsize.y );
}
if( m_LibList && m_LibListWindow )
{
m_LibListSize.y = clientsize.y - 2;
m_LibListWindow->SetSize( m_LibListSize );
m_LibList->SetSize( m_LibListWindow->GetClientSize() -
wxSize( EXTRA_BORDER_SIZE * 2, 0 ) );
}
if( m_CmpList && m_CmpListWindow )
{
m_CmpListSize.y = clientsize.y - 2;
m_CmpListWindow->SetSize( m_CmpListSize );
m_CmpListWindow->SetPosition( wxPoint( m_LibListSize.x, 0 ) );
m_CmpList->SetSize( m_CmpListWindow->GetClientSize() -
wxSize( EXTRA_BORDER_SIZE * 2, 0 ) );
}
SizeEv.Skip();
// Ensure the panel is always redrawn (sometimes some garbage remains):
DrawPanel->Refresh();
#else
if( m_auimgr.GetManagedWindow() ) if( m_auimgr.GetManagedWindow() )
m_auimgr.Update(); m_auimgr.Update();
SizeEv.Skip(); SizeEv.Skip();
#endif
} }
......
...@@ -79,7 +79,8 @@ if(APPLE) ...@@ -79,7 +79,8 @@ if(APPLE)
set_target_properties(${GERBVIEW_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(${GERBVIEW_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif(APPLE) endif(APPLE)
target_link_libraries(${GERBVIEW_NAME} common pcbcommon 3d-viewer polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES}) target_link_libraries(${GERBVIEW_NAME} common pcbcommon 3d-viewer polygon bitmaps kbool
${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
install(TARGETS ${GERBVIEW_NAME} install(TARGETS ${GERBVIEW_NAME}
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
......
...@@ -42,7 +42,14 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -42,7 +42,14 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
delta = GetScreen()->GetGridSize(); delta = GetScreen()->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( delta.x );
delta.y = DC->LogicalToDeviceYRel( delta.y );
Mouse = DrawPanel->CalcUnscrolledPosition( Mouse );
#else
GetScreen()->Scale( delta ); GetScreen()->Scale( delta );
#endif
if( delta.x == 0 ) if( delta.x == 0 )
delta.x = 1; delta.x = 1;
......
...@@ -283,7 +283,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track ...@@ -283,7 +283,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track
(double) (track->m_End.y - track->m_Start.y) ); (double) (track->m_End.y - track->m_Start.y) );
halfPenWidth = track->m_Width >> 1; halfPenWidth = track->m_Width >> 1;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( halfPenWidth ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( halfPenWidth ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( halfPenWidth ) < L_MIN_DESSIN )
#endif
{ {
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x,
track->m_Start.y, radius, 0, color ); track->m_Start.y, radius, 0, color );
...@@ -324,7 +329,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track ...@@ -324,7 +329,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track
radius = track->m_Width >> 1; radius = track->m_Width >> 1;
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH; fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( radius ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( radius ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( radius ) < L_MIN_DESSIN )
#endif
{ {
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, GRCircle( &panel->m_ClipBox, DC, track->m_Start.x,
track->m_Start.y, radius, 0, color ); track->m_Start.y, radius, 0, color );
...@@ -347,7 +357,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track ...@@ -347,7 +357,12 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track
l_piste = track->m_Width >> 1; l_piste = track->m_Width >> 1;
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH; fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( l_piste ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
#endif
{ {
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
track->m_End.x, track->m_End.y, 0, color ); track->m_End.x, track->m_End.y, 0, color );
...@@ -378,7 +393,11 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track ...@@ -378,7 +393,11 @@ void Trace_Segment( BOARD* aBrd, WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track
case S_SEGMENT: case S_SEGMENT:
l_piste = track->m_Width >> 1; l_piste = track->m_Width >> 1;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( l_piste ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
#endif
{ {
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y, GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
track->m_End.x, track->m_End.y, 0, color ); track->m_End.x, track->m_End.y, 0, color );
......
...@@ -26,7 +26,8 @@ public: ...@@ -26,7 +26,8 @@ public:
wxPoint m_CursorStartPos; // useful in testing the cursor wxPoint m_CursorStartPos; // useful in testing the cursor
// movement // movement
int m_ScrollButt_unit; // scroll bar pixels per unit value int m_scrollIncrementX; // X axis scroll increment in pixels per unit.
int m_scrollIncrementY; // Y axis scroll increment in pixels per unit.
bool m_AbortRequest; // Flag to abort long commands bool m_AbortRequest; // Flag to abort long commands
...@@ -59,7 +60,6 @@ public: ...@@ -59,7 +60,6 @@ public:
int m_CursorLevel; // Index for cursor redraw in XOR int m_CursorLevel; // Index for cursor redraw in XOR
// mode // mode
/* Cursor management (used in editing functions) */ /* Cursor management (used in editing functions) */
/* Mouse capture move callback function prototype. */ /* Mouse capture move callback function prototype. */
...@@ -124,6 +124,24 @@ public: ...@@ -124,6 +124,24 @@ public:
void OnActivate( wxActivateEvent& event ); void OnActivate( wxActivateEvent& event );
/**
* Prepare the device context for drawing.
*
* This overrides wxScrolledWindow::DoPrepareDC() for drawing depending
* on the render mode selected a build time. If the old kicad coordinate
* scaling code is used then this code doesn't do any thing other than
* update the boundary box. If wxDC coordinate manipulation is used, then
* the scale factor and drawing logical offset is set. Then the base
* method is called to set the DC device origin and user scale. This
* connects everything together to acheive the appropiate coordinate
* manipulation using wxDC LogicalToDeviceXXX and DeviceToLogixalXXX
* methods. This gets called automatically for a paint event. If you do
* any drawing outside the paint event, you must call DoPrepareDC manually.
*
* @param dc - The device context to prepare.
*/
virtual void DoPrepareDC(wxDC& dc);
/* Mouse and keys events */ /* Mouse and keys events */
void OnMouseWheel( wxMouseEvent& event ); void OnMouseWheel( wxMouseEvent& event );
void OnMouseEvent( wxMouseEvent& event ); void OnMouseEvent( wxMouseEvent& event );
...@@ -146,7 +164,7 @@ public: ...@@ -146,7 +164,7 @@ public:
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
bool IsPointOnDisplay( wxPoint ref_pos ); bool IsPointOnDisplay( wxPoint ref_pos );
void SetBoundaryBox(); void SetBoundaryBox( wxDC* dc );
void ReDraw( wxDC* DC, bool erasebg = TRUE ); void ReDraw( wxDC* DC, bool erasebg = TRUE );
/** Function CursorRealPosition /** Function CursorRealPosition
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#include <wx/dcbuffer.h> #include <wx/dcbuffer.h>
#endif #endif
#if USE_WX_GRAPHICS_CONTEXT && USE_WX_ZOOM
#include <wx/dcgraph.h>
#endif
// Helper class to handle the client Device Context // Helper class to handle the client Device Context
class KicadGraphicContext : public wxClientDC class KicadGraphicContext : public wxClientDC
{ {
...@@ -31,19 +35,39 @@ public: ...@@ -31,19 +35,39 @@ public:
// Macro used to declare a device context in kicad: // Macro used to declare a device context in kicad:
#if USE_WX_GRAPHICS_CONTEXT && USE_WX_ZOOM
#define INSTALL_DC(name,parent) \
wxClientDC _cDC( parent ); \
wxGCDC name(_cDC); \
parent->DoPrepareDC( name ); \
name.GetGraphicsContext()->Translate( 0.5, 0.5 );
#else
#ifdef KICAD_USE_BUFFERED_DC #ifdef KICAD_USE_BUFFERED_DC
#define INSTALL_DC(name,parent) \
#define INSTALL_DC(name,parent) \ wxClientDC _cDC( parent ); \
KicadGraphicContext _cDC( parent );\ wxBufferedDC name(&_cDC, _cDC.GetSize() ); \
wxBufferedDC name(&_cDC, _cDC.GetSize() ); parent->DoPrepareDC( name );
#else #else
#define INSTALL_DC(name,parent) KicadGraphicContext name( parent ) #define INSTALL_DC(name,parent) \
wxClientDC name( parent ); \
parent->DoPrepareDC( name );
#endif
#endif #endif
#ifdef KICAD_USE_BUFFERED_PAINTDC #if USE_WX_GRAPHICS_CONTEXT
#define INSTALL_PAINTDC(name,parent) wxAutoBufferedPaintDC name(parent ) #define INSTALL_PAINTDC(name,parent) \
wxPaintDC _pDC(parent); \
wxGCDC name(_pDC); \
parent->DoPrepareDC( name ); \
name.GetGraphicsContext()->Translate( 0.5, 0.5);
#elif !defined( USE_WX_ZOOM ) && defined( KICAD_USE_BUFFERED_PAINTDC )
#define INSTALL_PAINTDC(name,parent) \
wxAutoBufferedPaintDC name(parent ); \
parent->DoPrepareDC( name );
#else #else
#define INSTALL_PAINTDC(name,parent) wxPaintDC name( parent ) #define INSTALL_PAINTDC(name,parent) \
wxPaintDC name( parent ); \
parent->DoPrepareDC( name );
#endif #endif
#endif // __KICAD_DEVICE_CONTEXT_H__ #endif // __KICAD_DEVICE_CONTEXT_H__
...@@ -13,10 +13,7 @@ ...@@ -13,10 +13,7 @@
#include "wx/config.h" #include "wx/config.h"
#include <wx/wxhtml.h> #include <wx/wxhtml.h>
#include <wx/laywin.h> #include <wx/laywin.h>
#if defined(KICAD_AUIMANAGER) || defined(KICAD_AUITOOLBAR)
#include <wx/aui/aui.h> #include <wx/aui/aui.h>
#endif
#include "colors.h" #include "colors.h"
...@@ -103,9 +100,7 @@ public: ...@@ -103,9 +100,7 @@ public:
// It is "SchematicFrame", "PcbFrame" .... // It is "SchematicFrame", "PcbFrame" ....
wxString m_AboutTitle; // Name of program displayed in About. wxString m_AboutTitle; // Name of program displayed in About.
#ifdef KICAD_AUIMANAGER
wxAuiManager m_auimgr; wxAuiManager m_auimgr;
#endif
public: public:
WinEDA_BasicFrame( wxWindow* father, int idtype, WinEDA_BasicFrame( wxWindow* father, int idtype,
...@@ -689,11 +684,7 @@ public: ...@@ -689,11 +684,7 @@ public:
/* class WinEDA_Toolbar */ /* class WinEDA_Toolbar */
/*************************/ /*************************/
#if defined(KICAD_AUITOOLBAR)
class WinEDA_Toolbar : public wxAuiToolBar class WinEDA_Toolbar : public wxAuiToolBar
#else
class WinEDA_Toolbar : public wxToolBar
#endif
{ {
public: public:
wxWindow* m_Parent; wxWindow* m_Parent;
...@@ -704,7 +695,6 @@ public: ...@@ -704,7 +695,6 @@ public:
WinEDA_Toolbar( id_toolbar type, wxWindow* parent, WinEDA_Toolbar( id_toolbar type, wxWindow* parent,
wxWindowID id, bool horizontal ); wxWindowID id, bool horizontal );
#if defined(KICAD_AUITOOLBAR)
bool GetToolState( int toolId ) { return GetToolToggled(toolId); }; bool GetToolState( int toolId ) { return GetToolToggled(toolId); };
void AddRadioTool( int toolid, void AddRadioTool( int toolid,
...@@ -721,7 +711,6 @@ public: ...@@ -721,7 +711,6 @@ public:
void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {}; void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {};
void SetRows( int nRows ) {}; void SetRows( int nRows ) {};
#endif
/** Function GetDimension /** Function GetDimension
* @return the dimension of this toolbar (Height if horizontal, Width if vertical. * @return the dimension of this toolbar (Height if horizontal, Width if vertical.
......
...@@ -49,7 +49,7 @@ install(TARGETS KiCad ...@@ -49,7 +49,7 @@ install(TARGETS KiCad
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
COMPONENT binary) COMPONENT binary)
else(APPLE) else(APPLE)
target_link_libraries(kicad common bitmaps ${wxWidgets_LIBRARIES}) target_link_libraries(kicad common bitmaps ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
install(TARGETS kicad install(TARGETS kicad
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
COMPONENT binary) COMPONENT binary)
......
...@@ -259,9 +259,7 @@ void WinEDA_MainFrame::RecreateBaseHToolbar() ...@@ -259,9 +259,7 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
// Allocate memory for m_HToolBar // Allocate memory for m_HToolBar
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
wxBitmap( new_project_xpm ), wxBitmap( new_project_xpm ),
......
...@@ -67,23 +67,6 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, ...@@ -67,23 +67,6 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
// Bottom Window: box to display messages // Bottom Window: box to display messages
m_RightWin = new RIGHT_KM_FRAME( this ); m_RightWin = new RIGHT_KM_FRAME( this );
/* Setting the sash control interferes with wxAUIManager and prevents the
* right and left window panes from being resized.
*/
#ifndef KICAD_AUIMANAGER
m_LeftWin->SetDefaultSize( wxSize( m_LeftWin_Width, clientsize.y ) );
m_LeftWin->SetOrientation( wxLAYOUT_VERTICAL );
m_LeftWin->SetAlignment( wxLAYOUT_LEFT );
m_LeftWin->SetSashVisible( wxSASH_RIGHT, TRUE );
m_LeftWin->SetExtraBorderSize( 2 );
int rightWinWidth = clientsize.x - m_LeftWin_Width;
m_RightWin->SetDefaultSize( wxSize( rightWinWidth, clientsize.y ) );
m_RightWin->SetOrientation( wxLAYOUT_VERTICAL );
m_RightWin->SetAlignment( wxLAYOUT_RIGHT );
m_RightWin->SetExtraBorderSize( 2 );
#endif
msg = wxGetCwd(); msg = wxGetCwd();
line.Printf( _( "Ready\nWorking dir: %s\n" ), msg.GetData() ); line.Printf( _( "Ready\nWorking dir: %s\n" ), msg.GetData() );
PrintMsg( line ); PrintMsg( line );
...@@ -92,7 +75,6 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, ...@@ -92,7 +75,6 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::LoadProject" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::LoadProject" ) );
#endif #endif
#if defined(KICAD_AUIMANAGER)
RecreateBaseHToolbar(); RecreateBaseHToolbar();
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
...@@ -121,15 +103,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, ...@@ -121,15 +103,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
CloseButton( false ).Left().BestSize( m_LeftWin_Width, clientsize.y ). CloseButton( false ).Left().BestSize( m_LeftWin_Width, clientsize.y ).
Layer( 1 ).CaptionVisible( false ) ); Layer( 1 ).CaptionVisible( false ) );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
WinEDA_MainFrame::~WinEDA_MainFrame() WinEDA_MainFrame::~WinEDA_MainFrame()
{ {
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit(); m_auimgr.UnInit();
#endif
} }
...@@ -146,34 +125,15 @@ void WinEDA_MainFrame::PrintMsg( const wxString& text ) ...@@ -146,34 +125,15 @@ void WinEDA_MainFrame::PrintMsg( const wxString& text )
*/ */
void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event ) void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event )
{ {
#if defined(KICAD_AUIMANAGER)
#else
if( event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE )
return;
m_LeftWin_Width = event.GetDragRect().width;
m_LeftWin->SetDefaultSize( wxSize( m_LeftWin_Width, -1 ) );
wxLayoutAlgorithm layout;
layout.LayoutFrame( this );
#endif
event.Skip(); event.Skip();
} }
void WinEDA_MainFrame::OnSize( wxSizeEvent& event ) void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
{ {
#if defined(KICAD_AUIMANAGER)
if( m_auimgr.GetManagedWindow() ) if( m_auimgr.GetManagedWindow() )
m_auimgr.Update(); m_auimgr.Update();
#else
wxLayoutAlgorithm layout;
layout.LayoutFrame( this );
#endif
event.Skip(); event.Skip();
} }
......
...@@ -222,7 +222,8 @@ if(APPLE) ...@@ -222,7 +222,8 @@ if(APPLE)
set_target_properties(${PCBNEW_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) set_target_properties(${PCBNEW_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif(APPLE) endif(APPLE)
target_link_libraries(${PCBNEW_NAME} 3d-viewer common pcbcommon polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES}) target_link_libraries(${PCBNEW_NAME} 3d-viewer common pcbcommon polygon bitmaps kbool
${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES})
install(TARGETS ${PCBNEW_NAME} install(TARGETS ${PCBNEW_NAME}
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
......
...@@ -431,7 +431,11 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -431,7 +431,11 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
typeaff = DisplayOpt.DisplayDrawItems; typeaff = DisplayOpt.DisplayDrawItems;
width = m_Width; width = m_Width;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( width ) < 2 )
#else
if( panel->GetScreen()->Scale( width ) < 2 ) if( panel->GetScreen()->Scale( width ) < 2 )
#endif
typeaff = FILAIRE; typeaff = FILAIRE;
switch( typeaff ) switch( typeaff )
......
...@@ -254,7 +254,12 @@ void DRAWSEGMENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -254,7 +254,12 @@ void DRAWSEGMENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
mode = DisplayOpt.DisplayDrawItems; mode = DisplayOpt.DisplayDrawItems;
if( m_Flags & FORCE_SKETCH ) if( m_Flags & FORCE_SKETCH )
mode = SKETCH; mode = SKETCH;
#ifdef USE_WX_ZOOM
if( l_piste < DC->DeviceToLogicalXRel( L_MIN_DESSIN ) )
#else
if( l_piste < panel->GetScreen()->Unscale( L_MIN_DESSIN ) ) if( l_piste < panel->GetScreen()->Unscale( L_MIN_DESSIN ) )
#endif
mode = FILAIRE; mode = FILAIRE;
switch( m_Shape ) switch( m_Shape )
......
...@@ -191,7 +191,12 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -191,7 +191,12 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
if( !typeaff ) if( !typeaff )
typeaff = SKETCH; typeaff = SKETCH;
} }
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( m_Width ) < L_MIN_DESSIN )
#else
if( screen->Scale( m_Width ) < L_MIN_DESSIN ) if( screen->Scale( m_Width ) < L_MIN_DESSIN )
#endif
typeaff = FILAIRE; typeaff = FILAIRE;
switch( type_trace ) switch( type_trace )
......
...@@ -116,7 +116,12 @@ void MIREPCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -116,7 +116,12 @@ void MIREPCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, mode_color ); GRSetDrawMode( DC, mode_color );
typeaff = DisplayOpt.DisplayDrawItems; typeaff = DisplayOpt.DisplayDrawItems;
width = m_Width; width = m_Width;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( width ) < 2 )
#else
if( panel->GetScreen()->Scale( width ) < 2 ) if( panel->GetScreen()->Scale( width ) < 2 )
#endif
typeaff = FILAIRE; typeaff = FILAIRE;
rayon = m_Size / 4; rayon = m_Size / 4;
......
...@@ -66,7 +66,11 @@ MODULE::~MODULE() ...@@ -66,7 +66,11 @@ MODULE::~MODULE()
void MODULE::DrawAncre( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void MODULE::DrawAncre( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int dim_ancre, int draw_mode ) int dim_ancre, int draw_mode )
{ {
#ifdef USE_WX_ZOOM
int anchor_size = DC->DeviceToLogicalXRel( dim_ancre );
#else
int anchor_size = panel->GetScreen()->Unscale( dim_ancre ); int anchor_size = panel->GetScreen()->Unscale( dim_ancre );
#endif
GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, draw_mode );
......
...@@ -432,8 +432,12 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, ...@@ -432,8 +432,12 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
switch( m_DrillShape ) switch( m_DrillShape )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
if( screen->Scale( hole ) > 1 ) /* draw hole if its size is enought
*/ #ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( hole ) > 1 )
#else
if( screen->Scale( hole ) > 1 ) /* draw hole if its size is enough */
#endif
GRFilledCircle( &panel->m_ClipBox, DC, cx0, cy0, hole, 0, GRFilledCircle( &panel->m_ClipBox, DC, cx0, cy0, hole, 0,
color, color ); color, color );
break; break;
...@@ -548,8 +552,12 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, ...@@ -548,8 +552,12 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
tsize = min( AreaSize.y, AreaSize.x / numpad_len ); tsize = min( AreaSize.y, AreaSize.x / numpad_len );
#define CHAR_SIZE_MIN 5 #define CHAR_SIZE_MIN 5
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when
// size too small. #ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when size too small.
#else
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when size too small.
#endif
{ {
tsize = (int) ( tsize * 0.8 ); // reserve room for tsize = (int) ( tsize * 0.8 ); // reserve room for
// marges and segments // marges and segments
...@@ -569,8 +577,11 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, ...@@ -569,8 +577,11 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
shortname_len = MAX( shortname_len, MIN_CHAR_COUNT ); shortname_len = MAX( shortname_len, MIN_CHAR_COUNT );
tsize = min( AreaSize.y, AreaSize.x / shortname_len ); tsize = min( AreaSize.y, AreaSize.x / shortname_len );
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too #ifdef USE_WX_ZOOM
// small. if( DC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small.
#else
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small.
#endif
{ {
if( !( !IsOnLayer( screen->m_Active_Layer ) if( !( !IsOnLayer( screen->m_Active_Layer )
&& DisplayOpt.ContrastModeDisplay ) ) && DisplayOpt.ContrastModeDisplay ) )
......
...@@ -356,7 +356,12 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, ...@@ -356,7 +356,12 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
width = m_Width; width = m_Width;
if( ( frame->m_DisplayModText == FILAIRE ) if( ( frame->m_DisplayModText == FILAIRE )
#ifdef USE_WX_ZOOM
|| ( DC->LogicalToDeviceXRel( width ) < L_MIN_DESSIN ) )
#else
|| ( screen->Scale( width ) < L_MIN_DESSIN ) ) || ( screen->Scale( width ) < L_MIN_DESSIN ) )
#endif
width = 0; width = 0;
else if( frame->m_DisplayModText == SKETCH ) else if( frame->m_DisplayModText == SKETCH )
width = -width; width = -width;
...@@ -367,7 +372,12 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, ...@@ -367,7 +372,12 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
if( brd->IsElementVisible( ANCHOR_VISIBLE ) ) if( brd->IsElementVisible( ANCHOR_VISIBLE ) )
{ {
color = brd->GetVisibleElementColor(ANCHOR_VISIBLE); color = brd->GetVisibleElementColor(ANCHOR_VISIBLE);
#ifdef USE_WX_ZOOM
int anchor_size = DC->DeviceToLogicalXRel( 2 );
#else
int anchor_size = screen->Unscale( 2 ); int anchor_size = screen->Unscale( 2 );
#endif
GRLine( &panel->m_ClipBox, DC, GRLine( &panel->m_ClipBox, DC,
pos.x - anchor_size, pos.y, pos.x - anchor_size, pos.y,
pos.x + anchor_size, pos.y, 0, color ); pos.x + anchor_size, pos.y, 0, color );
......
...@@ -596,14 +596,24 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -596,14 +596,24 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( m_Shape == S_CIRCLE ) if( m_Shape == S_CIRCLE )
{ {
rayon = (int) hypot( (double) ( m_End.x - m_Start.x ), rayon = (int) hypot( (double) ( m_End.x - m_Start.x ),
(double) ( m_End.y - m_Start.y ) ); (double) ( m_End.y - m_Start.y ) );
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( l_piste ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
#endif
{ {
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color ); GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color );
} }
else else
{ {
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( l_piste ) <= 1 ) /* Sketch mode if l_piste/zoom <= 1 */
#else
if( panel->GetScreen()->Scale( l_piste ) <= 1 ) /* Sketch mode if l_piste/zoom <= 1 */ if( panel->GetScreen()->Scale( l_piste ) <= 1 ) /* Sketch mode if l_piste/zoom <= 1 */
#endif
{ {
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color ); GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color );
} }
...@@ -621,7 +631,11 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -621,7 +631,11 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
return; return;
} }
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( l_piste ) < L_MIN_DESSIN )
#else
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
#endif
{ {
GRLine( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRLine( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
m_End.x, m_End.y, 0, color ); m_End.x, m_End.y, 0, color );
...@@ -671,7 +685,11 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -671,7 +685,11 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( len < THRESHOLD * m_Width ) if( len < THRESHOLD * m_Width )
return; return;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( m_Width ) < 6 ) // no room to display a text inside track
#else
if( panel->GetScreen()->Scale( m_Width ) < 6 ) // no room to display a text inside track if( panel->GetScreen()->Scale( m_Width ) < 6 ) // no room to display a text inside track
#endif
return; return;
if( GetNet() == 0 ) if( GetNet() == 0 )
...@@ -693,7 +711,12 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -693,7 +711,12 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
int angle = 0; int angle = 0;
if( (m_End.x - m_Start.x) == 0 ) // Vertical segment if( (m_End.x - m_Start.x) == 0 ) // Vertical segment
angle = 900; // angle is in 0.1 degree angle = 900; // angle is in 0.1 degree
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( tsize ) >= 6 )
#else
if( panel->GetScreen()->Scale( tsize ) >= 6 ) if( panel->GetScreen()->Scale( tsize ) >= 6 )
#endif
{ {
if( !(!IsOnLayer( curr_layer )&& DisplayOpt.ContrastModeDisplay) ) if( !(!IsOnLayer( curr_layer )&& DisplayOpt.ContrastModeDisplay) )
{ {
...@@ -757,12 +780,24 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -757,12 +780,24 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
rayon = m_Width >> 1; rayon = m_Width >> 1;
// for small via size on screen (rayon < 4 pixels) draw a simplified shape // for small via size on screen (rayon < 4 pixels) draw a simplified shape
#ifdef USE_WX_ZOOM
int radius_in_pixels = DC->LogicalToDeviceXRel( rayon );
#else
int radius_in_pixels = panel->GetScreen()->Scale( rayon ); int radius_in_pixels = panel->GetScreen()->Scale( rayon );
#endif
bool fast_draw = false; bool fast_draw = false;
// Vias are drawn as a filled circle or a double circle. The hole will be drawn later // Vias are drawn as a filled circle or a double circle. The hole will be drawn later
int drill_rayon = GetDrillValue() / 2; int drill_rayon = GetDrillValue() / 2;
#ifdef USE_WX_ZOOM
int inner_rayon = rayon - DC->DeviceToLogicalXRel( 2 );
#else
int inner_rayon = rayon - panel->GetScreen()->Unscale( 2 ); int inner_rayon = rayon - panel->GetScreen()->Unscale( 2 );
#endif
if( radius_in_pixels < 3 ) if( radius_in_pixels < 3 )
{ {
fast_draw = true; fast_draw = true;
...@@ -804,7 +839,11 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -804,7 +839,11 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
else else
GRSetDrawMode( DC, GR_XOR ); GRSetDrawMode( DC, GR_XOR );
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( drill_rayon ) > 1 ) /* draw hole if its size is enought */
#else
if( screen->Scale( drill_rayon ) > 1 ) /* draw hole if its size is enought */ if( screen->Scale( drill_rayon ) > 1 ) /* draw hole if its size is enought */
#endif
GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x, GRFilledCircle( &panel->m_ClipBox, DC, m_Start.x,
m_Start.y, drill_rayon, 0, color, color ); m_Start.y, drill_rayon, 0, color, color );
...@@ -893,7 +932,12 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -893,7 +932,12 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
{ {
// calculate a good size for the text // calculate a good size for the text
int tsize = m_Width / len; int tsize = m_Width / len;
#ifdef USE_WX_ZOOM
if( DC->LogicalToDeviceXRel( tsize ) >= 6 )
#else
if( panel->GetScreen()->Scale( tsize ) >= 6 ) if( panel->GetScreen()->Scale( tsize ) >= 6 )
#endif
{ {
tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via
DrawGraphicText( panel, DC, m_Start, DrawGraphicText( panel, DC, m_Start,
......
...@@ -262,7 +262,14 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -262,7 +262,14 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
delta = GetScreen()->GetGridSize(); delta = GetScreen()->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( delta.x );
delta.y = DC->LogicalToDeviceYRel( delta.y );
Mouse = DrawPanel->CalcUnscrolledPosition( Mouse );
#else
GetScreen()->Scale( delta ); GetScreen()->Scale( delta );
#endif
if( delta.x <= 0 ) if( delta.x <= 0 )
delta.x = 1; delta.x = 1;
......
...@@ -188,7 +188,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, ...@@ -188,7 +188,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
if( DrawPanel ) if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE; DrawPanel->m_Block_Enable = TRUE;
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -226,7 +226,6 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, ...@@ -226,7 +226,6 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
...@@ -408,10 +407,9 @@ void WinEDA_ModuleEditFrame::SetToolbars() ...@@ -408,10 +407,9 @@ void WinEDA_ModuleEditFrame::SetToolbars()
} }
DisplayUnitsMsg(); DisplayUnitsMsg();
#if defined(KICAD_AUIMANAGER)
if( m_auimgr.GetManagedWindow() ) if( m_auimgr.GetManagedWindow() )
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
...@@ -455,7 +453,14 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -455,7 +453,14 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
delta = GetScreen()->GetGridSize(); delta = GetScreen()->GetGridSize();
#ifdef USE_WX_ZOOM
delta.x = DC->LogicalToDeviceXRel( wxRound( delta.x ) );
delta.y = DC->LogicalToDeviceYRel( wxRound( delta.y ) );
Mouse = DrawPanel->CalcUnscrolledPosition( Mouse );
#else
GetScreen()->Scale( delta ); GetScreen()->Scale( delta );
#endif
if( delta.x == 0 ) if( delta.x == 0 )
delta.x = 1; delta.x = 1;
......
...@@ -311,7 +311,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -311,7 +311,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
ReCreateAuxVToolbar(); ReCreateAuxVToolbar();
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz; wxAuiPaneInfo horiz;
...@@ -372,11 +371,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, ...@@ -372,11 +371,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
#else
if( m_AuxVToolBar )
m_AuxVToolBar->Show(m_show_microwave_tools);
#endif
SetToolbars(); SetToolbars();
ReFillLayerWidget(); // this is near end because contents establish size ReFillLayerWidget(); // this is near end because contents establish size
...@@ -617,5 +611,3 @@ void WinEDA_PcbFrame::SetVisibleAlls( ) ...@@ -617,5 +611,3 @@ void WinEDA_PcbFrame::SetVisibleAlls( )
for( int ii = 0; ii < PCB_VISIBLE(END_PCB_VISIBLE_LIST); ii++ ) for( int ii = 0; ii < PCB_VISIBLE(END_PCB_VISIBLE_LIST); ii++ )
m_Layers->SetRenderState( ii, true ); m_Layers->SetRenderState( ii, true );
} }
...@@ -32,9 +32,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() ...@@ -32,9 +32,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
wxString msg; wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*) m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString, m_HToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
wxBitmap( open_library_xpm ), wxBitmap( open_library_xpm ),
......
...@@ -192,9 +192,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -192,9 +192,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar->SetRows( 1 ); m_HToolBar->SetRows( 1 );
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, wxBitmap( new_xpm ), m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, wxBitmap( new_xpm ),
_( "New board" ) ); _( "New board" ) );
......
...@@ -265,13 +265,8 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -265,13 +265,8 @@ void WinEDA_PcbFrame::SetToolbars()
_( "Normal contrast display mode" ) : _( "Normal contrast display mode" ) :
_( "High contrast display mode" ) ); _( "High contrast display mode" ) );
#if !defined(KICAD_AUIMANAGER)
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
(m_AuxVToolBar && m_AuxVToolBar->IsShown()) ? true : false );
#else
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1, m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_auimgr.GetPane(wxT("m_AuxVToolBar")).IsShown() ); m_auimgr.GetPane(wxT("m_AuxVToolBar")).IsShown() );
#endif
} }
if( m_AuxiliaryToolBar ) if( m_AuxiliaryToolBar )
...@@ -281,8 +276,7 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -281,8 +276,7 @@ void WinEDA_PcbFrame::SetToolbars()
PrepareLayerIndicator(); PrepareLayerIndicator();
DisplayUnitsMsg(); DisplayUnitsMsg();
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow()) if(m_auimgr.GetManagedWindow())
m_auimgr.Update(); m_auimgr.Update();
#endif
} }
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