Commit 2a603275 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Build default change and minor schematic screen object improvements.

* Change default build to enable wxDC zooming.
* Move sheet label find function into SCH_SCREEN object.
* Move draw screen items function into SCH_SCREEN object.
* Remove redundant page print method from SCH_EDIT_FRAME.
* Add method to hit test for all items in SCH_SCREEN.
* Add method for testing if junction is required in SCH_SCREEN.
* Fix Doxygen waring in help_common_strings.h
parent 20efe4f6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ option(KICAD_GOST "enable/disable building using GOST notation for multiple gate
#for those who bored with uppercase
#for those who bored with uppercase
option(KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected")
option(KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected")


option(USE_WX_ZOOM "Use wxDC to perform zooming (default OFF). Warning, this is experimental" )
option(USE_WX_ZOOM "Use wxDC to perform zooming (default ON)." ON)


option(USE_WX_GRAPHICS_CONTEXT
option(USE_WX_GRAPHICS_CONTEXT
       "Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental")
       "Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental")
+2 −2
Original line number Original line Diff line number Diff line
@@ -667,7 +667,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
        if( item )
        if( item )
            return TRUE;
            return TRUE;


        pinsheet = LocateAnyPinSheet( pos, screen->GetDrawItems() );
        pinsheet = screen->GetSheetLabel( pos );


        if( pinsheet && IsBusLabel( pinsheet->m_Text ) )
        if( pinsheet && IsBusLabel( pinsheet->m_Text ) )
        {
        {
@@ -715,7 +715,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
           && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
           && ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
            return TRUE;
            return TRUE;


        pinsheet = LocateAnyPinSheet( pos, screen->GetDrawItems() );
        pinsheet = screen->GetSheetLabel( pos );


        if( pinsheet && !IsBusLabel( pinsheet->m_Text ) )
        if( pinsheet && !IsBusLabel( pinsheet->m_Text ) )
        {
        {
+12 −10
Original line number Original line Diff line number Diff line
@@ -14,9 +14,7 @@
#include "gestfich.h"
#include "gestfich.h"
#include "class_sch_screen.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "wxEeschemaStruct.h"

#include "dcsvg.h"
#include "dcsvg.h"

#include "general.h"
#include "general.h"
#include "libeditframe.h"
#include "libeditframe.h"
#include "sch_sheet_path.h"
#include "sch_sheet_path.h"
@@ -136,7 +134,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )


            fn = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".svg" );
            fn = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".svg" );


            bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), schscreen,
            bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) schscreen,
                                        m_ModeColorOption->GetSelection() == 0 ? false : true,
                                        m_ModeColorOption->GetSelection() == 0 ? false : true,
                                        aPrint_Sheet_Ref );
                                        aPrint_Sheet_Ref );
            msg = _( "Create file " ) + fn.GetFullPath();
            msg = _( "Create file " ) + fn.GetFullPath();
@@ -160,7 +158,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
        fn.SetExt( wxT( "svg" ) );
        fn.SetExt( wxT( "svg" ) );
        fn.MakeAbsolute();
        fn.MakeAbsolute();


        bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), screen,
        bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) screen,
                                    m_ModeColorOption->GetSelection() == 0 ? false : true,
                                    m_ModeColorOption->GetSelection() == 0 ? false : true,
                                    aPrint_Sheet_Ref );
                                    aPrint_Sheet_Ref );
        msg = _( "Create file " ) + fn.GetFullPath();
        msg = _( "Create file " ) + fn.GetFullPath();
@@ -178,7 +176,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )


bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame* frame,
bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame* frame,
                                    const wxString&   FullFileName,
                                    const wxString&   FullFileName,
                                    BASE_SCREEN*        screen,
                                    SCH_SCREEN*       screen,
                                    bool              aPrintBlackAndWhite,
                                    bool              aPrintBlackAndWhite,
                                    bool              aPrint_Sheet_Ref )
                                    bool              aPrint_Sheet_Ref )
{
{
@@ -216,7 +214,11 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame* frame,
    panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
    panel->m_ClipBox.SetHeight( 0x7FFFFF0 );


    screen->m_IsPrinting = true;
    screen->m_IsPrinting = true;
    frame->PrintPage( &dc, aPrint_Sheet_Ref, 1, false );
    screen->Draw( panel, &dc, GR_COPY );

    if( aPrint_Sheet_Ref )
        frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness );

    SetLocaleTo_Default();       // revert to the current locale
    SetLocaleTo_Default();       // revert to the current locale
    screen->m_IsPrinting   = false;
    screen->m_IsPrinting   = false;
    panel->m_ClipBox       = tmp;
    panel->m_ClipBox       = tmp;
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ private:


public:
public:
    static bool DrawSVGPage( WinEDA_DrawFrame* frame,
    static bool DrawSVGPage( WinEDA_DrawFrame* frame,
                             const wxString& FullFileName, BASE_SCREEN* screen,
                             const wxString& FullFileName, SCH_SCREEN* screen,
                             bool aPrintBlackAndWhite = false,
                             bool aPrintBlackAndWhite = false,
                             bool aPrint_Sheet_Ref = false );
                             bool aPrint_Sheet_Ref = false );
};
};
+6 −2
Original line number Original line Diff line number Diff line
@@ -343,7 +343,8 @@ void SCH_PRINTOUT::DrawPage()
        wxBitmap psuedoBitmap( 1, 1 );
        wxBitmap psuedoBitmap( 1, 1 );
        wxMemoryDC memDC;
        wxMemoryDC memDC;
        memDC.SelectObject( psuedoBitmap );
        memDC.SelectObject( psuedoBitmap );
        parent->PrintPage( &memDC, true, 0xFFFFFFFF, false );
        ( (SCH_SCREEN*) ActiveScreen )->Draw( panel, &memDC, GR_DEFAULT_DRAWMODE );
        parent->TraceWorkSheet( &memDC, ActiveScreen, g_DrawDefaultLineThickness );
        wxLogDebug( wxT( "MinX = %d, MaxX = %d, MinY = %d, MaxY = %d" ),
        wxLogDebug( wxT( "MinX = %d, MaxX = %d, MinY = %d, MaxY = %d" ),
                    memDC.MinX(), memDC.MaxX(), memDC.MinY(), memDC.MaxY() );
                    memDC.MinX(), memDC.MaxX(), memDC.MinY(), memDC.MaxY() );


@@ -371,7 +372,10 @@ void SCH_PRINTOUT::DrawPage()
    ActiveScreen->m_IsPrinting = true;
    ActiveScreen->m_IsPrinting = true;
    int bg_color = g_DrawBgColor;
    int bg_color = g_DrawBgColor;


    parent->PrintPage( dc, printReference, 0xFFFFFFFF, false );
    ( ( SCH_SCREEN* ) ActiveScreen )->Draw( panel, dc, GR_DEFAULT_DRAWMODE );

    if( printReference )
        parent->TraceWorkSheet( dc, ActiveScreen, g_DrawDefaultLineThickness );


    g_DrawBgColor = bg_color;
    g_DrawBgColor = bg_color;
    ActiveScreen->m_IsPrinting = false;
    ActiveScreen->m_IsPrinting = false;
Loading